Encountered a problem when using maven's Eclipse plugin. In the same workspace, there are two projects, A and B.
Project A will be provided as a jar to a 3rd-party and Project B was created to simulate the scene to use A. So definitely I want jar dependency in B rather than project dependency.
In B's pom.xml:
<dependency>
<groupId>com.foo.bar</groupId>
<artifactId>artifact-A</artifactId>
<version>1.0-SNAPSHOT</version>
<type>jar</type>
</dependency>
As mvn eclipse:clean eclipse:eclipse
executed successfully on B, I always got project dependency. The workaround is to modify .classpath file, or just copy B to another workspace, but both is inconvenient.
maven 3.0.2; eclipse 3.7 without m2eclipse
You need to set the maven-eclipse-plugin's useProjectResources to false. This way the project should only use jar dependencies directly and not reference any projects.
mvn eclipse:eclipse -Declipse.useProjectReferences=false
Try disabling workspace resolution (right click project B
, Maven -> Disable Workspace Resolution). If you want a more sure way, simply closing project A in Eclipse is sufficient.
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