【问题标题】:Can I redeploy to remote Tomcat instance and start local testing instance我可以重新部署到远程 Tomcat 实例并启动本地测试实例吗
【发布时间】:2016-11-20 21:19:58
【问题描述】:

我想在 Maven 的预集成测试阶段(在不同的端口上)启动一个新的本地 Tomcat 实例以进行测试,并在那里运行测试。然后,如果测试通过,我想做一个 cargo:redeploy 到远程 Tomcat 实例。不过,我在解决这个问题时遇到了问题。如果我这样做了

mvn org.codehaus.cargo:cargo-maven2-plugin:run -Dcargo.maven.containerId=tomcat8x -Dcargo.maven.containerUrl=https://archive.apache.org/dist/tomcat/tomcat-8/v8.0.36/bin/apache-tomcat-8.0.36.zip -Dcargo.maven.type=standalone

我明白了

[ERROR] Failed to execute goal org.codehaus.cargo:cargo-maven2-plugin:1.4.19:run (default-cli) on project atf-relay-server: Execution default-cli of goal org.co
    dehaus.cargo:cargo-maven2-plugin:1.4.19:run failed: Cannot create configuration. There's no registered configuration for the parameters (container [id = [tomcat
    8x], type = [installed]], configuration type [runtime]). Valid types for this configuration are:
    [ERROR] - standalone
    [ERROR] - existing
    [ERROR] -> [Help 1]

我的货物 pom.xml 是(仅指定远程实例):

    <plugin>
        <groupId>org.codehaus.cargo</groupId>
        <artifactId>cargo-maven2-plugin</artifactId>
        <version>1.4.19</version>
        <configuration>
            <container>
                <containerId>tomcat8x</containerId>
                <type>remote</type>
            </container>

            <configuration>
                <type>runtime</type>
                <properties>
                    <cargo.hostname>localhost</cargo.hostname>
                    <cargo.servlet.port>9990</cargo.servlet.port>
                    <cargo.remote.username>user</cargo.remote.username>
                    <cargo.remote.password>pass</cargo.remote.password>
                </properties>
            </configuration>
            <deployer>
                <type>remote</type>
            </deployer>
        </configuration>
    </plugin>

实现这一目标的正确方法是什么?

【问题讨论】:

    标签: java maven cargo maven-cargo


    【解决方案1】:

    好的,在熟悉了 Maven 配置文件之后似乎很容易实现。 我现在有一个配置文件控制远程 Tomcat 实例并执行 cargo:redeploy 和其他配置文件只是创建本地 Tomcat,运行它,在那里部署应用程序并运行测试。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-07-24
      • 2012-06-27
      • 1970-01-01
      • 2021-12-08
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多