Unpacking Artifacts : site usage example does not work.
-------------------------------------------------------
Key: MDEP-163
URL: http://jira.codehaus.org/browse/MDEP-163
Project: Maven 2.x Dependency Plugin
Issue Type: Bug
Components: unpack
Affects Versions: 2.0
Environment:
http://maven.apache.org/plugins/maven-dependency-plugin/examples/unpacking-artifacts.html
Reporter: Andrew Hughes
Assignee: Brian Fox
I've taken the dependency:unpack example on
http://maven.apache.org/plugins/maven-dependency-plugin/examples/unpacking-artifacts.html
(below) and it does now work (complete pom for you to test on the bottom if
you dare).
{noformat}
<project>
[...]
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>unpack</id>
<phase>package</phase>
<goals>
<goal>unpack</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<type>jar</type>
<overWrite>false</overWrite>
<outputDirectory>${project.build.directory}/alternateLocation</outputDirectory>
<destFileName>optional-new-name.jar</destFileName>
<includes>**/*.class,**/*.xml</includes>
<excludes>**/*test.class</excludes>
</artifactItem>
</artifactItems>
<includes>**/*.java</includes>
<excludes>**/*.properties</excludes>
<outputDirectory>${project.build.directory}/wars</outputDirectory>
<overWriteReleases>false</overWriteReleases>
<overWriteSnapshots>true</overWriteSnapshots>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
[...]
</project>
{noformat}
The error I get is...
{noformat}
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] One or more required plugin parameters are invalid/missing for
'dependency:unpack'
[0] inside the definition for plugin: 'maven-dependency-plugin'specify the
following:
<configuration>
...
<artifactItems>VALUE</artifactItems>
</configuration>.
[INFO] ------------------------------------------------------------------------
[DEBUG] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: Error configuring:
org.apache.maven.plugins:maven-dependency-plugin. Reason: Invalid or missing
parameters: [Mojo parameter [name: 'artifactItems'; alias: 'null']] for mojo:
org.apache.maven.plugins:maven-dependency-plugin:2.0:unpack
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:568)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:493)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:463)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:311)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:278)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:143)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:334)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:125)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:280)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.plugin.PluginParameterException: Error configuring:
org.apache.maven.plugins:maven-dependency-plugin. Reason: Invalid or missing
parameters: [Mojo parameter [name: 'artifactItems'; alias: 'null']] for mojo:
org.apache.maven.plugins:maven-dependency-plugin:2.0:unpack
at
org.apache.maven.plugin.DefaultPluginManager.checkRequiredParameters(DefaultPluginManager.java:907)
at
org.apache.maven.plugin.DefaultPluginManager.getConfiguredMojo(DefaultPluginManager.java:612)
at
org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:421)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:539)
... 16 more
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4 seconds
[INFO] Finished at: Fri Apr 18 14:05:51 CST 2008
[INFO] Final Memory: 12M/132M
[INFO] ------------------------------------------------------------------------
{noformat}
Complete pom, cut/paste/save and run 'mvn dependency:unpack' to see error
{noformat}
<?xml version="1.0" encoding="UTF-8"?>
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>mygroup</groupId>
<artifactId>myartifact</artifactId>
<packaging>jar</packaging>
<version>0.0.1-SNAPSHOT</version>
<description></description>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>unpack</id>
<phase>package</phase>
<goals>
<goal>unpack</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.4</version>
<type>jar</type>
<overWrite>false</overWrite>
<outputDirectory>
${project.build.directory}/alternateLocation
</outputDirectory>
<destFileName>
optional-new-name.jar
</destFileName>
<includes>
**/*.class,**/*.xml
</includes>
<excludes>**/*test.class</excludes>
</artifactItem>
</artifactItems>
<includes>**/*.java</includes>
<excludes>**/*.properties</excludes>
<outputDirectory>
${project.build.directory}/wars
</outputDirectory>
<overWriteReleases>false</overWriteReleases>
<overWriteSnapshots>
true
</overWriteSnapshots>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.4</version>
</dependency>
</dependencies>
</project>
{noformat}
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira