I want to package it not in a single executable jar for distribution. I need an executable to be something like main.jar and all dependencies to be in libs/*.jar
How can I make maven executable jar without preincluded into it dependencies libraries?
In How can I create an executable JAR with dependencies using Maven? there is a note by answered Dec 1 ’10 at 10:46
André Aronsen, but that one simply doesn’t work (failed s.a.descriptorRef is not set).
You can achieve this to a certain extent.
Firstly, you would create an executable jar by configuring maven jar plugin suitably.
You would then use maven assembly plugin to create a jar-with-dependencies, excluding your project jar. To do this, you would create a descriptor file, say
src/main/assembly/descriptor.xml, like this.Use it in your project like this.
You will end up getting two jars – one the executable jar created by your project and the other the jar-with-dependencies created by the assembly plugin.