Skip to content

Commit

Permalink
Fix error on missing target in root. (#348)
Browse files Browse the repository at this point in the history
When running the build from root with -pl option the sat will give an IOException error if the target folder in the root from which the build is started. This target folder is used for summary report. This change makes sure the target directory exists.

Signed-off-by: Hilbrand Bouwkamp <hilbrand@h72.nl>
  • Loading branch information
Hilbrand authored and martinvw committed Jun 28, 2019
1 parent 841ecbf commit 06b648e
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ public void execute() throws MojoFailureException {

// 7. Append the individual report to the summary, if it is not empty
if (summaryReportDirectory != null) {
ensureSummaryReportDirectoryExists();
generateSummaryByBundle(htmlOutputFileName, mergedReport);
generateSummaryByRules(htmlOutputFileName, mergedReport);
}
Expand Down Expand Up @@ -366,6 +367,12 @@ private void report(String priority, String log) {
}
}

private void ensureSummaryReportDirectoryExists() {
if (!summaryReportDirectory.exists()) {
summaryReportDirectory.mkdirs();
}
}

private void generateSummaryByBundle(File htmlOutputFileName, File secondMergeResult) {
NodeList nodes = selectNodes(secondMergeResult, "/sca/file/message");
int messagesNumber = nodes.getLength();
Expand Down

0 comments on commit 06b648e

Please sign in to comment.