Uploaded image for project: 'Maven Dependency Plugin'
  1. Maven Dependency Plugin
  2. MDEP-438

When classifier and main jar are on different SNAPSHOT builds, the wrong build is retrieved

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Incomplete
    • 2.8
    • None
    • copy
    • None

    Description

      In our repository we have 3 versions of an artifact being deployed at different intervals differentiated by a classifier -

      artifact.war
      artifact-classifier.war
      artifact-classes.jar

      In our pom file we are attempting to copy the main war but a classifier war has been deployed after the last deploy of the main war, so the maven-metadata.xml file looks similar to this:

      <metadata modelVersion="1.1.0">
      	<groupId>com.mycompany</groupId>
      	<artifactId>artifact</artifactId>
      	<version>1.0.0-SNAPSHOT</version>
      	<versioning>
      		<snapshot>
      			<timestamp>20140321.173622</timestamp>
      			<buildNumber>100</buildNumber>
      		</snapshot>
      		<lastUpdated>20140321173622</lastUpdated>
      		<snapshotVersions>
      			<snapshotVersion>
      				<extension>pom</extension>
      				<value>1.0.0-20140321.173622-100</value>
      				<updated>20140321173622</updated>
      			</snapshotVersion>
      			<snapshotVersion>
      				<extension>war</extension>
      				<value>1.0.0-20140321.173040-99</value>
      				<updated>20140321173040</updated>
      			</snapshotVersion>
      			<snapshotVersion>
      				<classifier>classes</classifier>
      				<extension>jar</extension>
      				<value>1.0.0-20140321.173622-100</value>
      				<updated>20140321173622</updated>
      			</snapshotVersion>
      			<snapshotVersion>
      				<classifier>classifier</classifier>
      				<extension>war</extension>
      				<value>1.0.0-20140321.173622-100</value>
      				<updated>20140321173622</updated>
      			</snapshotVersion>
      		</snapshotVersions>
      	</versioning>
      </metadata>
      

      So the main war is on build 99, while the classifier and classes builds are on build 100.

      It appears the dependency plugin is ignoring the <snapshotVersions> elements and using the value in the <snapshot> element regardless of classifier.

      Attachments

        Activity

          People

            Unassigned Unassigned
            caschmidt Chris Schmidt
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: