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
- 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:
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
This would convert it to an Eclipse project.
Now, lets import the project in Eclipse using :
File ->Import -> Existing Projects into Workspace
Import as Maven project
From Eclipse editor, import the project as a Maven project using following option :
File -> Import -> Maven -> Existing Maven Projects
© 2016, www.topjavatutorial.com. All rights reserved. On republishing this post, you must provide link to original post