Публикация в Nexus с использованием Gradle publi sh - Не удалось получить удаленные метаданные - PullRequest
0 голосов
/ 06 апреля 2020

Когда вы выполняете сборку из teamcity, репо публикуется в журналах, но в журналах отображается ошибка, приведенная ниже, и, следовательно, Teamcity показывает исключение, даже если репо было опубликовано. Что может быть не так?

[15:42:08]Picked up JAVA_TOOL_OPTIONS: -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap
[15:42:21]Could not transfer metadata com.abc.def:abc-project-java:0.47-SNAPSHOT/maven-metadata.xml from/to remote (https://nexus-write.abc.something.com/nexus/content/repositories/deploy-shared-013-snapshot): Could not get resource 'com/abc/def/abc-project-java/0.47-SNAPSHOT/maven-metadata.xml'
[15:42:21]
[15:42:21]Process exited with code 1
[15:42:21]Gradle failure report
[15:42:21][Gradle failure report] FAILURE: Build failed with an exception.
[15:42:21][Gradle failure report] 
[15:42:21][Gradle failure report] * What went wrong:
[15:42:21][Gradle failure report] Execution failed for task ':abc-project-java:publishMavenJavaPublicationToPublishNexusRepository'.
[15:42:21][Gradle failure report] > Failed to publish publication 'mavenJava' to repository 'PublishNexus'
[15:42:21][Gradle failure report]    > Failed to retrieve remote metadata com.abc.def:abc-project-java:0.47-SNAPSHOT/maven-metadata.xml: Could not transfer metadata com.abc.def:ems-client-java:0.47-SNAPSHOT/maven-metadata.xml from/to remote (https://nexus-write.abc.something.com/nexus/content/repositories/deploy-shared-013-snapshot): Could not get resource 'com/abc/def/abc-project-java/0.47-SNAPSHOT/maven-metadata.xml'
[15:42:21][Gradle failure report] 
[15:42:21][Gradle failure report] * Try:
[15:42:21][Gradle failure report] Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
[15:42:21][Gradle failure report] 
[15:42:21][Gradle failure report] * Get more help at https://help.gradle.org
[15:42:21][Gradle failure report] 
[15:42:21][Gradle failure report] BUILD FAILED in 12s 

build.gradle файл здесь. Обратите внимание, что я использовал плагин maven-publi sh, и я также использую обертку gradle в своем проекте. T C добавляет новую версию к снимку на основе счетчика сборки. : -

apply plugin: "java"
apply plugin: "application"
apply plugin: "maven"
apply plugin: "maven-publish"

dependencies {

    implementation ("org.apache.httpcomponents:httpclient:$httpclient_version")
    implementation ("javax.ws.rs:javax.ws.rs-api:$javaxws_version")
    implementation ("org.springframework.boot:spring-boot-starter:$spring_boot_version")
    implementation ("javax.validation:validation-api:$validation_version")
    implementation ("org.apache.commons:commons-lang3:$commons_lang3_version")
    implementation ("org.glassfish.jersey.core:jersey-client:$jersey_version")
    implementation ("org.glassfish.jersey.media:jersey-media-json-jackson:$jersey_version")
    implementation ("com.fasterxml.jackson.core:jackson-core:$jackson_version")
    implementation ("com.fasterxml.jackson.core:jackson-databind:$jackson_version")
    testImplementation "org.springframework.boot:spring-boot-starter-test:$spring_boot_version"
}

description("abc-project-java")

jacocoTestCoverageVerification{
    violationRules{
        rule{
            limit{
                minimum = 0.0
            }
        }
    }
}

ext {
    javaMainClass = "com.abc.def.client.ClientClass"
}

application {
    mainClassName = "com.abc.def.client.ClientClass"
}

publishing {
    publications {
        mavenJava(MavenPublication) {
               from components.java
         }
    }
    repositories {
        maven {
            credentials {
                username = "$nexusUser"
                password = "$nexusPass"
            }
            url = "https://nexus-write.abc.something.com/nexus/content/repositories/deploy-shared-013-snapshot"
        }
    }
}
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...