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

Deploy to maven Repository does not update Snapshot maven-metadata.xml

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • maven-plugin
    • None
    • Linux Red Hat - Jenkins 1.537 - Nexus 2.7.1

      we migrate from Artifactory a week ago, and we were using Artifactory Deploy Plugin to post build deploy our artifact.

      As we went to Nexus, we now use the Post build deploy feature of embedded Maven Project plugin.

      Everything seems to works, but the maven-metadata.xml are not updated when artifacts are uploaded.

      I run many tests, and mining into logs (as we got a Apache Front of our Nexus), and i saw that the plugin download (twice) the maven-metadata from Nexus, and upload one just after (that the normal behaviour - except the twice thing).

      After re-reading the apache logs, the metadata is simply not deployed. The log show the metadata of the artifact version, not the mave-metadata.xml with all version. We have tested without nexus, by deploying in a file system. The behaviour is the same, and the issue is still here. So Nexus is not involved.

      But when i look into the file (maven-metadata.xml) the new snapshot version is not present. As our integration process rely on this metadata, we are some kind of blocked (the workaround is to schedule a task in Nexus to rebuild metadata, but this is not "live")

      Am I missing something ?

      Here is the apache log :
      XXX.XXX.XXX.XXX - - [10/Mar/2014:11:22:50 +0100] "GET /nexus/content/repositories/snapshots/com/socgen/fwk/socle/socle-architecture-transverse/2.13.0-SNAPSHOT/maven-metadata.xml HTTP/1.1" 200 341
      XXX.XXX.XXX.XXX - - [10/Mar/2014:11:22:50 +0100] "GET /nexus/content/repositories/snapshots/com/socgen/fwk/socle/socle-architecture-transverse/2.13.0-SNAPSHOT/maven-metadata.xml.sha1 HTTP/1.1" 200 40
      XXX.XXX.XXX.XXX - - [10/Mar/2014:11:22:50 +0100] "PUT /nexus/content/repositories/snapshots/com/socgen/fwk/socle/socle-architecture-transverse/2.13.0-SNAPSHOT/socle-architecture-transverse-2.13.0-SNAPSHOT.pom HTTP/1.1" 201 -
      XXX.XXX.XXX.XXX - - [10/Mar/2014:11:22:50 +0100] "PUT /nexus/content/repositories/snapshots/com/socgen/fwk/socle/socle-architecture-transverse/2.13.0-SNAPSHOT/socle-architecture-transverse-2.13.0-SNAPSHOT.pom.md5 HTTP/1.1" 201 -
      XXX.XXX.XXX.XXX - - [10/Mar/2014:11:22:51 +0100] "PUT /nexus/content/repositories/snapshots/com/socgen/fwk/socle/socle-architecture-transverse/2.13.0-SNAPSHOT/socle-architecture-transverse-2.13.0-SNAPSHOT.pom.sha1 HTTP/1.1" 201 -
      XXX.XXX.XXX.XXX - - [10/Mar/2014:11:22:51 +0100] "GET /nexus/content/repositories/snapshots/com/socgen/fwk/socle/socle-architecture-transverse/2.13.0-SNAPSHOT/maven-metadata.xml HTTP/1.1" 200 341
      XXX.XXX.XXX.XXX - - [10/Mar/2014:11:22:51 +0100] "GET /nexus/content/repositories/snapshots/com/socgen/fwk/socle/socle-architecture-transverse/2.13.0-SNAPSHOT/maven-metadata.xml.sha1 HTTP/1.1" 200 40
      XXX.XXX.XXX.XXX - - [10/Mar/2014:11:22:51 +0100] "PUT /nexus/content/repositories/snapshots/com/socgen/fwk/socle/socle-architecture-transverse/2.13.0-SNAPSHOT/maven-metadata.xml HTTP/1.1" 201 -
      XXX.XXX.XXX.XXX - - [10/Mar/2014:11:22:51 +0100] "PUT /nexus/content/repositories/snapshots/com/socgen/fwk/socle/socle-architecture-transverse/2.13.0-SNAPSHOT/maven-metadata.xml.md5 HTTP/1.1" 201 -
      XXX.XXX.XXX.XXX - - [10/Mar/2014:11:22:51 +0100] "PUT /nexus/content/repositories/snapshots/com/socgen/fwk/socle/socle-architecture-transverse/2.13.0-SNAPSHOT/maven-metadata.xml.sha1 HTTP/1.1" 201 -

      here is the Jenkins logs :
      Mar 10, 2014 11:22:51 AM org.apache.maven.cli.logging.Slf4jLogger info
      INFO: Uploading repository metadata for: 'snapshot com.socgen.fwk.socle:socle-architecture-transverse:2.13.0-SNAPSHOT'

      Some attachment:

      • a screen of a section of my repo, and at the same the corresponding maven-metadata.xml
      • the configuration of my post deploy task (not unique version - even if instable)

          [JENKINS-22104] Deploy to maven Repository does not update Snapshot maven-metadata.xml

          After further investigation, the problem occur only if "unique version" if disabled in the job configuration.

          The maven-metadata.xml is correctly generated if the checkbox is checked.

          Steve Eckerlein added a comment - After further investigation, the problem occur only if "unique version" if disabled in the job configuration. The maven-metadata.xml is correctly generated if the checkbox is checked.

          jose Martinez added a comment - - edited

          We also have this problem but we are using the Artifactory Plugin, not Nexus. In my job configuration I do not see a checkbox for "unique version". Is this working as expected? It is causing a problem for us because updated artifacts are not being downloaded due to the lastUpdate timestamp in the maven-metadata.xml not being updated.

          jose Martinez added a comment - - edited We also have this problem but we are using the Artifactory Plugin, not Nexus. In my job configuration I do not see a checkbox for "unique version". Is this working as expected? It is causing a problem for us because updated artifacts are not being downloaded due to the lastUpdate timestamp in the maven-metadata.xml not being updated.

          tnabil added a comment -

          I'm facing the same issue with Artifactory. I also cannot see a "unique version" checkbox in the job configuration options.

          Is this actually a bug or is there some explicit parameter that we need to configure to ensure the Jenkins updates the maven-metadata.xml file?

          tnabil added a comment - I'm facing the same issue with Artifactory. I also cannot see a "unique version" checkbox in the job configuration options. Is this actually a bug or is there some explicit parameter that we need to configure to ensure the Jenkins updates the maven-metadata.xml file?

          Mike Stern added a comment -

          i resolved this by switching my mvn target from `mvn clean package` to `mvn clean install`

          Mike Stern added a comment - i resolved this by switching my mvn target from `mvn clean package` to `mvn clean install`

            Unassigned Unassigned
            hicwic Steve Eckerlein
            Votes:
            3 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: