2012-01-11 12 views

答えて

0
十分なはず

(ポートの指定は任意であり、tomcat7の異なるバージョンを取得するためのURLを変更する):MVNパッケージorg.codehaus.cargoより

 <plugin> 
    <groupId>org.codehaus.cargo</groupId> 
    <artifactId>cargo-maven2-plugin</artifactId> 
    <version>1.2.0</version> 
    <!-- minimal configuration to let adb run (mvn package org.codehaus.cargo:cargo-maven2-plugin:run) in a local tomcat --> 
    <configuration> 
     <container> 
     <containerId>tomcat7x</containerId> 
     <zipUrlInstaller> 
      <url>http://a-inet01:8100/apache-tomcat-7.0.25.zip</url> 
     </zipUrlInstaller> 
     </container> 
     <configuration> 
     <properties> 
      <cargo.servlet.port>1718</cargo.servlet.port> 
     </properties> 
     </configuration> 
    </configuration> 
    </plugin> 

(パッケージ化された "戦争"を持つmavenprojectで)戦争を起こし、与えられたURLからTomcatをダウンロードし、開始して戦争を展開します。あなたは、コンテナを起動し使用した場合のmavenは(uは統合テストに使用します。この1)を終了した場合は停止している: あなたは補数より自動的に貨物を開始する場合:ちょうど貨物Mavenのドキュメンタリー(HTTPからコピー

  <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> 

: //cargo.codehaus.org/Starting+and+stopping+a+container)。これは、 "integration-test"の前にコンテナを起動し、テスト後にコンテナを停止します。

+0

これは「埋め込み」と呼ばれていますか?私は同様の質問をhttp://stackoverflow.com/questions/13701562/cargo-plugin-the-deployable-state-is-unknownに持っています。私は埋め込みはtomcatでサポートされていないことに言及しました。 – MikeW

関連する問題