How do I create a JAR with dependent libraries?

Using Maven, how to create a JAR with dependent libraries? I am using mvn package, it does not include dependent libraries.


source to share

1 answer

Use the Maven Build Plugin and configure it to jar-with-depdencies


From the doc:

For example, imagine our project is generating a JAR. If we want to create a binary assembly that includes our project dependencies, we can use one of the prefab plugins, prefab descriptors, as follows:

        <!-- NOTE: We don't need a groupId specification because the group is
             org.apache.maven.plugins ...which is assumed by default.




All Articles