Created
May 12, 2017 09:32
-
-
Save ByoungInKim/91ac6c0561d38bd27f118aab6ce17945 to your computer and use it in GitHub Desktop.
How to Create Executable JAR file with resources and dependencies using Maven
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<project ....> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>com.inventory</groupId> | |
<artifactId>Inventory</artifactId> | |
<packaging>jar</packaging> | |
<version>0.0.1-SNAPSHOT</version> | |
<name>Inventory Management</name> | |
<dependencies> | |
.... | |
</dependencies> | |
<build> | |
<plugins> | |
<!--- Add below code --> | |
<plugin> | |
<artifactId>maven-assembly-plugin</artifactId> | |
<configuration> | |
<archive> | |
<manifest> | |
<mainClass>com.inventory.gui.InventoryApp</mainClass> | |
</manifest> | |
</archive> | |
<descriptorRefs> | |
<descriptorRef>jar-with-dependencies</descriptorRef> | |
</descriptorRefs> | |
</configuration> | |
</plugin> | |
<!--- end code --> | |
</plugins> | |
</build> | |
</project> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
After then you will run maven command
mvn clean install assembly:single