Question

I'm using eclipse indigo and maven 3.1

When I add a new dependency in pom.xml and run maven clean by right-clicking on pom.xml, maven is downloading missing jars to my local repository but not adding them to my list of referenced libraries.

After many hours of struggling I found out that I can solve this by running

mvn eclipse:eclipse -Dwtpversion=2.0

from command line each time after adding a new dependency. When I run maven clean from eclipse after doing this then the jars are added to referenced libraries.

Anybody know why this is happening like this?

Was it helpful?

Solution

Be carefull not to mix up the maven-eclipse-plugin and the m2e Maven eclipse integration.

You should use the Maven eclipse integration (m2). If you have maven commands in your IDE I suppose that you have installed m2e successfully (if not check this answer). In this case you can convert the project to a Maven project and the Maven Dependencies will be added as a Library to your Build Path.

As far as I know, if you use eclipse:eclipse the maven-eclipse-plugin will "mess up" your eclipse .classpath file and put every dependency as an own entry to the buildpath (and possibly the m2e configuration will be overwritten).

So both "tools" have different concepts that must not be used together. You have to take a decision which integration you prefer - IMHO m2e is mostly used.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top