Publishing SHA1 checksums to Ivy repositories using SshResolver doesn't work


(richard murray) #1

HI, I’ve just upgraded to gradle-1.1 as I wanted to use the new feature ‘Publishing SHA1 checksums to Ivy repositories’ which is mentioned in the release notes “Gradle will now automatically generate and publish SHA1 checksum files when publishing to an Ivy repository”

We currently use an SshResolver to retrieve and publish to our Ivy Repository, however the checksum files aren’t getting uploaded. The checksum files are uploaded if I test with a local filesystem repository and use the standard ‘ivy’ syntax to reference the repository but not with the SshResolver.

Is this a bug or a known limitation? Any suggestions for a workaround?

uploadArchives {
            repositories {
                          //checksum files don't get uploaded using an SshResolver
//
      add(new org.apache.ivy.plugins.resolver.SshResolver()) {
//
          name = 'ivy_repo'
//
          user = 'orchard'
            //
          userPassword = 'xxxxx'
//
          addIvyPattern
    "/uwm/ivy-repo/[organisation]/[module]/ivys/ivy-[revision].xml"
//
          addArtifactPattern "/uwm/ivy-repo/[organisation]/[module]/[type]s/[artifact]-[revision].[ext]"
//
          host = "junior"
//
      }
                  //cheksum files are uploaded using the local file system
        ivy {
            url "F:/ivy-repo-local/"
            layout 'pattern', {
                artifact "[organisation]/[module]/[type]s/[artifact]-[revision](-[classifier]).[ext]"
                ivy "[organisation]/[module]/ivys/ivy-[revision].xml"
            }
        }
              }
}

Thanks. Richard.


#2

Since you’re using a standard Ivy resolver for publishing, setting the ‘checksums’ property on the resolver should work: http://ant.apache.org/ivy/history/latest-milestone/settings/resolvers.html


(richard murray) #3

Thanks, it does work if I set add checksums = ‘sha1, md5’ as below. I forgot this was part of the Ivy API, I keep thinking of it as part of the Gradle API…

According to the ivy docs it should default to sha1 and md5 checksums anyway - perhaps it only does this when using ivy via the xml files.

uploadArchives {
            repositories {
                  add(new org.apache.ivy.plugins.resolver.SshResolver()) {
              name = 'ivy_repo'
              user = 'orchard'
                          userPassword = 'xxxxx'
              addIvyPattern
    "/uwm/ivy-repo/[organisation]/[module]/ivys/ivy-[revision].xml"
              addArtifactPattern "/uwm/ivy-repo/[organisation]/[module]/[type]s/[artifact]-[revision].[ext]"
              host = "junior"
              checksums = 'sha1, md5'
        }
           }
}