首页 > 解决方案 > 如何向 unleash-maven-plugin 提供 github 凭据?

问题描述

我有一个非常简单的 maven 项目发布到我启用了 2FA 的 github。我想使用unleash-maven-plugin发布新版本(看起来像改进/刷新maven-release-plugin)。我按照说明进行了操作,但对于如何提供凭据并不是很具体。我可以在我的~/.ssh.

我尝试了一个https和一个git连接,并在查询远程 git 存储库中的标签 '1.0.0': 时遇到了这个错误Algorithm negotiation fail

我该怎么做才能完成这项工作?

标签: gitmavengithubreleasemaven-release-plugin

解决方案


在文档中是:

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

推荐阅读