From df888c351d7e08698baee2d20ed1d6376fbee516 Mon Sep 17 00:00:00 2001 From: nekhtan <129828933+nekhtan@users.noreply.github.com> Date: Thu, 30 May 2024 13:21:12 +0200 Subject: [PATCH] Fallback on 'cdx' or 'bom' JSON files for Java BOM (#1127) * Fallback on 'cdx' or 'bom' JSON files for Java BOM Signed-off-by: nekhtan <129828933+nekhtan@users.noreply.github.com> * Look for bom files in target folder only Signed-off-by: nekhtan <129828933+nekhtan@users.noreply.github.com> --------- Signed-off-by: nekhtan <129828933+nekhtan@users.noreply.github.com> --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 9e7da5089..c2b8d7a06 100644 --- a/index.js +++ b/index.js @@ -1281,7 +1281,7 @@ export async function createJavaBom(path, options) { bomJsonFiles = getAllFiles(path, "**/target/*.json", options); // Check if the bom json files got created in a directory other than target if (!bomJsonFiles.length) { - bomJsonFiles = getAllFiles(path, "**/bom*.json", options); + bomJsonFiles = getAllFiles(path, "target/**/*{cdx,bom}*.json", options); } const bomGenerated = bomJsonFiles.length; if (!bomGenerated || result.status !== 0 || result.error) {