json validation may throw a FileNotFoundException: classpath:spdx.schema.json.
This is because the SchemaRegistry that's created in CycloneDxSchema#getJsonSchema resolves the classpath resource with SchemaLoader.CLASSPATH_RESOURCE_LOADER, which uses whatever classpath is in Thread.currentThread().getContextClassLoader() when com.networknt.schema.resource.SchemaLoader is initialized. This may or may not be a classloader that can load spdx.schema.json.
I'm not sure if this should be a bug in cyclonedx-core-java or an upstream bug in json-schema-validator, but I'm encountering it through cyclonedx-core-java, so I'm starting by registering it here :)
(FWIW this started failing for us between 11.0.1 and 12.2.0, haven't looked into why it worked on 11.0.1)
json validation may throw a
FileNotFoundException: classpath:spdx.schema.json.This is because the
SchemaRegistrythat's created inCycloneDxSchema#getJsonSchemaresolves the classpath resource withSchemaLoader.CLASSPATH_RESOURCE_LOADER, which uses whatever classpath is inThread.currentThread().getContextClassLoader()whencom.networknt.schema.resource.SchemaLoaderis initialized. This may or may not be a classloader that can loadspdx.schema.json.I'm not sure if this should be a bug in cyclonedx-core-java or an upstream bug in json-schema-validator, but I'm encountering it through cyclonedx-core-java, so I'm starting by registering it here :)
(FWIW this started failing for us between 11.0.1 and 12.2.0, haven't looked into why it worked on 11.0.1)