I have a multi module project with a parent project A, and two childs project B and C. Project B has a dependency on project C. I use the maven-dependency-plugin to copy the dependencies of B to a lib/ directory in the target/ directory. So, I can use the maven-assembly-plugin to include this lib/ directory in the final zip. The problem is I get the following error when I run mvn clean package on project B:
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209) ... 19 more
Caused by: java.io.FileNotFoundException: D:\path-to-projects-directory\C\target\classes (Access is denied)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.(FileInputStream.java:120)
at org.codehaus.plexus.util.io.FileInputStreamFacade.getInputStream(FileInputStreamFacade.java:36)
at org.codehaus.plexus.util.FileUtils.copyStreamToFile(FileUtils.java:1141)
at org.codehaus.plexus.util.FileUtils.copyFile(FileUtils.java:1048)
at org.apache.maven.plugin.dependency.AbstractDependencyMojo.copyFile(AbstractDependencyMojo.java:192) ... 23 more
Someone has an idea?
I've done some research on the web and I found that there is such an issue (see http://jira.codehaus.org/browse/MWAR-192 , that's for the wars but I have the similar problem with JAR). It seems that the target/classes directory of project C can't be accessed to create the C.jar (the C.jar must be included in the lib/ directory of project B).
Thanks