in artifactregistry-maven-wagon/src/main/java/com/google/cloud/artifactregistry/wagon/ArtifactRegistryWagon.java [204:218]
private void rethrowAuthorizationException(HttpResponseException e)
throws AuthorizationException {
if (e.getStatusCode() == HttpStatusCodes.STATUS_CODE_FORBIDDEN
|| e.getStatusCode() == HttpStatusCodes.STATUS_CODE_UNAUTHORIZED) {
String errorMessage = "Permission denied on remote repository (or it may not exist). ";
if (!hasCredentials) {
errorMessage += "The request had no credentials because none were available "
+ "from the environment. Ensure that either 1) You are logged into gcloud or 2) "
+ "Application default credentials are setup (see "
+ "https://developers.google.com/accounts/docs/application-default-credentials for "
+ "more information).";
}
throw new AuthorizationException(errorMessage, e);
}
}