mirror of
https://github.com/ysoftdevs/DependencyCheck.git
synced 2026-03-24 10:01:35 +01:00
updated output format to accept 'ALL' to generated both HTML and XML reports
Former-commit-id: 002943f373d5541d0ede54d00beb9c155eb454c0
This commit is contained in:
@@ -112,9 +112,10 @@ public class ReportGenerator {
|
|||||||
* reports.
|
* reports.
|
||||||
*/
|
*/
|
||||||
public void generateReports(String outputDir, String outputFormat) throws IOException, Exception {
|
public void generateReports(String outputDir, String outputFormat) throws IOException, Exception {
|
||||||
if ("XML".equalsIgnoreCase(outputFormat)) {
|
if ("XML".equalsIgnoreCase(outputFormat) || "ALL".equalsIgnoreCase(outputFormat)) {
|
||||||
generateReport("XmlReport", outputDir + File.separator + "DependencyCheck-Report.xml");
|
generateReport("XmlReport", outputDir + File.separator + "DependencyCheck-Report.xml");
|
||||||
} else {
|
}
|
||||||
|
if ("HTML".equalsIgnoreCase(outputFormat) || "ALL".equalsIgnoreCase(outputFormat)) {
|
||||||
generateReport("HtmlReport", outputDir + File.separator + "DependencyCheck-Report.html");
|
generateReport("HtmlReport", outputDir + File.separator + "DependencyCheck-Report.html");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -108,8 +108,10 @@ public final class CliParser {
|
|||||||
}
|
}
|
||||||
if (line.hasOption(ArgumentName.OUTPUT_FORMAT)) {
|
if (line.hasOption(ArgumentName.OUTPUT_FORMAT)) {
|
||||||
final String format = line.getOptionValue(ArgumentName.OUTPUT_FORMAT);
|
final String format = line.getOptionValue(ArgumentName.OUTPUT_FORMAT);
|
||||||
if (!("XML".equalsIgnoreCase(format) || "HTML".equalsIgnoreCase(format))) {
|
if (!("ALL".equalsIgnoreCase(format)
|
||||||
throw new ParseException("Supported output formats are XML and HTML");
|
|| "XML".equalsIgnoreCase(format)
|
||||||
|
|| "HTML".equalsIgnoreCase(format))) {
|
||||||
|
throw new ParseException("Supported output formats are XML, HTML, or ALL");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -187,7 +189,7 @@ public final class CliParser {
|
|||||||
.create(ArgumentName.OUT_SHORT);
|
.create(ArgumentName.OUT_SHORT);
|
||||||
|
|
||||||
final Option outputformat = OptionBuilder.withArgName("format").hasArg().withLongOpt(ArgumentName.OUTPUT_FORMAT)
|
final Option outputformat = OptionBuilder.withArgName("format").hasArg().withLongOpt(ArgumentName.OUTPUT_FORMAT)
|
||||||
.withDescription("the output format to write to.")
|
.withDescription("the output format to write to (XML, HTML, ALL).")
|
||||||
.create(ArgumentName.OUTPUT_FORMAT_SHORT);
|
.create(ArgumentName.OUTPUT_FORMAT_SHORT);
|
||||||
|
|
||||||
//TODO add the ability to load a properties file to override the defaults...
|
//TODO add the ability to load a properties file to override the defaults...
|
||||||
|
|||||||
Reference in New Issue
Block a user