Create Maven Jar Project Eclipse
If you want to create maven project and package them in JAR file for deployment or add to any other project please follow steps below:
Tools needed: Eclipse Kepler or higher version (Note: Eclipse Kepler comes with in-built maven plug-in)
- Open your eclipse
- Click File –> New –> Other –> Maven –> Maven Project
- Next screen select below then click Next:
- Enter all information based on your need then choose Packaging Jar from the drop down and click Finish shown below:
- You will see new project name MavenJarProject got created.
- If you want to verify what kind of project it is, double click to open pom.xml file go to Overview tab you will see below:
- Maven eclipse plug-in provide below default build and to see this: Right click pom.xml –> Run As you will see below:
- To package this project in Jar file: Right click pom.xml –> Run As –> Maven Install. This will clean compiles source code, execute unit test, packaging them in Jar file and put them in target folder. Once you see message BUILD SUCCESS on the console refresh and open target folder you will jar file got created.
- That’s it for more information create maven project please refer Apache tutorial here