maven attach dependencies
I create a simple maven 109
project - maven-archetype-quickstart
.
pom.xml
a dependency to derby.
When I run mvn dependency:tree
, I see, that the dependency parsed correctly: [INFO] \- org.apache.derby:derby:jar:10.8.1.2:compile
. But when I see the package generated by mvn package
, it has only 3.2kB and the dependency is not ther开发者_StackOverflowe. Why? How it works?Because most people don't want all dependencies in their JAR by default. Imagine the people who want to use your artifact but a different version of derby.
To create an "ueber JAR" (i.e. a JAR which contains everything necessary to run it), use the Maven assembly plugin (search for "Creating an Executable JAR").
精彩评论