0

I have a Maven project which has a dependency on another one, defined in the pom.xml. This dependent project already exists in my local repository because I did a mvn install on its pom. I have both projects in my workspace, so when running the other project from Eclipse, it resolves the dependent classes from the project's target/classes. This is not what I want in that case, because the dependent project is a Hadoop job which is to be submitted to a Cluster, and the Job sets its jar by setJarByClass.

So, when running from Eclipse, submitting the Job to Hadoop fails because the Jar is not found (as the classes from target/classes are used as stated before). Is there a way to force M2E to use the Jar when running from Eclipse instead of using target/classes?

rabejens
  • 7,594
  • 11
  • 56
  • 104
  • 1
    Is _Resolve Workspace Artifacts_ unchecked? See, for instance, [m2Eclipse plugin: What does 'Resolve Workspace Artifacts' do?](http://stackoverflow.com/questions/13205734/m2eclipse-plugin-what-does-resolve-workspace-artifacts-do) – Gerold Broser Nov 11 '14 at 11:55
  • Yes, this is what I now did, I disabled the workspace resolution via Context menu `Maven` -> `Disable Workspace Resolution` and updated the project. This works, but disables workspace resolution for ALL dependencies. Is it possible to disable the workspace resolution for just ONE dependency? – rabejens Nov 11 '14 at 12:33
  • I'm not aware of an option in Maven or m2e to achieve this. (From my POV this also doesn't fit into Maven's dependency resolution mechanism.) A "workaround" for m2e would be to move the ONE dependency to a different workspace. – Gerold Broser Nov 14 '14 at 22:33

0 Answers0