0

当运行 jenkins 管道并使用 artifactoryPublish 运行 gradle 时,它​​给了我这个错误消息和堆栈跟踪。我使用以下配置:

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
  1. 构建,分级:

buildscript { repositories { jcenter() } dependencies { classpath "org.jfrog.buildinfo:build-info-extractor-gradle:4.4.5" classpath files(bndURI, bndRepoURI) }

}

apply plugin: "com.jfrog.artifactory"
  1. 詹金斯的输出:

[管道] getArtifactoryServer [管道] newGradleBuild [管道] ArtifactoryGradleBuild [efpi-core] $ /var/jenkins_home/tools/hudson.plugins.gradle.GradleInstallation/Gradle_3.1/bin/gradle clean artifactoryPublish -b build.gradle 错误:无法'不执行 gradle 任务。[Pipeline] } [Pipeline] // 节点 [Pipeline] 管道结束

org.jfrog.hudson.pipeline.steps.ArtifactoryGradleBuild$Execution.run(ArtifactoryGradleBuild.java :124) at org.jfrog.hudson.pipeline.steps.ArtifactoryGradleBuild$Execution.run(ArtifactoryGradleBuild.java:95) at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousStepExecution.start(AbstractSynchronousStepExecution.java:40) at 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(Unknown Source) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48) at 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) at org.kohsuke.groovy.sandbox.impl.Checker$1.call(Checker.java:149) at org.kohsuke.groovy.sandbox.impl.Checker .checkedCall(Checker.java:146) at com.cloudbees.groovy.cps.sandbox.SandboxInvoker.methodCall(SandboxInvoker.java:16) at WorkflowScript.run(WorkflowScript:14) atgroovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113) at org.kohsuke.groovy.sandbox.impl.Checker$1 .call(Checker.java:151) at org.kohsuke.groovy.sandbox.GroovyInterceptor.onMethodCall(GroovyInterceptor.java:21) at 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) 在groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113) at org.kohsuke.groovy.sandbox.impl.Checker$1 .call(Checker.java:151) at org.kohsuke.groovy.sandbox.GroovyInterceptor.onMethodCall(GroovyInterceptor.java:21) at 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) 在runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113) at org.kohsuke.groovy.sandbox.impl.Checker$1.call(Checker.java:151) at org.kohsuke.groovy.sandbox.GroovyInterceptor.onMethodCall(GroovyInterceptor .java:21) 在 org.kohsuke.groovy.sandbox.impl.Checker$1.call(Checker.java:149) 在 org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor.onMethodCall(SandboxInterceptor.java:115)在 org.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.java:146) 在 com.cloudbees.groovy.cps.sandbox.SandboxInvoker.methodCall(SandboxInvoker.java:16) 在 WorkflowScript.run(WorkflowScript:14 ) 在runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113) at org.kohsuke.groovy.sandbox.impl.Checker$1.call(Checker.java:151) at org.kohsuke.groovy.sandbox.GroovyInterceptor.onMethodCall(GroovyInterceptor .java:21) 在 org.kohsuke.groovy.sandbox.impl.Checker$1.call(Checker.java:149) 在 org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor.onMethodCall(SandboxInterceptor.java:115)在 org.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.java:146) 在 com.cloudbees.groovy.cps.sandbox.SandboxInvoker.methodCall(SandboxInvoker.java:16) 在 WorkflowScript.run(WorkflowScript:14 ) 在onMethodCall(GroovyInterceptor.java:21) at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor.onMethodCall(SandboxInterceptor.java:115) at 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(工作流程脚本:14)在onMethodCall(GroovyInterceptor.java:21) at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor.onMethodCall(SandboxInterceptor.java:115) at 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(工作流程脚本:14)在运行(工作流脚本:14)在运行(工作流脚本:14)在 cps.transform(本机方法)在 com.cloudbees.groovy.cps.impl.ContinuationGroup.methodCall(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(Unknown Source) 在 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 在 java .lang.reflect.Method.invoke(Method.java:498) 在 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。项目 (CollectionLiteralBlock.java:45) 在 sun.reflect.GeneratedMethodAccessor263.invoke(Unknown Source) 在 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 在 java.lang.reflect.Method.invoke(Method.java:第 498 章.groovy.cps.Next.step(Next.java:58) at com.cloudbees.groovy.cps.Continuable.run0(Continuable.java:154) 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) at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.run(CpsThreadGroup.java:324) at org.jenkinsci.plugins.workflow.cps .CpsThreadGroup.access$100(CpsThreadGroup.java:78) at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:236) at 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) 在 hudson.remoting。SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:112) at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util .concurrent.FutureTask.run(FutureTask.java:266) 在 java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) 在 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) 在java.lang.Thread.run(Thread.java:745) 完成:失败java:266) 在 java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) 在 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) 在 java.lang.Thread.run(Thread .java:745) 完成:失败java:266) 在 java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) 在 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) 在 java.lang.Thread.run(Thread .java:745) 完成:失败

4

0 回答 0