From 4a1c01837890f1df5de696afdc8b6c965e31be26 Mon Sep 17 00:00:00 2001 From: Zvi Grinberg Date: Fri, 8 Dec 2023 03:09:01 +0200 Subject: [PATCH] fix: little adjustment Signed-off-by: Zvi Grinberg --- src/providers/java_maven.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/providers/java_maven.js b/src/providers/java_maven.js index 2d420f8..938f402 100644 --- a/src/providers/java_maven.js +++ b/src/providers/java_maven.js @@ -105,10 +105,10 @@ function parseDependencyTree(src, srcDepth, lines, sbom) { if (targetDepth === srcDepth + 1) { let from = parseDep(src); let to = parseDep(target); - let matchedScope = target.match(/compile|provided|runtime|test|system/g) + let matchedScope = target.match(/:compile|:provided|:runtime|:test|:system/g) let matchedScopeSrc = src.match(/:compile|:provided|:runtime|:test|:system/g) // only add dependency to sbom if it's not with test scope or if it's root - if ((matchedScope && matchedScope[0] !== "test" && (matchedScopeSrc && matchedScopeSrc[0] !== "test")) || (srcDepth == 0 && matchedScope && matchedScope[0] !== "test")) { + if ((matchedScope && matchedScope[0] !== ":test" && (matchedScopeSrc && matchedScopeSrc[0] !== ":test")) || (srcDepth == 0 && matchedScope && matchedScope[0] !== ":test")) { sbom.addDependency(sbom.purlToComponent(from), to) } } else {