Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-40409

When publishing a gradle project with ivy publications, the revision specified on the publication is ignored

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • artifactory-plugin
    • None
    • jenkins: 2.35
      jenkins-artifactory-plugin: 2.8.2
      gradle: 3.2.1

      The following gradle scripts shows a minimal reproducer of my use case. It is a gradle project using the ivy-publish plugin. I specify a version on project level. For publishing I override the project version by using the revision attribute(I add a timestamp to the published revision). For different reasons I cannot add the timestamp on the project version.

      build.gradle
      apply plugin: 'java'
      apply plugin: 'ivy-publish'
      
      group = 'my.sample'
      version = '1.0.0.SNAPSHOT'
      
      publishing {
          publications {
              ivyJava(IvyPublication) {
                  from components.java
      	    revision = "1.0.0.SNAPSHOT.${System.currentTimeMillis()}"
              }
          }
          repositories {
              ivy {
                  url "$buildDir/repo"
              }
          }
      }
      

      Running

      ./gradlew publish

      without jenkins produces the desired result:

      Output of ./gradlew --info publish without jenkins/artifactory plugins

      ...
      Published artifactory-gradle-version-bug-reproducer.jar (my.sample:artifactory-gradle-version-bug-reproducer:1.0.0.SNAPSHOT.1481626157755) to file:/C:/git/artifactory-gradle-version-bug-reproducer/build/repo/my.sample/artifactory-gradle-version-bug-reproducer/1.0.0.SNAPSHOT.1481626157755/artifactory-gradle-version-bug-reproducer-1.0.0.SNAPSHOT.1481626157755.jar
      ...

      When building this via jenkins with enabled artifactory-plugin and gradle integration, the result is that the timestamp is not added

      I also pushed the above example to github.

            eyalbe Eyal Ben Moshe
            eikek Eike Kohnert
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: