当运行jenkins管道并使用artifactoryPublish运行gradle时,它会给我这个错误消息和stacktrace。我使用以下配置:
1 jenkins管道工作(版本2.19 jenkins和artifactory插件2.7.2) 2脚本:
我们执行以下操作:在管道中(jenkinsfile)
def server = Artifactory.server('artifactory')
def artifactoryGradle = Artifactory.newGradleBuild()
artifactoryGradle.tool = "Gradle 3.1" // Tool name from Jenkins configuration
artifactoryGradle.deployer repo:'efpi-core', server: server
artifactoryGradle.resolver repo:'remote-repos', server: server
artifactoryGradle.deployer.usesPlugin = true // Artifactory plugin already defined in build script
def buildInfo = artifactoryGradle.run rootDir: "efpi-core/", buildFile: 'build.gradle', tasks: 'clean artifactoryPublish'
server.publishBuildInfo buildInfo
buildscript { 存储库{ jcenter() } 依赖{ classpath" org.jfrog.buildinfo:build-info-extractor-gradle:4.4.5" 类路径文件(bndURI,bndRepoURI) }
}
apply plugin: "com.jfrog.artifactory"
[Pipeline] getArtifactoryServer [Pipeline] newGradleBuild [Pipeline] ArtifactoryGradleBuild [efpi-core] $ /var/jenkins_home/tools/hudson.plugins.gradle.GradleInstallation/Gradle_3.1/bin/gradle clean artifactoryPublish -b build.gradle错误:无法执行 gradle任务。 [Pipeline]} [Pipeline] // node [Pipeline] End of 管道
hudson.model.Run $ RunnerAbortedException at org.jfrog.hudson.pipeline.steps.ArtifactoryGradleBuild $ Execution.exe(ArtifactoryGradleBuild.java:192) 在 org.jfrog.hudson.pipeline.steps.ArtifactoryGradleBuild $ Execution.run(ArtifactoryGradleBuild.java:124) 在 org.jfrog.hudson.pipeline.steps.ArtifactoryGradleBuild $ Execution.run(ArtifactoryGradleBuild.java:95) 在 org.jenkinsci.plugins.workflow.steps.AbstractSynchronousStepExecution.start(AbstractSynchronousStepExecution.java:40) 在org.jenkinsci.plugins.workflow.cps.DSL.invokeStep(DSL.java:184) 在org.jenkinsci.plugins.workflow.cps.DSL.invokeMethod(DSL.java:126) 在 org.jenkinsci.plugins.workflow.cps.CpsScript.invokeMethod(CpsScript.java:120) 在 org.jfrog.hudson.pipeline.types.GradleBuild.run(GradleBuild.java:66) 在org.jfrog.hudson.pipeline.types.GradleBuild $ run $ 1.call(未知 来源)at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48) 在 org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113) 在org.kohsuke.groovy.sandbox.impl.Checker $ 1.call(Checker.java:151) 在 org.kohsuke.groovy.sandbox.GroovyInterceptor.onMethodCall(GroovyInterceptor.java:21) 在 org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor.onMethodCall(SandboxInterceptor.java:115) 在org.kohsuke.groovy.sandbox.impl.Checker $ 1.call(Checker.java:149) 在 org.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.java:146) 在 com.cloudbees.groovy.cps.sandbox.SandboxInvoker.methodCall(SandboxInvoker.java:16) 在WorkflowScript.run(WorkflowScript:14)at com.cloudbees.groovy.cps.impl.ContinuationGroup.methodCall上的 cps.transform (原生方法)(ContinuationGroup.java:48) 在 com.cloudbees.groovy.cps.impl.FunctionCallBlock $ ContinuationImpl.dispatchOrArg(FunctionCallBlock.java:109) 在 com.cloudbees.groovy.cps.impl.FunctionCallBlock $ ContinuationImpl.fixArg(FunctionCallBlock.java:82) 在sun.reflect.GeneratedMethodAccessor186.invoke(未知来源)at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 在java.lang.reflect.Method.invoke(Method.java:498)at com.cloudbees.groovy.cps.impl.ContinuationPtr $ ContinuationImpl.receive(ContinuationPtr.java:72) 在 com.cloudbees.groovy.cps.impl.CollectionLiteralBlock $ ContinuationImpl.dispatch(CollectionLiteralBlock.java:55) 在 com.cloudbees.groovy.cps.impl.CollectionLiteralBlock $ ContinuationImpl.item(CollectionLiteralBlock.java:45) 在sun.reflect.GeneratedMethodAccessor263.invoke(未知来源)at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 在java.lang.reflect.Method.invoke(Method.java:498)at com.cloudbees.groovy.cps.impl.ContinuationPtr $ ContinuationImpl.receive(ContinuationPtr.java:72) 在 com.cloudbees.groovy.cps.impl.ConstantBlock.eval(ConstantBlock.java:21) 在com.cloudbees.groovy.cps.Next.step(Next.java:58)at com.cloudbees.groovy.cps.Continuable.run0(Continuable.java:154)at at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.access $ 001(SandboxContinuable.java:18) 在 org.jenkinsci.plugins.workflow.cps.SandboxContinuable $ 1.call(SandboxContinuable.java:33) 在 org.jenkinsci.plugins.workflow.cps.SandboxContinuable $ 1.call(SandboxContinuable.java:30) 在 org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.GroovySandbox.runInSandbox(GroovySandbox.java:108) 在 org.jenkinsci.plugins.workflow.cps.SandboxContinuable.run0(SandboxContinuable.java:30) 在 org.jenkinsci.plugins.workflow.cps.CpsThread.runNextChunk(CpsThread.java:164) 在 org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.run(CpsThreadGroup.java:324) 在 org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.access $ 100(CpsThreadGroup.java:78) 在 org.jenkinsci.plugins.workflow.cps.CpsThreadGroup $ 2.call(CpsThreadGroup.java:236) 在 org.jenkinsci.plugins.workflow.cps.CpsThreadGroup $ 2.call(CpsThreadGroup.java:224) 在 org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService $ 2.call(CpsVmExecutorService.java:47) 在java.util.concurrent.FutureTask.run(FutureTask.java:266)at hudson.remoting.SingleLaneExecutorService $ 1.run(SingleLaneExecutorService.java:112) 在 jenkins.util.ContextResettingExecutorService $ 1.run(ContextResettingExecutorService.java:28) 在 java.util.concurrent.Executors $ RunnableAdapter.call(Executors.java:511) 在java.util.concurrent.FutureTask.run(FutureTask.java:266)at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) 在 java.util.concurrent.ThreadPoolExecutor中的$ Worker.run(ThreadPoolExecutor.java:617) 在java.lang.Thread.run(Thread.java:745)完成:失败