Skip to content

Commit

Permalink
Merge pull request #493 from CycloneDX/cdx-core-9.0.5
Browse files Browse the repository at this point in the history
build: bump cyclonedx-core-java to 9.0.5
  • Loading branch information
skhokhlov authored Aug 15, 2024
2 parents fab2435 + 73a345c commit f9eb6e6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ repositories {
}

dependencies {
implementation("org.cyclonedx:cyclonedx-core-java:9.0.4") {
implementation("org.cyclonedx:cyclonedx-core-java:9.0.5") {
exclude(group = "org.apache.logging.log4j", module ="log4j-slf4j-impl")
}

Expand Down
13 changes: 6 additions & 7 deletions src/main/java/org/cyclonedx/gradle/CycloneDxTask.java
Original file line number Diff line number Diff line change
Expand Up @@ -734,14 +734,13 @@ private void writeXMLBom(final Version schemaVersion, final Bom bom)

private void writeJSONBom(final Version schemaVersion, final Bom bom) throws IOException {
final BomJsonGenerator bomGenerator = BomGeneratorFactory.createJson(schemaVersion, bom);
final String bomString = bomGenerator.toJsonString();
final File bomFile = new File(getDestination().get(), getOutputName().get() + ".json");
getLogger().info(MESSAGE_WRITING_BOM_JSON);
FileUtils.write(bomFile, bomString, StandardCharsets.UTF_8, false);
getLogger().info(MESSAGE_VALIDATING_BOM);

final Parser bomParser = new JsonParser();
try {
final String bomString = bomGenerator.toJsonString();
final File bomFile = new File(getDestination().get(), getOutputName().get() + ".json");
getLogger().info(MESSAGE_WRITING_BOM_JSON);
FileUtils.write(bomFile, bomString, StandardCharsets.UTF_8, false);
getLogger().info(MESSAGE_VALIDATING_BOM);
final Parser bomParser = new JsonParser();
final List<ParseException> exceptions = bomParser.validate(bomFile, schemaVersion);
exceptions.forEach(it -> getLogger().error(it.getMessage()));
if (!exceptions.isEmpty()) {
Expand Down

0 comments on commit f9eb6e6

Please sign in to comment.