0

I am using jgitflow-maven-plugin to manage gitflow process for my project. I am moving away from usign ssh urls to https urls with OAuth token.

However, when I use https url with jgitflow-maven-plugin:release-start I get following error

Caused by: org.eclipse.jgit.api.errors.TransportException: https://<token>@githubserver.com/myorg/myrepo.git: Authentication is required but no CredentialsProvider has been registered
at org.eclipse.jgit.api.FetchCommand.call(FetchCommand.java:139)
at com.atlassian.jgitflow.core.JGitFlowInitCommand.call(JGitFlowInitCommand.java:141)
... 26 more

Caused by: https://<token>@githubserver.com/myorg/myrepo.git: Authentication is required but no CredentialsProvider has been registered
at org.eclipse.jgit.transport.TransportHttp.connect(TransportHttp.java:498)
at org.eclipse.jgit.transport.TransportHttp.openFetch(TransportHttp.java:309)
at org.eclipse.jgit.transport.FetchProcess.executeImp(FetchProcess.java:136)
at org.eclipse.jgit.transport.FetchProcess.execute(FetchProcess.java:122)
at org.eclipse.jgit.transport.Transport.fetch(Transport.java:1138)
at org.eclipse.jgit.api.FetchCommand.call(FetchCommand.java:130)
... 27 more


org.eclipse.jgit.api.errors.TransportException:     
https://<token>@githubserver.com/myorg/myrepo.git: Authentication is required but no CredentialsProvider has been registered
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:216)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at ...

Caused by: com.atlassian.maven.plugins.jgitflow.exception.MavenJGitFlowException: Error starting release: org.eclipse.jgit.api.errors.TransportException: https://<token>@githubserver.com/myorg/myrepo.git: Authentication is required but no CredentialsProvider has been registered
at com.atlassian.maven.plugins.jgitflow.manager.DefaultFlowReleaseManager.start(DefaultFlowReleaseManager.java:62)
at com.atlassian.maven.plugins.jgitflow.mojo.ReleaseStartMojo.execute(ReleaseStartMojo.java:113)
... 21 more


Caused by: org.eclipse.jgit.errors.TransportException: https://<token>@githubserver.com/myorg/myrepo.git: Authentication is required but no CredentialsProvider has been registered
at org.eclipse.jgit.transport.TransportHttp.connect(TransportHttp.java:498)
at org.eclipse.jgit.transport.TransportHttp.openFetch(TransportHttp.java:309)
at org.eclipse.jgit.transport.FetchProcess.executeImp(FetchProcess.java:136)
at org.eclipse.jgit.transport.FetchProcess.execute(FetchProcess.java:122)
at org.eclipse.jgit.transport.Transport.fetch(Transport.java:1138)
at org.eclipse.jgit.api.FetchCommand.call(FetchCommand.java:130)
... 27 more 

Looks like jgit library doesn't support HTTP urls with OAuth token in it. Is there a way around it. This works fine when I use ssh urls

Pushkar
  • 541
  • 4
  • 18
  • If you are using GitHub, the OAuth token needs to be specified as the user name instead of as part of the URL (see also here: http://www.codeaffine.com/2014/12/09/jgit-authentication/). – Rüdiger Herrmann Jun 01 '16 at 17:15
  • Thanks @RüdigerHerrmann It looks like `jgit-maven-plugin` requires both username and password to be specified. I tried using OAuth token value for both and it worked. – Pushkar Jun 01 '16 at 17:55

0 Answers0