google cloud artifact registry maven发布失败

yjghlzjz  于 2021-07-03  发布在  Java
关注(0)|答案(0)|浏览(282)

我知道maven artifacts for gcp artifact registry在alpha中,但我仍然有这个问题,希望有人能帮我解决。
我已经为maven创建了一个存储库。我有一个具有访问权限的服务用户(artifact registry reader和artifact registry writer)。我已经下载了凭证文件,并且我有指向它的google应用程序凭证。
我知道凭证文件是好的,因为如果我弄乱了它,它会告诉我缺少字段等。
但是当我做一个简单的 ./gradlew clean 我明白了:

FAILURE: Build failed with an exception.

* What went wrong:

A problem occurred configuring project ':plugin'.
> Failed to notify project evaluation listener.
   > 'org.gradle.api.credentials.Credentials org.gradle.api.internal.artifacts.repositories.DefaultMavenArtifactRepository.getConfiguredCredentials()'

有人知道可能出了什么问题吗?
编辑:添加 build.gradle.kts 供参考:

import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
    id("org.jetbrains.kotlin.jvm") version "1.4.20"
    `java-gradle-plugin`
    `maven-publish`
    id("com.google.cloud.artifactregistry.gradle-plugin") version "2.1.0"
}

repositories {
    maven {
        url = uri("artifactregistry://us-west1-maven.pkg.dev/glitchy-maven/repo")
    }
    mavenCentral()
}

tasks.withType<KotlinCompile>().configureEach {
    kotlinOptions {
        jvmTarget = JavaVersion.VERSION_15.toString()
    }
}

dependencies {
    // Align versions of all Kotlin components
    implementation(platform("org.jetbrains.kotlin:kotlin-bom"))
    // Use the Kotlin JDK 8 standard library.
    implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
    // Use the Kotlin test library.
    testImplementation("org.jetbrains.kotlin:kotlin-test")
    // Use the Kotlin JUnit integration.
    testImplementation("org.jetbrains.kotlin:kotlin-test-junit")
}

group = "com.glitchybyte.gradle.plugin"
version = "1.0.0"

gradlePlugin {
    plugins {
        create("buildinfoplugin") {
            id = "com.glitchybyte.gradle.plugin.buildinfoplugin"
            implementationClass = "com.glitchybyte.gradle.plugin.buildinfoplugin.BuildInfoPlugin"
        }
    }
}

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题