我已经成功地发布到Artifact Registry,我可以在“正常”使用中使用Artifact:dependencies { implementation("mygroup:myartifact:myversion") }
。
我的问题是插件。我创建了一个插件。我可以成功地将其发布到Artifact Registry和Maven local。我可以从Maven本地使用它,但是我不能让我的构建脚本从Artifact Registry获取它。
buildscript {
repositories {
maven(url = uri("artifactregistry://us-west1-maven.pkg.dev/glitchy-maven/repo"))
}
}
plugins {
id("com.google.cloud.artifactregistry.gradle-plugin") version "2.1.1"
id("com.glitchybyte.gradle.plugin.buildinfo") version "1.0.0"
`java-library`
}
我得到:
* What went wrong:
Plugin [id: 'com.glitchybyte.gradle.plugin.buildinfo', version: '1.0.0'] was not found in any of the following sources:
- Gradle Core Plugins (plugin is not in 'org.gradle' namespace)
- Plugin Repositories (could not resolve plugin artifact 'com.glitchybyte.gradle.plugin.buildinfo:com.glitchybyte.gradle.plugin.buildinfo.gradle.plugin:1.0.0')
Searched in the following repositories:
Gradle Central Plugin Repository
因此,它不会在Artifact Registry中查找插件。我知道我错过了什么,但我不知道是什么。
更新...
我从build.gradle.kts
中删除了buildscript
,并将其添加到settings.gradle.kts
中:
pluginManagement {
plugins {
id("com.google.cloud.artifactregistry.gradle-plugin") version "2.1.1"
}
repositories {
maven(url = uri("artifactregistry://us-west1-maven.pkg.dev/glitchy-maven/repo"))
}
我得到:
* What went wrong:
Error resolving plugin [id: 'com.glitchybyte.gradle.plugin.buildinfo', version: '1.0.0']
> Could not resolve all dependencies for configuration 'detachedConfiguration1'.
> Not a supported repository protocol 'artifactregistry': valid protocols are [http, https, file, gcs, s3, sftp]
1条答案
按热度按时间nle07wnf1#
你好,很抱歉回答晚了。我认为您缺少要添加到settings.gradle.kts中的这部分配置
更多细节请参见此链接。