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 の start-container を実行します-plugin:1.3.1:deployer-deploy が失敗しました: 構成を作成できません。パラメーターの登録済み構成はありません (コンテナー [id = [tomcat6x]、タイプ = [リモート]]、構成タイプ [リモート])。この構成の有効なタイプは次のとおりです。

http://<myhost>:8080/managerブラウザから正常にアクセスできます。私が実行しているTomcatのバージョンは7です。

4

2 に答える 2

1

@maba : type タグには 2 種類あります

<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 に答える