Maven assembly plugin provide facility to Maven create jar with all dependencies. Here is maven plugin which create fat jar file that contains all dependency jar files in single jar file.


execute following command : mvn clean compile assembly:single

[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building com.javadeveloperzone 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ com.javadeveloperzone ---
[INFO] Deleting F:\extrawork\java9-demo\module-stream-demo\target
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ com.javadeveloperzone ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 0 resource
[INFO] --- maven-compiler-plugin:3.6.0:compile (default-compile) @ com.javadeveloperzone ---
[INFO] Changes detected - recompiling the module!
[WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent!
[INFO] Compiling 37 source files to F:\extrawork\java9-demo\module-stream-demo\target\classes
[INFO] /F:/extrawork/java9-demo/module-stream-demo/src/main/java/com/javadeveloperzone1/ Some input files use unchecked or unsafe operations.
[INFO] /F:/extrawork/java9-demo/module-stream-demo/src/main/java/com/javadeveloperzone1/ Recompile with -Xlint:unchecked for details.
[INFO] --- maven-assembly-plugin:3.0.0:single (default-cli) @ com.javadeveloperzone ---
[INFO] Building jar: F:\extrawork\java9-demo\module-stream-demo\target\com.javadeveloperzone-1.0-SNAPSHOT-jar-with-dependencies.jar
[INFO] ------------------------------------------------------------------------

New jar with all dependencies

maven create jar with all dependencies

maven create jar with all dependencies


maven assembly plugin document

Was this post helpful?
Let us know, if you liked the post. Only in this way, we can improve us.
Tags: ,

Leave a Reply

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