Maven: Packaging dependencies alongside project JAR?

Viewed 50952

I'd like Maven to package a project alongside its run-time dependencies. I expect it to create a JAR file with the following manifest:

.....
Main-Class : com.acme.MainClass
Class-Path : lib/dependency1.jar lib/dependency2.jar
.....

and create the following directory structure:

target
|-- ....
|-- my-project.jar
|-- lib
    |-- dependency1.jar
    |-- dependency2.jar

Meaning, I want the main JAR to exclude any dependencies and I want all transitive dependencies to get copied into a "lib" sub-directory. Any ideas?

3 Answers
Related