Jenkins pipeline Dependency-Check Plugin v5 migration

140 views
Skip to first unread message

ya

unread,
Aug 6, 2019, 11:01:48 AM8/6/19
to Jenkins Users
Hi all. 
We use jenkins pipelines and want start migrate to new version of OWASP Dependency-Check plugin, but can't understand new syntax.
On github page we find only description of new version. 
On jenkins wiki we find only free style project example.
On jenkins we find new method dependencyCheck without examples. And on google we can't find any reference about new syntax.

Our stage in 4.* version
stage("Dependency Check") {
     dependencyCheckAnalyzer datadir
: 'dependency-check-data', isFailOnErrorDisabled: true, hintsFile: '', includeCsvReports: false, includeHtmlReports: true, includeJsonReports: false, isAutoupdateDisabled: false, outdir: '', scanpath: '', skipOnScmChange: false, skipOnUpstreamChange: false, suppressionFile: '', zipExtensions: ''
     dependencyCheckPublisher canComputeNew
: false, defaultEncoding: '', healthy: '', pattern: '', unHealthy: ''
     archiveArtifacts allowEmptyArchive
: true, artifacts: '**/dependency-check-report.*', onlyIfSuccessful: true    
 
}

So in new version jenkins write: java.lang.NoSuchMethodError: No such DSL method 'dependencyCheckAnalyzer' , we understand this cause. 

But when we try do somethink like this in new version, we have just errors: 
 stage("Dependency Check") {
    dependency
-check //or dependencycheck or dependencyCheck
    dependencyCheckPublisher canComputeNew
: false, defaultEncoding: '', healthy: '', pattern: '', unHealthy: ''
    archiveArtifacts allowEmptyArchive
: true, artifacts: '**/dependency-check-report.*', onlyIfSuccessful: true
 
}
ERROR:
groovy.lang.MissingPropertyException: No such property: dependency for class: WorkflowScript

Another try:
stage("Dependency Check") {
   
dependencyCheck datadir: 'dependency-check-data', isFailOnErrorDisabled: true, hintsFile: '', includeCsvReports: false, includeHtmlReports: true, includeJsonReports: false, isAutoupdateDisabled: false, outdir: '', scanpath: '', skipOnScmChange: false, skipOnUpstreamChange: false, suppressionFile: '', zipExtensions: ''
    dependencyCheckPublisher canComputeNew: false, defaultEncoding: '', healthy: '', pattern: '', unHealthy: ''
    archiveArtifacts allowEmptyArchive
: true, artifacts: '**/dependency-check-report.*', onlyIfSuccessful: true
 
}
ERROR:
[DependencyCheck] A Dependency-Check installation was not specified. Please configure the build and specify a Dependency-Check installation to use.

Another try:
stage("Dependency Check") {
    dependency-check datadir: 'dependency-check-data', isFailOnErrorDisabled: true, hintsFile: '', includeCsvReports: false, includeHtmlReports: true, includeJsonReports: false, isAutoupdateDisabled: false, outdir: '', scanpath: '', skipOnScmChange: false, skipOnUpstreamChange: false, suppressionFile: '', zipExtensions: ''
    dependencyCheckPublisher canComputeNew: false, defaultEncoding: '', healthy: '', pattern: '', unHealthy: ''
    archiveArtifacts allowEmptyArchive: true, artifacts: '**/dependency-check-report.*', onlyIfSuccessful: true
 
}
ERROR: 
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
WorkflowScript: 15: expecting '}', found 'datadir' @ line 15, column 26.
           dependency-check datadir: 'dependency-check-data', isFailOnErrorDisabled: true, hintsFile: '', includeCsvReports: false, includeHtmlReports: true, includeJsonReports: false, isAutoupdateDisabled: false, outdir: '', scanpath: '', skipOnScmChange: false, skipOnUpstreamChange: false, suppressionFile: '', zipExtensions: '' 


And we read this github description, so we need to just use bash command in our pipeline to start a dependency check?
Maybe someone who use pipelines with dependency check can write examples how to use new version of dependency check with pipelines?

Adam Horn

unread,
Jun 22, 2020, 12:48:54 PM6/22/20
to Jenkins Users

Did you figure out how to do this? I just updated to v5 and am running into the same issues.
Reply all
Reply to author
Forward
0 new messages