Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-58660

Errors running OWASP Dependency-Check plugin cause non-obvious failures of the build

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: Major Major
    • None
    • Jenkins 2.181
      Dependency-check plugin 5.2.0

      If any errors occur in the Dependency-Check plugin (i.e. the CLI tool exits with a non-zero return code) then the Jenkins build result is set to failure, as per this code https://github.com/jenkinsci/dependency-check-plugin/blob/master/src/main/java/org/jenkinsci/plugins/DependencyCheck/DependencyCheckToolBuilder.java#L157

      final boolean success = (exitCode == 0);
      build.setResult(success ? Result.SUCCESS : Result.FAILURE); 

      I have two concerns with this.

      1. When this happens, it is far from obvious that the reason for the build failure is the Dependency-Check plugin.  The build may well continue and do many more stages, so parsing build output to determine the root cause is much more onerous than it needs to be.
      2. I believe it ought to be possible to configure (through plugin invocation parameters) the effect on the build of any errors running the plugin.  For example, it may be more appropriate to make the build UNSTABLE, or even not to affect the result at all (depending on the exact use case and convention).  Given that Jenkins doesn't allow you to "improve" the build status after it's already been set to a given level (in this case FAILURE) then no workaround is possible (except to reinvent the wheel by downloading and running the CLI in a customised manner).

            Unassigned Unassigned
            oliverlockwood Oliver Lockwood
            Votes:
            5 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: