在尝试将版本推送到Maven时,我遇到了几个错误,包括:
Permission denied (publickey).
fatal: The remote end hung up unexpectedly和
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Unable to commit files
Provider message:
The git-commit command failed.
Command output:发布于 2012-10-04 06:52:58
所以这只是我把git上的一个开源项目的发行版推到Sonatype maven repo上所经历的过程的一个大脑转储。这里的几乎所有内容都包含在单独的StackOverflow问题中,但对于那些(像我这样)第一次这样做的人来说,概述一下是很有用的。
整个过程实际上只有两个命令:
然而,正是这些繁琐的细节让我着迷。所以这是我需要遵循的过程:
Permission denied (publickey).错误。git-commit command failed.错误。上使用命令mvn -Pgpg gpg:sign-and-deploy-file -Durl=https://oss.sonatype.org/service/local/staging/deploy/maven2/ -DrepositoryId=sonatype-nexus-staging -DpomFile=pom.xml -Dfile=pom.xml
这是~/.m2/settings.xml文件。
<settings>
<servers>
<server>
<id>sonatype-nexus-snapshots</id>
<username>username</username>
<password>password</password>
</server>
<server>
<id>sonatype-nexus-staging</id>
<username>username</username>
<password>password</password>
</server>
</servers>
<profiles>
<profile>
<id>gpg</id>
<properties>
<gpg.passphrase>password</gpg.passphrase>
<gpg.keyname>12345678</gpg.keyname>
</properties>
</profile>
</profiles>
</settings>https://stackoverflow.com/questions/12718017
复制相似问题