Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

m2e Does Not Detect Any Jars in Local Repository

In my Java project, which has a maven 'nature', m2e version 1.0.10020110804 does NOT detect any jars located in my local repo. I can successfully compile/install using maven from the command line, but when I open the project in Eclipse I'm notified of 100+ (cannot be resolved to a type) errors. Does anyone know how to resolve this problem? I've tried updating dependencies and cleaning my project, but neither works. My local repo is set in m2e under 'User Settings'.

like image 203
Ari Avatar asked Dec 17 '11 01:12

Ari


1 Answers

M2e needs to be configured to use your local , home repository . In general, one would expect it to do so automatically... But in your case, its using a different home repository.

I feel your pain here - I have seen it use a default repo inside of eclipse in some cases, which can cause problems if you have / need your own local .m2 directory.

I believe that when I first got this problem, I was installing the m2e plugin without having installed first setting maven up as a standalone application. In this case, it might be that the m2e plugin uses a local maven copy/repo .

So the moral of the story is : You need to configure the plugin to "see" and "use" your M2_HOME correctly.

There are some good tips on getting the settings right here : Eclipse m2eclipse getting dependancies from local repository

By editing the m2e plugin settings through the Preferences window, you can ensure that m2e is accessing the right Maven HOME directory, and that will solve this problem.

like image 157
jayunit100 Avatar answered Oct 31 '22 19:10

jayunit100