You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Tobias Oberlies (JIRA)" <ji...@codehaus.org> on 2014/06/11 13:07:10 UTC

[jira] (MDEP-449) unpack fails to download SNAPSHOT artifact with classifier

Tobias Oberlies created MDEP-449:
------------------------------------

             Summary: unpack fails to download SNAPSHOT artifact with classifier
                 Key: MDEP-449
                 URL: https://jira.codehaus.org/browse/MDEP-449
             Project: Maven Dependency Plugin
          Issue Type: Bug
    Affects Versions: 2.8, 2.7
            Reporter: Tobias Oberlies


The unpack goal fails to replace the literal {{SNAPSHOT}} in the URL when trying to download snapshot artifacts with a classifier.

For this configuration
{noformat}
<plugin>
   <groupId>org.apache.maven.plugins</groupId>
   <artifactId>maven-dependency-plugin</artifactId>
   <executions>
      <execution>
         <goals>
            <goal>unpack</goal>
         </goals>
         <phase>process-resources</phase>
         <configuration>
            <artifactItems>
               <artifactItem>
                  <groupId>org.eclipse.download.epp</groupId>
                  <artifactId>eclipse-jee</artifactId>
                  <version>luna-RC3-SNAPSHOT</version>
                  <classifier>win32-x86_64</classifier>
                  <type>zip</type>
               </artifactItem>
            </artifactItems>
         </configuration>
      </execution>
   </executions>
</plugin>
{noformat}
the log output is the following:
{noformat}
[INFO] --- maven-dependency-plugin:2.8:unpack (default) @ dependency-copy-test ---
[INFO] Configured Artifact: org.eclipse.download.epp:eclipse-jee:win32-x86_64:luna-RC3-SNAPSHOT:zip
[INFO] Downloading: http://nexus:8081/nexus/content/repositories/build.snapshots/org/eclipse/download/epp/eclipse-jee/luna-RC3-SNAPSHOT/maven-metadata.xml
[INFO] Downloaded: http://nexus:8081/nexus/content/repositories/build.snapshots/org/eclipse/download/epp/eclipse-jee/luna-RC3-SNAPSHOT/maven-metadata.xml (1016 B at 0.5 KB/sec)
[INFO] Downloading: http://nexus:8081/nexus/content/repositories/build.snapshots/org/eclipse/download/epp/eclipse-jee/luna-RC3-SNAPSHOT/eclipse-jee-luna-RC3-SNAPSHOT-win32-x86_64.zip
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-dependency-plugin:2.8:unpack (default) on project dependency-copy-test: Unable to find artifact. Could not find artifact org.eclipse.download.epp:eclipse-jee:zip:win32-x86_64:luna-RC3-SNAPSHOT in build.snapshots.repo (http://nexus:8081/nexus/content/repositories/build.snapshots/)
{noformat}

The problem is that the {{SNAPSHOT}} in the download URL is not replaced by the qualifier used in the remote repository.

For comparison, this is the log output for an artifact without classifier:
{noformat}
[INFO] --- maven-dependency-plugin:2.8:unpack (default) @ dependency-copy-test ---
[INFO] Configured Artifact: org.eclipse.download.epp:eclipse-jee:luna-RC3-unclassified-SNAPSHOT:zip
[INFO] Downloading: http://nexus:8081/nexus/content/repositories/build.snapshots/org/eclipse/download/epp/eclipse-jee/luna-RC3-unclassified-SNAPSHOT/maven-metadata.xml
[INFO] Downloaded: http://nexus:8081/nexus/content/repositories/build.snapshots/org/eclipse/download/epp/eclipse-jee/luna-RC3-unclassified-SNAPSHOT/maven-metadata.xml (833 B at 0.3 KB/sec)
[INFO] Downloading: http://nexus:8081/nexus/content/repositories/build.snapshots/org/eclipse/download/epp/eclipse-jee/luna-RC3-unclassified-SNAPSHOT/eclipse-jee-luna-RC3-unclassified-20140611.104638-1.zip
[INFO] Downloaded: http://nexus:8081/nexus/content/repositories/build.snapshots/org/eclipse/download/epp/eclipse-jee/luna-RC3-unclassified-SNAPSHOT/eclipse-jee-luna-RC3-unclassified-20140611.104638-1.zip (264766 KB at 9409.5 KB/sec)
[INFO] Unpacking C:\Users\myuser\.m2\repository\org\eclipse\download\epp\eclipse-jee\luna-RC3-unclassified-SNAPSHOT\eclipse-jee-luna-RC3-unclassified-SNAPSHOT.zip to C:\Env\Eclipse\Workspaces\BNDL\dependency-copy-test\target\dependency with includes "" and excludes ""
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
{noformat}

Note that for reproducing this issue, you need to use a classified snapshot artifact available in your repository manager.

For reference, the content of the {{luna-RC3-SNAPSHOT/maven-metadata.xml}} is
{noformat}
<?xml version="1.0" encoding="UTF-8"?>
<metadata modelVersion="1.1.0">
  <groupId>org.eclipse.download.epp</groupId>
  <artifactId>eclipse-jee</artifactId>
  <version>luna-RC3-SNAPSHOT</version>
  <versioning>
    <snapshot>
      <timestamp>20140611.104752</timestamp>
      <buildNumber>4</buildNumber>
    </snapshot>
    <lastUpdated>20140611104752</lastUpdated>
    <snapshotVersions>
      <snapshotVersion>
        <classifier>win32-x86_64</classifier>
        <extension>pom</extension>
        <value>luna-RC3-20140611.104752-4</value>
        <updated>20140611104752</updated>
      </snapshotVersion>
      <snapshotVersion>
        <extension>zip</extension>
        <value>luna-RC3-20140611.103729-3</value>
        <updated>20140611103729</updated>
      </snapshotVersion>
      <snapshotVersion>
        <extension>pom</extension>
        <value>luna-RC3-20140611.103729-3</value>
        <updated>20140611103729</updated>
      </snapshotVersion>
    </snapshotVersions>
  </versioning>
</metadata>
{noformat}



--
This message was sent by Atlassian JIRA
(v6.1.6#6162)