score:119
If you right-click on your project, there should be an option under "maven" to "enable dependency management". That's it.
score:0
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.
score:0
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.
score:0
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.
score:0
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.
score:0
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.
score:1
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.
score:1
For newer Eclipse versions (>=Mars) right click on project > configure > convert to Maven project
score:1
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.
score:1
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.
score:2
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
score:4
I did not found the maven or configure menus but found the following button that solved my problem:
score:5
In Eclipse (Mars) go to:
Project Properties --> Maven. Ensure that "Resolve dependencies from workspace projects" is disabled.
score:11
I did like this..
Right click on the project--> configure-->convert to maven project. Right click on the project-->maven-->add dependencies.
score:14
Right click on the project Configure > convert to Maven project
Then you can see all the Maven related Menu for you project.
score:20
Add this to .classpath file ..
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
Thx
score:29
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.
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).If you created a "Maven Project" under Eclipse (Ctrl+N > Maven Project), then it should be already "Maven ready".
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.
score:69
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.
Source: stackoverflow.com
Related Query
- How to configure Eclipse build path to use Maven dependencies?
- How can I run a Maven webapp in Eclipse when I use profiles to populate properties files at build time?
- When and how does m2e use the Maven test scope to include test dependencies in Eclipse Run Configurations?
- can we use dependencies from Eclipse p2 repository in a regular Maven build
- How to configure eclipse build path to develop an ant task ? Is there a plugin for ant tasks dev?
- How to configure Eclipse to automatically resolve and build multiple maven modules?
- How can I make Maven set up (and keep up to date) the build path for my Eclipse project?
- m2e maven eclipse plugin not configure the build path
- how can I configure Jenkins to use maven that's pre-installed on eclipse
- How to config maven pom.xml when my don't want src/test/java present in my eclipse java build path source category when update project?
- How to use Maven dependencies in eclipse auto import
- How to fix this Maven error in eclipse - "Could not calculate build plan: Plugin or one of its dependencies cannot be resolved""
- maven dependencies to a parent project build path in eclipse
- How should I configure the eclipse to make use of different values of environment variable for different maven phases, during maven building process?
- How to configure build path entries in eclipse
- how to work with maven under eclipse ("This compilation unit is not on the build path of a java project")
- Maven dependencies not visible under Build path in Eclipse Luna
- What causes imported Maven project in Eclipse to use Java 1.5 instead of Java 1.6 by default and how can I ensure it doesn't?
- How to build and run Maven projects after importing into Eclipse IDE
- How do you configure GCC in Eclipse to use C99?
- Use dependencies from Eclipse p2 repository in a regular Maven build?
- How can I add build path items to Eclipse 3.5 using relative paths?
- Include maven dependencies in eclipse "Run As -> Android Application" build
- How do i configure eclipse to make use of different version of JDK
- Build Path Issue with Maven Dependencies (jconsole-jdk.jar)
- Eclipse Run Configurations: how to add Maven dependencies of projects added to Classpath
- Eclipse maven build path issue in case of custom sourceDirectory
- How can I use eclipse to build a GUI? (I want to use only swing/awt and no other packages)
- How to deny maven to use open projects in Eclipse instead of jar from repository
- How to use Tomcat with maven correctly in Eclipse
More Query from same tag
- Coloring rows in a TreeViewer
- What causes eclipse to hang while disconnecting from workspace?
- Unexpected mismatch between local and server runs
- Unable to launch Chrome 67 via Selenium WebDriver and ChromeDriver version is 67. Eclipse version is Oxygen M2
- Conflicting dependency while eclipse updating; Common Navigator View installed threee times
- Eclipse/Java always beyond 100% CPU usage in OpenSuse 12.2
- Admob crashes my app Android (Eclipse)
- Why is my Google App Engine run options missing in eclipse..?
- Android Media player OncompletionListener Play Next song but not the second song
- Where I can found org.testng.TestNg package in testng framework using Eclipse IDE for Java?
- How to view javadoc tooltip in Eclipse, if there's a warning marker on that line?
- How do I import this API from github into my project?
- Unable to deploy servlet using ojdbc in Webserver 7 from Eclipse
- The type java.util.Map$Entry cannot be resolved. It is indirectly referenced from required .class files
- How to exclude a folder that is producing warnings/errors in an Eclipse project?
- ActivityNotFoundException - Android application using fb login and google maps
- Difference between the output with the paws and without?
- retrieve jsf bean in axis2 web service as server request
- Eclipse Mars wont start after Java 8 Update 71
- ClassNotFoundException using Processing's PApplet with Arduino Tool
- creating META-INF/services folder in Eclipse
- Eclipse xtext- Xml grammar
- Springboot application jar - very slow view resolver
- Eclipse External Tools configurations
- can't modify output from scanner unreadable
- How do you add a button to the email message window toolbar in Lotus Notes 8.5+?
- Integrating Redmine with Mylyn in Zend Studio 8.0.0
- Undefined reference to `round' c language
- how to stepin/debug a Maven web project in eclipse
- Use Navigation History in Eclipse RCP