我正在使用maven-release-plugin为我的项目准备发行版。
我添加了这样的插件:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.5.3</version>
</plugin>Git回购是这样建立起来的:
<scm>
<url>http://my-repo.com:7990/projects/repos/my-project</url>
<connection>scm:git:ssh://git@my-repo.com:7999/wrap/my-project.git</connection>
<developerConnection>scm:git:ssh://git@my-repo.com:7999/wrap/my-project.git</developerConnection>
<tag>my-project-1.1</tag>
</scm>但是,当我运行这个程序时:
mvn release:prepare我得到了这个错误:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.5.3:prepare (default-cli) on project my-project: Unable to tag SCM
[ERROR] Provider message:
[ERROR] The git-push command failed.
[ERROR] Command output:
[ERROR] Permission denied (publickey).
[ERROR] fatal: Could not read from remote repository.
[ERROR]
[ERROR] Please make sure you have the correct access rights
[ERROR] and the repository exists.发布于 2018-07-31 15:41:13
我也面临着同样的问题。事实证明,Maven没有许可代表我发布到我的Github存储库。这是必需的,以使它能够生成一个新的发布标签。我的项目是Jenkins插件,所以我在Jenkins开发人员wiki中找到了答案
但是,如果您的插件托管在GitHub上,并且GitHub和jenkins-ci.org有不同的用户名和/或密码,那么使用命令行参数作为用户名/密码将导致错误。您必须启动ssh代理并导入您的私钥,以便发布插件可以访问GitHub存储库(请参阅向GitHub帐户添加新的SSH密钥).
当然,如果您还没有创建一个新的SSH密钥并将其添加到SSH客户端,那么第一步就是使用一个。
下面是我遵循的步骤(来自上述链接中的说明)。
$ ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
Generating public/private rsa key pair.
Enter a file in which to save the key (/Users/you/.ssh/id_rsa): [Press enter]
Enter passphrase (empty for no passphrase): [Type a passphrase]
Enter same passphrase again: [Type passphrase again]然后将新的SSH密钥添加到SSH代理中。
eval "$(ssh-agent -s)"
Agent pid 59566使用您最喜欢的编辑器打开~/.ssh/config并添加以下内容:
Host *
AddKeysToAgent yes
UseKeychain yes
IdentityFile ~/.ssh/id_rsa然后跑:
$ ssh-add -K ~/.ssh/id_rsa将公钥复制到剪贴板中:
pbcopy < ~/.ssh/id_rsa.pub转到Github,从您的化身旁边的雪佛龙选择Settings>SSH和GPG keys>New SSH键,粘贴公钥,值,给它一个稍后会识别和保存的名称。
应该是这样的。
那就去吉顿吧
https://stackoverflow.com/questions/42717009
复制相似问题