diff --git a/src/providers/base_java.js b/src/providers/base_java.js index e39d330..28d4d59 100644 --- a/src/providers/base_java.js +++ b/src/providers/base_java.js @@ -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) diff --git a/src/providers/java_gradle.js b/src/providers/java_gradle.js index d61a669..4871cd2 100644 --- a/src/providers/java_gradle.js +++ b/src/providers/java_gradle.js @@ -393,7 +393,7 @@ export default class Java_gradle extends Base_java { // Dependency line is of form String Notation } else { let depParts - if(depToBeIgnored.match(/^[a-z]+\s/)) { + if(depToBeIgnored.match(/^[a-zA-Z]+\s/)) { depParts = depToBeIgnored.split(" ")[1].split(":"); } else {