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

    XMLWordPrintable

    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

            People

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

              Dates

              • Created:
                Updated:
                Resolved: