maven之maven-antrun-plugin插件使用
执行命令
mvn compile
时发现hibernate的映射文件(*.hbm.xml)没有拷贝到target/classes的指定目录中,故需在pom.xml中添加插件maven-antrun-plugin,进行文件的拷贝。如下:
<plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-antrun-plugin</artifactId><version>1.7</version><executions><execution><id>prepare-hbm-copy</id><phase>generate-resources</phase><goals><goal>run</goal></goals><configuration><tasks><copy todir="target/classes/com/srt/vas/bll/xn/model"overwrite="true"><fileset dir="src/main/java/com/srt/vas/bll/xn/model"><include name="**/*.hbm.xml" /></fileset></copy></tasks></configuration></execution></executions></plugin>
参阅:http://blog.csdn.net/johnnywww/article/details/8179522