我正在尝试使用maven运行集成测试。它正在将catalina-base部署到正确的目录,并使用catelina-home设置作为Tomcat7的本地安装。
但是copy / configfile命令不适用于server.xml。正确复制了tomcat-users.xml,但未复制server.xml。知道为什么会这样吗? 请参阅下面的pom.xml:
<plugin>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven2-plugin</artifactId>
<configuration>
<deployables>
<deployable>
<groupId>${project.groupId}</groupId>
<artifactId>${project.artifactId}</artifactId>
<type>war</type>
</deployable>
</deployables>
<container>
<containerId>tomcat7x</containerId>
<home>${catalina-home}</home>
<type>installed</type>
</container>
<configuration>
<home>${project.build.directory}/catalina-base</home>
<type>standalone</type>
<files>
<copy>
<configfile>true</configfile>
<file>server.xml</file>
<tofile>conf/server.xml</tofile>
<overwrite>true</overwrite>
</copy>
<copy>
<configfile>true</configfile>
<file>tomcat-users.xml</file>
<tofile>conf/tomcat-users.xml</tofile>
<overwrite>true</overwrite>
</copy>
</files>
</configuration>
</configuration>
<executions>
<execution>
<id>tomcat-run</id>
<phase>pre-integration-test</phase>
<goals>
<goal>start</goal>
</goals>
</execution>
<execution>
<id>tomcat-shutdown</id>
<phase>post-integration-test</phase>
<goals>
<goal>stop</goal>
</goals>
</execution>
</executions>
</plugin>
答案 0 :(得分:2)
我遇到了类似的问题。我使用<configfiles>
代替<files>
,这就是诀窍。