Skip to content
This repository has been archived by the owner on Apr 16, 2021. It is now read-only.

GCP error on version 2.3 #66

Open
porfirioribeiro opened this issue Sep 3, 2019 · 5 comments
Open

GCP error on version 2.3 #66

porfirioribeiro opened this issue Sep 3, 2019 · 5 comments

Comments

@porfirioribeiro
Copy link

I followed the guide posted here https://egkatzioura.com/2018/04/09/host-your-maven-artifacts-using-google-cloud-storage/ to make deployment of my project to Google Cloud Storage.

It worked well but then i updated the version of this plugin to 2.3 and i got this error:

Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project commons: Failed to deploy artifacts: Could not transfer artifact net.agroop:commons:jar:1.0.1 from/to my-repo-bucket-release (gs://agroop-mvn/release): Please configure you google cloud account by logging using gcloud and specify a default project

I don't know if something needs to change on the config or it's a bug.

For now i'll keep using 1.0

@Guillaume-Mayer
Copy link
Contributor

Same problem here, a bunch of severe exceptions when running mvn versions:display-dependency-updates gcloud authentication issues (so I'll keep using 1.7)

@gkatzioura
Copy link
Owner

gkatzioura commented Sep 4, 2019

Do you use this environmental variable?
GOOGLE_APPLICATION_CREDENTIALS=/path/to/your/service/account/key.json mvn clean deploy
Also you can go for a settings configuration

<servers> <server> <id>repo-id</id> <configuration> <keyPath>/path/to/your/service/account/key.json</keyPath> </configuration> </server> </servers>
(Settings is on the latest version)

@celandro
Copy link

I am having the exact same issue with the latest google tools. I have tried authenticating with gcloud auth and also with gcloud auth application-default as am ad,om iser. I have also tried creating a service token with Storage Object Create and another service token with Storage Object Admin. None of them worked on versions 1.8, 2.2 or, 2.3

I just get this error

Oct 20, 2019 8:23:22 PM com.gkatzioura.maven.cloud.gcs.wagon.GoogleStorageRepository connect
SEVERE: Could not establish connection with google cloud
java.lang.NullPointerException
at com.gkatzioura.maven.cloud.gcs.wagon.GoogleStorageRepository.createStorage(GoogleStorageRepository.java:74)
at com.gkatzioura.maven.cloud.gcs.wagon.GoogleStorageRepository.connect(GoogleStorageRepository.java:65)
at com.gkatzioura.maven.cloud.gcs.wagon.GoogleStorageWagon.connect(GoogleStorageWagon.java:139)

Version 1.7 does work though

@gkatzioura
Copy link
Owner

gkatzioura commented Oct 21, 2019

@celandro
Unfortunately I fail to reproduce it.
However I use key from a service account.
Once I create a service account with the appropriate permissions I test the key using gsutil.
If everything ok I use
<servers> <server> <id>repo-id</id> <configuration> <keyPath>/path/to/your/service/account/key.json</keyPath> </configuration> </server> </servers>

@prakashayappan
Copy link

prakashayappan commented Nov 10, 2019

Its working with GCP Service Account JSON based auth.

Key path base is from pom.xml location. And NOT from settings.xml
Also make sure, Service Account has appropriate rights.

However, request to update the plugin with gcloud based credentials.

@gkatzioura @celandro @porfirioribeiro

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

No branches or pull requests

5 participants