Karaf maven plugin fails to read from GCP Artifact registry

slm
Bronze 1
Bronze 1

The Karaf maven plugin doesn't doesn't recognize the "artifactregistry" protocol preventing any Karaf-based projects from using GCP Artifact Registry.

Details are here:  https://issues.apache.org/jira/browse/KARAF-7516

 

0 9 598
9 REPLIES 9

The Apache issue claims it is following the Configure Maven documentation, but it shows a different version.

Please try using version 2.2.0 as shown in the Google Cloud documentation, as follows:

<build>
<extensions>
<extension>
<groupId>com.google.cloud.artifactregistry</groupId>
<artifactId>artifactregistry-maven-wagon</artifactId>
<version>2.2.0</version>
</extension>
</extensions>
</build>

slm
Bronze 1
Bronze 1
I tried 2.2.0, but I'm still seeing the same failure.

Here is my extension setting:


com.google.cloud.artifactregistry
artifactregistry-maven-wagon
2.2.0

Hi, slm,

To work around this problem, we have found 2 possible solutions:
- Grant the Role "Artifact Registry Reader" to the Service Account related to the Karaf Maven plug-in.
- Use a dedicated Service Account to read from the Artifact Registry and add the credentials in the Artifact Registry URL.

Please tell me if it solved your issue, I will be waiting for your response.

Your suggestion did not have an effect unfortunately.

My account already had the Artifact Registry Repository Administrator
role. I added the Artifact Registry Reader role as suggested.

I'm still getting:

*java.net.MalformedURLException*: *unknown protocol: artifactregistry*

Is the account with the Artifact Registry Repository Administrator
role, the same for the plug in?

Yes it is

Hi, slm,

Could you try changing the URL of your repository?

This documentation shows a sample:
`artifactregistry://region-maven.pkg.dev/PROJECTID/REPOID`

The URLs shown in here don’t seem to have a PROJECTID (or something like REDACTED_PROJECTID).

I am guessing java-repo is the REPOID, not the PROJECTID.
`artifactregistry://us-central1-maven.pkg.dev/java-repo/snapshots`

slm
Bronze 1
Bronze 1

The URL we are using was obtained from the gcloud command found in Artifact Registry -> selecting my registry -> Setup Instructions.  Found therein is a "gcloud artifacts print-settings mvn ..." command that displays the URL to be used.  I believe it is correct with the projectid first, then the repoid.

I think someone on your team needs to debug the artifactregistry-maven-wagon extension to get to the bottom of this issue.

Hi, slm,

For further research, your project would need to be inspected by support.

This can be done over a support case.

If not, I suggest you create Public Issue Tracker.