title: Jenkins build not failing at pipeline stage where OWASP Dependency Checker finds vulnerabilities
body: <p>I am trying to fail my Jenkins build <strong>at the pipeline stage when OWASP Dependency checker finds and reports out vulnerabilities found</strong>. But instead it is moving forward and executing all the subsequent stages even if a vulnerability is found. My Jenkinsfile looks like this :- </p>
  
  <pre><code>pipeline {
      tools {
          nodejs "nodejs"
      }
      stages {
          stage('install') {
              steps {
                  // 'ci' install node modules
                  sh 'npm ci'
              }
          }
          stage('Dependency Check') {
              steps {
                  sh 'npm prune --production'
                  sh "mkdir -p build/report"
                  sh "'$DEPENDENCY_PATH' --project demoProject --disableRetireJS --suppression 'dependency-check-suppressions.xml' --format XML --out 'build/report/dependency-check-report.xml' --scan ."
                  dependencyCheckPublisher pattern: 'build/report/dependency-check-report.xml', failedTotalCritical: '0', failedTotalHigh: '0', failedTotalLow: '0', failedTotalMedium: '0'
              }
          }
          stage('Test Step') {
              steps {
                  sh 'echo "Reaching test step"'
              }
          }
      }
  }
  </code></pre>
  
  <p>Env. variable <em>'$DEPENDENCY_PATH'</em> contains the location for <em>dependency-check.bat</em> file. OWASP Dependency Checker finds and reports vulnerabilities which I can see in the <em>dependency-check-report.xml</em> and at the end it fails the build also. <strong>But the last stage Test Step also gets executed which I do not want. I want Jenkins build to fail at the Dependency Check stage if any vulnerabilities are found.</strong> Where am I doing wrong here?</p>