【问题标题】:Maven Cargo Tomcat7 the server.xml is being over writtenMaven Cargo Tomcat 7 server.xml 被覆盖
【发布时间】:2013-01-14 12:25:35
【问题描述】:

我正在尝试使用 maven 运行我们的集成测试。它将 catalina-base 部署到正确的目录并运行 catelina-home 设置为 Tomcat7 的本地安装。

但是,复制/配置文件命令不适用于 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> 

【问题讨论】:

    标签: java jakarta-ee tomcat7 maven-3 maven-cargo


    【解决方案1】:

    我遇到了一个类似的问题。我使用了&lt;configfiles&gt; 而不是&lt;files&gt;,这样就成功了。

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

    【讨论】:

      猜你喜欢
      • 2012-02-07
      • 2013-02-28
      • 2015-04-02
      • 2013-01-19
      • 1970-01-01
      • 2013-05-07
      • 2011-09-20
      • 2011-04-17
      • 1970-01-01
      相关资源
      最近更新 更多