首页 > 解决方案 > 在远程(nexus)中找不到元数据 maven-metadata.xml

问题描述

我在我的项目中使用 spring-contract 作为合同测试。我想将合同存根发布到 nexus 服务器。但是当我执行发布命令时。发生错误。

build.gradle文件

buildscript {
    project.ext {
        bootVersion = '2.0.4.RELEASE'
        nexusUsername = project.hasProperty('nexusUsername') ? project.getProperty('nexusUsername') : ''
        nexusPassword = project.hasProperty('nexusPassword') ? project.getProperty('nexusPassword') : ''
        nexusUrl = project.hasProperty('nexusUrl') ? project.getProperty('nexusUrl') : ''
    }
}
apply plugin: 'maven-publish'
publishing {
    repositories {
        maven {
            url nexusUrl
            credentials {
                username = nexusUsername
                password = nexusPassword
            }
        }
    }
}
......

当我执行下面的发布命令时

./gradlew publish -P nexusUsername=xxx -P nexusPassword=xxx -P nexusUrl=nexus-domain:8081/repository/maven-snapshots/

然后发生错误

Could not find metadata xxx:backend:0.0.1-SNAPSHOT/maven-metadata.xml in remote (xxx:8081/repository/maven-snapshots/)
Upload xxx:8081/repository/maven-snapshots/xxx/backend/0.0.1-SNAPSHOT/backend-0.0.1-20200409.083111-1.pom

但是在nexus服务器中有一个xx:backend:0.0.1-SNAPSHOT/maven-metadata.xml远程xxx:8081/repository/maven-snapshots/。(它以前工作过,但现在不工作了。)所以我现在很困惑......你有什么建议吗?请。

]([![

标签: maven-pluginnexuscontract

解决方案


推荐阅读