【发布时间】:2013-12-21 00:18:04
【问题描述】:
我正在使用 Maven 在 Github 上发布一个项目。 release:prepare 失败:
[ERROR] Provider message:
[ERROR] The git-push command failed.
[ERROR] Command output:
[ERROR] remote: Permission to FOO/BAR.git denied to BAZ.
[ERROR] fatal: unable to access 'https://github.com/FOO/BAR.git/': The requested URL returned error: 403
奇怪的是BAZ 是“错误的”github.com 帐户。它是我在 Github 上使用的两个用户名之一,但不是我在 BAR 项目中使用过的一个。假设正确的帐户是FIZZ。
SCM 设置未指定用户名:
<scm>
<connection>scm:git:https://github.com/FOO/BAR.git</connection>
<url>scm:git:https://github.com/FOO/BAR.git</url>
<developerConnection>scm:git:https://github.com/FOO/BAR.git</developerConnection>
...
</scm>
(FOO 是我参与的一个组织。)事实上,我不知道BAZ 到底来自哪里。它不在~/.gitconfig 或.git/config 中。没有~/.m2/settings.xml 文件。我的 Maven settings.xml 文件没有提到 Github。
如果我在命令行上使用git,它就可以工作——例如push就可以了。
谁能告诉我这可能来自哪里?某个隐藏的配置文件或目录,无论是 Maven 还是 Git 相关的?
或者,记录 Github 用户以在私有本地文件中使用的最佳做法是什么,例如 Maven settings.xml 或 .git/config,这样我就不需要将自己的用户放入构建文件中?
我使用的是 Mac OS X。
【问题讨论】:
标签: macos maven github release maven-scm