I understand that users using Maven should not care about dependencies as Maven will download them as specified in the pom. However I want to distribute another jar to non-maven users. So I still want to generate the raw jar for Maven, no problem there. But I would also want to have the ability to generate another jar with some dependencies included within. By some dependencies I mean that I will choose some of the dependencies as defined in the pom.xml, and include them in this other jar I will distribute myself.
So let’s say I have 10 dependencies in my pom.xml. dep1.jar, dep2.jar, … , dep10.jar.
The main jar generated for distribution with MAVEN will not have any of these dependencies, of course. But I would like the ability to generate another jar somehow with dep3.jar and dep4.jar included.
Any help will be highly appreciated!
EDIT: Directing me to a maven plugin does not help. But giving me a pom.xml example does. 🙂
Take a look at the maven-assembly-plugin. You can configure it to create a JAR containing all of the dependencies of your project, along with the project’s source code. You can then bind an execution of the plugin to the package phase so this mega-jar is built as a part of the regular lifecycle.