pom.xml的build/plugins节添加
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<includeGroupIds>com.xxx.xxx</includeGroupIds>
<outputDirectory>${project.targetDir}</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
package打包后会自动将依赖的group为com.xxx.xxx的jar包放到target/dependency目录中