GoogleCloudPlatform / artifact-registry-maven-tools

Apache License 2.0
22 stars 23 forks source link

Log when no credentials can be found. #54

Closed megan-kuo closed 2 years ago

megan-kuo commented 2 years ago

Fix #34

megan-kuo commented 2 years ago

/gcbrun

yihanzhen commented 2 years ago

I think I've repro'ed the original issue and can make sure that the fix has worked:

Setup: no application default credentials, gcloud uninstalled. The test project applied this plugin but doesn't actually depend on any artifacts in Artifact Registry.

without this PR, I got:

hzyi@hzyi-laptop:~/artifactregistry/gradletestingproject/pull$ ./gradlew build

FAILURE: Build failed with an exception.

* Where:
Build file '/home/hzyi/artifactregistry/gradletestingproject/pull/build.gradle' line: 13

* What went wrong:
An exception occurred applying plugin request [id: 'com.google.cloud.artifactregistry.gradle-plugin', version: '2.1.2']
> Failed to apply plugin 'com.google.cloud.artifactregistry.gradle-plugin'.
   > Failed to get access token from gcloud or Application Default Credentials

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

* Get more help at https://help.gradle.org

BUILD FAILED in 622ms

With this PR:

hzyi@hzyi-laptop:~/artifactregistry/gradletestingproject/pull$ ./gradlew build

BUILD SUCCESSFUL in 612ms
4 actionable tasks: 4 up-to-date

I think we can merge this :)

megan-kuo commented 2 years ago

/gcbrun