I create a simple maven 109 project – maven-archetype-quickstart.
Then, add to 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 there. Why? How it works?
I create a simple maven 109 project – maven-archetype-quickstart . Then, add to pom.xml
Share
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”).