Uploaded image for project: 'Dev - Nexus Repo'
  1. Dev - Nexus Repo
  2. NEXUS-24098

Snapshot GAV metadata rebuilt incorrectly if packaging has multiple segments

    XMLWordPrintable

    Details

      Description

      Deploy a snapshot file into Nexus Repo that has packaging with multiple segments, such as "cpio.gz".

      mvn deploy:deploy-file -DgroupId=com.somecompany -DartifactId=project -Dversion=1.0.0-SNAPSHOT -DgeneratePom=true -Dpackaging=cpio.gz -DrepositoryId=foo -Durl=http://localhost:8081/repository/maven-snapshots -Dfile=foo.cipo.gz
      

      Observe that the GAV level maven-metadata correctly shows the extension:

      <?xml version="1.0" encoding="UTF-8"?>
      <metadata modelVersion="1.1.0">
        <groupId>com.somecompany</groupId>
        <artifactId>project</artifactId>
        <version>1.0.0-SNAPSHOT</version>
        <versioning>
          <snapshot>
            <timestamp>20200527.192712</timestamp>
            <buildNumber>1</buildNumber>
          </snapshot>
          <lastUpdated>20200527192712</lastUpdated>
          <snapshotVersions>
            <snapshotVersion>
              <extension>cpio.gz</extension>
              <value>1.0.0-20200527.192712-1</value>
              <updated>20200527192712</updated>
            </snapshotVersion>
            <snapshotVersion>
              <extension>pom</extension>
              <value>1.0.0-20200527.192712-1</value>
              <updated>20200527192712</updated>
            </snapshotVersion>
          </snapshotVersions>
        </versioning>
      </metadata>
      

       
      Now run a task to rebuild the maven-metadata.xml file. After running, the extension will be incorrect:

      <?xml version="1.0" encoding="UTF-8"?>
      <metadata modelVersion="1.1.0">
        <groupId>com.somecompany</groupId>
        <artifactId>project</artifactId>
        <version>1.0.0-SNAPSHOT</version>
        <versioning>
          <snapshot>
            <timestamp>20200527.192712</timestamp>
            <buildNumber>1</buildNumber>
          </snapshot>
          <lastUpdated>20200527192855</lastUpdated>
          <snapshotVersions>
            <snapshotVersion>
              <extension>gz</extension>
              <value>1.0.0-20200527.192712-1</value>
              <updated>20200527192712</updated>
            </snapshotVersion>
            <snapshotVersion>
              <extension>pom</extension>
              <value>1.0.0-20200527.192712-1</value>
              <updated>20200527192712</updated>
            </snapshotVersion>
          </snapshotVersions>
        </versioning>
      </metadata>
      
      

      Note that this file will be also be rebuilt when cleanup policies are applied, or the snapshot remover is run. So this bug is present in normal operation.

      Also note that "tar.gz" files are not affected by this bug.
       

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              sonofreichuk Sergii Onofreichuk
              Reporter:
              rseddon Rich Seddon
              Last Updated By:
              Joseph Stephens Joseph Stephens
              Team:
              NXRM - Trinity
              Votes:
              0 Vote for this issue
              Watchers:
              9 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Date of First Response:

                  tigCommentSecurity.panel-title