Skip to content

Commit

Permalink
Merge pull request #4142 from Gepardgame/feat/set-to-empty-version-wh…
Browse files Browse the repository at this point in the history
…en-non-given

Use empty string instead of `SNAPSHOT` as version in BOM download if project doesn't have a version
  • Loading branch information
nscuro authored Sep 12, 2024
2 parents eb3e74e + e7eda8c commit edb95ce
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -708,7 +708,7 @@ public static org.cyclonedx.model.Metadata createMetadata(final Project project)
cycloneComponent.setGroup(StringUtils.trimToNull(project.getGroup()));
cycloneComponent.setName(StringUtils.trimToNull(project.getName()));
if (StringUtils.trimToNull(project.getVersion()) == null) {
cycloneComponent.setVersion("SNAPSHOT"); // Version is required per CycloneDX spec
cycloneComponent.setVersion(""); // Version is required per CycloneDX spec
} else {
cycloneComponent.setVersion(StringUtils.trimToNull(project.getVersion()));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ public void exportProjectAsCycloneDxInventoryTest() {
"name": "projectSupplier"
},
"name": "acme-app",
"version": "SNAPSHOT"
"version": ""
},
"manufacture": {
"name": "projectManufacturer"
Expand Down Expand Up @@ -492,7 +492,7 @@ public void exportProjectAsCycloneDxInventoryWithVulnerabilitiesTest() {
"type": "application",
"bom-ref": "${json-unit.matches:projectUuid}",
"name": "acme-app",
"version": "SNAPSHOT"
"version": ""
},
"tools": [
{
Expand Down Expand Up @@ -686,7 +686,7 @@ public void exportProjectAsCycloneDxVdrTest() {
"type": "application",
"bom-ref": "${json-unit.matches:projectUuid}",
"name": "acme-app",
"version": "SNAPSHOT"
"version": ""
},
"tools": [
{
Expand Down

0 comments on commit edb95ce

Please sign in to comment.