Jenkins pipeline Dependency-Check Plugin v5 migration

已查看 138 次
跳至第一个未读帖子

ya

未读,
2019年8月6日 11:01:482019/8/6
收件人 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

未读,
2020年6月22日 12:48:542020/6/22
收件人 Jenkins Users

Did you figure out how to do this? I just updated to v5 and am running into the same issues.
回复全部
回复作者
转发
0 个新帖子