Cloud Build Artifacts Maven Wagon

A Maven wagon used to connect to Cloud Build Artifacts Maven repositories.

License

License

Categories

Categories

Maven Build Tools
GroupId

GroupId

com.google.cloud.buildartifacts
ArtifactId

ArtifactId

buildartifacts-maven-wagon
Last Version

Last Version

1.2.1
Release Date

Release Date

Type

Type

jar
Description

Description

Cloud Build Artifacts Maven Wagon
A Maven wagon used to connect to Cloud Build Artifacts Maven repositories.
Project URL

Project URL

https://github.com/GoogleCloudPlatform/build-artifacts-maven-tools
Source Code Management

Source Code Management

https://github.com/GoogleCloudPlatform/build-artifacts-maven-tools

Download buildartifacts-maven-wagon

How to add to project

<!-- https://jarcasting.com/artifacts/com.google.cloud.buildartifacts/buildartifacts-maven-wagon/ -->
<dependency>
    <groupId>com.google.cloud.buildartifacts</groupId>
    <artifactId>buildartifacts-maven-wagon</artifactId>
    <version>1.2.1</version>
</dependency>
// https://jarcasting.com/artifacts/com.google.cloud.buildartifacts/buildartifacts-maven-wagon/
implementation 'com.google.cloud.buildartifacts:buildartifacts-maven-wagon:1.2.1'
// https://jarcasting.com/artifacts/com.google.cloud.buildartifacts/buildartifacts-maven-wagon/
implementation ("com.google.cloud.buildartifacts:buildartifacts-maven-wagon:1.2.1")
'com.google.cloud.buildartifacts:buildartifacts-maven-wagon:jar:1.2.1'
<dependency org="com.google.cloud.buildartifacts" name="buildartifacts-maven-wagon" rev="1.2.1">
  <artifact name="buildartifacts-maven-wagon" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.google.cloud.buildartifacts', module='buildartifacts-maven-wagon', version='1.2.1')
)
libraryDependencies += "com.google.cloud.buildartifacts" % "buildartifacts-maven-wagon" % "1.2.1"
[com.google.cloud.buildartifacts/buildartifacts-maven-wagon "1.2.1"]

Dependencies

compile (5)

Group / Artifact Type Version
com.google.cloud.buildartifacts : buildartifacts-auth-common jar 1.2.1
org.apache.maven.wagon : wagon-http-shared jar 3.3.3
org.apache.maven : maven-plugin-api jar 3.6.1
com.google.http-client : google-http-client jar 1.30.2
com.google.auth : google-auth-library-oauth2-http jar 0.16.2

Project Modules

There are no modules declared in this project.

Artifact Registry Maven Tools

This repository contains tools to help with interacting with Maven repositories hosted on Artifact Registry.

Authentication

Requests to Artifact Registry will be authenticated using credentials from the environment. The tools described below search the environment for credentials in the following order:

  1. Google Application Default Credentials.
    • Note: It is possible to set Application Default Credentials for a user account via gcloud auth login --update-adc or gcloud auth application-default login
  2. From the gcloud SDK. (i.e., the access token printed via gcloud config config-helper --format='value(credential.access_token)')
    • Hint: You can see which account is active with the command gcloud config config-helper --format='value(configuration.properties.core.account)'

Maven Setup

The Artifact Registry Wagon is an implementation of the Maven Wagon API which allows you to configure Maven to interact with repositories stored in Artifact Registry.

To enable the wagon, add the following configuration to the pom.xml in your project root:

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

You can then configure repositories by using the "artifactregistry://" prefix. In this example the repository is in 'us-west1', you should use the correct location for your repository.

  <repositories>
    <repository>
      <id>my-repository</id>
      <url>artifactregistry://us-west1-maven.pkg.dev/PROJECT_ID/REPOSITORY_ID</url>
      <releases>
        <enabled>true</enabled>
        <updatePolicy>always</updatePolicy>
      </releases>
      <snapshots>
        <enabled>true</enabled>
      </snapshots>
    </repository>
  </repositories>

Where

  • PROJECT_ID is the ID of the project.
  • REPOSITORY_ID is the ID of the repository.

Gradle Setup

To use Artifact Registry repositories with gradle, add the following configuration to the build.gradle file in your project. In this example the repository is in 'us-west1', you should use the correct location for your repository.

plugins {
  id "com.google.cloud.artifactregistry.gradle-plugin" version "2.1.0"
}

repositories {
    maven {
      url 'artifactregistry://us-west1-maven.pkg.dev/PROJECT_ID/REPOSITORY_ID'
    }
}

publishing {
    repositories {
        maven {
          url 'artifactregistry://us-west1-maven.pkg.dev/PROJECT_ID/REPOSITORY_ID'
        }
    }
}

Where

  • PROJECT_ID is the ID of the project.
  • REPOSITORY_ID is the ID of the repository.

Alternatives

If you need to use Artifact Registry repositories inside your init.gradle or settings.gradle, the plugin can also be used inside init.gradle or settings.gradle files.

  • To use plugin inside init.gradle file:
initscript {
  repositories {
    maven {
      url "https://plugins.gradle.org/m2/"
    }
  }
  dependencies {
    classpath "gradle.plugin.com.google.cloud.artifactregistry:artifactregistry-gradle-plugin:2.1.0"
  }
}

apply plugin: com.google.cloud.artifactregistry.gradle.plugin.ArtifactRegistryGradlePlugin
  • To use plugin inside settings.gradle file:
buildscript {
  repositories {
    maven {
      url "https://plugins.gradle.org/m2/"
    }
  }
  dependencies {
    classpath "gradle.plugin.com.google.cloud.artifactregistry:artifactregistry-gradle-plugin:2.1.0"
  }
}

apply plugin: "com.google.cloud.artifactregistry.gradle-plugin"
com.google.cloud.buildartifacts

Google Cloud Platform

Versions

Version
1.2.1
1.2.0
1.1.3
1.1.2
1.1.1
1.1.0
1.0.0