更新时间:2022-06-18 03:51:37
我将创建一个pom.xml文件(包含所有必填字段,例如groupId,artifactId ...),然后将所有依赖项添加到此pom中,并添加这个pom的maven程序集插件.执行mvm assembly:single
命令.将创建具有所有依赖项的jar.
I would create a pom.xml file (with all the required fields, like groupId, artifactId ...) add all the dependencies to this pom, and add maven assembly plugin to this pom. execute mvm assembly:single
command. Your jar with all the dependencies will be created.
<build>
<plugins>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
</plugin>
</plugins>
</build>