我正尝试从jenkins将工件Report-0.0.1-SNAPSHOT.jar上传到nexus存储库,但我一直收到以下错误:
> 10 % completed (6.6 MB / 66 MB). 20 % completed (13 MB / 66 MB). 30 %
> completed (20 MB / 66 MB). 40 % completed (26 MB / 66 MB). 50 %
> completed (33 MB / 66 MB). 60 % completed (40 MB / 66 MB). 70 %
> completed (46 MB / 66 MB). 80 % completed (53 MB / 66 MB). 90 %
> completed (59 MB / 66 MB). 100 % completed (66 MB / 66 MB). 110 %
> completed (73 MB / 66 MB). 120 % completed (79 MB / 66 MB). [Pipeline]
> echo Nexus Upload Failed:
> [sp.sd.nexusartifactuploader.steps.NexusArtifactUploaderStep$Execution.run(NexusArtifactUploaderStep.java:259),
> sp.sd.nexusartifactuploader.steps.NexusArtifactUploaderStep$Execution.run(NexusArtifactUploaderStep.java:217),
> org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1$1.call(AbstractSynchronousNonBlockingStepExecution.java:47),
> hudson.security.ACL.impersonate(ACL.java:290),
> org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1.run(AbstractSynchronousNonBlockingStepExecution.java:44),
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511),
> 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)] [Pipeline] } [Pipeline] //
> stage [Pipeline] } [Pipeline] // node [Pipeline] End of Pipeline
> Finished: SUCCESS
下面是我的管道脚本
echo "***** Uploading to Nexus *****"
// Working but unable to upload
// With
try {
nexusArtifactUploader artifacts: [[artifactId: 'Report-0.0.1-SNAPSHOT', classifier: '', file: 'Report-0.0.1-SNAPSHOT.jar', type: 'jar']], groupId: 'com.mycompany.myproject', nexusUrl: 'url-to-nexus/nexus/', nexusVersion: 'nexus2', protocol: 'https', repository: 'mycompany-xxx-yyy-zzz-hosted', version: '0.0.1-SNAPSHOT'
echo 'Succeeded!'
} catch (err) {
echo "Nexus Upload Failed: ${err.stackTrace}"
}
答案 0 :(得分:0)
我对https://jenkins.io/doc/pipeline/steps/nexus-jenkins-plugin/有很好的经验 该插件受Sonatype支持。也许这是您的解决方法