Jakarta ee Maven cargo插件嵌入tomcat 7配置

Jakarta ee Maven cargo插件嵌入tomcat 7配置,jakarta-ee,maven-2,tomcat7,maven-cargo,Jakarta Ee,Maven 2,Tomcat7,Maven Cargo,我想知道maven cargo插件运行嵌入式tomcat 7进行集成测试所需的最低配置是什么,请告知,谢谢。这应该足够了(指定端口是可选的,更改url以获得不同版本的tomcat7): org.codehaus.cargo cargo-maven2-plugin 1.2.0 tomcat7x http://a-inet01:8100/apache-tomcat-7.0.25.zip 1718 然后,mvn包org.codehaus.cargo:cargo-maven2-plugin:run(

我想知道maven cargo插件运行嵌入式tomcat 7进行集成测试所需的最低配置是什么,请告知,谢谢。

这应该足够了(指定端口是可选的,更改url以获得不同版本的tomcat7):


org.codehaus.cargo
cargo-maven2-plugin
1.2.0
tomcat7x
http://a-inet01:8100/apache-tomcat-7.0.25.zip
1718
然后,mvn包org.codehaus.cargo:cargo-maven2-plugin:run(在打包为“war”的mavenproject上)将创建war,从给定url下载tomcat,启动它并部署war。如果您使用start,那么如果maven完成,容器将停止(您将在集成测试中使用这个): 如果要自动启动货物,请执行以下操作:

            <plugin>
            <groupId>org.codehaus.cargo</groupId>
            <artifactId>cargo-maven2-plugin</artifactId>
            <executions>
                <execution>
                    <id>start-container</id>
                    <phase>pre-integration-test</phase>
                    <goals>
                        <goal>start</goal>
                    </goals>
                </execution>
                <execution>
                    <id>stop-container</id>
                    <phase>post-integration-test</phase>
                    <goals>
                        <goal>stop</goal>
                    </goals>
                </execution>
            </executions>
            <configuration>
                [Cargo plugin configuration goes in here]
            </configuration>
        </plugin>

org.codehaus.cargo
cargo-maven2-plugin
启动容器
预集成测试
开始
停止容器
整合后测试
停止
[货物插件配置在这里]
刚从cargo maven docu复制过来(http://cargo.codehaus.org/Starting+和+停止+容器)。这将在“集成测试”之前启动容器,并在测试之后停止它。

这就是他们所谓的“嵌入式”吗?我有一个类似的问题,没有回答。我看到有人提到tomcat不支持embedded。针对tomcat 9进行了更新:
            <plugin>
            <groupId>org.codehaus.cargo</groupId>
            <artifactId>cargo-maven2-plugin</artifactId>
            <executions>
                <execution>
                    <id>start-container</id>
                    <phase>pre-integration-test</phase>
                    <goals>
                        <goal>start</goal>
                    </goals>
                </execution>
                <execution>
                    <id>stop-container</id>
                    <phase>post-integration-test</phase>
                    <goals>
                        <goal>stop</goal>
                    </goals>
                </execution>
            </executions>
            <configuration>
                [Cargo plugin configuration goes in here]
            </configuration>
        </plugin>