错误如下:
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 29.902 s
[INFO] Finished at: 2021-01-21T09:58:57+08:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.owasp:dependency-check-maven:6.0.5:check (default-cli) on project core-account-service: One or more exceptions occurred during dependency-check analysis: One or more exceptions occurred during analysis:
[ERROR] InitializationException: Unable to initialize the Retire JS respository
[ERROR] caused by UpdateException: Failed to initialize the RetireJS repo
[ERROR] caused by DownloadFailedException: Download failed, unable to copy 'https://raw.githubusercontent.com/Retirejs/retire.js/master/repository/jsrepository.json' to '/app/repository/org/owasp/dependency-check-utils/6.0.5/../../dependency-check-data/5.0/jsrepository.json'; Error downloading file https://raw.githubusercontent.com/Retirejs/retire.js/master/repository/jsrepository.json; unable to connect.
[ERROR] caused by DownloadFailedException: Error downloading file https://raw.githubusercontent.com/Retirejs/retire.js/master/repository/jsrepository.json; unable to connect.
[ERROR] caused by ConnectException: Connection refused (Connection refused)
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
詹金斯管道
stage('dependencyCheck') {
steps {
parallel(
dependencyCheck: {
sh 'mvn org.owasp:dependency-check-maven:check -Ddependency-check-format=XML -DdisableRetireJS -DdisableNodeJS'
step([$class: 'DependencyCheckPublisher', unstableTotalAll: '0'])
}
)
}
}
stage('dependencyCheck') {
steps {
parallel(
dependencyCheck: {
sh 'mvn org.owasp:dependency-check-maven:check -Ddependency-check-format=XML --disableRetireJS --disableNodeJS'
step([$class: 'DependencyCheckPublisher', unstableTotalAll: '0'])
}
)
}
}
当我们尝试将 Dependency-check 与上图所示的 Jenkins Pipelow 集成时,它失败了。
关于如何添加disableRetireJS和disableNodeJS的任何想法,当使用mvn org.owasp:dependency-check-maven:check