Build with dependency in gcp artifact registry

2.5k Views Asked by At

Building an application with a dependency to google cloud platform artifact registry results in an error:

Cannot access artifactregistry://us-central1-maven.pkg.dev/project/repository with type default using the available connector factories: BasicRepositoryConnectorFactory: Cannot access artifactregistry://us-central1-maven.pkg.dev/project/repository using the registered transporter factories: WagonTransporterFactory: java.util.NoSuchElementException
1

There are 1 best solutions below

1
On BEST ANSWER

You need to add com.google.cloud.artifactregistry maven extension to your pom.xml (not covered in the documentation), it is not enough with repositories, distributionmanagement and dependency.

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