Software Development

Maven – Create an executable jar

[wp_ad_camp_1]

This post demonstrates how to create an executable jar in Apache Maven using maven-shade-plugin plugin.

Software Requirements

  1. Java 8
  2. Eclipse Mars.2
  3. Maven 3.3.3 (Embedded)

Update pom.xml

Create a Maven project in Eclipse or open an existing Maven project, update your pom.xml with the following plugin.

[wp_ad_camp_4]

Package it

To package it from Eclipse, run embedded Maven using the package goal.

[wp_ad_camp_3]

Test Out

Depending on your current configuration, your JAVA_HOME and PATH may no be properly set. In this case, simply set them up on the same Windows command line window.

There will be two (2) jar files generated. Choose the one without the original- prefix on the file name.

[wp_ad_camp_5]

Download the Codes

https://github.com/Turreta/Maven-Create-executable-jar

[wp_ad_camp_2]

Loading

Got comments or suggestions? We disabled the comments on this site to fight off spammers, but you can still contact us via our Facebook page!.


You Might Also Like