org.jenkinsci.plugins.DependencyCheck
Class DependencyCheckBuilder

java.lang.Object
  extended by hudson.tasks.BuildStepCompatibilityLayer
      extended by hudson.tasks.Builder
          extended by org.jenkinsci.plugins.DependencyCheck.AbstractDependencyCheckBuilder
              extended by org.jenkinsci.plugins.DependencyCheck.DependencyCheckBuilder
All Implemented Interfaces:
hudson.ExtensionPoint, hudson.model.Describable<hudson.tasks.Builder>, hudson.tasks.BuildStep, Serializable

public class DependencyCheckBuilder
extends AbstractDependencyCheckBuilder
implements Serializable

The DependencyCheck builder class provides the ability to invoke a DependencyCheck build as a Jenkins build step. This class takes the configuration from the UI, creates options from them and passes them to the DependencyCheckExecutor for the actual execution of the DependencyCheck Engine and ReportGenerator.

Author:
Steve Springett (steve.springett@owasp.org)
See Also:
Serialized Form

Nested Class Summary
static class DependencyCheckBuilder.DescriptorImpl
          Descriptor for DependencyCheckBuilder.
 
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
hudson.ExtensionPoint.LegacyInstancesAreScopedToHudson
 
Nested classes/interfaces inherited from interface hudson.tasks.BuildStep
hudson.tasks.BuildStep.PublisherList
 
Field Summary
 
Fields inherited from class org.jenkinsci.plugins.DependencyCheck.AbstractDependencyCheckBuilder
OUT_TAG, skipOnScmChange, skipOnUpstreamChange
 
Fields inherited from interface hudson.tasks.BuildStep
BUILDERS, PUBLISHERS
 
Constructor Summary
DependencyCheckBuilder(String scanpath, String outdir, String datadir, String suppressionFile, String zipExtensions, Boolean isAutoupdateDisabled, Boolean isVerboseLoggingEnabled, Boolean includeHtmlReports, Boolean skipOnScmChange, Boolean skipOnUpstreamChange, Boolean useMavenArtifactsScanPath)
           
 
Method Summary
 boolean areMavenArtifactsUsedForScanPath()
          Retrieves whether Maven artifacts from the build should be used as the scan path.
 String getDatadir()
          Retrieves the data directory that DependencyCheck will use.
 DependencyCheckBuilder.DescriptorImpl getDescriptor()
          A Descriptor Implementation.
 String getOutdir()
          Retrieves the output directory to write the report.
 String getScanpath()
          Retrieves the path to scan.
 String getSuppressionFile()
          Retrieves the suppression file that DependencyCheck will use.
 String getZipExtensions()
          Retrieves a comma-separated list of file extensions to treat as ZIP format.
 boolean includeHtmlReports()
          Retrieves whether HTML reports should be generated (in addition to the XML report) or not.
 boolean isAutoupdateDisabled()
          Retrieves whether auto update should be disabled or not.
 boolean isMaven(Class<? extends hudson.model.AbstractProject> clazz)
          Convenience method that determines if the project is a Maven project.
 boolean isVerboseLoggingEnabled()
          Retrieves whether verbose logging is enabled or not.
 boolean perform(hudson.model.AbstractBuild build, hudson.Launcher launcher, hudson.model.BuildListener listener)
          This method is called whenever the DependencyCheck build step is executed.
 boolean skipOnScmChange()
          Retrieves whether execution of the builder should be skipped if triggered by an SCM change.
 boolean skipOnUpstreamChange()
          Retrieves whether execution of the builder should be skipped if triggered by an Upstream change.
 
Methods inherited from class org.jenkinsci.plugins.DependencyCheck.AbstractDependencyCheckBuilder
configureDataDirectory, configureDataMirroring, configureProxySettings, optionsBuilder, setOptions, substituteVariable, toCommaSeparatedString
 
Methods inherited from class hudson.tasks.Builder
all, getRequiredMonitorService, prebuild
 
Methods inherited from class hudson.tasks.BuildStepCompatibilityLayer
getProjectAction, getProjectAction, getProjectActions, perform, prebuild
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DependencyCheckBuilder

@DataBoundConstructor
public DependencyCheckBuilder(String scanpath,
                                                   String outdir,
                                                   String datadir,
                                                   String suppressionFile,
                                                   String zipExtensions,
                                                   Boolean isAutoupdateDisabled,
                                                   Boolean isVerboseLoggingEnabled,
                                                   Boolean includeHtmlReports,
                                                   Boolean skipOnScmChange,
                                                   Boolean skipOnUpstreamChange,
                                                   Boolean useMavenArtifactsScanPath)
Method Detail

getScanpath

public String getScanpath()
Retrieves the path to scan. This is a per-build config item. This method must match the value in config.jelly.


getOutdir

public String getOutdir()
Retrieves the output directory to write the report. This is a per-build config item. This method must match the value in config.jelly.


getDatadir

public String getDatadir()
Retrieves the data directory that DependencyCheck will use. This is a per-build config item. This method must match the value in config.jelly.


getSuppressionFile

public String getSuppressionFile()
Retrieves the suppression file that DependencyCheck will use. This is a per-build config item. This method must match the value in config.jelly.


getZipExtensions

public String getZipExtensions()
Retrieves a comma-separated list of file extensions to treat as ZIP format. This is a per-build config item. This method must match the value in config.jelly.


isAutoupdateDisabled

public boolean isAutoupdateDisabled()
Retrieves whether auto update should be disabled or not. This is a per-build config item. This method must match the value in config.jelly.


isVerboseLoggingEnabled

public boolean isVerboseLoggingEnabled()
Retrieves whether verbose logging is enabled or not. This is a per-build config item. This method must match the value in config.jelly.


includeHtmlReports

public boolean includeHtmlReports()
Retrieves whether HTML reports should be generated (in addition to the XML report) or not. This is a per-build config item. This method must match the value in config.jelly.


skipOnScmChange

public boolean skipOnScmChange()
Retrieves whether execution of the builder should be skipped if triggered by an SCM change. This is a per-build config item. This method must match the value in config.jelly.


skipOnUpstreamChange

public boolean skipOnUpstreamChange()
Retrieves whether execution of the builder should be skipped if triggered by an Upstream change. This is a per-build config item. This method must match the value in config.jelly.


areMavenArtifactsUsedForScanPath

public boolean areMavenArtifactsUsedForScanPath()
Retrieves whether Maven artifacts from the build should be used as the scan path. This is a per-build config item. This method must match the value in config.jelly.


isMaven

public boolean isMaven(Class<? extends hudson.model.AbstractProject> clazz)
Convenience method that determines if the project is a Maven project.

Overrides:
isMaven in class AbstractDependencyCheckBuilder
Parameters:
clazz - The projects class

perform

public boolean perform(hudson.model.AbstractBuild build,
                       hudson.Launcher launcher,
                       hudson.model.BuildListener listener)
                throws InterruptedException,
                       IOException
This method is called whenever the DependencyCheck build step is executed.

Specified by:
perform in interface hudson.tasks.BuildStep
Overrides:
perform in class AbstractDependencyCheckBuilder
Parameters:
build - A Build object
launcher - A Launcher object
listener - A BuildListener object
Returns:
A true or false value indicating if the build was successful or if it failed
Throws:
InterruptedException
IOException

getDescriptor

public DependencyCheckBuilder.DescriptorImpl getDescriptor()
A Descriptor Implementation.

Specified by:
getDescriptor in interface hudson.model.Describable<hudson.tasks.Builder>
Overrides:
getDescriptor in class hudson.tasks.Builder


Copyright © 2012-2015 OWASP. All Rights Reserved.