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

Provide maven build.finalName in the downloadable artifacts name

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • maven-plugin
    • None
    • Ubuntu 10.10 server with sun jdk 1.6.0_24 from apt, glassfish 2.1.1, maven 2.2.1, jenkins 1.408

      Dear Sirs,

      this is a feature that always worked well on hudson. I migrated our integration system to jenkins this week and I figured out that the new builds did not apply the maven build.finalName to the downloadable artifacts of each build.

      We have this section in our master pom which activates the integration specific naming style:

      <profile>
      <id>jenkins</id>
      <activation>
      <property>
      <name>SVN_REVISION</name>
      </property>
      </activation>
      <build>
      <finalName>${artifactId}-${version}-r${buildNumber}</finalName>
      </build>
      </profile>

      When I dive into the job's workspace section I can see the final name applied to each artifact compiled into the target folder. This seems to be always the buildNumer of the last run. But with hudson, when browsing to the job's individual build numbers and then picking out any artifact from the list, the finalName was also applied to the download links from there. In jenkins this is not the case anymore. The artifacts have only standart convention like <artifactId>-<version>-SNAPSHOT. See the difference in the screenshots.

      I would really appreciate that the old behavior would be available again and I think this can only be a bug, because I see no reason why this feature should have been intentionally turned off.

      I'm not shure where this issue concerns to from your view, I assigned the component entry to maven2, maybe this must be relocated.

      With kind regards,
      Oliver

          [JENKINS-9466] Provide maven build.finalName in the downloadable artifacts name

          Elifarley added a comment -

          The fix for JENKINS-9122 (introduced in Jenkins 1.405) might have caused this.

          See the change at https://github.com/jenkinsci/jenkins/commit/ca56a32e16b97a8dae2e76718144ea00b24f51b1#L0R190

          Elifarley added a comment - The fix for JENKINS-9122 (introduced in Jenkins 1.405) might have caused this. See the change at https://github.com/jenkinsci/jenkins/commit/ca56a32e16b97a8dae2e76718144ea00b24f51b1#L0R190

          Elifarley added a comment -

          I have tested Jenkins 1.404 and this bug isn't there.

          Elifarley added a comment - I have tested Jenkins 1.404 and this bug isn't there.

          This issue is impacting us with generating wars. We rely on the finalName to keep the version number out of the war file. As of Jenkins 1.418 I still see this error. If a final name is specified, the artifacts don't reflect the final name. We are getting around the issue currently by using a post build action to "Archive the artifacts".

          To reproduce you can create a war from an archetype.

          mvn archetype:generate -B -DarchetypeGroupId=org.apache.maven.archetypes -DarchetypeArtifactId=maven-archetype-webapp -DarchetypeVersion=1.0-alpha-4 -DgroupId=com.company -DartifactId=sample -Dversion=1.0-SNAPSHOT -Dpackage=1.5

          Then have Jenkins build this file. Instead of seeing sample.war in the artifacts, you see sample-1.0-SNAPSHOT.war.

          Brandon Richins added a comment - This issue is impacting us with generating wars. We rely on the finalName to keep the version number out of the war file. As of Jenkins 1.418 I still see this error. If a final name is specified, the artifacts don't reflect the final name. We are getting around the issue currently by using a post build action to "Archive the artifacts". To reproduce you can create a war from an archetype. mvn archetype:generate -B -DarchetypeGroupId=org.apache.maven.archetypes -DarchetypeArtifactId=maven-archetype-webapp -DarchetypeVersion=1.0-alpha-4 -DgroupId=com.company -DartifactId=sample -Dversion=1.0-SNAPSHOT -Dpackage=1.5 Then have Jenkins build this file. Instead of seeing sample.war in the artifacts, you see sample-1.0-SNAPSHOT.war.

          artifact archiving goal is to track the relation between builds that use same binaries, and keep a copy of anything jenkins has built attached to the build data. This is not designed to convert jenkins into a distribution platform. Disambiguating (archived) maven artifacts during archiving using full maven coordinates including classifiers (introduced by JENKINS-9122) is the way to go imho.
          If you need the finalName artifact used elsewhere in your pipeline, consider a post-build step to deploy to a binary repository

          Nicolas De Loof added a comment - artifact archiving goal is to track the relation between builds that use same binaries, and keep a copy of anything jenkins has built attached to the build data. This is not designed to convert jenkins into a distribution platform. Disambiguating (archived) maven artifacts during archiving using full maven coordinates including classifiers (introduced by JENKINS-9122 ) is the way to go imho. If you need the finalName artifact used elsewhere in your pipeline, consider a post-build step to deploy to a binary repository

          Andrei Badea added a comment -

          The result of this "disambiguation" results in a Maven command-line build being different from a Maven build done in Jenkins. That's deeply wrong, because users do not expect it. It also makes one think "if this in different in the Jenkins build, what else is different?".

          Andrei Badea added a comment - The result of this "disambiguation" results in a Maven command-line build being different from a Maven build done in Jenkins. That's deeply wrong, because users do not expect it. It also makes one think "if this in different in the Jenkins build, what else is different?".

            Unassigned Unassigned
            senortorpedo senortorpedo
            Votes:
            15 Vote for this issue
            Watchers:
            15 Start watching this issue

              Created:
              Updated: