Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[m2e-users] How to add "Maven Managed Dependencies"?

Hello.

I am facing the exact same problem as described here:
<https://stackoverflow.com/questions/4859825/how-to-add-maven-managed-dependencies-library-in-build-path-eclipse>.
However, none of the posted solutions seem to work for me. Been
Googling all day, but still no go. Maybe something changed in the
latest Eclipse?

I have "Eclipse IDE for Java Developers", Kepler, Build id:
20130919-0819. This comes with M2E version 1.4.0. I only installed the
latest updates.

1. Create a new Maven Project.
2. Use "maven-archetype-quick". BTW: I get the same problem if I skip
archetype selection.
3. Right-click on the project, Properties > Project Facets > Convert
to faceted form > add _only_ Java.
4. It builds with errors, complaining that JUnit is missing (the
archetype above created a AppTest.java). Check the pom.xml, the
dependency is there!
5. Right-click on the project, Build Path > Add Libraries > Maven
Managed Dependencies > Next
6. At this point I am presented with "Use Maven Project settings to
configure Maven dependency resolution". Not sure what that is? But I
am able to click Finish.
7. When I click Finish, nothing happens. I do know for sure that I
have JUnit in my local M2/repository already.
8. Right-click on the project, Maven > Update Project also does nothing.

As per the link above, I can run `mvn eclipse:eclipse` from the
command line to fix the dependencies in Eclipse, but I have to do this
for every single added dependency? This does not seem correct? Also,
some people in that discussion suggested that this may in fact cause
some other problems, but they did not say what.

I have another project in my Eclipse, that has the "Maven
Dependencies" library as part of the build path. So the "feature"
works. Any dependency I add to the pom in _that_ project is
automagically added to the Eclipse build path under Maven
Dependencies. Unfortunately somebody gave me this already packaged up.

How do I correctly set this up in Eclipse from scratch? What is the
obvious thing that I am missing?

TIA for any advice. ML.


Back to the top