2
votes

Jenkins 2.7.2 Pipeline job is not working for 'Flat property' in downloading schema.

While downloading artifacts from generic Artifactory repository (rb-artifactory), Jenkins pipeline job is throwing this error:

java.lang.NoClassDefFoundError: org/eclipse/jgit/util/StringUtils 

I request for your support to resolve this error.

We have the following download schema:

def ar_download_logs = """{
  "files": [
    {
      "pattern": "${ar_url}/out/*",
      "flat": "1",
      "target": "logs/"
    }
  ]
}"""
def buildInfo1 = ar_server.download(ar_download_logs)

"flat": "1" causes the problem while converting from String to Boolean, which uses StringUtil and causing an exception java.lang.NoClassDefFoundError.

How to establish dependencies between some of StringUtils package for Artifactory Plugin: 2.5.1 to use string to Boolean conversion?

If you take a look at the following source code where the exception occurs, then it’s a Line 79 of GenericDownloadExecutor.java as given by the stack trace.

https://github.com/jenkinsci/artifactory-plugin/blob/master/src/main/java/org/jfrog/hudson/pipeline/executors/GenericDownloadExecutor.java

boolean isFlat = file.getFlat() != null && StringUtils.toBoolean(file.getFlat());

I also would like to share a plugin that are used for the project:

  • Artifactory Plugin: 2.5.1
  • Groovy : 1.29
  • Ivy Plugin : 1.26
  • Pipeline : 2.2
  • Pipeline: Groovy : 2.7
  • Pipeline: Job : 2.3
3
I am trying to get an account on the JFrog JIRA to file this as a bug. I also attempted to file an Issue on the Github repository but it looks like Issues are not enabled for this project. A painful hack might involve adding the org.eclipse.jgit JAR inside of the git-client plugin classpath, which many Jenkins have installed. - Brian Ray
should read "inside of the git-client plugin to the classpath," The permanent fix they might implement is to use commons-lang.BooleanUtils#toBoolean instead of the org.eclipse.jgit equivalent. - Brian Ray
Not an answer, but I was able to enter a JIRA for this. - Brian Ray

3 Answers

6
votes

Installing git plugin solves the issue.
In order for this to take affect Jenkins must be restarted after the installation.

5
votes

A fix for this issue is included as part of the Artifactory Plugin 2.8.0: https://www.jfrog.com/jira/browse/HAP-829

0
votes

According with other responses, you have 2 options:

In these 2 options you need to update or install plugins so you need to restart your Jenkins installation.Restart Jenkins usually takes some minutes.

I recommend you to update your Artifactory plugin for solve this issue and posible future issues.