我在运行工作时遇到错误。 Maven版本:2.7.1
Started by user ******
Running as ******
Building in workspace /******/jenkins-v2/jobs/******/workspace
> /******/git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
> /******/git config remote.develop.url ssh://git@bitbucketdc-ssh.jpmchase.net:7999/etrading/fcs-bloomberg.git # timeout=10
Fetching upstream changes from ssh://git@bitbucketdc-ssh.jpmchase.net:7999/etrading/fcs-bloomberg.git
> /******/git --version # timeout=10
using GIT_ASKPASS to set credentials Git stash access
> /******/git fetch --tags --progress ssh://git@bitbucketdc-ssh.jpmchase.net:7999/etrading/fcs-bloomberg.git +refs/heads/*:refs/remotes/develop/*
> ******/git rev-parse develop/develop^{commit} # timeout=10
Checking out Revision 7ca15cc212d82863db6659e8c4c90fb8d4579f81 (develop/develop)
> /******/git config core.sparsecheckout # timeout=10
> /******/git checkout -f 7ca15cc212d82863db6659e8c4c90fb8d4579f81
Commit message: "******"
> /******/git rev-list --no-walk 7ca15cc212d82863db6659e8c4c90fb8d4579f81 # timeout=10
FATAL: jenkins/scm/RunWithSCM
java.lang.NoClassDefFoundError: jenkins/scm/RunWithSCM
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:760)
at jenkins.util.AntClassLoader.defineClassFromData(AntClassLoader.java:1139)
at hudson.ClassicPluginStrategy$AntClassLoader2.defineClassFromData(ClassicPluginStrategy.java:878)
at jenkins.util.AntClassLoader.getClassFromStream(AntClassLoader.java:1310)
at jenkins.util.AntClassLoader.findClassInComponents(AntClassLoader.java:1366)
at jenkins.util.AntClassLoader.findClass(AntClassLoader.java:1326)
at jenkins.util.AntClassLoader.loadClass(AntClassLoader.java:1079)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at org.jenkinsci.plugins.workflow.job.WorkflowJob$SCMListenerImpl.onCheckout(WorkflowJob.java:621)
at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:609)
at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:529)
at hudson.model.Run.execute(Run.java:1741)
at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:543)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:410)
Caused by: java.lang.ClassNotFoundException: jenkins.scm.RunWithSCM
at jenkins.util.AntClassLoader.findClassInComponents(AntClassLoader.java:1376)
at jenkins.util.AntClassLoader.findClass(AntClassLoader.java:1326)
at jenkins.util.AntClassLoader.loadClass(AntClassLoader.java:1079)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 17 more
Finished: FAILURE
有时我也会:
FATAL: org/jenkinsci/plugins/workflow/job/WorkflowRun
java.lang.NoClassDefFoundError: org/jenkinsci/plugins/workflow/job/WorkflowRun
at org.jenkinsci.plugins.workflow.job.WorkflowJob$SCMListenerImpl.onCheckout(WorkflowJob.java:621)
at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:609)
at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:529)
at hudson.model.Run.execute(Run.java:1741)
at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:543)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:410)
Finished: FAILURE
我已经看到了关于同一问题的两个主题,但他们没有回答:
java.lang.NoClassDefFoundError: jenkins/scm/RunWithSCM
"NoClassDefFoundError" in jenkins/scm/RunWithSCM
我已尝试过第一个链接所说的内容,但它没有解决问题:
错误的解决方案。 'workflow-aggregator'(管道)插件导致了这个问题。一些依赖项是不兼容的。卸载并重新安装了包含所有依赖项的插件,修复了上述问题。
非常感谢你的帮助。
此致
安德烈
答案 0 :(得分:0)
我认为你有2个插件版本的问题。 scm是bitbucket,工作流是描述CI的步骤的管道。
它似乎与maven无关。
检查你的Jenkins版本,如果你正在运行LTS,这是一个好的开始。见:https://jenkins.io/changelog-stable/
最新和最好的是开始的最佳选择。我要寻找的其他东西是这些插件的稳定版本。 https://plugins.jenkins.io/bitbucket似乎在12月更新,如果最新版本不适合您,请尝试上一版本