3

我的 pom.xml 中有以下内容

<plugin>
    <groupId>org.codehaus.cargo</groupId>
    <artifactId>cargo-maven2-plugin</artifactId>
    <configuration>
        <wait>true</wait>
        <container>
            <containerId>tomcat7x</containerId>
            <type>remote</type>
        </container>
        <configuration>
            <type>remote</type> 
            <properties>
                <cargo.tomcat.manager.url>http://<myhost>:8080/manager</cargo.tomcat.manager.url>
                <cargo.remote.username>admin</cargo.remote.username>
                <cargo.remote.password>password</cargo.remote.password>
            </properties>
        </configuration>
        <deployer>
            <type>installed</type>
            <deployables>
                <deployable>
                    <groupId>com.mycode</groupId>
                    <artifactId>myartifact</artifactId>
                    <type>war</type>
                </deployable>
            </deployables>
        </deployer>
    </configuration>
    <executions>
        <execution>
            <id>start-container</id>
            <phase>pre-integration-test</phase>
            <goals>
                <goal>deployer-deploy</goal>
            </goals>
        </execution>
        <execution>
            <id>stop-container</id>
            <phase>post-integration-test</phase>
            <goals>
                <goal>deployer-undeploy</goal>
            </goals>
        </execution>
        <execution>
            <id>verify-deploy</id>
            <phase>install</phase>
            <goals>
                <goal>deployer-deploy</goal>
            </goals>
        </execution> 
        <execution>
            <id>clean-undeploy</id>
            <phase>pre-clean</phase>
            <goals>
                <goal>deployer-undeploy</goal>
            </goals>
        </execution> 
    </executions>
</plugin>

在此之后我发出命令mvn deploy但是我收到以下错误:

[错误] 无法在项目 fismacm 上执行目标 org.codehaus.cargo:cargo-maven2-plugin:1.3.1:deployer-deploy (start-container):执行目标 org.codehaus.cargo:cargo-maven2 的启动容器-plugin:1.3.1:deployer-deploy failed: 无法创建配置。参数没有注册配置(容器 [id = [tomcat6x],类型 = [remote]],配置类型 [remote])。此配置的有效类型是:

http://<myhost>:8080/manager我可以从我的浏览器成功访问。我正在运行的tomcat版本是7。

4

2 回答 2

1

@maba:有两种类型标签

<container>
    <type></type>
</container>

在那里你可以嵌入/远程

接着

<configuration>
    <type>runtime</type>
</configuration>

实际上,您可以在哪里拥有您提到的值:独立、现有或运行时

@birdy:我面临同样的问题:如果您摆脱它,请提及它:) 顺便说一句,日志错误还为您提供了可能的类型,但您没有将其粘贴到您的帖子中。

于 2016-01-15T15:33:51.507 回答
0

刚刚在调查一个稍微不同的问题时遇到了这个问题。希望这可以帮助将来的人:

我相信

<configuration>
    <type>remote</type>
</configuration>

应该:

<configuration>
    <type>runtime</type>
</configuration>

以下是对我有用的 pom.xml 的摘录:

<plugins>
    <plugin>
        <groupId>org.codehaus.cargo</groupId>
        <artifactId>cargo-maven2-plugin</artifactId>
        <version>1.6.0</version>
        <configuration>
            <container>
                <containerId>tomcat7x</containerId>
                <type>remote</type>
            </container>
            <configuration>
                <type>runtime</type>
                <properties>
                    <cargo.hostname>hostname</cargo.hostname>
                    <cargo.servlet.port>port</cargo.servlet.port>
                    <cargo.tomcat.manager.url>http://${cargo.hostname}:${cargo.servlet.port}/manager</cargo.tomcat.manager.url>
                    <cargo.remote.username>username</cargo.remote.username>
                    <cargo.remote.password>password</cargo.remote.password>
                </properties>
            </configuration>
            <deployables>
                <deployable>
                    <groupId>${project.groupId}</groupId>
                    <artifactId>${project.artifactId}</artifactId>
                    <type>${project.packaging}</type>
                </deployable>
            </deployables>
        </configuration>
    </plugin>
</plugins>
于 2016-10-26T10:24:06.540 回答