Merge pull request #204 from rperam/master

Property to control whether external reports need to be generated or not

Former-commit-id: 8a53f09f1e4af41695c48d057eee963a24903b5d
This commit is contained in:
Steve Springett
2015-03-26 10:38:23 -05:00

View File

@@ -209,6 +209,29 @@ public class DependencyCheckScanAgent {
this.autoUpdate = autoUpdate; this.autoUpdate = autoUpdate;
} }
/**
* flag indicating whether or not to generate a report of findings.
*/
private boolean generateReport = true;
/**
* Get the value of generateReport.
*
* @return the value of generateReport
*/
public boolean isGenerateReport() {
return generateReport;
}
/**
* Set the value of generateReport.
*
* @param generateReport new value of generateReport
*/
public void setGenerateReport(boolean generateReport) {
this.generateReport = generateReport;
}
/** /**
* The report format to be generated (HTML, XML, VULN, ALL). This configuration option has no affect if using this * The report format to be generated (HTML, XML, VULN, ALL). This configuration option has no affect if using this
* within the Site plugin unless the externalReport is set to true. Default is HTML. * within the Site plugin unless the externalReport is set to true. Default is HTML.
@@ -945,11 +968,13 @@ public class DependencyCheckScanAgent {
* @throws org.owasp.dependencycheck.exception.ScanAgentException thrown if there is an exception executing the * @throws org.owasp.dependencycheck.exception.ScanAgentException thrown if there is an exception executing the
* scan. * scan.
*/ */
public void execute() throws ScanAgentException { public Engine execute() throws ScanAgentException {
Engine engine = null; Engine engine = null;
try { try {
engine = executeDependencyCheck(); engine = executeDependencyCheck();
if (this.generateReport) {
generateExternalReports(engine, new File(this.reportOutputDirectory)); generateExternalReports(engine, new File(this.reportOutputDirectory));
if (this.showSummary) { if (this.showSummary) {
showSummary(engine.getDependencies()); showSummary(engine.getDependencies());
} }
@@ -966,6 +991,7 @@ public class DependencyCheckScanAgent {
engine.cleanup(); engine.cleanup();
} }
} }
return engine;
} }
/** /**