maven-antrun-plugin的使用
自定义maven变量以及maven内置常量http://panyongzheng.iteye.com/blog/2036736
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
Xml代码 <build> <outputDirectory>src/main/webapp/WEB-INF/classes</outputDirectory> <testOutputDirectory>src/main/webapp/WEB-INF/classes</testOutputDirectory> <plugins> <plugin> <artifactId>maven-antrun-plugin</artifactId> <executions> <execution> <id>copy-lib-src-webapps</id> <phase>package</phase> <configuration> <tasks> <!-- 打印信息 --> <echo message="corp file;copy dir" /> <!-- 删除文件夹 --> <delete dir="src/main/webapp/WEB-INF/lib" /> <!-- 删除文件 --> <delete file="${project.build.directory}/classes/abc.properties" /> <!-- 复制文件 --> <copy todir="${project.web-common.lib-targetPath}"> <fileset dir="${project.commonmodule.lib-source.directory}"> <include name="*" /> </fileset> </copy> <!-- 拷贝文件,选择是否overwrite --> <copy tofile="D:\aa.txt" file="D:\bb.txt" overwrite="true"></copy> <!-- 拷贝文件夹,将test1、test2文件夹中的内容拷贝到test文件夹中 --> <copy todir="d:\test"> <fileset dir="d:\test1"></fileset> <fileset dir="d:\test2"></fileset> </copy> </tasks> </configuration> <goals> <goal>run</goal> </goals> </execution> </executions> </plugin> </plugins> </build> |