适用于HTTPS的Maven JGitFlow插件身份验证

Yif*_*ach 5 git authentication bitbucket maven

我无法通过Maven JGitFlow插件通过HTTPS对BitBucket进行身份验证,git-bash在Windows上运行.

错误消息是:"身份验证是必需的,但没有注册CredentialsProvider".我看到的建议似乎假设我可以作为开发人员访问JGit代码本身.

直接执行git命令没问题(我正在使用git-credential-winstore).此外,当我在pom.xml文件中明确地在POM中提供了我的用户名和密码时,它也有效.

但是,我不希望将我的密码上传到我的BitBucket存储库,并且正在寻找JGitFlow插件以与GIT本身相同的方式进行身份验证的方法.

我做错了什么,我该如何解决?

Chr*_*oop 7

以下JGitFlow Maven插件配置有效

<plugin>
    <groupId>external.atlassian.jgitflow</groupId>
    <artifactId>jgitflow-maven-plugin</artifactId>
    <version>1.0-m5.1</version>
    <configuration>
        <username>${git.user}</username>
        <password>${git.password}</password>
    </configuration>
</plugin>
Run Code Online (Sandbox Code Playgroud)

使用用户名和密码作为Java系统属性从命令行调用它,即使用-Dgit.user=<user>-Dgit.password=<password>,例如

mvn -Dgit.user=user@bitbucket.com -Dgit.password = secret jgitflow:release-start

注意:插件应该真正使用Maven进行更新,该Maven CredentialsProvider能够从settings.xml和/或Git凭证解析器获取凭据,该解析器在命令行上使用与git相同的机制.