Gradle在sha1文件上将RPM发布到Nexus Yum Repo失败

时间:2019-02-04 17:56:53

标签: maven gradle rpm maven-publish

我正在尝试通过Gradle将我们项目中的RPM工件发布到Nexus上的Yum Repo中:

publishing {
    repositories {
        ivy {
            url 'http://myrepo:8081/repository/myproject'
            credentials {
                username "aaa"
                password "xxx"
            }
            layout "pattern", {
                artifact "${buildRpm.outputs.getFiles().getSingleFile().getName()}"
            }
        }

        publications {
            rpm(IvyPublication) {
                artifact buildRpm.outputs.getFiles().getSingleFile()
            }
        }
    }
}

当我运行./gradlew publish时,将开始执行此任务,并开始上传90MB的主要.rpm工件。然后失败,并显示以下错误:

> Task :search:publishRpmPublicationToIvyRepository FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':search:publishRpmPublicationToIvyRepository'.
> Failed to publish publication 'rpm' to repository 'ivy'
   > Could not write to resource 'http://myrepo/repository/myproject/myproject-1.23.4.noarch.rpm.sha1'.
      > Could not PUT 'http://myrepo/repository/myproject/myproject-1.23.4.noarch.rpm.sha1'. Received status code 400 from server: Invalid path for a Yum repository

如何防止.sha1文件上传?我只想上传RPM(显然这是此仓库中唯一允许的内容)。

我也尝试使用maven-publish代替ivy-publish,但是两者都给出类似的问题。 maven-publish尝试上传类似错误的.pom。

我可以使用curl手动上传RPM,但是我更愿意使用Gradle插件和标准来完成。

0 个答案:

没有答案