ulkas
ulkas

Reputation: 5918

how to run the command mvn eclipse:eclipse

I'm following these instructions, but having problems with running commands like mvn eclipse:eclipse.

How and where shall I run the command?

My setup:

I installed the m2e via the plugin installation in Eclipse.

Upvotes: 50

Views: 243643

Answers (4)

PSR
PSR

Reputation: 40338

Right click on the project

->Run As --> Run configurations.

Then select Maven Build

Then click new button to create a configuration of the selected type. Click on Browse workspace (now is Workspace...) then select your project and in goals specify eclipse:eclipse

Upvotes: 101

kostja
kostja

Reputation: 61568

The m2e plugin uses it's own distribution of Maven, packaged with the plugin.

In order to use Maven from command line, you need to have it installed as a standalone application. Here is an instruction explaining how to do it in Windows

Once Maven is properly installed (i.e. be sure that MAVEN_HOME, JAVA_HOME and PATH variables are set correctly): you must run mvn eclipse:eclipse from the directory containing the pom.xml.

Upvotes: 52

belgoros
belgoros

Reputation: 3928

I don't think one needs it any more. The latest versions of Eclipse have Maven plugin enabled. So you will just need to import a Maven project into Eclipse and no more as an existing project. Eclipse will create the needed .project, .settings, .classpath files based on your pom.xml and environment settings (installed Java version, etc.) . The earlier versions of Eclipse needed to have run the command mvn eclipse:eclipse which produced the same result.

Upvotes: 5

Pablo Thiele
Pablo Thiele

Reputation: 370

Besides the powerful options on the "Run Configurations.." on a well configured project you'll see the maven tasks on the Run As as well.

enter image description here

Upvotes: 2

Related Questions