Anyone?  :-)

-----Ursprüngliche Nachricht-----
Von: Lewis, Eric [mailto:eric.le...@ipi.ch] 
Gesendet: Dienstag, 23. Oktober 2012 16:53
An: users@maven.apache.org
Betreff: dependency:unpack doesn't work correctly with Nexus, SNAPSHOT and 
classifier?

Hi

First of all I'd like to ask you to be gentle with me  :-)
The solution I'm talking about is one big hack and will have to be migrated one 
day.

But for the time being, here's the issue:

We have a WAR from an old Ant build which is built in a stage-dependent way 
(one WAR for local use, one for development, one for production etc.).

The old build was coaxed into deploying the WAR into our Nexus with a 
classifier representing the stage, e.g. 
ch.ige:wdlbrowserzk:local:3.3.0-SNAPSHOT:war

This works well, and I can see the different WARs with their build date.

To deploy the WAR, I rebuild it with a Maven build. First, I use 
dependency:unpack to get the WAR and unpack it. Later on, since the Maven 
project is a war project, the WAR is rebuilt and deployed.

Now, my problem is that dependency:unpack always unpacks from the local repo. 
It downloads the metadata from Nexus and then assumes that the local WAR is the 
same as on Nexus - which it isn't!

The classifier is given to the plugin's configuration by using a profile. The 
only bug I can imagine is that the plugin downloads the metadata, sees no 
difference between the local repo and Nexus (since it seems to ignore the 
classifier) and then proceeds with the local repo.

Does the plugin use a different dependency resolution? Or is my approach wrong? 
(I mean, apart from the obviously hacky way of doing it)

Here's the configuration:
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
        <executions>
          <execution>
            <id>unpack-wdl-war</id>
            <phase>prepare-package</phase>
            <goals>
              <goal>unpack</goal>
            </goals>
            <configuration>
              <artifactItems>
                <!-- Note: This works only if a stage-dependent profile is 
active! -->
                <artifactItem>
                  <groupId>ch.ige</groupId>
                  <artifactId>wdlbrowserzk</artifactId>
                  <version>${wdlbrowserzk.version}</version>
                  <type>war</type>
                  <classifier>${profile.id}</classifier>
                  <overWrite>true</overWrite>
                </artifactItem>
              </artifactItems>
              <outputDirectory>${webapp.directory}</outputDirectory>
              <overWriteReleases>true</overWriteReleases>
              <overWriteSnapshots>true</overWriteSnapshots>
            </configuration>
          </execution>
        </executions>
      </plugin>

And here's the console output:

[INFO] --- maven-dependency-plugin:2.5.1:unpack (unpack-wdl-war) @ 
etrademark-nt-wdl-web ---
[INFO] Configured Artifact: ch.ige:wdlbrowserzk:local:3.3.0-SNAPSHOT:war
Downloading: 
http://myrepo.com/content/groups/public/ch/ige/wdlbrowserzk/3.3.0-SNAPSHOT/maven-metadata.xml
Downloaded: 
http://myrepo.com/content/groups/public/ch/ige/wdlbrowserzk/3.3.0-SNAPSHOT/maven-metadata.xml
 (264 B at 7.2 KB/sec)
[INFO] Unpacking 
C:\jp\maven-repository\ch\ige\wdlbrowserzk\3.3.0-SNAPSHOT\wdlbrowserzk-3.3.0-SNAPSHOT-local.war
 to C:\jp\esv-projects\etrademark-nt\etrademark-nt-wdl-web\target\wdl with 
includes "" and excludes ""

Any hint is appreciated!

Best regards,
Eric

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org

Reply via email to