如何使用maven发布插件将发布推送到github?
我可以使用SSH将其推送到我的Gihub存储库,但在准备阶段尝试使用maven发布插件推送时出现了一个错误:如何使用maven发布插件将发布推送到github?,git,maven,github,ssh,ssh-keys,Git,Maven,Github,Ssh,Ssh Keys,我可以使用SSH将其推送到我的Gihub存储库,但在准备阶段尝试使用maven发布插件推送时出现了一个错误: Failed to execute goal org.apache.maven.plugins:maven-release-plugin:3.0.0-M1:prepare (default-cli) on project netbeans-visual-diff-standalone: Unable to commit file Caused by: org.apache.maven.
Failed to execute goal org.apache.maven.plugins:maven-release-plugin:3.0.0-M1:prepare (default-cli) on project netbeans-visual-diff-standalone: Unable to commit file
Caused by: org.apache.maven.shared.release.scm.ReleaseScmCommandException: Unable to commit files
Provider message:
The git-push command failed.
Command output:
nbauma109@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.
我按照此处的所有步骤创建公钥/私钥,将公钥上载到我的github帐户,并将私钥添加到ssh代理:
我用发布插件配置和scm连接设置更新了maven POM:
<scm>
<connection>scm:git:https://github.com/nbauma109/netbeans-visual-diff-standalone.git</connection>
<developerConnection>scm:git:ssh://git@github.com/nbauma109/netbeans-visual-diff-standalone.git</developerConnection>
<url>https://github.com/nbauma109/netbeans-visual-diff-standalone</url>
<tag>HEAD</tag>
</scm>
<distributionManagement>
<repository>
<id>pkg.github.com</id>
<name>GitHub nbauma109 Apache Maven Packages</name>
<url>https://maven.pkg.github.com/nbauma109/mvn-repo</url>
</repository>
</distributionManagement>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>3.0.0-M1</version>
<configuration>
<tagBase>ssh://git@github.com/nbauma109/netbeans-visual-diff-standalone/tags</tagBase>
</configuration>
</plugin>
</plugins>
</build>
<properties>
<project.scm.id>github.com</project.scm.id>
</properties>
当系统提示我输入版本和标签信息时,我只需按enter键选择默认值
- 发行版本:2.0.1
- 下一个开发版本:2.0.2-SNAPSHOT
现在我的问题是,我推送了一个没有身份验证任何人都无法访问的包,并且我的发布标签中没有其他项目可以使用的二进制文件。除了使用Github web GUI手动将二进制文件重新上载到发布标签之外,我没有其他选择吗?只要您看到
nbauma109@github.com
,您可以确保SSH推送将失败(从命令行或maven)
GitHub SSH URL将始终使用远程用户“git
”:git@github.com:…
,决不是实际的GitHub用户帐户名:您注册到所述GitHub帐户的公钥将用于验证您的身份
因此,从以下方面开始测试:
<username>git</username>
git
Ok现在它成功地推送了一个标记,但现在它在推送Github包时卡住了(没有错误)。我将相应地更新我的问题。@Sybuser这是一个完全独立的问题。
mvn -X -Dusername=git release:clean release:prepare release:perform
<username>git</username>