Skip to content

Commit

Permalink
fix: maven component analysis xml wrong parsing of x.0 versions ( x >=0)
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 7, 2024
1 parent aa42da1 commit 00f5b59
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
5 changes: 4 additions & 1 deletion src/providers/java_maven.js
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,10 @@ export default class Java_maven extends Base_java {
// build xml parser with options
let parser = new XMLParser({
commentPropName: '#comment', // mark comments with #comment
isArray: (_, jpath) => 'project.dependencies.dependency' === jpath // load deps as array
isArray: (_, jpath) => 'project.dependencies.dependency' === jpath,
numberParseOptions: {
skipLike: /[0-9]+[.]0/
}
})
// read manifest pom.xml file into buffer
let buf = fs.readFileSync(manifest)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,10 +169,10 @@
{
"group": "javax.enterprise",
"name": "cdi-api",
"version": "2",
"purl": "pkg:maven/javax.enterprise/cdi-api@2",
"version": "2.0",
"purl": "pkg:maven/javax.enterprise/cdi-api@2.0",
"type": "library",
"bom-ref": "pkg:maven/javax.enterprise/cdi-api@2"
"bom-ref": "pkg:maven/javax.enterprise/cdi-api@2.0"
},
{
"group": "commons-configuration",
Expand Down Expand Up @@ -221,7 +221,7 @@
"pkg:maven/com.fasterxml.jackson.core/jackson-databind@2.16.0",
"pkg:maven/com.google.code.findbugs/jsr305@3.0.2",
"pkg:maven/com.github.spotbugs/spotbugs-annotations@4.8.3",
"pkg:maven/javax.enterprise/cdi-api@2",
"pkg:maven/javax.enterprise/cdi-api@2.0",
"pkg:maven/commons-configuration/commons-configuration@1.1",
"pkg:maven/com.squareup.okhttp3/okhttp@4.12.0",
"pkg:maven/org.projectlombok/lombok@1.18.30"
Expand Down Expand Up @@ -300,7 +300,7 @@
"dependsOn": []
},
{
"ref": "pkg:maven/javax.enterprise/cdi-api@2",
"ref": "pkg:maven/javax.enterprise/cdi-api@2.0",
"dependsOn": []
},
{
Expand Down

0 comments on commit 00f5b59

Please sign in to comment.