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

"deploy unique version" use distinc sequence number per artifact

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Critical Critical
    • maven-plugin
    • None
    • Platform: All, OS: All

      When hudson is used to deploy maven artifacts + the "unique version" advanced
      option is checked, and the built project has multiple artifacts (a POM, a JAR, a
      sources-JAR for example), each of them get a dedicated unique version number.
      The same feature on the maven-deploy-plugin use the same unique version for all
      artifacts, so it's easy to know they are related.

          [JENKINS-2593] "deploy unique version" use distinc sequence number per artifact

          Nicolas De Loof created issue -

          I couldn't reproduce this problem.

          I confirmed through the debugger that Maven only computes a timestamp once and
          then use it for all the artifacts it publishes.

          Can you elaborate on your set up more? Also, if possible, please post your
          config.xml of your job.

          Kohsuke Kawaguchi added a comment - I couldn't reproduce this problem. I confirmed through the debugger that Maven only computes a timestamp once and then use it for all the artifacts it publishes. Can you elaborate on your set up more? Also, if possible, please post your config.xml of your job.
          Kohsuke Kawaguchi made changes -
          Status Original: Open [ 1 ] New: In Progress [ 3 ]

          thomas3er added a comment -

          We have the same problem with the projects that have multible artifacts. For
          example we create a "service.jar" and an artifact with the cassifire "client" -
          "service-client.jar". In this case in the repository the folwing will be deployed:
          service-1.0.0-20090525.121212-1.jar
          service-1.0.0-20090525.121212-1.pom
          service-1.0.0-20090525.121212-2-client.jar

          After this the "maven-metadata.xml" in the repository looks like:
          <metadata>
          <groupId>de.vk.backend</groupId>
          <artifactId>service</artifactId>
          <version>1.0.0-SNAPSHOT</version>
          <versioning>
          <snapshot>
          <timestamp>20090525.121212</timestamp>
          <buildNumber>2</buildNumber>
          </snapshot>
          <lastUpdated>20090525121212</lastUpdated>
          </versioning>
          </metadata>

          and with this oure repository is broken!

          I think the reason should be find in the "MavenArtifactRecord" class in the
          "deploy" method where attached artifacts will be deployed.

          thomas3er added a comment - We have the same problem with the projects that have multible artifacts. For example we create a "service.jar" and an artifact with the cassifire "client" - "service-client.jar". In this case in the repository the folwing will be deployed: service-1.0.0-20090525.121212-1.jar service-1.0.0-20090525.121212-1.pom service-1.0.0-20090525.121212-2-client.jar After this the "maven-metadata.xml" in the repository looks like: <metadata> <groupId>de.vk.backend</groupId> <artifactId>service</artifactId> <version>1.0.0-SNAPSHOT</version> <versioning> <snapshot> <timestamp>20090525.121212</timestamp> <buildNumber>2</buildNumber> </snapshot> <lastUpdated>20090525121212</lastUpdated> </versioning> </metadata> and with this oure repository is broken! I think the reason should be find in the "MavenArtifactRecord" class in the "deploy" method where attached artifacts will be deployed.

          tjuerge added a comment -
              • Issue 3518 has been marked as a duplicate of this issue. ***

          tjuerge added a comment - Issue 3518 has been marked as a duplicate of this issue. ***
          tjuerge made changes -
          Link New: This issue is duplicated by JENKINS-3518 [ JENKINS-3518 ]

          tjuerge added a comment -

          As already suggested by Thomas: It seems that deploying attached artifacts via
          an instance of ArtifactDeployer retrieved MavenEmbedder in
          MavenArtifactRecord.deploy() increments <buildNumber> in
          "maven-metadata-<repoid>.xml".

          Maybe is is an issue with an outdated version of MavenEmbedder used with Hudson.

          tjuerge added a comment - As already suggested by Thomas: It seems that deploying attached artifacts via an instance of ArtifactDeployer retrieved MavenEmbedder in MavenArtifactRecord.deploy() increments <buildNumber> in "maven-metadata-<repoid>.xml". Maybe is is an issue with an outdated version of MavenEmbedder used with Hudson.

          tjuerge added a comment -

          Btw. the logging of deploying attached artifacts could be improved by printing
          the filename of the attached artifact instead of the main artifacts one:

          Index: MavenArtifactRecord.java
          ===================================================================
          — MavenArtifactRecord.java (revision 18451)
          +++ MavenArtifactRecord.java (working copy)
          @@ -119,8 +119,8 @@

          deployer.deploy(main.getFile(),main,deploymentRepository,embedder.getLocalRepository());

          for (MavenArtifact aa : attachedArtifacts)

          { - logger.println(Messages.MavenArtifact_DeployingAttachedArtifact(main.getFile().getName())); Artifact a = aa.toArtifact(handlerManager,factory, parent); + logger.println(Messages.MavenArtifact_DeployingAttachedArtifact(a.getFile().getName())); deployer.deploy(a.getFile(),a,deploymentRepository,embedder.getLocalRepository()); }

          }

          tjuerge added a comment - Btw. the logging of deploying attached artifacts could be improved by printing the filename of the attached artifact instead of the main artifacts one: Index: MavenArtifactRecord.java =================================================================== — MavenArtifactRecord.java (revision 18451) +++ MavenArtifactRecord.java (working copy) @@ -119,8 +119,8 @@ deployer.deploy(main.getFile(),main,deploymentRepository,embedder.getLocalRepository()); for (MavenArtifact aa : attachedArtifacts) { - logger.println(Messages.MavenArtifact_DeployingAttachedArtifact(main.getFile().getName())); Artifact a = aa.toArtifact(handlerManager,factory, parent); + logger.println(Messages.MavenArtifact_DeployingAttachedArtifact(a.getFile().getName())); deployer.deploy(a.getFile(),a,deploymentRepository,embedder.getLocalRepository()); } }

          godin added a comment -

          We have the same problem when using attached to pom assemblies. And I can
          provide test project or steps to reproduce this.

          godin added a comment - We have the same problem when using attached to pom assemblies. And I can provide test project or steps to reproduce this.

          thoaan added a comment -

          This issue has been marked as critical and in progress, but it doesn't seem like anything has been done in a while. It is still unassigned and seems to be forgotten. It would be nice to get a status on this issue, and if we can expect it do be solved in the nearby future.

          We have this problem on Hudson version 1.345 and Maven 2.09.

          thoaan added a comment - This issue has been marked as critical and in progress, but it doesn't seem like anything has been done in a while. It is still unassigned and seems to be forgotten. It would be nice to get a status on this issue, and if we can expect it do be solved in the nearby future. We have this problem on Hudson version 1.345 and Maven 2.09.

            Unassigned Unassigned
            ndeloof Nicolas De Loof
            Votes:
            12 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated: