You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
JSON schema for events must be loaded from classpath #71
Which means it expects to find the schema as a file in the filesystem. This code fails when the cdevents-java-sdk is consumed as a dependency by other projects, as the schema files are no longer found in the filesystem but rather as embedded resources within the cdevents-java-sdk JAR.
This code must be updated to find the schema as a classpath resource first, falling back to filesystem if not found.
dev.cdevents.exception.CDEventsException: Exception while reading Event JsonSchema file
at dev.cdevents.events.PipelinerunStartedCDEvent.eventSchema(PipelinerunStartedCDEvent.java:106)
at dev.cdevents.CDEvents.getJsonSchemaValidationMessages(CDEvents.java:136)
at dev.cdevents.CDEvents.validateCDEvent(CDEvents.java:82)
at dev.cdevents.CDEvents.cdEventAsCloudEvent(CDEvents.java:55)
at org.jreleaser.extensions.cdevents.CDEventsWorkflowListener.onSessionStart(CDEventsWorkflowListener.java:181)
at org.jreleaser.model.internal.JReleaserContext.fireSessionStartEvent(JReleaserContext.java:1051)
at org.jreleaser.workflow.WorkflowImpl.doExecute(WorkflowImpl.java:104)
at org.jreleaser.workflow.WorkflowImpl.execute(WorkflowImpl.java:54)
at org.jreleaser.cli.Assemble.doExecute(Assemble.java:99)
at org.jreleaser.cli.AbstractModelCommand.execute(AbstractModelCommand.java:89)
at org.jreleaser.cli.AbstractCommand.call(AbstractCommand.java:52)
at org.jreleaser.cli.AbstractModelCommand.call(AbstractModelCommand.java:53)
at org.jreleaser.cli.AbstractCommand.call(AbstractCommand.java:37)
at picocli.CommandLine.executeUserObject(CommandLine.java:2041)
at picocli.CommandLine.access$1500(CommandLine.java:148)
at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2461)
at picocli.CommandLine$RunLast.handle(CommandLine.java:2453)
at picocli.CommandLine$RunLast.handle(CommandLine.java:2415)
at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2273)
at picocli.CommandLine$RunLast.execute(CommandLine.java:2417)
at picocli.CommandLine.execute(CommandLine.java:2170)
at org.jreleaser.cli.Main.execute(Main.java:98)
at org.jreleaser.cli.Main.run(Main.java:81)
at org.jreleaser.cli.Main.main(Main.java:70)
Caused by: java.nio.file.NoSuchFileException: ../spec/schemas/pipelinerunstarted.json
at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:92)
at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:106)
at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)
at java.base/sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:261)
at java.base/java.nio.file.Files.newByteChannel(Files.java:379)
at java.base/java.nio.file.Files.newByteChannel(Files.java:431)
at java.base/java.nio.file.Files.readAllBytes(Files.java:3268)
at java.base/java.nio.file.Files.readString(Files.java:3346)
at java.base/java.nio.file.Files.readString(Files.java:3305)
at dev.cdevents.events.PipelinerunStartedCDEvent.eventSchema(PipelinerunStartedCDEvent.java:104)
... 23 more
Activity
aalmiray commentedon Feb 13, 2024
Here's an stacktrace that occurs when an event is created with the following code:
Fix cdevents#71 Load JSON schemas from classpath
Fix cdevents#71 Load JSON schemas from classpath
Fix cdevents#71 Load JSON schemas from classpath
Fix cdevents#71 Load JSON schemas from classpath
Fix #71 Load JSON schemas from classpath (#76)
cdevents-bot commentedon Mar 12, 2024
🎉 This issue has been resolved in
v0.3.1(Release Notes)