在maven构建项目时候,构建完成后或者构建项目前先zip压缩或者zip解压某个文件。
在maven项目的pom.xml文件中的build->plugins节点下添加以下插件依赖
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.6</version>
<executions>
<!-- ...这里执行任务 -->
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.6</version>
<executions>
<configuration>
<target>
<unzip scr="src/main/resources/xx.zip" dest="src/main/resources/xx" />
</target>
</configuration>
</executions>
</plugin>
maven的插件执行顺序与引入插件的顺序有关,所以在build->plugins下面把插件顺序摆放好即可。
http://blog.xqlee.com/article/2504172027409188.html