Create an Eclipse Project by Maven
Monday, April 28th, 2008You will install this 2 plugin: eclipse plugin for maven and m2eclipse( Maven 2 Eclipse plugin ).
First, you create a Maven project layout:
mvn archetype:create -DgroupId=com.langcode \
-DartifactId=Test
This will create a folder named Test ( artifactId, which is your release jar file base name).
After that, we will create the Eclipse project file:
cd Test mvn eclipse:eclipse
Now, we can start the Eclipse and import the project we created. And do the following steps:
- Right click on the project and enable Maven Package management.
- Update Maven dependency.
- Update Maven Source folder.
Now, you have an Eclipse development set up. You will want to add some common maven phase into Run menu using the “Run As” Dialog. Or, you can do it manually in CLI.
Some common tasks are:
Clean up:
mvn clean
Build Jar:
mvn package
Copy all dependencies into target folder:
mvn dependency:copy-dependencies
Run Test:
mvn test
