你可以使用带有
“ jar-with-dependencies”描述符的
maven-assembly插件来执行此操作。这是我们
pom.xml之一的相关块,它可以完成此任务:
<build> <plugins> <!-- any other plugins --> <plugin> <artifactId>maven-assembly-plugin</artifactId> <executions> <execution> <phase>package</phase> <goals> <goal>single</goal> </goals> </execution> </executions> <configuration> <descriptorRefs> <descriptorRef>jar-with-dependencies</descriptorRef> </descriptorRefs> </configuration> </plugin> </plugins> </build>



