pom.xml中
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.2</version>
<configuration>
<webappDirectory>WebContent</webappDirectory>
<!-- 必须指定,否则默认会变成在target/war/work 导致被打包进war文件,指定后为target/work -->
<workDirectory>${project.build.directory}/work</workDirectory>
<useCache>false</useCache>
<packagingExcludes>WEB-INF/lib/**/*</packagingExcludes>
<archive>
<addMavenDescriptor>true</addMavenDescriptor>
</archive>
</configuration>
</plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.2</version>
<configuration>
<webappDirectory>WebContent</webappDirectory>
<!-- 必须指定,否则默认会变成在target/war/work 导致被打包进war文件,指定后为target/work -->
<workDirectory>${project.build.directory}/work</workDirectory>
<useCache>false</useCache>
<packagingExcludes>WEB-INF/lib/**/*</packagingExcludes>
<archive>
<addMavenDescriptor>true</addMavenDescriptor>
</archive>
</configuration>
</plugin>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>copy-lib-src-webapps</id>
<phase>package</phase>
<configuration>
<tasks>
<!-- <delete dir="src/main/webapp/WEB-INF/lib" />-->
<copy todir="C:\Users\Administrator"><!-- 目标目录 -->
<fileset dir="D:\Users\hyyy\git\yipeng-hezuo\src\target\"><!-- 源目录 -->
<include name="yipeng-hezuo.war" /><!-- 源文件 -->
</fileset>
</copy>
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>