2012-02-21 3 views
1

이 프로젝트에서 필자는 몇 가지 모듈 (도메인, DAO, 서비스, 전쟁)을 정의하는 큰 마스터 POM 파일을 가지고 있습니다.Maven Cargo를 사용하여 다중 모듈 프로젝트 배포

나는 카고를 사용하여 나의 원격 톰캣 서버에 전쟁을 전개하고 싶다.

실행중인 mvn cargo : deploy -Ptest 그러나 모듈 dao에서 모듈 도메인에 대한 종속성을 확인할 수 없다는 오류가 발생합니다.

나는 전쟁 무기에있는 뱃짐 윤곽을 두는 것을 시도하고 그러나 아직도 동일 물을 시도했다.

나를 도와 줄 사람이 있습니까?

은 POM

<?xml version="1.0" encoding="UTF-8"?> 
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> 
    <modelVersion>4.0.0</modelVersion> 
    <groupId>com.domain</groupId> 
    <artifactId>product</artifactId> 
    <version>1.2-SNAPSHOT</version> 
    <packaging>pom</packaging> 

    <dependencyManagement> 
     <dependencies> 
      <!-- Internal dependencies --> 
      <dependency> 
       <groupId>com.domain.product</groupId> 
       <artifactId>product-domain</artifactId> 
       <version>${project.version}</version> 
       <type>jar</type> 
       <scope>compile</scope> 
      </dependency> 
      <dependency> 
       <groupId>com.domain.product.dao</groupId> 
       <artifactId>product-dao-api</artifactId> 
       <version>${project.version}</version> 
       <type>jar</type> 
       <scope>compile</scope> 
      </dependency> 
      <dependency> 
       <groupId>com.domain.product.dao</groupId> 
       <artifactId>product-dao-jpa2</artifactId> 
       <version>${project.version}</version> 
       <type>jar</type> 
       <scope>compile</scope> 
      </dependency> 
      <dependency> 
       <groupId>com.domain.product.service</groupId> 
       <artifactId>product-service-api</artifactId> 
       <version>${project.version}</version> 
       <type>jar</type> 
       <scope>compile</scope> 
      </dependency> 
      <dependency> 
       <groupId>com.domain.product.service</groupId> 
       <artifactId>product-service-impl</artifactId> 
       <version>${project.version}</version> 
       <type>jar</type> 
       <scope>compile</scope> 
      </dependency> 
      <dependency> 
       <groupId>com.domain.product</groupId> 
       <artifactId>product-war</artifactId> 
       <version>${project.version}</version> 
       <type>jar</type> 
       <type>war</type> 
       <scope>compile</scope> 
      </dependency> 
     </dependencies> 
    </dependencyManagement> 

    <build> 
     <pluginManagement> 
      <plugins> 
       <plugin> 
        <groupId>org.codehaus.cargo</groupId> 
        <artifactId>cargo-maven2-plugin</artifactId> 
        <version>1.2.0</version> 
       </plugin> 
      </plugins> 
     </pluginManagement> 
    </build> 

    <!-- profiles --> 
    <profiles> 
     <profile> 
      <id>test</id> 
      <activation> 
      <property> 
       <name>environment.type</name> 
       <value>test</value> 
      </property> 
      </activation> 
      <properties> 
      </properties> 
     </profile> 
    </profiles> 

    <modules> 
     <module>product-domain</module> 
     <module>product-dao-api</module> 
     <module>product-dao-jpa2</module> 
     <module>product-service-api</module> 
     <module>product-service-impl</module> 
     <module>product-war</module> 
    </modules> 
</project> 

이 전쟁 POM 인 부모 :

<?xml version="1.0" encoding="UTF-8"?> 
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> 
    <modelVersion>4.0.0</modelVersion> 
    <parent> 
     <artifactId>product</artifactId> 
     <groupId>com.domain</groupId> 
     <version>1.2-SNAPSHOT</version> 
    </parent> 
    <groupId>com.domain.product</groupId> 
    <artifactId>product-war</artifactId> 
    <name>product</name> 
    <packaging>war</packaging> 

    <dependencies> 
     <dependency> 
      <groupId>com.domain.product.service</groupId> 
      <artifactId>product-service-impl</artifactId> 
     </dependency> 
     <dependency> 
      <groupId>com.domain.product.service</groupId> 
      <artifactId>product-service-api</artifactId> 
     </dependency> 
    </dependencies> 

    <profiles> 
     <profile> 
      <id>test</id> 
      <activation> 
       <property> 
        <name>environment.type</name> 
        <value>test</value> 
       </property> 
      </activation> 
      <properties> 
       <!-- Deployment settings --> 
       <cargo.containerId>tomcat7x</cargo.containerId> 
       <cargo.baseurl>http://test.domain.net:8080</cargo.baseurl> 
       <container.url>${cargo.baseurl}/manager/text</container.url> 
       <container.user>tomcat-txt</container.user> 
       <container.password>password</container.password> 
       <container.pingurl>${cargo.baseurl}/${project.name}/index.html</container.pingurl> 
      </properties> 
      <build> 
       <plugins> 
        <plugin> 
         <groupId>org.codehaus.cargo</groupId> 
         <artifactId>cargo-maven2-plugin</artifactId> 
         <configuration> 
          <wait>true</wait> 
          <container> 
           <containerId>${cargo.containerId}</containerId> 
           <type>remote</type> 
          </container> 
          <configuration> 
           <type>runtime</type> 
           <properties> 
            <cargo.remote.uri>${container.url}</cargo.remote.uri> 
            <cargo.remote.username>${container.user}</cargo.remote.username> 
            <cargo.remote.password>${container.password}</cargo.remote.password> 
           </properties> 
          </configuration> 
          <deployer> 
           <deployables> 
            <deployable> 
             <groupId>com.domain.product</groupId> 
             <artifactId>product-war</artifactId> 
             <type>war</type> 
             <properties> 
              <context>${project.name}</context> 
             </properties> 
             <pingURL>${container.pingurl}</pingURL> 
            </deployable> 
           </deployables> 
          </deployer> 
         </configuration> 
        </plugin> 
       </plugins> 
      </build> 
     </profile> 
    </profiles> 
</project> 

당신이 볼 수 있듯이, 전쟁이 자체로 DAO에서 의존하는 서비스에서 의존 그리고 그 도메인에서 하나. 제 생각에는

+0

정보가 충분하지 않음보다 먼저 사용해야합니다. 배포하려는 모듈에 pom.xml을 첨부하십시오. –

+0

이 응답은화물로 다중 모듈 배치를 수행하는 방법에 도움이됩니까? http://stackoverflow.com/a/21190644/219304? –

답변

1

당신은 MVN 설치하고

mvn -pl product-war cargo:deploy -Ptest 
관련 문제