Accepted answer

if you right-click on your project, there should be an option under "maven" to "enable dependency management". that's it.


maybe you could look into maven-eclipse-plugin instead of m2eclipse.

there you basically add maven-eclipse-plugin configuration to your pom.xml and then execute mvn eclipse:eclipse which will generate the required .project and .classpath files for eclipse. then you'll have the correct build path in eclipse.


make sure your pom follows the naming convention, and is named in lowercase lettering as pom.xml and not pom.xml.

in my case all was right, but eclipse still complained when trying to right-click and update project configuration - told me that the pom could not be read. changed the name to lowercase - pom.xml from pom.xml - and it worked.


i met this issue too. when i add dependencies in the pom.xml, i checked in the local folder /users/xyz/.m2/ and the jars are already downloaded there, but cann't added the the buildpath of the eclipse.

my eclipse version: mars.2 release (4.5.2)

right click project > maven > enable workspace resolution

and this solved my issue.


typically, you can copy the .classpath file from a working project since there isn’t anything project specific here assuming you’re structured as a standard maven project.


this worked for me in eclipse oxygen (4.7.0):

right click project -> maven -> select maven profiles... then check the repository proxy box, press ok.


i had a slight variation that caused some issues - multiple sub projects within one project. in this case i needed to go into each individual folder that contained a pom, execute the mvn eclipse:eclipse command and then manually copy/merge the classpath entries into my project classpath file.


for newer eclipse versions (>=mars) right click on project > configure > convert to maven project


adding my answers for a couple of reasons:

  • somehow none of the answers listed directly resolved my problem.
  • i couldn't find "enable dependency management" under maven. i'm using eclipse 4.4.2 build on wed, 4 feb 2015.

what helped me was another option under maven called as "update project" and then when i click it this window opens which has a checkbox that says "force update of snapshot/releases". the real purpose of this checkbox is different i know but somehow it resolved the dependencies issue. enter image description here


none of that solved my problem. but what i did was if click on the pom.xml, there is a tab at the bottom named dependencies. in this tab it is split into 2 section, one called dependencies and one called dependency management. select every thing in the dependency section and click add to be under the dependency management control. close and reopen your project.


when m2eclipse is installed properly, it should add dependencies automatically. however, you should generate the eclipse project files by entering:

mvn eclipse:m2eclipse

or, alternatively if you don't use m2eclipse:

mvn eclipse:eclipse


i did not found the maven or configure menus but found the following button that solved my problem:

enter image description here


in eclipse (mars) go to:

project properties --> maven. ensure that "resolve dependencies from workspace projects" is disabled.


i did like this..

right click on the project--> configure-->convert to maven project. right click on the project-->maven-->add dependencies.


right click on the project configure > convert to maven project

then you can see all the maven related menu for you project.


add this to .classpath file ..

<classpathentry kind="con" path="org.eclipse.m2e.maven2_classpath_container">
        <attribute name="maven.pomderived" value="true"/>



i'm assuming you are using m2eclipse as you mentioned it. however it is not clear whether you created your project under eclipse or not so i'll try to cover all cases.

  1. if you created a "java" project under eclipse (ctrl+n > java project), then right-click the project in the package explorer view and go to maven > enable dependency management (depending on the initial project structure, you may have modify it to match the maven's one, for example by adding src/java to the source folders on the build path).

  2. if you created a "maven project" under eclipse (ctrl+n > maven project), then it should be already "maven ready".

  3. if you created a maven project outside eclipse (manually or with an archetype), then simply import it in eclipse (right-click the package explorer view and select import... > maven projects) and it will be "maven ready".

now, to add a dependency, either right-click the project and select maven > add dependency) or edit the pom manually.

ps: avoid using the maven-eclipse-plugin if you are using m2eclipse. there is absolutely no need for it, it will be confusing, it will generate some mess. no, really, don't use it unless you really know what you are doing.


if you execute

mvn eclipse:clean

followed by

mvn eclipse:eclipse

if will prepare the eclipse .classpath file for you. that is, these commands are run against maven from the command line i.e. outside of eclipse.

Related Query

More Query from same tag