Building a fat jar using maven

后端 未结 6 2032
梦毁少年i
梦毁少年i 2020-11-21 23:51

I have a code base which I want to distribute as jar. It also have dependency on external jars, which I want to bundle in the final jar.

I heard that this can be do

6条回答
  •  Happy的楠姐
    2020-11-22 00:42

    You can use the maven-shade-plugin.

    After configuring the shade plugin in your build the command mvn package will create one single jar with all dependencies merged into it.

提交回复
热议问题