Slackbot
08/22/2023, 6:39 PMJoseph Ottinger
08/22/2023, 6:45 PMbuildscript block set to use the gradlePluginPortal and adds the artifactregistry to the classpath, then I apply the plugin, but in dependencyResolutionManagement, I get an exception saying the protocol is invalid.Chris Lee
08/22/2023, 6:45 PMJoseph Ottinger
08/22/2023, 6:49 PMsettings.gradle.kts, slightly munged:
pluginManagement {
repositories {
mavenLocal()
mavenCentral()
gradlePluginPortal()
maven {
setUrl("<https://place.jfrog.io/artifactory/libs-release-local>")
credentials {
username = System.getenv("ARTIFACTORY_USER")
password = System.getenv("ARTIFACTORY_PASSWORD")
}
}
}
}
buildscript {
repositories {
gradlePluginPortal()
}
dependencies {
classpath("gradle.plugin.com.google.cloud.artifactregistry:artifactregistry-gradle-plugin:2.2.1")
}
}
apply {
plugin("com.google.cloud.artifactregistry.gradle-plugin")
}
dependencyResolutionManagement {
repositories {
mavenCentral()
maven {
url = uri("<artifactregistry://us-east4-maven.pkg.dev/shared-place/mvn-repo-shared>")
if (System.getenv("GCP_KEY") != null) {
credentials {
username = "_json_key"
password = System.getenv("GCP_KEY")
}
}
}
maven {
setUrl("<https://place.jfrog.io/artifactory/libs-release-local>")
credentials {
username = System.getenv("ARTIFACTORY_USER")
password = System.getenv("ARTIFACTORY_PASSWORD")
}
}
maven("<https://packages.confluent.io/maven>")
mavenLocal()
}
versionCatalogs {
create("libs") {
from("com.place:place-bom:0.0.1")
}
}
}
rootProject.name = "thing-service"
include("thing-streams-app")
include("thing-service-api")Joseph Ottinger
08/22/2023, 6:50 PMCould not resolve all dependencies for configuration 'incomingCatalogForLibs0'.
> Not a supported repository protocol 'artifactregistry': valid protocols are [http, https, file, gcs, s3, sftp]Joseph Ottinger
08/22/2023, 6:54 PMbuild.gradle.kts but we're building a version catalog as well, so ... settingsChris Lee
08/22/2023, 6:55 PMJoseph Ottinger
08/22/2023, 6:56 PMChris Lee
08/22/2023, 6:57 PMJoseph Ottinger
08/22/2023, 6:57 PMversionCatalogs {
create("libs") {
from("com.place:place-bom:0.0.1")
}
}
^^^ consumptionChris Lee
08/22/2023, 6:58 PMJoseph Ottinger
08/22/2023, 6:58 PMJoseph Ottinger
08/22/2023, 7:01 PMChris Lee
08/22/2023, 7:01 PMChris Lee
08/22/2023, 7:02 PMChris Lee
08/22/2023, 7:03 PMif (u != null && u.getScheme() != null && u.getScheme().equals("artifactregistry")) {
try {
arRepo.setUrl(new URI("https", u.getHost(), u.getPath(), u.getFragment()));
} catch (URISyntaxException e) {
throw new ProjectConfigurationException(
String.format("Invalid repository URL %s", u.toString()), e);
}
if (crd != null && shouldStoreCredentials(arRepo)) {
arRepo.setConfiguredCredentials(crd);
arRepo.authentication(authenticationContainer -> authenticationContainer
.add(new DefaultBasicAuthentication("basic")));
}
}Anze Sodja
08/22/2023, 7:04 PMChris Lee
08/22/2023, 7:04 PM<https://us-east4-maven.pkg.dev/shared-place/mvn-repo-shared>
should be equivalent.Chris Lee
08/22/2023, 7:05 PMJoseph Ottinger
08/22/2023, 7:08 PMChris Lee
08/22/2023, 7:11 PMVampire
08/22/2023, 10:30 PMpluginManagement {
repositories {
maven {
name = "supercalifragilisticexpialidocious"
url = uri("<artifactregistry://us-east4-maven.pkg.dev/shared-place/mvn-repo-shared>")
if (System.getenv("GCP_KEY") != null) {
credentials {
username = "_json_key"
password = System.getenv("GCP_KEY")
}
}
}
}
}
buildscript {
repositories {
gradlePluginPortal()
}
dependencies {
classpath("gradle.plugin.com.google.cloud.artifactregistry:artifactregistry-gradle-plugin:2.2.1")
}
}
apply(plugin = "com.google.cloud.artifactregistry.gradle-plugin")
dependencyResolutionManagement {
repositories {
gradle.settingsEvaluated {
pluginManagement
.repositories
.matching { it.name == "supercalifragilisticexpialidocious" }
.forEach {
add(it)
pluginManagement.repositories.remove(it)
}
}
}
}