请注意本文末尾的第二个问题!
我在使用 Jenkins、maven-release-plugin 和完整性(使用 MKS)作为源代码管理(scm)时遇到了一些麻烦。
好吧,我尝试通过 Jenkins 将我的项目从 MKS 发布到 Sonartype Nexus。如果我在 maven-release-plugin 中使用“部署”作为 maven 目标,一切都很好,并且发布部署正确,但它在 Nexus 中保存为快照。
为了避免这个快照问题,我决定将 maven-release-plugin 与 release:perform 一起使用。它应该将版本号更改为没有快照的版本(例如:1.0.0),发布它并在发布完成后再次将快照添加到版本号。版本也增加了(如 1.0.1-SNAPSHOT)。
但是,如果我使用“release:prepare”或“release:perform”作为 maven 目标,输出会告诉我:
[ERROR] No SCM URL was provided to perform the release from
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 24.405s
[INFO] Finished at: Fri Feb 14 11:56:40 CET 2014
[INFO] Final Memory: 10M/245M
[INFO] ------------------------------------------------------------------------
Waiting for Jenkins to finish collecting data
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.0:perform (default-cli) on project javatests-test04: No SCM URL was provided to perform the release from -> [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/MojoFailureException
在我搜索了很长时间但没有找到我需要的答案后,我想出了打开这个新问题的想法。
我试过这样的事情:
向 pom.xml 添加信息,但甚至不确定 maven 是否意识到这一点(不知道对我来说正确的 URL 是什么,或者我什至有一个,所以我没有更改它)
本站原创:
<scm>
<connection>scm:git:git@github.com:user/project.git</connection>
<url>scm:git:git@github.com:user/project.git</url>
<developerConnection>scm:git:git@github.com:user/project.git</developerConnection>
</scm>
我的版本:
<scm>
<connection>scm:integrity|myUser@myServer:7001|#p=d:/MKS/Tools/Tools.pj#s=Tests/Tests.pj#javatests-test04 </connection>
<url>scm:git:git@github.com:user/project.git</url>
<developerConnection>scm:integrity|myUser@myServer:7001|#p=d:/MKS/Tools/Tools.pj#s=Tests/Tests.pj#javatests-test04</developerConnection>
</scm>
我将 maven 目标更改为第二次尝试(与 -Dproject.scm.developerConnerction 相同):
发布:执行 -DconnectionUrl=scm:integrity:myUser@myMksServer:7001|#p=d:/MKS/Tools/Tools.pj#s=Tests/Tests.pj#javatests-test04
but it leads to a new error:
[ERROR] Failed to execute goal
org.apache.maven.plugins:maven-release-plugin:2.0:prepare
(default-cli) on project javatests-test04: The provider given in the
SCM URL could not be found: No such provider: 'integrity'.
我事实上它与“部署”作为 maven 目标工作正常,我确信这不是错误的项目路径或 Sonartype Nexus 的错。
任何人都可以帮助我和/或告诉我我的 Maven 目标应该是什么样的吗?我在 pom 中有改变吗?在主 pom 中?我想要发布声明工作...