2014-04-08 4 views
0

부모 자바와 함께 여러 자바 프로젝트를 배포하고 싶습니다. 내 나무는 다음 코드를 복제 할 경우Maven에서 다중 프로젝트를 배포하는 방법?

pom.xml 
└── /project 1 
     └── pom.xml 
└── /project 2 
     └── pom.xml 

, 내 응용 프로그램 배포 부모 치어의 쓰기 싶습니다 : 나는 명령을 사용할 때

<distributionManagement> 
     <repository> 
     <id>myName</id> 
     <url>scp://myURL</url> 
     </repository> 
    </distributionManagement> 

 <extensions> 
      <extension> 
      <groupId>org.apache.maven.wagon</groupId> 
      <artifactId>wagon-ssh</artifactId> 
      <version>2.4</version> 
      </extension> 
     </extensions> 

을 " mvn deploy "가지고 있어요 :

[INFO] ------------------------------------------------------------------------ 
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.8.1:deploy (default-deploy) on project project1: Deployment failed: repository element was not specified in the POM inside distributionManagement element or in -DaltDeploymentRepository=id::layout::url parameter -> [Help 1] 
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. 
[ERROR] Re-run Maven using the -X switch to enable full debug logging. 
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles: 
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException 

고마워요. 사전에!

+1

가능한 중복 http://stackoverflow.com/questions/22717053/netbeans-and-maven-clean-and-build-with-dependent-projects/ 22717378 # 22717378) 구조와 관계가 있는지 확인하십시오. – sakura

+1

mvn help : effective-pom을 실행하여 maven이 부모 POM 구성을 선택하는지 확인하십시오. – JamesB

+0

부모 프로젝트를 자녀 수당에 ''으로 기입 했습니까? – blackbuild

답변

1

이 &을 통과하십시오 그것을 밖으로 시도 ... 부모 POM

<parent> 
    <relativePath>../ParentProject1/</relativePath> 
    <groupId>soemthing..</groupId> 
    <artifactId>soemthing..</artifactId> 
    <version>1.0.0.0</version> 
</parent> 

에서 '부모'태그를

<modules> 
    <module>../ChildProjec1</module> 
    <module>../ChildProjec2</module> 
    <module>../ChildProjec3</module> 
</modules> 

처럼 paernt 치어 뭔가를 모듈 태그를 추가하고 추가 부모 태그 안의 모든 하위 태그는 하위 프로젝트에서도 사용할 수 있습니다. 이 도움이

희망 ... [이] (의

관련 문제