Skip to content

Commit

Permalink
fix: maven import scope is excluded in Stack analysis
Browse files Browse the repository at this point in the history
Signed-off-by: Zvi Grinberg <zgrinber@redhat.com>
  • Loading branch information
zvigrinberg committed Jul 28, 2024
1 parent c0639d7 commit d5b9aac
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/providers/base_java.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ export default class Base_Java {
if (targetDepth === srcDepth + 1) {
let from = this.parseDep(src);
let to = this.parseDep(target);
let matchedScope = target.match(/:compile|:provided|:runtime|:test|:system/g)
let matchedScopeSrc = src.match(/:compile|:provided|:runtime|:test|:system/g)
let matchedScope = target.match(/:compile|:provided|:runtime|:test|:system|:import/g)
let matchedScopeSrc = src.match(/:compile|:provided|:runtime|:test|:system|:import/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")) {
sbom.addDependency(sbom.purlToComponent(from), to)
Expand Down

0 comments on commit d5b9aac

Please sign in to comment.