Skip to content

Commit

Permalink
Merge pull request #149 from RHEcosystemAppEng/hotfix/maven-import-sc…
Browse files Browse the repository at this point in the history
…ope-excluded-sa

fix: 2 bugs of gradle and maven
  • Loading branch information
zvigrinberg authored Jul 28, 2024
2 parents c0639d7 + 02e4851 commit a79b900
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 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
2 changes: 1 addition & 1 deletion src/providers/java_gradle.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit a79b900

Please sign in to comment.