Reputation: 832
I am having some issues with building a project via the maven CLI and Eclipse: When I build the project in Eclipse, I have no issues. When I build the project in a shell, I get an error that the compiler can't find a specific package.
This is using the same pom file. The issue are the transitive dependencies. When Eclipse updates the project, it's able to pull down the dependencies just fine, whereas the cli can't. The dependencies are stored in a custom (Ivy) repository layout, but we have mirrors set up that enable maven to read them. Both the cli and Eclipse are reading the same pom file and the same settings.xml.
I'm seeking to understand how Eclipse can resolve those dependencies whereas raw Maven cannot.
Upvotes: 4
Views: 1356
Reputation: 185
M2Eclipse uses an embedded Maven. So it will also use its own .m2 repo. You can force it to use the .m2 repo for the CLI Maven by going to Preferences/Maven/Intallations.
Upvotes: 0
Reputation: 832
It seems as through when running m2eclipse, Eclipse will discover and resolve all transient dependencies and put them on the classpath. I added those dependencies as explicit (since I was using them) and the project built.
Upvotes: 0
Reputation: 2072
According to your question: M2Eclipse is just a tool for using Maven inside Eclipse
Here we can find from M2Eclipse site:
M2Eclipse provides tight integration for Apache Maven into the IDE with the following features:
Upvotes: 1