title: How to run pmd through pom without failing the build in Jenkins?
body: <p>I am running pmd (checkstyle and findbugs as well) via maven plugins in my pom.xml. The build on Jenkins fails due to errors reported by pmd.</p>
  
  <p>The build stage runs 6 modules in parallel and I run the publisher and another stage after that. If pmd fails the whole build fails and stops immediately.</p>
  
  <p>This is a snippet from my pom.xml:</p>
  
  <pre><code>&lt;/properties&gt;
      &lt;failOnChecks&gt;true&lt;/failOnChecks&gt;
  &lt;/properties&gt;
  &lt;!-- ...... --&gt;
  &lt;plugin&gt;
      &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
      &lt;artifactId&gt;maven-pmd-plugin&lt;/artifactId&gt;
      &lt;version&gt;3.8&lt;/version&gt;
      &lt;dependencies&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;net.sourceforge.pmd&lt;/groupId&gt;
              &lt;artifactId&gt;pmd-core&lt;/artifactId&gt;
              &lt;version&gt;${version.pmd}&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;net.sourceforge.pmd&lt;/groupId&gt;
              &lt;artifactId&gt;pmd-java&lt;/artifactId&gt;
              &lt;version&gt;${version.pmd}&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;net.sourceforge.pmd&lt;/groupId&gt;
              &lt;artifactId&gt;pmd-javascript&lt;/artifactId&gt;
              &lt;version&gt;${version.pmd}&lt;/version&gt;
              &lt;scope&gt;runtime&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;net.sourceforge.pmd&lt;/groupId&gt;
              &lt;artifactId&gt;pmd-jsp&lt;/artifactId&gt;
              &lt;version&gt;${version.pmd}&lt;/version&gt;
              &lt;scope&gt;runtime&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;my.software&lt;/groupId&gt;
              &lt;artifactId&gt;build-tools&lt;/artifactId&gt;
              &lt;version&gt;${version.build-tools}&lt;/version&gt;
          &lt;/dependency&gt;
      &lt;/dependencies&gt;
      &lt;configuration&gt;
          &lt;rulesets&gt;
              &lt;ruleset&gt;pmd/ruleset.xml&lt;/ruleset&gt;
          &lt;/rulesets&gt;
          &lt;failOnViolation&gt;${failOnChecks}&lt;/failOnViolation&gt;
      &lt;/configuration&gt;
      &lt;executions&gt;
          &lt;execution&gt;
              &lt;phase&gt;process-resources&lt;/phase&gt;
              &lt;goals&gt;
                  &lt;goal&gt;check&lt;/goal&gt;
              &lt;/goals&gt;
          &lt;/execution&gt;
      &lt;/executions&gt;
  &lt;/plugin&gt;
  </code></pre>
  
  <p>The Jenkinsfile has those two stages:</p>
  
  <pre><code>stage('modules') {
    gitlabCommitStatus('modules') {
      parallel Config.stepsForParallel
    }
  }
  
  stage('Jenkins Code Analysis') {
    pmd canRunOnFailed: true, canComputeNew: false, defaultEncoding: '', healthy: '', pattern: '', unHealthy: ''
    checkstyle canRunOnFailed: true, canComputeNew: false, defaultEncoding: '', healthy: '', pattern: '', unHealthy: ''
    //findbugs canComputeNew: false, defaultEncoding: '', excludePattern: '', healthy: '', includePattern: '', pattern: '', unHealthy: ''
  }
  </code></pre>
  
  <p>It fails in the build before the second stage can be reached.</p>
  
  <p>The plugins should not stop the pipeline but instead finish it and then fail, and run the publisher afterwards, so I can see the issue in Jenkins.</p>
  
  <p>So far I set <em>failOnViolation</em> via a property, but I am not able to let the build fail at the end. I think I need to check the status there somewhere and call error.</p>
  
  <p>Is there any cleaner way to achieve this?</p>