如何将GitHub凭证提供给unleash-maven-plugin?

时间:2019-03-14 07:14:37

标签: git maven github release maven-release-plugin

我有一个发布到github的非常简单的maven项目,其中启用了2FA。我想使用unleash-maven-plugin发行新版本(看起来像经过改进/刷新的maven-release-plugin)。我遵循了说明,但是关于如何提供凭据不是很具体。我可以使用用户名/密码(由于2FA而不能使用,可以吗?),也可以使用密码短语来加密我的~/.ssh中的私钥。

我通过httpsgit连接进行了尝试,并在远程git存储库中查询标签'1.0.0':Algorithm negotiation fail时遇到了此错误。

要做什么才能完成这项工作?

1 个答案:

答案 0 :(得分:0)

文档中的是:

Custom SCM credentials
Sometimes it is necessary to provide SCM credentials to the SCM provider. This can be the case if the system does not cache the credentials or if you want to make SCM changes as a specific user. You can use the parameters scmUsername adn scmPassword for this purpose. When calling the goal from command line and providing these parameters through system properties the call would look like this:

mvn unleash:perform -Dunleash.scmUsername=... -Dunleash.scmPassword=...

您尝试过吗:

mvn unleash:perform -Dunleash.scmSshPassphrase=<private key here>

或者:

PRIVATE_KEY=<private key>

mvn unleash:perform -Dunleash.scmSshPassphraseEnvVar=PRIVATE_KEY