maven-release-plugin 不使用作业配置或/和 .ssh/config 中提供的 ssh 密钥

vin*_*i_f 6 git ssh maven maven-release-plugin jenkins

我有一个 jenkins 工作,它有一个 git repo 作为 scm,jenkins 通过 ssh 连接到后者。

当涉及到 clone 命令时,一切都很好,我已经在 .ssh/config 中设置了正确的密钥,它被 Jenkins 使用。

但是当涉及到使用插件 maven-release-plugin(尝试版本 2.3.2 和 2.5.1)执行 maven 发布时,它会因访问被拒绝而失败。

[INFO] Executing: /bin/sh -c cd /path/slave/workspace/foo-27 && git push ssh://git@git.url/mfx/project.git refs/heads/develop-27:refs/heads/develop-27
[INFO] Working directory: /path/slave/workspace/foo-27

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 46.447s
[INFO] Finished at: Fri Oct 10 20:00:06 GMT 2014
[INFO] Final Memory: 15M/222M
[INFO] ------------------------------------------------------------------------
[JENKINS] Archiving /path/slave/workspace/foo-27/pom.xml to /bld/shared/jenkins/jobs/foo-27/modules/bar$project/builds/2014-10-10_19-59-14/archive/bar/project/27.1.1.0-SNAPSHOT/project-27.1.1.0-SNAPSHOT.pom

Waiting for Jenkins to finish collecting data
mavenExecutionResult exceptions not empty
message : Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.5.1:prepare (default-cli) on project project: Unable to commit files
Provider message:
The git-push command failed.
Command output:
Access denied.
fatal: Could not read from remote repository.
Run Code Online (Sandbox Code Playgroud)

当我在与 pwd 相同的目录中从相同的服务器运行相同的 git push 时,该命令可以完美运行。

此外,在我的工作定义中,我使用了一个为用户 git 设置密钥的凭证。

我的印象是 maven-release-plugin 没有使用 .ssh/config 中定义的 ssh 密钥...

我需要改变或做些什么才能让它发挥作用?

vin*_*i_f 4

事实证明问题不在于 ssh 密钥。消息“访问被拒绝”而不是“权限被拒绝”指出 git repo 权限不足以创建标签。