How to build and run Maven projects after importing into Eclipse IDE

I would recommend you don’t use the m2eclipse command line tools (i.e. mvn eclipse:eclipse) and instead use the built-in Maven support, known as m2e.

Delete your project from Eclipse, then run mvn eclipse:clean on your project to remove the m2eclipse project data. Finally, with a modern version of Eclipse, just do “Import > Maven > Existing project into workspace…” and select your pom.xml.

M2e will automatically manage your dependencies and download them as required. It also supports Maven builds through a new “Run as Maven build…” interface. It’s rather nifty.

Leave a Comment

tech