CycloneDX / CycloneDX/cyclonedx-maven-plugin
Cyclonedx seems to ignore some configuration options
- Dominant language
- Java
- Stars
- 385
- Forks
- 107
- Avg merge
- 17h 31m
- Merged PRs (30d)
- 7
Description
After recently upgrading libraries in a project, including upgrading cyclonedx-maven-plugin from 2.5.3 to 2.9.1, the output file is no longer written to the desired path, nor with the desired name.
The console output looks like:
```
[INFO] --- cyclonedx:2.9.1:makeAggregateBom (default) @ project name ---
[INFO] CycloneDX: Resolving Dependencies
[INFO] CycloneDX: Creating BOM version 1.6 with 248 component(s)
[INFO] CycloneDX: Writing and validating BOM (JSON): project base dir\target\classes\META-INF\sbom\application.cdx.json
[WARNING] Unknown keyword meta:enum - you should define your own Meta Schema. If the keyword is irrelevant for validation, just use a NonValidationKeyword or if it should generate annotations AnnotationKeyword
[WARNING] Unknown keyword deprecated - you should define your own Meta Schema. If the keyword is irrelevant for validation, just use a NonValidationKeyword or if it should generate annotations AnnotationKeyword
[INFO] attaching as project name-2.1.1-RELEASE-cyclonedx.json
```
I do not want it to be saved to /target/classes/META-INF/sbom, but to /target root dir. I also don't want it to be called application.cdx.json, but bom.xml
No changes were made to configuration values at first after the dependency upgrade. Attempted to add various explicit outputDirectory values during testing to no effect.
Attempted to use different versions of cyclonedx. Versions 2.6.2 and lower fail due to xml incompatabilities. Any version from 2.7.0 and up give the same incorrect outputfile result as described above.
Unsure if it is a cyclonedx bug, configuration fault, compatability conflict with maven, or something else I and my coworkers are just not seeing.
To Reproduce
Compile via maven.
Expected behavior
To follow defined configuraion values.
Environment (please complete the following information):
OS: Windows and Linux (via maven install in IntelliJ Idea IDE, and maven compile in Jenkins)
Maven version 3.9.9 and 3.9.8
CycloneDX Plugin version 2.9.1 (and any version higher than 2.6.2)
Java version: 21
Please let me know if you require any more information about the build plugins and other dependencies in the project.
Additional context
Below is my current cyclonedx configuration in pom.xml
```xml
org.cyclonedx
cyclonedx-maven-plugin
${cyclonedx-maven-plugin-version}
package
makeAggregateBom
library
${cyclonedx-schema-version}
true
true
true
true
true
false
false
true
all
bom
${project.build.directory}
false
```
Contributor guide
Research direction
Start with the plugin configuration in pom.xml and reproduce the issue by compiling via Maven. Compare the effective CycloneDX plugin configuration with the generated path and filename; done means the BOM files are written to the configured project build directory with the configured output name.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100