简体   繁体   English

没有使用 jenkins gradle artifactory 插件部署的工件

[英]No artifacts deployed with jenkins gradle artifactory plugin

I try to use jenkins pipeline to upload gradle artifacts to the maven repository.我尝试使用 jenkins 管道将 gradle 工件上传到 maven 存储库。 I have followed Working With Pipeline Jobs in Jenkins我关注了在 Jenkins 中使用流水线作业

As mentioned in the referenced document, the rtGradle.run shall deploy build artifacts to the artifactory.如参考文档中所述, rtGradle.run应将构建工件部署到工件。 However, no build artifacts are deployed in my case.但是,在我的案例中没有部署任何构建工件。

I have checked the content of buildInfo.getDeployableArtifacts and figured out that it is empty.我检查了buildInfo.getDeployableArtifacts的内容,发现它是空的。

Following some hints, I have put the following code to my build.gradle :根据一些提示,我将以下代码放入我的build.gradle

apply plugin: 'maven-publish'

    publishing {
        publications {
            mavenJava(MavenPublication) {
                artifact file("bmo-interface-common/build/libs/bmo-interface-common-${version}.jar")
            }
        }
    }

However, the previous doesn't help and still no artifact is deployed.但是,以前的没有帮助,仍然没有部署工件。

Where is the problem?问题出在哪里? What do I miss?我想念什么?

Thanks for any input.感谢您提供任何意见。

EDIT编辑

I have forget to add server setting for the gradle deployer.我忘记为 gradle 部署程序添加服务器设置。 With this setting the deployment was successful.使用此设置,部署成功。

“我忘记为 gradle 部署器添加服务器设置。使用此设置部署成功”请将此添加为答案并将其作为正确答案。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM