Skip to content

Commit

Permalink
Fixed JSONArray parsing issue in report creation mojo
Browse files Browse the repository at this point in the history
Signed-off-by: ywittmann <[email protected]>
  • Loading branch information
YanWittmann committed Sep 9, 2024
1 parent 9283a6d commit 910ff12
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ public abstract class AbstractInventoryReportCreationMojo extends AbstractProjec
*
* @parameter
*/
private JSONArray generateOverviewTablesForAdvisories = new JSONArray();
private String generateOverviewTablesForAdvisories = "[]";

// other template parameters

Expand Down Expand Up @@ -366,7 +366,11 @@ protected void configureInventoryReport(InventoryReport report) {
report.setSecurityPolicy(securityPolicy);
report.setFilterVulnerabilitiesNotCoveredByArtifacts(filterVulnerabilitiesNotCoveredByArtifacts);
report.setFilterAdvisorySummary(filterAdvisorySummary);
report.addGenerateOverviewTablesForAdvisoriesByMap(generateOverviewTablesForAdvisories);
try {
report.addGenerateOverviewTablesForAdvisoriesByMap(new JSONArray(generateOverviewTablesForAdvisories));
} catch (Exception e) {
throw new RuntimeException("Failed to parse generateOverviewTablesForAdvisories, must be a valid content identifier JSONArray: " + generateOverviewTablesForAdvisories, e);
}

// diff settings
report.setDiffInventoryFile(diffInventoryFile);
Expand Down
2 changes: 1 addition & 1 deletion plugins/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
particular when the plugin has already been installed. Approaches
that workaround this concepts do not harmonize with the parent
poms being build in the same reactor. -->
<phase>install</phase>
<phase>installX</phase>
</execution>
</executions>
</plugin>
Expand Down

0 comments on commit 910ff12

Please sign in to comment.