Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-53728

No such method if git-client 3.0.0 beta is used with declarative pipeline

    Details

    • Type: Improvement
    • Status: Closed (View Workflow)
    • Priority: Minor
    • Resolution: Fixed
    • Component/s: git-client-plugin
    • Labels:
      None
    • Environment:
      git-client 3.0.0 beta 5
      git 4.0.0 beta 3
    • Similar Issues:

      Description

      I integrated warnings plugin 5.0.0 beta with Git-Client plugin 3.0.0 beta.
      I get the following exception:

      java.lang.NoSuchMethodError: org.eclipse.jgit.lib.Repository.getRef(Ljava/lang/String;)Lorg/eclipse/jgit/lib/Ref;
      	at jenkins.plugins.git.GitSCMFileSystem.lambda$new$0(GitSCMFileSystem.java:114)
      	at jenkins.plugins.git.GitSCMFileSystem.lambda$invoke$e8567d7e$1(GitSCMFileSystem.java:181)
      	at org.jenkinsci.plugins.gitclient.AbstractGitAPIImpl.withRepository(AbstractGitAPIImpl.java:28)
      	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.withRepository(CliGitAPIImpl.java:75)
      	at jenkins.plugins.git.GitSCMFileSystem.invoke(GitSCMFileSystem.java:181)
      	at jenkins.plugins.git.GitSCMFileSystem.<init>(GitSCMFileSystem.java:114)
      	at jenkins.plugins.git.GitSCMFileSystem$BuilderImpl.build(GitSCMFileSystem.java:339)
      	at jenkins.scm.api.SCMFileSystem.of(SCMFileSystem.java:196)
      	at jenkins.scm.api.SCMFileSystem.of(SCMFileSystem.java:172)
      	at org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:108)
      	at org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:67)
      	at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:303)
      	at hudson.model.ResourceController.execute(ResourceController.java:97)
      	at hudson.model.Executor.run(Executor.java:429)
      Finished: FAILURE
      
      

      The declarative pipeline used:

      pipeline {
          agent 'any'
          tools {
              maven 'mvn-default'
              jdk 'jdk-default'
          }
          stages {
              stage ('Build') {
                  steps {
                      sh '${M2_HOME}/bin/mvn --batch-mode -V -U -e clean verify -Dsurefire.useFile=false -Dmaven.test.failure.ignore'
                  }
              }
      
              stage ('Analysis') {
                  steps {
                      sh '${M2_HOME}/bin/mvn --batch-mode -V -U -e checkstyle:checkstyle pmd:pmd pmd:cpd findbugs:findbugs spotbugs:spotbugs'
                  }
              }
          }
          post {
              always {
                  junit testResults: '**/target/surefire-reports/TEST-*.xml'
      
                  recordIssues enabledForFailure: true, tools: [[pattern: '', tool: [$class: 'MavenConsole']], [pattern: '', tool: [$class: 'Java']], [pattern: '', tool: [$class: 'JavaDoc']]]
                  recordIssues enabledForFailure: true, tools: [[pattern: '', tool: [$class: 'CheckStyle']]]
                  recordIssues enabledForFailure: true, tools: [[pattern: '', tool: [$class: 'FindBugs']]]
                  recordIssues enabledForFailure: true, tools: [[pattern: '', tool: [$class: 'SpotBugs']]]
                  recordIssues enabledForFailure: true, tools: [[pattern: '**/target/cpd.xml', tool: [$class: 'Cpd']]]
                  recordIssues enabledForFailure: true, tools: [[pattern: '**/target/pmd.xml', tool: [$class: 'Pmd']]]
              }
          }
      }
      

        Attachments

          Activity

          Hide
          markewaite Mark Waite added a comment -

          Sorry for the mistake on this one. The most recent beta release of the git plugin is "behind" the most recent release of the git client plugin. The most recent git plugin release contains a dependency on JGit 4.x while the most recent beta release of the git client plugin delivers JGit 5.x.

          The immediate workaround is to base your plugin builds on the incremental versions of git client plugin and git plugin until the next beta release of both.

          The incremental for git client plugin is git-client-3.0.0-beta6-rc1776.912790760394

          The incremental for git plugin is git/4.0.0-rc2892.70634f157021/git-4.0.0-rc2892.70634f157021.hpi

          Show
          markewaite Mark Waite added a comment - Sorry for the mistake on this one. The most recent beta release of the git plugin is "behind" the most recent release of the git client plugin. The most recent git plugin release contains a dependency on JGit 4.x while the most recent beta release of the git client plugin delivers JGit 5.x. The immediate workaround is to base your plugin builds on the incremental versions of git client plugin and git plugin until the next beta release of both. The incremental for git client plugin is git-client-3.0.0-beta6-rc1776.912790760394 The incremental for git plugin is git/4.0.0-rc2892.70634f157021/git-4.0.0-rc2892.70634f157021.hpi
          Hide
          markewaite Mark Waite added a comment -

          Fixed with git client plugin 3.0.0-beta6 and git plugin 4.0.0-beta4 released December 15, 2018

          Show
          markewaite Mark Waite added a comment - Fixed with git client plugin 3.0.0-beta6 and git plugin 4.0.0-beta4 released December 15, 2018
          Hide
          poojashah pooja shah added a comment -

           

          Git client 3.2.1
          Jenkins: 2.189
          

           

          I'm facing the same with Git client 3.2.1

          The same used to work till October 10, 2020. Suddenly started breaking. 

          And I don't have the warnings plugin installed.  

          I can't fine an option upgrade to 4.4 by default without upgrading the entire jenkins version upgrade. 
          The only option I get is to downgrade to 2.5.0. Will it help?

          Any safe workaround would be a great help. 

          Show
          poojashah pooja shah added a comment -   Git client 3.2.1 Jenkins: 2.189   I'm facing the same with Git client 3.2.1 The same used to work till October 10, 2020. Suddenly started breaking.  And I don't have the warnings plugin installed.   I can't fine an option upgrade to 4.4 by default without upgrading the entire jenkins version upgrade.  The only option I get is to downgrade to 2.5.0. Will it help? Any safe workaround would be a great help. 
          Hide
          markewaite Mark Waite added a comment -

          pooja shah I assume that you've chosen to remain on a weekly Jenkins version that is over 15 months old because you don't want to evaluate new Jenkins versions. That choice will limit your other choices and will significantly complicate the evaluation of those choices.

          Git plugin 4.3.0 updated the minimum Jenkins version from 2.138 to 2.204. You may be able to install git plugin 4.2.2. Anything 4.3.0 and later will not operate correctly in Jenkins 2.189.

          Git client plugin 3.3.0 updated the minimum Jenkins version from 2.138 to 2.204. Git plugin 4.2.2 requires git client plugin 3.0.0 or newer. It should be able to operate with any git client plugin 3.0.0 through 3.2.1 (inclusive).

          Since you're very focused on reducing risk, you should assure that you have reliable backups of your system before you run any of those experiments with plugin versions.

          Since you're very focused on reducing risk, you should confirm that you are not affected by any of the Jenkins security advisories published since the release of Jenkins 2.189.

          Show
          markewaite Mark Waite added a comment - pooja shah I assume that you've chosen to remain on a weekly Jenkins version that is over 15 months old because you don't want to evaluate new Jenkins versions. That choice will limit your other choices and will significantly complicate the evaluation of those choices. Git plugin 4.3.0 updated the minimum Jenkins version from 2.138 to 2.204. You may be able to install git plugin 4.2.2. Anything 4.3.0 and later will not operate correctly in Jenkins 2.189. Git client plugin 3.3.0 updated the minimum Jenkins version from 2.138 to 2.204. Git plugin 4.2.2 requires git client plugin 3.0.0 or newer. It should be able to operate with any git client plugin 3.0.0 through 3.2.1 (inclusive). Since you're very focused on reducing risk, you should assure that you have reliable backups of your system before you run any of those experiments with plugin versions. Since you're very focused on reducing risk, you should confirm that you are not affected by any of the Jenkins security advisories published since the release of Jenkins 2.189.

            People

            • Assignee:
              markewaite Mark Waite
              Reporter:
              drulli Ulli Hafner
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: