打包Jar后自动复制到其他位置
在pom.xml文件中添加plugins插件:
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>copy-lib-src-webapps</id>
<phase>package</phase>
<configuration>
<tasks>
<!-- 你将要拷贝的位置 -->
<copy todir="D:\target">
<!-- 从哪里拷贝 -->
<fileset dir="${project.build.directory}">
<!-- 拷贝内容 -->
<include name="*.jar" />
</fileset>
</copy>
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>