简体   繁体   中英

How do I open a Java project (that uses maven) in Eclipse? (Do I use M2E or maven-eclipse-plugin)

I'm trying to open this project in Eclipse but not sure how.

I followed the build instructions and not sure how I tell Eclipse to use Maven as the source control (if required) and then open the Java project so I can step through it.

I discovered that there are two Maven plugins for Eclipse (M2E and maven-eclipse-plugin) and not sure which one to choose, since they are incompatible with each other and I need to use.

From the OS command line, in the directory of the pom.xml file:

mvn eclipse:clean eclipse:eclipse

This will create the various eclipse project files. Then in eclipse, in the "Project" pane, right-click > "Import existing project" and navigate to the directory - you'll find it has recognised there's now a project to import.

This should work:

Right click in the Package Explorer, choose Import.

From the context-menu of the Package Explorer choose import.

In the now open panel search for Existing Maven projects. The rest is pretty much self explaining.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM