如何使用maven将文件复制到tomcat webapp文件夹?
我想使用Maven
将资源文件从src / main / resources复制到/ target / tomcat6x / container / webapps中的Cargo
Tomcat
。
我尝试使用maven-resources-plugin
但没有取得任何成功。
我试过这个:
org.codehaus.cargo cargo-maven2-plugin 1.0.5 false tomcat6x http://mirrors.enquira.co.uk/apache/tomcat/tomcat-6/v6.0.30/bin/apache-tomcat-6.0.30.zip ${installDir} ${project.build.directory}/tomcat6x.log ${project.build.directory}/cargo.log src/main/resources/datasource.properties ${project.build.directory}/tomcat6x/container/webapps ${project.build.directory}/tomcat6x/container high 8081 start-container pre-integration-test configure start deploy ${project.groupId} ${project.artifactId} war http://localhost:8081/charmweb-0.0.1-SNAPSHOT/ 180000 charmweb-0.0.1-SNAPSHOT stop-container post-integration-test stop
…但是在服务器启动并且应用程序被ping之前,文件没有复制。
有谁知道如何正确使用它?
您可以使用maven-antrun-plugin执行此操作并执行ant复制任务:
maven-antrun-plugin 1.6 package run
好的,这里的答案是:
org.codehaus.cargo cargo-maven2-plugin 1.0.5 false tomcat6x http://mirrors.enquira.co.uk/apache/tomcat/tomcat-6/v6.0.30/bin/apache-tomcat-6.0.30.zip ${installDir} ${project.build.directory}/cargo.log ${project.build.directory}/tomcat6x/container high 8081 ${project.basedir}/src/main/resources/datasource.properties webapps true true