Import Maven project in Eclipse

After creating a maven project using maven archetype:generate command, the maven project would be generated, but you can’t directly import it into Eclipse as a normal project.

 

You can import the project in Eclipse in following ways:

 

  • Run mvn eclipse command to create eclipse project structure and then import as normal project

 

(OR)

 

  • Import the project as a Maven project

 

Generate eclipse project structure and then Import as normal project

 

Convert the generated project to eclipse project by running the following command from command prompt:

 

mvn eclipse:eclipse

 

This command should be run from the path where pom.xml is present. For example, we created the “SpringXMLApp” project in C:\projects and the pom.xml is inside the SpringXMLApp folder. So, we run the command from C:\projects\SpringXMLApp

 

C:\projects\SpringXMLApp>mvn eclipse:eclipse

 

convert maven project to eclipse project

 

This would convert it to an Eclipse project.

 

Now, lets import the project in Eclipse using :

 

File ->Import -> Existing Projects into Workspace

 

Import project in Eclipse

 

 

Import as Maven project

 

From Eclipse editor, import the project as a Maven project using following option :

 

File -> Import -> Maven -> Existing Maven Projects

 

import maven projects

 

 

© 2016, https:. All rights reserved. On republishing this post, you must provide link to original post

5 comments

  1. […] this project in Eclipse. Refer following article if you need help importing the project :   Import Maven project in Eclipse   Now, lets add jersey-client dependency in pom.xml : […]

Leave a Reply.. code can be added in <code> </code> tags

%d bloggers like this: