Jenkins错误与插件bitbucket分支源插件

时间:2017-08-28 12:07:53

标签: jenkins continuous-integration bitbucket jenkins-plugins

自上次插件更新以来,我的所有构建都失败了,但我没有改变任何配置。 我试图回滚到最新版本的插件,但问题仍然存在。

似乎BitbucketStatusNotificationPlugin试图访问某些Mercurial类......

该项目是一个多分支管道。 詹金斯项目的官方JIRA JENKINS-46296

也引用了该问题

非常感谢任何帮助。

谢谢!

这是输出:

 Started by user Olivier
 Checking out git REPO_URL
 into /var/jenkins_home/workspace/TaaS_API_TaaS_develop-HDR4FYYRLEPSYBGEYT6L5UEWPW5HVQDT5PW7ZBCJ6VTGPTYLU6OQ@script to read Jenkinsfile
 > git rev-parse --is-inside-work-tree # timeout=10
 Fetching changes from the remote Git repository
 > git config remote.origin.url 
timeout=10
 Fetching without tags
 Fetching upstream changes from REPO_URL
 > git --version # timeout=10
 using GIT_ASKPASS to set credentials Bitbucket pass
 > git fetch --no-tags --progress 
 +refs/heads/develop:refs/remotes/origin/develop
 Checking out Revision 5fa34124eb6be5ab7242633a97cced7de4e7af5e (develop)
 Commit message: "Finish team"
 > git config core.sparsecheckout # timeout=10
 > git checkout -f 5fa34124eb6be5ab7242633a97cced7de4e7af5e
 > git rev-list 5fa34124eb6be5ab7242633a97cced7de4e7af5e # timeout=10
 java.lang.IllegalAccessError: tried to access class hudson.plugins.mercurial.MercurialSCMSource$MercurialRevision from class com.cloudbees.jenkins.plugins.bitbucket.BitbucketBuildStatusNotifications
 at com.cloudbees.jenkins.plugins.bitbucket.BitbucketBuildStatusNotifications.getHash(BitbucketBuildStatusNotifications.java:124)
 at com.cloudbees.jenkins.plugins.bitbucket.BitbucketBuildStatusNotifications.sendNotifications(BitbucketBuildStatusNotifications.java:104)
 at com.cloudbees.jenkins.plugins.bitbucket.BitbucketBuildStatusNotifications.access$000(BitbucketBuildStatusNotifications.java:54)
 at com.cloudbees.jenkins.plugins.bitbucket.BitbucketBuildStatusNotifications$JobCheckOutListener.onCheckout(BitbucketBuildStatusNotifications.java:14
 at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:127)
 at org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:130)
 at org.jenkinsci.plugins.workflow.multibranch.SCMBinder.create(SCMBinder.java:120)
 at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:263)
 at hudson.model.ResourceController.execute(ResourceController.java:97)
 at hudson.model.Executor.run(Executor.java:405)
 Finished: FAILURE

1 个答案:

答案 0 :(得分:0)

This is most likely caused by a version incompatibility between your plugins.

Make sure you update all of the required dependencies to at least the required versions. The minimum required versions of dependencies for the latest version of the plugin can be located on the plugin page.

For older versions, the easiest place to get this information I've found so far is probably the pom file e.g. version 2.2.4.

Before version 2.0 of the mercurial plugin, the type MercurialSCMSource.MercurialRevision was package private (not visible to other packages/plugins).

The latest version of the Bitbucket Branch Source Plugin (2.2.6) declares a dependency on at least version 2.0 of the mercurial plugin. I'm not sure which versions are declared for the versions you are using, but it seems that mercurial 2.0 has been required since at least version 2.2.0 of the Bitbucket Branch Source Plugin.

Even if you aren't using mercurial, the code/classes are still required.