带有 DependenceCheck 的 Jenkinsfile 管道因 RetireJS 检查而失败

时间:2021-01-21 02:08:48

标签: jenkins-pipeline maven-dependency-check-plugin

错误如下:

[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.

Jenkins 流水线

        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 集成时,如上所示,它失败了。

关于如何在使用 mvn org.owasp:dependency-check-maven:check 时添加 disableRetireJSdisableNodeJS 的任何想法>

0 个答案:

没有答案