I have parent pom and two module poms. In first module I want to copy second module (jar) to some folder. When I compiling project from first module pom - it works, but when I'm trying to compile from parent project pom, plugin tries to copy module classes insted of jar:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-dependency-plugin:2.1:copy (default) on project module1: Error copying artifact from /home/chardex/projects/test/module2/target/classes to /home/chardex/projects/test/module1/target/lib/classes: /home/chardex/projects/test/module2/target/classes (Is a directory) -> [Help 1]
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<phase>compile</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>...</groupId>
<artifactId>module2</artifactId>
<version>...</version>
<type>jar</type>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
Thanks.
Transitive Dependencies. Maven avoids the need to discover and specify the libraries that your own dependencies require by including transitive dependencies automatically. This feature is facilitated by reading the project files of your dependencies from the remote repositories specified.
ArtifactItem represents information specified in the plugin configuration section for each artifact.
The Maven Clean Plugin, as the name implies, attempts to clean the files and directories generated by Maven during its build. While there are plugins that generate additional files, the Clean Plugin assumes that these files are generated inside the target directory.
I believe this is a bug in maven-dependency-plugin: http://jira.codehaus.org/browse/MDEP-259
While doing this in eclipse, unchecking the "Resolve workspace artifacts" got rid of the error, and I could do a clean install successfully.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With