From 910ff1227e112a0412a31e533fcdd35ce9cbd5fa Mon Sep 17 00:00:00 2001 From: ywittmann Date: Mon, 9 Sep 2024 08:39:10 +0200 Subject: [PATCH] Fixed JSONArray parsing issue in report creation mojo Signed-off-by: ywittmann --- .../mojo/AbstractInventoryReportCreationMojo.java | 8 ++++++-- plugins/pom.xml | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/plugins/ae-inventory-maven-plugin/src/main/java/org/metaeffekt/core/maven/inventory/mojo/AbstractInventoryReportCreationMojo.java b/plugins/ae-inventory-maven-plugin/src/main/java/org/metaeffekt/core/maven/inventory/mojo/AbstractInventoryReportCreationMojo.java index 237b4853..51b32998 100644 --- a/plugins/ae-inventory-maven-plugin/src/main/java/org/metaeffekt/core/maven/inventory/mojo/AbstractInventoryReportCreationMojo.java +++ b/plugins/ae-inventory-maven-plugin/src/main/java/org/metaeffekt/core/maven/inventory/mojo/AbstractInventoryReportCreationMojo.java @@ -281,7 +281,7 @@ public abstract class AbstractInventoryReportCreationMojo extends AbstractProjec * * @parameter */ - private JSONArray generateOverviewTablesForAdvisories = new JSONArray(); + private String generateOverviewTablesForAdvisories = "[]"; // other template parameters @@ -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); diff --git a/plugins/pom.xml b/plugins/pom.xml index 89b6e449..a060aa23 100644 --- a/plugins/pom.xml +++ b/plugins/pom.xml @@ -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. --> - install + installX