2012-11-24 6 views
6

나는이 사용하는 디렉토리에 "배포"메이븐을하려면메이븐 : 릴리스 플러그인을 볼 수 없습니다 내 <repository>에서 <distributionManagement>

<distributionManagement> 
    <downloadUrl>http://code.google.com/p/junitdiff/downloads/list</downloadUrl> 
    <repository> 
     <id>local-hack-repo</id> 
     <name>LocalDir</name> 
     <url>file://${project.basedir}/dist-maven</url> 
    </repository> 
    <snapshotRepository> 
     <id>jboss-snapshots-repository</id> 
     <name>JBoss Snapshots Repository</name> 
     <!-- 
     <url>https://repository.jboss.org/nexus/content/repositories/snapshots</url> 
     --> 
     <url>file://${project.basedir}/dist-maven</url> 
    </snapshotRepository> 
</distributionManagement> 

이 유효 치어에 나타납니다.

... 
<distributionManagement> 
<repository> 
    <id>local-hack-repo</id> 
    <name>LocalDir</name> 
    <url>file:///home/ondra/work/TOOLS/JUnitDiff/github/dist-maven</url> 
</repository> 
<snapshotRepository> 
    <id>jboss-snapshots-repository</id> 
    <name>JBoss Snapshots Repository</name> 
    <url>file:///home/ondra/work/TOOLS/JUnitDiff/github/dist-maven</url> 
</snapshotRepository> 
<downloadUrl>http://code.google.com/p/junitdiff/downloads/list</downloadUrl> 
</distributionManagement> 

하지만 여전히, 메이븐이이 아니라고 주장 :

[INFO] [ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project JUnitDiff: Deployment failed: repository element was not specified in the POM inside distributionManagement element or in -DaltDeploymentRepository=id::layout::url parameter -> [Help 1] 
[INFO] org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project JUnitDiff: Deployment failed: repository element was not specified in the POM inside distributionManagement element or in -DaltDeploymentRepository=id::layout::url parameter 
... 
[INFO] Caused by: org.apache.maven.plugin.MojoExecutionException: Deployment failed: repository element was not specified in the POM inside distributionManagement element or in -DaltDeploymentRepository=id::layout::url parameter 
[INFO] at org.apache.maven.plugin.deploy.DeployMojo.getDeploymentRepository(DeployMojo.java:235) 
[INFO] at org.apache.maven.plugin.deploy.DeployMojo.execute(DeployMojo.java:118) 
[INFO] at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101) 
[INFO] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209) 
[INFO] ... 19 more 

나는 받는다는 출시 - 플러그인을 통해 그것을 사용하고 있습니다.

업데이트 :이 ^^^는 핵심 부분 인 것 같습니다. mvn deploy이 잘 작동합니다.

관련 : http://www.java-tutorial.ch/maven/maven-release

문제점은 무엇입니까?

Maven 3.0.4. 추가 할 Pom.

+1

처음에 파일을 디렉토리에 배포하려는 경우 file : /// home/ondra/repository/snapshots 및 file : /// home/ondra/repository/releases와 같이 프로젝트 외부에있는 것을 사용하십시오. pom 발췌의 오류 메시지 사이의 관계를 볼 수 없습니다. 따라서 가장 좋은 방법은 완전한 pom 파일과 정확하게 사용 된 명령을 표시하는 것입니다. – khmarbaise

+0

어떤 Maven 버전입니까? 어떤 버전의 maven-deploy-plugin을 사용하고 있습니까? pom.xml을 게시하십시오. 우리 모두가 유리 공을 가지고 있거나, 심령입니다. :) – carlspring

+0

릴리스 플러그인이 어떻게 든 요소가없는 잘못된 git 태그를 체크 아웃한다는 것이 문제인 것 같습니다. 알아 내기. 과정은 조금 까다 롭습니다. –

답변

0

maven-release-plugin은 로컬 파일뿐만 아니라 버전 제어의 파일에서도 작동하기 때문에 실제로 사용하는 파일에는 <distributionManagement> 태그가 없습니다.