Details
-
Type:
Bug
-
Status:
Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: Help Wanted, Maven Embedder
-
Labels:None
-
Environment:Windows XP SP2, Eclipse 3.4.1, external maven 2.0.9
-
Testcase included:yes
-
Number of attachments :6
Description
When we enable "Resolve dependencies from workspace projects", maven-dependency-plugin doesn't find its dependencies anymore, and fails with an "internal error". You can only see this error if you use the debug option "-X".
I attached two pom files which describes two projects :
- projet1 is a very simple jar project
- projet2 depends on projet1 and uses the "copy" goal of maven-dependency-project to copy this dependency.
-
- machine1.txt
- 03/Nov/08 10:14 AM
- 340 kB
- Julien Wajsberg
-
- machine2.txt
- 03/Nov/08 10:14 AM
- 236 kB
- Julien Wajsberg
-
- machine3.txt
- 03/Nov/08 10:14 AM
- 270 kB
- Julien Wajsberg
-
- pom.xml
- 31/Oct/08 1:26 PM
- 1 kB
- Julien Wajsberg
-
- pom.xml
- 31/Oct/08 1:26 PM
- 0.5 kB
- Julien Wajsberg
-
Hide
- workspace.zip
- 03/Nov/08 2:40 AM
- 11 kB
- Julien Wajsberg
-
- projet1/.classpath 0.6 kB
- projet1/.project 0.5 kB
- projet1/.../org.eclipse.jdt.core.prefs 0.2 kB
- projet1/.../org.maven.ide.eclipse.prefs 0.2 kB
- projet1/pom.xml 0.5 kB
- projet1/src/.../developpez/HelloWord.java 0.2 kB
- projet1/src/.../TestHelloWorld.java 0.2 kB
- projet1/src/test/resources/test.txt 0.0 kB
- projet1/target/.../HelloWord.class 0.5 kB
- projet1/target/.../TestHelloWorld.class 0.4 kB
- projet1/target/test-classes/test.txt 0.0 kB
- projet2/.classpath 0.6 kB
- projet2/.project 0.5 kB
- projet2/.../org.eclipse.jdt.core.prefs 0.2 kB
- projet2/.../org.maven.ide.eclipse.prefs 0.2 kB
- projet2/pom.xml 1 kB
- projet2/.../projet1-0.0.1-SNAPSHOT.jar 2 kB
Issue Links
- depends upon
-
MDEP-187
dependency:copy fails when invoked from m2e with workspace resolution enabled, or more generally when copying within reactor for phases earlier than package
-
- relates to
-
MNGECLIPSE-1000
generated-source not added to the classpath when "resolve dependencies from workspace projects" is enabled
-
Activity
Julien, does this happen only when launching Maven? Can you please provide the stack trace you are seeing. Thanks.
BTW, it would make easier for us to use your test poms if you had provided complete projects in an archive, so we could just import those projects here without intermediate steps.
> Julien, does this happen only when launching Maven? Can you please provide the stack trace you are seeing. Thanks.
Sorry, I don't understand the first question.
For the stack trace, I can't because it isn't written on the console, even with -X... Is there a way to display it ?
> > Julien, does this happen only when launching Maven? Can you please provide the
> stack trace you are seeing. Thanks.
> Sorry, I don't understand the first question.
There is several cases when m2eclipse can execute Maven:
- launching Maven using Run As... / Maven xxx
- Maven builder runs goals specified on Maven page in project properties
- Maven project import and update configuration runs goals specified on Maven preference page in Window / Preferences / Maven
- update dependencies also delegate to Maven to read project
You need to be very specific about what action caused error you are seeing.
> For the stack trace, I can't because it isn't written on the console, even with
> -X... Is there a way to display it ?
So, there is nothing goes to the Eclipse error log?
There is a -console option in Eclipse command line and you can also explicitly specify to use java.exe instead of javaw.exe in eclipse.ini. Something like this:
-startup plugins\org.eclipse.equinox.launcher_1.0.100.v20080509-1800.jar --launcher.library plugins\org.eclipse.equinox.launcher.win32.win32.x86_1.0.100.v20080509-1800 -showsplash org.eclipse.platform -vm C:\jdk1.6.0_06\bin\java.exe -vmargs -Xms256m -Xmx500m -XX:PermSize=32m -XX:MaxPermSize=256m
Originally, we trigger this bug using "clean" from menu "Project" in Eclipse. This clean triggers "process-test-resources" on the project, because of the maven configuration for this project.
Using this way doesn't show any stacktrace, just a message "Internal error in the plugin manager executing goal 'org.apache.maven.plugins:maven-dependency-plugin:2.0-alpha-4:copy': Mojo execution failed."
I tried now to directly launch the goal "process-test-resources" from a Maven run configuration. The bug didn't show up first. But then, I check "Resolve workspace artifacts", the bug is back ! And this time I have the stack trace (note "Accès refusé" is french for "Access Forbidden") :
The following mojo encountered an error while executing: Group-Id: org.apache.maven.plugins Artifact-Id: maven-dependency-plugin Version: 2.0-alpha-4 Mojo: copy brought in via: POM While building project: Group-Id: com.developpez Artifact-Id: projet2 Version: 0.0.1-SNAPSHOT From file: C:\OmarH\workspace\projet2\pom.xml Reason: Error copying artifact from C:\OmarH\workspace\projet1\target\classes to C:\OmarH\workspace\projet2\target\copied-files\classes java.io.FileNotFoundException: C:\OmarH\workspace\projet1\target\classes (Accès refusé) at java.io.FileInputStream.open(Native Method) at java.io.FileInputStream.<init>(FileInputStream.java:106) at org.codehaus.plexus.util.FileUtils.copyFile(FileUtils.java:820) at org.apache.maven.plugin.dependency.AbstractDependencyMojo.copyFile(AbstractDependencyMojo.java:194) at org.apache.maven.plugin.dependency.fromConfiguration.CopyMojo.copyArtifact(CopyMojo.java:98) at org.apache.maven.plugin.dependency.fromConfiguration.CopyMojo.execute(CopyMojo.java:72) at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:579) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:498) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegmentForProject(DefaultLifecycleExecutor.java:265) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:191) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:149) at org.apache.maven.DefaultMaven.execute_aroundBody0(DefaultMaven.java:223) at org.apache.maven.DefaultMaven.execute_aroundBody1$advice(DefaultMaven.java:304) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:1) at org.apache.maven.embedder.MavenEmbedder.execute_aroundBody2(MavenEmbedder.java:904) at org.apache.maven.embedder.MavenEmbedder.execute_aroundBody3$advice(MavenEmbedder.java:304) at org.apache.maven.embedder.MavenEmbedder.execute(MavenEmbedder.java:1) at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:176) at org.apache.maven.cli.MavenCli.main(MavenCli.java:63) at org.apache.maven.cli.MavenCli.main(MavenCli.java:52) Error stacktrace: org.apache.maven.lifecycle.LifecycleExecutionException: Internal error in the plugin manager executing goal 'org.apache.maven.plugins:maven-dependency-plugin:2.0-alpha-4:copy': Mojo execution failed. at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:505) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegmentForProject(DefaultLifecycleExecutor.java:265) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:191) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:149) at org.apache.maven.DefaultMaven.execute_aroundBody0(DefaultMaven.java:223) at org.apache.maven.DefaultMaven.execute_aroundBody1$advice(DefaultMaven.java:304) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:1) at org.apache.maven.embedder.MavenEmbedder.execute_aroundBody2(MavenEmbedder.java:904) at org.apache.maven.embedder.MavenEmbedder.execute_aroundBody3$advice(MavenEmbedder.java:304) at org.apache.maven.embedder.MavenEmbedder.execute(MavenEmbedder.java:1) at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:176) at org.apache.maven.cli.MavenCli.main(MavenCli.java:63) at org.apache.maven.cli.MavenCli.main(MavenCli.java:52) Caused by: org.apache.maven.plugin.PluginExecutionException: Mojo execution failed. at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:601) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:498) ... 12 more Caused by: org.apache.maven.plugin.MojoExecutionException: Error copying artifact from C:\OmarH\workspace\projet1\target\classes to C:\OmarH\workspace\projet2\target\copied-files\classes at org.apache.maven.plugin.dependency.AbstractDependencyMojo.copyFile(AbstractDependencyMojo.java:199) at org.apache.maven.plugin.dependency.fromConfiguration.CopyMojo.copyArtifact(CopyMojo.java:98) at org.apache.maven.plugin.dependency.fromConfiguration.CopyMojo.execute(CopyMojo.java:72) at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:579) ... 13 more Caused by: java.io.FileNotFoundException: C:\OmarH\workspace\projet1\target\classes (Accès refusé) at java.io.FileInputStream.open(Native Method) at java.io.FileInputStream.<init>(FileInputStream.java:106) at org.codehaus.plexus.util.FileUtils.copyFile(FileUtils.java:820) at org.apache.maven.plugin.dependency.AbstractDependencyMojo.copyFile(AbstractDependencyMojo.java:194) ... 16 more
Note also that the bug is triggered both by Maven embedder and external maven, so I'm not sure it's in the correct bug category.
Can you please attach your Eclipse configuration details from Help / About Eclipse SDK / Configuration Details?
Error like access forbidden probably mean that there is something with permissions on the file system. I would suggest to try to use clean checkout for that project or try this on a different machine.
We encounter the very same problem on 3 different machines already.
Here are the configurations for all 3 machines.
Just wanted to comment about a "workaround" in my opinion.
I had the same issue, but running the build with install goal solves it, because the dependencies are installed into the repository and brought up from the repository and not the workspace.
As far as I know, recently released maven-dependency-plugin 2.1 contains a fix for the root cause of the problem. See MDEP-187 .
Attached the testcase