DependencyTrack / DependencyTrack/dependency-track
Add support for multiple non expression licenses
- Dominant language
- Java
- Stars
- 4.2k
- Forks
- 811
- Avg merge
- 8h 39m
- Merged PRs (30d)
- 237
Description
### Current Behavior
I'm having an issue with deptrack to display multiple licenses in cyclondx 1.5 format.
The licenses are not an expression but an array of licenses.
Deptrack takes only the latest license in the array and displays it.
This causes inconsistency and false positives on license usage.
The sbom (left only the problematic dependency):
```{
"bomFormat": "CycloneDX",
"specVersion": "1.5",
"serialNumber": "urn:uuid:8892617a-60e7-42e1-abb5-bda1f451e960",
"version": 1,
"metadata": {
"timestamp": "2024-08-06T13:33:56Z",
"tools": {
"components": [
{
"group": "@cyclonedx",
"name": "cdxgen",
"version": "10.9.2",
"purl": "pkg:npm/%40cyclonedx/cdxgen@10.9.2",
"type": "application",
"bom-ref": "pkg:npm/@cyclonedx/cdxgen@10.9.2",
"author": "OWASP Foundation",
"publisher": "OWASP Foundation"
}
]
},
"authors": [
{
"name": "OWASP Foundation"
}
],
"lifecycles": [
{
"phase": "build"
}
],
"component": {
"name": "project-name",
"type": "application",
"group": "com.company",
"version": "0.0.1-LOCAL",
"properties": [
{
"name": "buildFile",
"value": "/app/build.gradle"
},
{
"name": "projectDir",
"value": "/app"
},
{
"name": "rootDir",
"value": "/app"
}
],
"purl": "pkg:maven/com.company/project-name@0.0.1-LOCAL?type=jar",
"bom-ref": "pkg:maven/com.company/project-name@0.0.1-LOCAL?type=jar",
"components": [
{
"group": "",
"name": "app",
"version": "latest",
"type": "application",
"bom-ref": "pkg:gem/app@latest",
"purl": "pkg:gem/app@latest"
}
]
},
"properties": [
{
"name": "cdx:bom:componentTypes",
"value": "maven"
},
{
"name": "cdx:bom:componentNamespaces",
"value": "commons-io\\njakarta.servlet\\norg.apache.commons\\norg.apache.logging.log4j\\norg.apache.santuario\\norg.junit.jupiter\\norg.junit.platform\\norg.opensaml"
}
]
},
"components": [
{
"publisher": "Eclipse Foundation",
"group": "jakarta.servlet",
"name": "jakarta.servlet-api",
"version": "5.0.0",
"description": "\n Eclipse Enterprise for Java (EE4J) is an open source initiative to create standard APIs,\n implementations of those APIs, and technology compatibility kits for Java runtimes\n that enable development, deployment, and management of server-side and cloud-native applications.\n ",
"licenses": [
{
"license": {
"id": "EPL-2.0",
"url": "https://opensource.org/licenses/EPL-2.0"
}
},
{
"license": {
"id": "GPL-2.0-with-classpath-exception",
"url": "https://opensource.org/licenses/GPL-2.0-with-classpath-exception"
}
}
],
"purl": "pkg:maven/jakarta.servlet/jakarta.servlet-api@5.0.0?type=jar",
"externalReferences": [
{
"type": "vcs",
"url": "https://github.com/eclipse-ee4j/servlet-api"
}
],
"type": "library",
"bom-ref": "pkg:maven/jakarta.servlet/jakarta.servlet-api@5.0.0?type=jar",
"properties": [
{
"name": "GradleProfileName",
"value": "compileClasspath"
}
]
}
],
"services": [],
"dependencies": [
"not relevant"
]
}
```
dep track:
We have issue #170 , but I think it's more related to the expression type license sbom.
### Proposed Behavior
Display all possible licenses - perhaps convert them to an expression and display it that way.
### Checklist
- [X] I have read and understand the [contributing guidelines](https://github.com/DependencyTrack/dependency-track/blob/master/CONTRIBUTING.md#filing-issues)
- [X] I have checked the [existing issues](https://github.com/DependencyTrack/dependency-track/issues) for whether this enhancement was already requested
Contributor guide
Assessment
This issue has not been assessed yet.