Skip to content

Commit

Permalink
fix: little adjustment
Browse files Browse the repository at this point in the history
Signed-off-by: Zvi Grinberg <zgrinber@redhat.com>
  • Loading branch information
zvigrinberg committed Dec 20, 2023
1 parent 5e4f907 commit 4a1c018
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/providers/java_maven.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 4a1c018

Please sign in to comment.