2016-12-12 9 views
0

cargo:deploy経由でwarをTomcat 7とWeblogicの両方のコンテナに同時に展開したいと考えています。私は、一度に1つのプロファイルをアクティブにすることしかできません。ここで複数のMavenプロファイルを展開する

は、私が現在持っているものです。

<profiles> 
    <!-- ********************************************************************* 
          CARGO - FOR TOMCAT. 
          Activated when file ${env.USERPROFILE}/foo.bar exists (which should be there after successful Tomcat tookit install) 
       ********************************************************************* --> 
    <profile> 
     <id>tomcat</id> 
     <activation> 
      <file><exists>${env.USERPROFILE}/foo.bar</exists></file> 
     </activation> 
     <build> 
      <plugins> 
       <plugin> 
        <groupId>org.codehaus.cargo</groupId> 
        <artifactId>cargo-maven2-plugin</artifactId> 
        <version>${cargo-maven2-plugin.version}</version> 
        <configuration> 
         <container> 
          <containerId>tomcat7x</containerId> 
          <type>installed</type> 
          <home>${env.USERPROFILE}/foo/apache-tomcat-7.0.57</home> 
          <timeout>180000</timeout> 
         </container> 
         <configuration> 
          <type>existing</type> 
          <home>${env.USERPROFILE}/foo/apache-tomcat-7.0.57</home> 
         </configuration> 
         <deployables> 
          <deployable> 
           <groupId>${project.groupId}</groupId> 
           <artifactId>${project.artifactId}</artifactId> 
           <type>war</type> 
           <properties> 
            <!--No slash needed before the context--> 
            <context>sec-captc</context> 
           </properties> 
          </deployable> 
         </deployables> 
        </configuration> 
       </plugin> 
      </plugins> 
     </build> 
    </profile> 


    <!-- ********************************************************************* 
           CARGO - FOR WEBLOGIC 
        ********************************************************************* --> 
    <profile> 
     <id>weblogic</id> 
     <activation> 
      <file><exists>${env.USERPROFILE}/foo.bar</exists></file> 
     </activation> 
     <build><plugins> 
      <plugin> 
       <groupId>org.codehaus.cargo</groupId> 
       <artifactId>cargo-maven2-plugin</artifactId> 
       <version>${cargo-maven2-plugin.version}</version> 
       <configuration> 
        <container> 
         <containerId>weblogic12x</containerId> 
         <type>installed</type> 
         <home>${installed-weblogic.home}/foo</home> 
         <timeout>180000</timeout> 
        </container> 
        <configuration> 
         <type>existing</type> 
         <home>${installed-weblogic.domain}</home> 
        </configuration> 
        <deployables> 
         <deployable> 
          <groupId>${project.groupId}</groupId> 
          <artifactId>${project.artifactId}</artifactId> 
          <type>war</type> 
          <properties> 
           <context>/${installed-weblogic.war.contextpath}</context> 
          </properties> 
         </deployable> 
        </deployables> 
       </configuration> 
      </plugin> 
     </plugins></build> 
    </profile> 
</profiles> 

は、私は、同時にこれらの作業を行うことができるように/変更を追加するために何が必要ですか?

答えて

0

アクティブなプロファイルは1つだけですか?どちらもアクティブであるかもしれませんが、cargo-maven2-pluginプラグインの実行は同じIDを使用しているため、1つしか実行されません。

プロファイルでは、各サーバーの設定があるようですが、プラグインの実行はありません。実行していないプロファイルのcargo-maven2-pluginに実行を追加してみてください。実行IDを「deploy-tomcat」のように設定します。それが役立つかどうかを見てください。

Mavenをデバッグモード(-X)で実行すると、何が起こっているのかを確認するのに役立ちます。

+0

私はむしろメイヴンにとって新人です。私が読んだことを考えれば、それがそれであるかどうか疑問に思っていました。私はそれを試して、それが動作するかどうかを見てみましょう。 – TheLimeTrees

関連する問題