开发者

maven attach dependencies

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 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").

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜