Create Maven Jar Project Eclipse

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

Create Maven Jar Project Eclipse

  • Next screen select below then click Next:

Create Maven Jar Project Eclipse

  • Enter all information based on your need then choose Packaging Jar from the drop down and click Finish shown below:

Create Maven Jar Project Eclipse

  • You will see new project name MavenJarProject got created.

Create Maven Jar Project Eclipse

  • 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:

Create Maven Jar Project Eclipse

  • Maven eclipse plug-in provide below default build and to see this: Right click pom.xml –> Run As you will see below:

Create Maven Jar Project Eclipse

  • 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.

Create Maven Jar Project Eclipse

  • That’s it for more information create maven project please refer Apache tutorial here

Leave a Reply

Your email address will not be published. Required fields are marked *

I am not Robot *