Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create Jar file from Maven project in eclipse

I have a Maven project, but I am not familiar to Maven. I wanted to create an executable JAR file from this Maven project to use it in another project by eclipse. How can I do this?

like image 389
Questioner Avatar asked Jul 31 '15 09:07

Questioner


People also ask

How will you create jar file of the project using Maven?

Summary. To create a JAR file from a Maven project in IntelliJ IDEA, go to the Maven Tool Window (View → Tool Windows → Maven), expand your project in the tree, expand Lifecycle, and then double-click on package. Maven will compile your package, and the compiled JAR file will be written to the target/ directory.


2 Answers

To build jar From Eclipse, Right click on your maven project name then

Run as > Maven install

like image 130
kswaughs Avatar answered Sep 27 '22 23:09

kswaughs


Right click maven project,

choose Run As-> Maven Build ....

Type package in the Goals box.

Click Run.

like image 20
Priyantha Avatar answered Sep 28 '22 00:09

Priyantha