vivin / gradle-semantic-build-versioning

Gradle plugin to generate version-numbers and tags using semantic versioning
MIT License
86 stars 32 forks source link

Authentication required for pushing git tag #73

Open broth-eu opened 7 years ago

broth-eu commented 7 years ago

When I invoke task tag with option --push, I always get the following error: Authentication is required but no CredentialsProvider has been registered

How do I need to specify my credentials for the remote git repository?

vivin commented 7 years ago

I think this may be related to configuring git. Are you able to push tags manually from the command-line using git by itself?

broth-eu commented 7 years ago

Yes, pushing from command-line works as expected. Currently, my workaround is to push the newly created version tag by invoking the according git command.

vivin commented 7 years ago

I'll look into this a bit more. It might be related to the way JGit does things. I vaguely remember running into a similar issue before.

vivin commented 7 years ago

@broth-eu Are you trying to push to github? Or is it some other git repo? What sort of authentication are you using?

broth-eu commented 7 years ago

I'm trying to push to a BitBucket cloud repo. I always authenticate using username and password. Windows provides both using its credential manager.

vivin commented 7 years ago

I see; so every time you push, you provide your username and password?

vivin commented 7 years ago

I think a way around this is to be able to provide authentication information to the plugin and configure the credentials holder that way.

vivin commented 6 years ago

Sorry I've been really busy the past few months. Will try to look at this again.

kazvictor commented 6 years ago

I get the same error when this is run from TravisCI:

:tag FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':tag'.
> org.eclipse.jgit.api.errors.TransportException: https://github.com/example-org/my-repo.git: Authentication is required but no CredentialsProvider has been registered

How do you?

provide authentication information to the plugin and configure the credentials holder

kazvictor commented 6 years ago

I fixed this in my use case for travisCI by pushing the tag separately:

script: ./gradlew printVersion tag -Prelease && git push "https://${GH_TOKEN}@github.com/${TRAVIS_REPO_SLUG}.git" --tags
vivin commented 6 years ago

I'm trying to fix another issue currently, but will look at this again. I'm not sure why it isn't pulling in auth settings.

jsmithpkp commented 4 years ago

I am having the same problem with gitlab and the git server and the CI server are the same. I had to do something similar to kazvictor.