0

I'm trying to get our integration testing running with maven. It's deploying the catalina-base to the correct directory and running with catelina-home set as the local install of Tomcat7.

However the copy/configfile commands don't work for the server.xml. The tomcat-users.xml is being correctly copied but not the server.xml. Any idea why this would be happening? See the pom.xml below:

<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> 
4

1 回答 1

3

I've run into a simular issue. I've used <configfiles> instead of <files>, that did the trick.

See: http://cargo.codehaus.org/Configuration+files+option

于 2013-08-15T18:38:51.400 回答