1. pom.xml添加插件
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<!-- 主程序入口 -->
<!--<archive>-->
<!--<manifest>-->
<!--<mainClass></mainClass>-->
<!--</manifest>-->
<!--</archive>-->
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<appendAssemblyId>false</appendAssemblyId>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
2. 修改maven-assembly-plugin插件配置,目录\repository\org\apache\maven\plugins\maven-assembly-plugin,修改jar包中的jar-with-dependencies.xml