Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Maven Central Version

Google Artifact Registry support for sbt and/or coursier

Adds handler for artifactregistry:// protocol to sbt and/or coursier.
Inspired by abdolence/sbt-gcs-resolver and 987Nabil/gar-coursier.

Supports artifactregistry only.
Splitted into modules that can also be used without sbt and/or only with coursier by adding a custom protocol handler.
Adds support for missing maven-metadata.xml.

Usage

To use the sbt plugin add to project/plugins.sbt:

lazy val garHandlerVersion = "0.1.4"

addSbtPlugin("dev.rolang" % "sbt-gar-handler" % garHandlerVersion)

// this is optional, add it if you have artifactregistry:// resolvers for build dependencies
csrConfiguration := csrConfiguration.value.withProtocolHandlerDependencies(
  Seq("dev.rolang" % "gar-coursier_2.13" % garHandlerVersion)
)

For publish settings in build.sbt use:

publishTo := Some(
  dev.rolang.sbt.gar.ArtifactRegistryIvyResolver.create(
    "My Registry", "https://${LOCATION}-maven.pkg.dev/${GCP_PROJECT}/maven"
  )
)

The plugin is automatically enabled for all projects and will install a global artifactregistry:// handler as well as adding the protocol handler to coursier.

To use with coursier only use the dev.rolang:gar-coursier_2.13 package.
Example usage via the coursier JVM CLI (ensure default google credentials are set up):

cs launch coursier:2.1.24 dev.rolang:gar-coursier_2.13:0.1.3 -- \
    resolve \
    -r '!artifactregistry://LOCATION-maven.pkg.dev/PROJECT/REPOSITORY' -r central \
    org:name:ver

Development

Run test

Ensure default google credentials are set up. Run:

// GetVersions test args: 1. maven root, 2. organization, 3. module name
sbt '++2.13; coursier/Test/runMain GetVersions asia-maven.pkg.dev/my-project/maven com.example my-package_2.13'

Publish local:

sbt '+publishLocal'

About

Google Artifact Registry support for sbt and/or coursier

Topics

Resources

Stars

Watchers

Forks

Releases

Used by

Contributors

Languages