Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse m2eclipse getting dependencies from local repository

I have dependencies installed local on my machine (~/.m2/repository/blah/blah/blah) and m2eclipse is not recognizing them as there - I think m2eclipse is using its own maven instance. Is there any way to force m2eclipse to use the local maven installation in osx?

like image 796
wuntee Avatar asked May 11 '10 21:05

wuntee


People also ask

Where is the .m2 folder in Eclipse?

Eclipse IDE, menu bar. Select Window > Preferences. Select Java > Build Path > Classpath Variables. Click on the new button > defined a new M2_REPO variable and point it to your local Maven repository.

How do I force Maven to download dependencies in Eclipse?

Via the Maven index, you can search for dependencies, select them and add them to your pom file. To download the index, select Windows > Preferences > Maven and enable the Download repository index updates on startup option. After changing this setting, restart Eclipse. This triggers the download of the Maven index.


2 Answers

I had the same problem, and this is what worked for me. Using Eclipse Indigo:

Windows->Show View->Other

In the pop-up: Maven->Maven Repositories

Once the view is displayed, right click on the appropriate repo, and select "Rebuild Index"

Wait a few seconds and done!

like image 169
Delicia Brummitt Avatar answered Oct 16 '22 14:10

Delicia Brummitt


I have dependencies installed local on my machine (~/.m2/repository/blah/blah/blah) and m2eclipse is not recognizing them as there.

Do they have good metadata? How did you install them? Because m2eclipse definitely uses your local repository for dependency resolution.

I think m2eclipse is using its own maven instance. Is there any way to force m2eclipse to use the local maven installation in osx?

Yes, m2eclipse uses its own version of Maven by default and you can add an external installation via Window > Preferences > Maven > Installations but this won't change anything to the local repository used by one or the other that you can configure via Window > Preferences > Maven > User Settings as shown below:

alt text http://www.imagebanana.com/img/w5y2vevt/screenshot_008.png

This send us back to the questions above: how did you "install" the problematic dependencies?

like image 21
Pascal Thivent Avatar answered Oct 16 '22 12:10

Pascal Thivent