Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception when only username is provided #153

Closed
ajoberstar opened this issue Mar 23, 2017 · 6 comments
Closed

Exception when only username is provided #153

ajoberstar opened this issue Mar 23, 2017 · 6 comments
Labels
Milestone

Comments

@ajoberstar
Copy link
Owner

GitHub auth token's can be passed as a username and no password, but currently taking a similar approach here using GRGIT_USER and no GRGIT_PASS will fail.

@marcphilipp
Copy link

We're also experiencing this issue in junit-team/junit5#782. Is there any workaround or a solution in sight?

@ajoberstar
Copy link
Owner Author

I think it will be a pretty easy fix, just haven't had time to look at it. May have some time tomorrow.

ajoberstar added a commit that referenced this issue Apr 9, 2017
Username-only creds are useful for things like GitHub access tokens.
Prior to this commit, specifying only a username resulted in a null
password, which caused an ambiguous method call to the
UserNamePasswordCredentialsProvider constructor.

Now Credentials has been beefed up to fallback to empty strings for
values that aren't provided. There's also an explicit method for how to
check the validity of a Credentials object rather than needing to
specify it directly in each case.

Fixes #153
@ajoberstar
Copy link
Owner Author

Copying Marc's sample error to make this easier to find with search:

:documentation:asciidoctor
:prepareDocsForUploadToGhPages
:createCurrentDocsFolder SKIPPED
:gitPublishReset FAILED
:gitPublishClose FAILED

FAILURE: Build completed with 2 failures.

1: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':gitPublishReset'.
> Ambiguous method overloading for method org.eclipse.jgit.transport.UsernamePasswordCredentialsProvider#<init>.
  Cannot resolve which method to invoke for [class java.lang.String, null] due to overlapping prototypes between:
        [class java.lang.String, class java.lang.String]
        [class java.lang.String, class [C]

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
==============================================================================

2: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':gitPublishClose'.
> Could not get unknown property 'repo' for object of type org.ajoberstar.gradle.git.publish.GitPublishExtension.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
==============================================================================

BUILD FAILED

@ajoberstar
Copy link
Owner Author

1.9.1 is out now. I'll be making fix releases of a bunch of the other plugins to update their dependencies on this too.

@marcphilipp
Copy link

Thanks for the quick turnaround! The new version works now! 👍

@andrii-kovalenko-ct
Copy link

thanks for the fix: i hoped to have it!

Maybe now the migrating doc https://github.com/ajoberstar/gradle-git-publish#migrating-from-orgajoberstargithub-pages could be changed, e.g. at least refer credentials section to http://ajoberstar.org/grgit/docs/groovydoc/index.html?org/ajoberstar/grgit/auth/AuthConfig.html ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants