Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Maven JGitFlow plugin authentication for HTTPS

I'm having trouble authenticating with BitBucket through HTTPS via the Maven JGitFlow plugin, run through git-bash on Windows.

The error message is: "Authentication is required but no CredentialsProvider has been registered". The suggestions I've seen though seem to assume that I have access to the JGit code itself as a developer.

I've had no trouble executing git commands directly (I'm using git-credential-winstore). Also, when I've supplied my username and password in the POM explicitly in the pom.xml file, it also worked.

However, I would not like my password to be uploaded to my BitBucket repository, and am looking for a way for the JGitFlow plugin to authenticate the same way as GIT itself does.

What am I doing wrong, and how can I fix that?

like image 863
Yiftach Avatar asked Mar 23 '16 22:03

Yiftach


1 Answers

The following JGitFlow Maven plugin configuration works

<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>

Call it from the command line with the username and password as Java System Properties, i.e. with -Dgit.user=<user> and -Dgit.password=<password>, e.g.

mvn [email protected] -Dgit.password=secret jgitflow:release-start

Note: the plugin should really be updated with a Maven CredentialsProvider that is capable of obtaining the credentials from settings.xml and/or a Git credentials parser that uses the same mechanism as git on the command line.

like image 62
Christoffer Soop Avatar answered Oct 26 '22 02:10

Christoffer Soop