maven发布:执行失败

时间:2010-02-24 10:20:23

标签: maven-2 maven-release-plugin

我正在尝试了解maven-release-plugin(版本2.0,CVS)。 release-prepare 效果很好。 但我不明白为什么发布 - 执行不起作用?我已经测试了部署功能,我可以将工件部署到远程仓库,没有任何例外。

[INFO] [ERROR] BUILD ERROR
[INFO] [INFO] Failed to configure plugin parameters for: org.apache.maven.plugins:maven-deploy-plugin:2.4
[INFO] check that the following section of the pom.xml is present and correct:
[INFO] <distributionManagement>
[INFO]   <!-- use the following if you're not using a snapshot version. -->
[INFO]   <repository>
[INFO]     <id>repo</id>
[INFO]     <name>Repository Name</name>
[INFO]     <url>scp://host/path/to/repo</url>
[INFO]   </repository>
[INFO]   <!-- use the following if you ARE using a snapshot version. -->
[INFO]   <snapshotRepository>
[INFO]     <id>repo</id>
[INFO]     <name>Repository Name</name>
[INFO]     <url>scp://host/path/to/repo</url>
[INFO]   </snapshotRepository>
[INFO] </distributionManagement>
[INFO]
[INFO] Cause: Class 'org.apache.maven.artifact.repository.ArtifactRepository' cannot be instantiated
[INFO] Maven execution failed, exit code: '1'

2 个答案:

答案 0 :(得分:5)

首先,您应该确保按照错误本身的建议以正确的方式配置了distributionManagement。然后你尝试运行发布:准备目标指定命令行“-Dresume = false”,如下所示:

$ mvn release:prepare -Dresume=false

成功完成后,运行发布:再次执行目标,错误应该会消失。

答案 1 :(得分:1)

我已经解决了这个问题。我试图从我的孩子POM发布。父POM中指定的存储库URL。但为什么我的孩子POM没有继承它...