2016-12-12 6 views
0

cargo:deploy을 통해 war을 Tomcat 7 및 Weblogic 컨테이너에 동시에 배포하고 싶습니다. 그것이 의미하는 한 번에 하나의 프로필 만 활성화 될 수 있습니다.복수의 메이븐 프로파일 배포

<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

프로필이 하나만 활성화되어 있습니까? 두 가지 모두 활성화되어있을 수도 있지만 cargo-maven2-plugin 플러그인 실행은 동일한 ID를 사용하므로 하나만 실행됩니다.

프로필에는 각 서버에 대한 구성이 있지만 플러그인 실행이없는 것처럼 보입니다. 실행 중이 지 않은 프로필에서 cargo-maven2-plugin에 실행을 추가해보십시오. 실행 ID를 "deploy-tomcat"과 같이 설정하십시오. 도움이되는지 확인하십시오.

디버그 모드에서 Maven을 실행하면 (-X) 도움이 될 것입니다.

+0

나는 신기한 사람이다. 이드는 그것이 내가 읽었던 것을 생각해 보면 그것이 이상한 것인지 궁금해했다. 나는 그것을 시도하고 그것이 작동하는지 확인합니다. – TheLimeTrees