Jenkins Artifactory Plugin with Tycho building

问题描述

我正在尝试在 Jenkins 中创建一个作业,该作业使用 Maven/Tycho 构建一个 jar 文件并将该 jar 发布到 Artifactory 中的 Maven 本地存储库。这是我的 Jenkinsfile:

node {
    def server
    def rtMaven
    def buildInfo
    stage("Prepare ...") {
        checkout([
            $class: 'GitSCM',branches: [[name: '*/master']],extensions: [
                [$class: 'RelativeTargetDirectory',relativeTargetDir: '.']
            ],userRemoteConfigs: [
                [url: 'http://bitbucket:7990/scm/acme/acme-releng.git']
            ]
        ])
        checkout([
            $class: 'GitSCM',relativeTargetDir: 'acme']
            ],userRemoteConfigs: [
                [url: 'http://bitbucket:7990/scm/acme/acme.git']
            ]
        ])
    }
    stage("Configure ...") {
        server = rtServer (
            id: 'acn-artifactory-server',url: 'http://192.168.178.26:8082/artifactory',username: 'admin',password: 'password',timeout: 300
        )
        rtMaven = Artifactory.newMavenBuild();


        rtMaven.resolver server: server,releaseRepo: 'acn-libs-release',snapshotRepo: 'acn-libs-snapshot'
        rtMaven.deployer server: server,releaseRepo: 'acn-libs-release-local',snapshotRepo: 'acn-libs-snapshot-local'

        rtMaven.deployer.artifactDeploymentPatterns.addExclude('acme/acme/.polyglot.build.properties')

        rtMaven.deployer.threads = 3      
        rtMaven.deployer.deployArtifacts = true  
    }

    stage ('Build ...') {
        buildInfo = rtMavenRun (
            tool: 'Maven 3.6.3',pom: './pom.xml',goals: 'clean install')
        
    }
}

jar 已构建,但最后出现以下错误

java.lang.IllegalArgumentException: File not found: /var/jenkins_home/workspace/acme/acme/.polyglot.build.properties
    at org.jfrog.build.extractor.clientConfiguration.deploy.DeployDetails$Builder.build(DeployDetails.java:142)
    at org.jfrog.hudson.pipeline.common.types.buildInfo.BuildInfo$DeployPathsAndPropsCallable.lambda$invoke$0(BuildInfo.java:378)
    at java.util.LinkedHashMap.forEach(LinkedHashMap.java:684)
    at org.jfrog.hudson.pipeline.common.types.buildInfo.BuildInfo$DeployPathsAndPropsCallable.invoke(BuildInfo.java:368)
    at org.jfrog.hudson.pipeline.common.types.buildInfo.BuildInfo$DeployPathsAndPropsCallable.invoke(BuildInfo.java:344)
    at hudson.FilePath.act(FilePath.java:1164)
    at hudson.FilePath.act(FilePath.java:1147)
    at org.jfrog.hudson.pipeline.common.types.buildInfo.BuildInfo.getAndAppendDeployableArtifactsByModule(BuildInfo.java:210)
    at org.jfrog.hudson.pipeline.common.executors.MavenExecutor.execute(MavenExecutor.java:83)
    at org.jfrog.hudson.pipeline.declarative.steps.maven.MavenStep$Execution.runStep(MavenStep.java:95)
    at org.jfrog.hudson.pipeline.declarative.steps.maven.MavenStep$Execution.runStep(MavenStep.java:80)
    at org.jfrog.hudson.pipeline.ArtifactorySynchronousNonBlockingStepExecution.run(ArtifactorySynchronousNonBlockingStepExecution.java:54)
    at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)
Finished: FAILURE

我无法让 Artifactory 插件忽略丢失的文件。事实上,我真的很困惑,我不知道我是否理解了什么,因为我没有得到预期的结果。例如,如果我更改 Artifactory 服务器的 IP,我希望构建会立即失败,但事实并非如此。它还说部署和发布构建信息已禁用。

[main] INFO org.jfrog.build.extractor.maven.BuildDeploymentHelper - Artifactory Build Info Recorder: deploy artifacts set to false,artifacts will not be deployed...
[main] INFO org.jfrog.build.extractor.maven.BuildDeploymentHelper - Artifactory Build Info Recorder: publish build info set to false,build info will not be published...

有什么想法吗?

非常感谢

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)