Sat*_*yaS 4 git github maven-3 maven maven-release-plugin
在使用像Hudson/Jenkins这样的CI工具时,如何使用GitHub(或GitHub企业)成功使用Maven版本插件
遇到的问题是
有许多事情需要正确才能发挥作用.
为了使pom.xml的子文件夹提交起作用,该错误在Maven release插件2.5.1中得到解决.获取最新的依赖项.以下部分显示了pom.xml
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.5.1</version>
<dependencies>
<dependency>
<groupId>org.apache.maven.scm</groupId>
<artifactId>maven-scm-provider-gitexe</artifactId>
<version>1.9.2</version>
</dependency>
</dependencies>
<configuration>
<checkModificationExcludes>
<checkModificationExclude>pom.xml</checkModificationExclude>
</checkModificationExcludes>
</configuration>
</plugin>
Run Code Online (Sandbox Code Playgroud)在pom.xml中正确配置SCM部分.要使公钥认证正常工作,请使用SSH协议.对于https协议,将需要用户/密码,此答案不包括此内容.应该可以通过在servers部分的Maven settings.xml中提供user/pwd来实现.
<scm>
<developerConnection>scm:git:ssh://github.com/org/repo.git</developerConnection>
<url>https://github.com/org/repo</url>
<tag>HEAD</tag>
</scm>
Run Code Online (Sandbox Code Playgroud)在源服务器中创建一个名为git的用户.如果您像任何其他用户一样运行,则developerConnection url将需要git@github.com而不是github.com.Maven将尝试在git push命令中放置一个git:******,它因服务未知而失败.如果您使用任何其他用户SSH到github,它将拒绝公钥验证失败.
使用git作为用户,生成SSH密钥并按照以下简单步骤进行配置
编辑您的Hudson/Jenkins工作,如下所示
使用maven目标运行你的工作清理编译版本:准备和发布:执行.它应该工作.
| 归档时间: |
|
| 查看次数: |
8022 次 |
| 最近记录: |