Reputation: 17893
I have a Maven project. I have converted it to eclipse project using the command.
mvn eclipse:eclipse
I imported this project to eclipse. I am getting missing library error.
I have updated the maven repository details in Maven setting of eclipse.
My current maven repository is E:\myfolder\repository
I have edited this my settings.xml too.
<localRepository>E:\myfolder\repository</localRepository>
I have added a class-path variable MAVEN_REPO.
MAVEN_REPO = E:\myfolder\repository
The actual address of the jar in repository is M2_REPO/javax/ccpp/ccpp/1.0/ccpp-1.0.jar.
But the eclipse is not able to locate the jar in the repository.
It is taking default repository address.
Still I am getting missing library error and it is pointing to default maven repository address rather than my new repository address.
Project 'Testproj' is missing required library: '\\user dir\.m2\repository\antlr\antlr\2.7.6\antlr-2.7.6.jar'
Can some one tell how to overcome this error.
Thanks in Advance.
Upvotes: 3
Views: 6132
Reputation: 21
This is what worked for me: In Eclipse, Windows->Preferences->Maven->User Settings
Even if the settings.xml was updated as expected it was still pointing to default directory. So i did 'Restore Defaults' then 'Apply' And then i again changed the Global Settings and User Settings to point to correct settings.xml. Do Reindex for local repository. Click OK and bang! Projects compiled perfectly!
Upvotes: 2
Reputation: 6260
In eclipse, go to Preferences
> Maven
> Installations
Make sure that the Global Settings file is pointing to the right config and it is pointing to the right local repository.
Upvotes: 2
Reputation: 10987
Are you sure you did all the configurations and only then executed mvn eclipse:eclipse? Also is this mvn pointing to the same maven installation which you have configured? Before open the project in eclipse just check the generated .classpath file and see if it points to wrong location repo.
Although I would suggest this -
Eclipse has excellent maven plugin. You do not need to do mvn eclipse:eclipse.
Simply import project in eclipse as maven project. Before import ensure the maven plugin is configured to use the same settings.xml which you have configured for command line maven.
Upvotes: 0