Maven
  1. Maven
  2. MNG-4452

Metadata for snapshots should include classifier

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.2.1, 3.0-alpha-4
    • Fix Version/s: 3.0
    • Labels:
      None

      Description

      Please see the whole conversation here:
      http://old.nabble.com/Multi-Platform-snapshots-td25295999.html

      Essentially, an artifact's classifier isn't included in the repository's metadata of a snapshot. This makes it difficult (impossible?) to deploy multiply snapshots with different classifiers. The primary use case is to continuously build an artifact for different environments.

      1. output
        232 kB
        Leon Franzen
      2. nar-artifact-list.txt
        103 kB
        Leon Franzen
      3. nar-maven-metadata.xml
        2 kB
        Leon Franzen

        Issue Links

          Activity

          Paul Benedict created issue -
          Hide
          Dan Tran added a comment -

          don't think 2.2.1 is affected. Just 3.0

          Show
          Dan Tran added a comment - don't think 2.2.1 is affected. Just 3.0
          Hide
          Paul Benedict added a comment - - edited

          Dan, can you please check to verify?

          Show
          Paul Benedict added a comment - - edited Dan, can you please check to verify?
          Hide
          Dan Tran added a comment -

          confirm, it only affects maven 3

          Show
          Dan Tran added a comment - confirm, it only affects maven 3
          Hide
          Benjamin Bentmann added a comment -

          Not sure what exactly you consider as being affected, the metadata used by Maven 2 and 3 is the same. Maven 3.0 does not support non-unique snapshots but the general problem with the metadata exists in all existing Maven versions.

          Show
          Benjamin Bentmann added a comment - Not sure what exactly you consider as being affected, the metadata used by Maven 2 and 3 is the same. Maven 3.0 does not support non-unique snapshots but the general problem with the metadata exists in all existing Maven versions.
          Hide
          Dan Tran added a comment -

          sorry about the confusion. This issue should mainly raise concern where maven 3 removes non-unique snapshot feature, and does not provide an alternative.

          deploy non-unique snapshot still works with 2.2.1

          Show
          Dan Tran added a comment - sorry about the confusion. This issue should mainly raise concern where maven 3 removes non-unique snapshot feature, and does not provide an alternative. deploy non-unique snapshot still works with 2.2.1
          Benjamin Bentmann made changes -
          Field Original Value New Value
          Link This issue is duplicated by MNG-3408 [ MNG-3408 ]
          Hide
          Benjamin Bentmann added a comment -

          Fixed in r995057.

          Show
          Benjamin Bentmann added a comment - Fixed in r995057 .
          Benjamin Bentmann made changes -
          Status Open [ 1 ] Closed [ 6 ]
          Resolution Fixed [ 1 ]
          Assignee Benjamin Bentmann [ bentmann ]
          Fix Version/s 3.0-beta-4 [ 16712 ]
          Hide
          Benjamin Bentmann added a comment -

          To support interop with existing repository managers that don't know about the new format but try to process it on the server side, the system property maven.metadata.legacy=true|false has been added in r995081 to revert to the 1.0.0 format during deployment if needed.

          Show
          Benjamin Bentmann added a comment - To support interop with existing repository managers that don't know about the new format but try to process it on the server side, the system property maven.metadata.legacy=true|false has been added in r995081 to revert to the 1.0.0 format during deployment if needed.
          Paul Gier made changes -
          Link This issue is related to MDEPLOY-48 [ MDEPLOY-48 ]
          Benjamin Bentmann made changes -
          Fix Version/s 3.0-beta-4 [ 16712 ]
          Fix Version/s 3.0 [ 13142 ]
          Hide
          Andrei Pozolotin added a comment -

          Benjamin:
          just to confirm, is it fixed in 3.0.1? the issue still affecting me
          thanks;
          Andrei

          Show
          Andrei Pozolotin added a comment - Benjamin: just to confirm, is it fixed in 3.0.1? the issue still affecting me thanks; Andrei
          Hide
          Andrei Pozolotin added a comment -

          I guess, I must clarify:

          1) yes I see in 3.0.1 that shapshots metadata does includes classifier;

          2) the problem is that resolver still does not find attached artifacts form previous deployments;

          for example, this is repo metadata after 2 deployments:

          note, that artifacts of interest are (build 83 and 84):

          com.barchart.udt:barchart-udt4:1.0.2-20110108.023638-83:i386-Linux-g++-jni:nar
          com.barchart.udt:barchart-udt4:1.0.2-20110108.023723-84:amd64-Linux-g++-jni:nar

          ##############################################################

          <metadata modelVersion="1.1.0">
          <groupId>com.barchart.udt</groupId>
          <artifactId>barchart-udt4</artifactId>
          <version>1.0.2-SNAPSHOT</version>

          <versioning>

          <snapshot>
          <timestamp>20110108.023723</timestamp>
          <buildNumber>84</buildNumber>
          </snapshot>
          <lastUpdated>20110108023723</lastUpdated>

          <snapshotVersions>

          <snapshotVersion>
          <extension>jar</extension>
          <value>1.0.2-20110108.023723-84</value>
          <updated>20110108023723</updated>
          </snapshotVersion>

          <snapshotVersion>
          <extension>pom</extension>
          <value>1.0.2-20110108.023723-84</value>
          <updated>20110108023723</updated>
          </snapshotVersion>

          <snapshotVersion>
          <classifier>noarch</classifier>
          <extension>nar</extension>
          <value>1.0.2-20110108.023723-84</value>
          <updated>20110108023723</updated>
          </snapshotVersion>

          <snapshotVersion>
          <classifier>i386-Linux-g++-jni</classifier>
          <extension>nar</extension>
          <value>1.0.2-20110108.023638-83</value>
          <updated>20110108023638</updated>
          </snapshotVersion>

          <snapshotVersion>
          <classifier>amd64-Linux-g++-jni</classifier>
          <extension>nar</extension>
          <value>1.0.2-20110108.023723-84</value>
          <updated>20110108023723</updated>
          </snapshotVersion>
          </snapshotVersions>
          </versioning>
          </metadata>

          ##############################################################

          and this is dependency declaration, I want 1 jar and 2 nar, platform dependent:

          ##############################################################

          <dependency>
          <groupId>com.barchart.udt</groupId>
          <artifactId>barchart-udt4</artifactId>
          <version>$

          {barchart.version}</version>
          <type>jar</type>
          </dependency>

          <dependency>
          <groupId>com.barchart.udt</groupId>
          <artifactId>barchart-udt4</artifactId>
          <version>${barchart.version}

          </version>
          <classifier>i386-Linux-g++-jni</classifier>
          <type>nar</type>
          </dependency>

          <dependency>
          <groupId>com.barchart.udt</groupId>
          <artifactId>barchart-udt4</artifactId>
          <version>$

          {barchart.version}

          </version>
          <classifier>amd64-Linux-g++-jni</classifier>
          <type>nar</type>
          </dependency>

          ##############################################################

          and this is the error:

          ##############################################################

          [INFO] Scanning for projects...
          [INFO] snapshot com.barchart.udt:barchart-udt4-parent:1.0.0-SNAPSHOT: checking for updates from sonatype-nexus-snapshots
          [INFO] ------------------------------------------------------------------------
          [INFO] Building Unnamed - com.barchart.udt:barchart-udt4-bundle:jar:1.0.0-SNAPSHOT
          [INFO] task-segment: [validate]
          [INFO] ------------------------------------------------------------------------
          [INFO] snapshot com.barchart.udt:barchart-udt4:1.0.2-SNAPSHOT: checking for updates from sonatype-nexus-snapshots
          Downloading: https://oss.sonatype.org/content/repositories/snapshots/com/barchart/udt/barchart-udt4/1.0.2-SNAPSHOT/barchart-udt4-1.0.2-20110108.023723-84.pom

          Downloading: https://oss.sonatype.org/content/repositories/snapshots/com/barchart/udt/barchart-udt4/1.0.2-SNAPSHOT/barchart-udt4-1.0.2-20110108.023723-84.jar
          78K downloaded (barchart-udt4-1.0.2-20110108.023723-84.jar)
          Downloading: https://oss.sonatype.org/content/repositories/snapshots/com/barchart/udt/barchart-udt4/1.0.2-SNAPSHOT/barchart-udt4-1.0.2-20110108.023723-84-i386-Linux-g++-jni.nar
          Downloading: https://oss.sonatype.org/content/repositories/snapshots/com/barchart/udt/barchart-udt4/1.0.2-SNAPSHOT/barchart-udt4-1.0.2-20110108.023723-84-amd64-Linux-g++-jni.nar

          [INFO] ------------------------------------------------------------------------
          [ERROR] BUILD ERROR
          [INFO] ------------------------------------------------------------------------
          [INFO] Failed to resolve artifact.

          ##############################################################

          in other words, the resolver tries to find

          barchart-udt4-1.0.2-20110108.023723-84-i386-Linux-g++-jni.nar
          and
          barchart-udt4-1.0.2-20110108.023723-84-amd64-Linux-g++-jni.nar

          both from latest build #84, instead of looking through the versioning
          in order to find the file that actually exists in build #83:

          barchart-udt4-1.0.2-20110108.023638-83:i386-Linux-g++-jni.nar

          Show
          Andrei Pozolotin added a comment - I guess, I must clarify: 1) yes I see in 3.0.1 that shapshots metadata does includes classifier; 2) the problem is that resolver still does not find attached artifacts form previous deployments; for example, this is repo metadata after 2 deployments: note, that artifacts of interest are (build 83 and 84): com.barchart.udt:barchart-udt4:1.0.2-20110108.023638-83:i386-Linux-g++-jni:nar com.barchart.udt:barchart-udt4:1.0.2-20110108.023723-84:amd64-Linux-g++-jni:nar ############################################################## <metadata modelVersion="1.1.0"> <groupId>com.barchart.udt</groupId> <artifactId>barchart-udt4</artifactId> <version>1.0.2-SNAPSHOT</version> − <versioning> − <snapshot> <timestamp>20110108.023723</timestamp> <buildNumber>84</buildNumber> </snapshot> <lastUpdated>20110108023723</lastUpdated> − <snapshotVersions> − <snapshotVersion> <extension>jar</extension> <value>1.0.2-20110108.023723-84</value> <updated>20110108023723</updated> </snapshotVersion> − <snapshotVersion> <extension>pom</extension> <value>1.0.2-20110108.023723-84</value> <updated>20110108023723</updated> </snapshotVersion> − <snapshotVersion> <classifier>noarch</classifier> <extension>nar</extension> <value>1.0.2-20110108.023723-84</value> <updated>20110108023723</updated> </snapshotVersion> − <snapshotVersion> <classifier>i386-Linux-g++-jni</classifier> <extension>nar</extension> <value>1.0.2-20110108.023638-83</value> <updated>20110108023638</updated> </snapshotVersion> − <snapshotVersion> <classifier>amd64-Linux-g++-jni</classifier> <extension>nar</extension> <value>1.0.2-20110108.023723-84</value> <updated>20110108023723</updated> </snapshotVersion> </snapshotVersions> </versioning> </metadata> ############################################################## and this is dependency declaration, I want 1 jar and 2 nar, platform dependent: ############################################################## <dependency> <groupId>com.barchart.udt</groupId> <artifactId>barchart-udt4</artifactId> <version>$ {barchart.version}</version> <type>jar</type> </dependency> <dependency> <groupId>com.barchart.udt</groupId> <artifactId>barchart-udt4</artifactId> <version>${barchart.version} </version> <classifier>i386-Linux-g++-jni</classifier> <type>nar</type> </dependency> <dependency> <groupId>com.barchart.udt</groupId> <artifactId>barchart-udt4</artifactId> <version>$ {barchart.version} </version> <classifier>amd64-Linux-g++-jni</classifier> <type>nar</type> </dependency> ############################################################## and this is the error: ############################################################## [INFO] Scanning for projects... [INFO] snapshot com.barchart.udt:barchart-udt4-parent:1.0.0-SNAPSHOT: checking for updates from sonatype-nexus-snapshots [INFO] ------------------------------------------------------------------------ [INFO] Building Unnamed - com.barchart.udt:barchart-udt4-bundle:jar:1.0.0-SNAPSHOT [INFO] task-segment: [validate] [INFO] ------------------------------------------------------------------------ [INFO] snapshot com.barchart.udt:barchart-udt4:1.0.2-SNAPSHOT: checking for updates from sonatype-nexus-snapshots Downloading: https://oss.sonatype.org/content/repositories/snapshots/com/barchart/udt/barchart-udt4/1.0.2-SNAPSHOT/barchart-udt4-1.0.2-20110108.023723-84.pom Downloading: https://oss.sonatype.org/content/repositories/snapshots/com/barchart/udt/barchart-udt4/1.0.2-SNAPSHOT/barchart-udt4-1.0.2-20110108.023723-84.jar 78K downloaded (barchart-udt4-1.0.2-20110108.023723-84.jar) Downloading: https://oss.sonatype.org/content/repositories/snapshots/com/barchart/udt/barchart-udt4/1.0.2-SNAPSHOT/barchart-udt4-1.0.2-20110108.023723-84-i386-Linux-g++-jni.nar Downloading: https://oss.sonatype.org/content/repositories/snapshots/com/barchart/udt/barchart-udt4/1.0.2-SNAPSHOT/barchart-udt4-1.0.2-20110108.023723-84-amd64-Linux-g++-jni.nar [INFO] ------------------------------------------------------------------------ [ERROR] BUILD ERROR [INFO] ------------------------------------------------------------------------ [INFO] Failed to resolve artifact. ############################################################## in other words, the resolver tries to find barchart-udt4-1.0.2-20110108.023723-84-i386-Linux-g++-jni.nar and barchart-udt4-1.0.2-20110108.023723-84-amd64-Linux-g++-jni.nar both from latest build #84, instead of looking through the versioning in order to find the file that actually exists in build #83: barchart-udt4-1.0.2-20110108.023638-83:i386-Linux-g++-jni.nar
          a137779cbd054 made changes -
          Link This issue is depended upon by MNG-4965 [ MNG-4965 ]
          Hide
          Andrei Pozolotin added a comment -

          forgot to mention: of course, this relates to SNAPSHOT artifacts only

          Show
          Andrei Pozolotin added a comment - forgot to mention: of course, this relates to SNAPSHOT artifacts only
          a137779cbd054 made changes -
          Link This issue is related to MNG-4965 [ MNG-4965 ]
          Benjamin Bentmann made changes -
          Link This issue is related to MNG-4965 [ MNG-4965 ]
          Hide
          Leon Franzen added a comment -

          We are seeing exactly the same problem as Andrei in Maven 3.0.1 with platform dependent nar builds. This is a critical blocker for us.

          By reconfiguring our settings.xml to work around the inability of Nexus to provide the new classifier/type specific metadata information through a repository-group, we are now stuck on this issue. Is there a way to set the build number at deploy time to work around this issue?

          Show
          Leon Franzen added a comment - We are seeing exactly the same problem as Andrei in Maven 3.0.1 with platform dependent nar builds. This is a critical blocker for us. By reconfiguring our settings.xml to work around the inability of Nexus to provide the new classifier/type specific metadata information through a repository-group, we are now stuck on this issue. Is there a way to set the build number at deploy time to work around this issue?
          Hide
          Leon Franzen added a comment -

          The state of the snapshot repository during the Maven build shown in the file "output" (attached)

          Show
          Leon Franzen added a comment - The state of the snapshot repository during the Maven build shown in the file "output" (attached)
          Leon Franzen made changes -
          Attachment nar-maven-metadata.xml [ 53182 ]
          Attachment output [ 53180 ]
          Attachment nar-artifact-list.txt [ 53181 ]
          Hide
          Andrei Pozolotin added a comment -

          Leon:
          my woraround is use direct repo access and NOT to use repo-to-repo proxy:
          https://issues.sonatype.org/browse/NEXUS-4055
          Andrei

          Show
          Andrei Pozolotin added a comment - Leon: my woraround is use direct repo access and NOT to use repo-to-repo proxy: https://issues.sonatype.org/browse/NEXUS-4055 Andrei
          Hide
          Leon Franzen added a comment - - edited

          Then I think perhaps I am not configuring my settings.xml properly to work around the problem. I am still referencing a repository group but have tried to include a direct repo reference to my snapshot repository.

          <settings>
          <mirrors>
          <mirror>
          <id>nexus</id>
          <mirrorOf>*,!snapshots</mirrorOf>
          <url>http://nexus:8081/nexus/content/groups/public</url> <!-- My problematic repo-group -->
          </mirror>
          </mirrors>
          <profiles>
          <profile>
          <id>nexus</id>
          <repositories>
          <repository>
          <id>snapshots</id>
          <url>http://nexus:8081/nexus/content/repositories/snapshots</url> <!-- My snapshot repo -->
          <releases>
          <enabled>false</enabled>
          </releases>
          <snapshots>
          <enabled>true</enabled>
          </snapshots>
          </repository>
          ...

          Andrei, how were you specifically able to work around the issue? Are you not using a group?

          Show
          Leon Franzen added a comment - - edited Then I think perhaps I am not configuring my settings.xml properly to work around the problem. I am still referencing a repository group but have tried to include a direct repo reference to my snapshot repository. <settings> <mirrors> <mirror> <id>nexus</id> <mirrorOf>*,!snapshots</mirrorOf> <url> http://nexus:8081/nexus/content/groups/public </url> <!-- My problematic repo-group --> </mirror> </mirrors> <profiles> <profile> <id>nexus</id> <repositories> <repository> <id>snapshots</id> <url> http://nexus:8081/nexus/content/repositories/snapshots </url> <!-- My snapshot repo --> <releases> <enabled>false</enabled> </releases> <snapshots> <enabled>true</enabled> </snapshots> </repository> ... Andrei, how were you specifically able to work around the issue? Are you not using a group?
          Hide
          Andrei Pozolotin added a comment -

          Leon:

          in my case:

          1) my "real repo" is sonaytpe oss;

          2) my "proxy repo" is internal corporate repo which was going after sonatype oss;

          Andrei

          Show
          Andrei Pozolotin added a comment - Leon: in my case: 1) my "real repo" is sonaytpe oss; 2) my "proxy repo" is internal corporate repo which was going after sonatype oss; Andrei
          Hide
          Andrei Pozolotin added a comment -

          Leon:

          according to this:
          https://issues.sonatype.org/browse/NEXUS-4055

          sonatype folks fixed this in trunk; you may want to build nexus;

          Andrei

          Show
          Andrei Pozolotin added a comment - Leon: according to this: https://issues.sonatype.org/browse/NEXUS-4055 sonatype folks fixed this in trunk; you may want to build nexus; Andrei
          Hide
          Andrei Pozolotin added a comment -

          Leon:

          I tried to send you email (listed on this site); but it got bounced;

          I wanted to ask you if you were able to solve the following nar issue:
          https://issues.sonatype.org/browse/NAR-181

          thank you;

          Andrei

          Show
          Andrei Pozolotin added a comment - Leon: I tried to send you email (listed on this site); but it got bounced; I wanted to ask you if you were able to solve the following nar issue: https://issues.sonatype.org/browse/NAR-181 thank you; Andrei
          Hide
          Lukasz Szelag added a comment -

          I'm also experiencing the same issue (Maven 2.2.1 and Archiva 1.3.5). As I'm not ready to switch to Maven 3.x yet - is there a patch for 2.2.1 that provides a fix? I'm using this functionality (classifier) to name artifacts for different environments.

          Thanks,
          Lukasz

          Show
          Lukasz Szelag added a comment - I'm also experiencing the same issue (Maven 2.2.1 and Archiva 1.3.5). As I'm not ready to switch to Maven 3.x yet - is there a patch for 2.2.1 that provides a fix? I'm using this functionality (classifier) to name artifacts for different environments. Thanks, Lukasz
          Hervé Boutemy made changes -
          Fix Version/s 2.2.x (to be reviewed) [ 13141 ]
          Michael Osipov made changes -
          Fix Version/s 2.2.x (to be reviewed) [ 13141 ]
          Mark Thomas made changes -
          Project Import Sun Apr 05 08:49:45 UTC 2015 [ 1428223785911 ]
          Mark Thomas made changes -
          Link This issue is related to MDEPLOY-48 [ MDEPLOY-48 ]
          Mark Thomas made changes -
          Workflow jira [ 12714759 ] Default workflow, editable Closed status [ 12754395 ]
          Mark Thomas made changes -
          Project Import Sun Apr 05 21:45:26 UTC 2015 [ 1428270326204 ]
          Mark Thomas made changes -
          Link This issue is related to MDEPLOY-48 [ MDEPLOY-48 ]
          Mark Thomas made changes -
          Workflow jira [ 12951221 ] Default workflow, editable Closed status [ 12987479 ]
          Mark Thomas made changes -
          Reporter Paul Benedict [ ID134349 ] Paul Benedict [ paul4christ79 ]
          Transition Time In Source Status Execution Times Last Executer Last Execution Date
          Open Open Closed Closed
          294d 19h 8m 1 Benjamin Bentmann 08/Sep/10 09:48

            People

            • Assignee:
              Benjamin Bentmann
              Reporter:
              Paul Benedict
            • Votes:
              3 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development