当我尝试推送或下载 ny gradle plugin的 SNAPSHOT 版本时,我遇到了 Github 包注册表问题。当我第一次发送发布我的包时,一切正常,但是当我尝试安装或更新这个包时,我收到以下错误:
使用固定版本(没有快照)似乎有效(即使更新不起作用,但这可能是故意的,因为它是 422 错误)。
如果有帮助,这是我的 build.gradle.kts 文件。
group = "com.github.imflog"
version = "0.10.0-SNAPSHOT"
plugins {
kotlin("jvm").version("1.3.71")
id("java-gradle-plugin")
id("com.gradle.plugin-publish") version "0.11.0"
id("maven-publish")
id("com.github.ben-manes.versions") version "0.28.0"
}
repositories {
jcenter()
mavenCentral()
maven("http://packages.confluent.io/maven/")
}
java {
withSourcesJar()
}
// Dependencies versions
val confluentVersion = "5.4.1"
val avroVersion = "1.8.2"
dependencies {
implementation(gradleApi())
implementation(kotlin("stdlib"))
implementation("io.confluent", "kafka-schema-registry", confluentVersion) {
exclude("org.slf4j", "slf4j-log4j12")
}
}
// Test versions
val junitVersion = "5.6.1"
val mockkVersion = "1.9.3"
val wiremockVersion = "2.26.3"
val assertJVersion = "3.15.0"
dependencies {
testImplementation(gradleTestKit())
testImplementation("org.junit.jupiter", "junit-jupiter-api", junitVersion)
testImplementation("org.junit.jupiter", "junit-jupiter-engine", junitVersion)
testImplementation("org.assertj", "assertj-core", assertJVersion)
testImplementation("io.mockk", "mockk", mockkVersion)
testImplementation("com.github.tomakehurst", "wiremock-jre8", wiremockVersion)
}
tasks.withType<Test> {
useJUnitPlatform()
}
publishing {
repositories {
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/ImFlog/schema-registry-plugin")
credentials {
username = System.getenv("GITHUB_USERNAME")
password = System.getenv("GITHUB_TOKEN")
}
}
}
}
val registryPluginName = "com.github.imflog.kafka-schema-registry-gradle-plugin"
gradlePlugin {
plugins {
create("schema-registry") {
id = registryPluginName
description = "A plugin to download, register and test schemas from a Kafka Schema Registry"
displayName = "Kafka schema registry gradle plugin"
version = version
implementationClass = "com.github.imflog.schema.registry.SchemaRegistryPlugin"
}
}
}
pluginBundle {
website = "https://github.com/ImFlog/schema-registry-plugin"
vcsUrl = "https://github.com/ImFlog/schema-registry-plugin.git"
tags = listOf("schema", "registry", "schema-registry", "kafka")
}
谢谢 !