{"id":39600314,"url":"https://github.com/cdevents/sdk-java","last_synced_at":"2026-01-18T07:52:06.616Z","repository":{"id":42522517,"uuid":"469039738","full_name":"cdevents/sdk-java","owner":"cdevents","description":"Java SDK for CDEvents","archived":false,"fork":false,"pushed_at":"2024-03-12T21:54:19.000Z","size":341,"stargazers_count":4,"open_issues_count":6,"forks_count":6,"subscribers_count":5,"default_branch":"main","last_synced_at":"2024-03-12T22:46:13.900Z","etag":null,"topics":["cdevents","hacktoberfest","java","sdk"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cdevents.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2022-03-12T09:40:23.000Z","updated_at":"2023-10-27T16:00:57.000Z","dependencies_parsed_at":"2024-03-12T22:51:47.432Z","dependency_job_id":null,"html_url":"https://github.com/cdevents/sdk-java","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/cdevents/sdk-java","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdevents%2Fsdk-java","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdevents%2Fsdk-java/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdevents%2Fsdk-java/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdevents%2Fsdk-java/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cdevents","download_url":"https://codeload.github.com/cdevents/sdk-java/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdevents%2Fsdk-java/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28533235,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-18T00:39:45.795Z","status":"online","status_checked_at":"2026-01-18T02:00:07.578Z","response_time":98,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cdevents","hacktoberfest","java","sdk"],"created_at":"2026-01-18T07:52:06.523Z","updated_at":"2026-01-18T07:52:06.595Z","avatar_url":"https://github.com/cdevents.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CDEvents Java SDK\n\nJava SDK to produce [CDEvents](https://cdevents.dev).\n\nThe SDK can be used to create CDEvents and render as CloudEvents to send them to a specific CloudEvents broker\n\n## Add dependency module\n\n```xml\n\u003cdependency\u003e\n  \u003cgroupId\u003edev.cdevents\u003c/groupId\u003e\n  \u003cartifactId\u003ecdevents-sdk-java\u003c/artifactId\u003e\n  \u003cversion\u003e${cdevents.version}\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n## Create your first CDEvent\n\nBelow is the example of creating a new [PipelineRun-finished](https://cdevents.dev/docs/core/#pipelinerun-finished) event,\n\n```java\npublic class CDEventsExample {\n\n    public static void main(String args[]){\n        /*when creating new object of any CDEvent type, the event will be initialized with\n        context.id, context.type, context.version, context.timestamp\n        and subject.type */\n        PipelinerunFinishedCDEvent pipelinerunFinishedCDEvent =  new PipelinerunFinishedCDEvent();\n\n        /* set the required context fields to the pipelineRunFinishedCDEvent */\n        pipelinerunFinishedCDEvent.setSource(URI.create(\"http://dev.cdevents\"));\n\n        /* set the required subject fields to the pipelineRunFinishedCDEvent */\n        pipelinerunFinishedCDEvent.setSubjectId(\"/dev/pipeline/run/1\");\n        pipelinerunFinishedCDEvent.setSubjectSource(URI.create(\"http://dev.pipeline.run/source\"));\n        pipelinerunFinishedCDEvent.setSubjectUrl(\"http://dev.pipeline.run/url\");\n        pipelinerunFinishedCDEvent.setSubjectOutcome(CDEventConstants.Outcome.SUCCESS.getOutcome());\n        pipelinerunFinishedCDEvent.setSubjectPipelineName(\"testPipeline\");\n        pipelinerunFinishedCDEvent.setSubjectErrors(\"pipelineErrors\");\n\n        /* Create a CloudEvent from a pipelineRunFinishedCDEvent */\n        CloudEvent ceEvent = CDEvents.cdEventAsCloudEvent(pipelinerunFinishedCDEvent);\n\n        /* This CDEvent can be sent as CloudEvent using HTTP Protocol Binding,\n            Refer : https://cloudevents.github.io/sdk-java/http-basic.html\n         */\n\n    }\n}\n```\nNow the CDEvent can be sent as CloudEvent using [Generic HTTP Protocol Binding](https://cloudevents.github.io/sdk-java/http-basic.html)\n\n## Contributing\n\nIf you would like to contribute, see our [development](DEVELOPMENT.md) guide.\n\n## References\n\n- [CDEvents](https://cdevents.dev)\n- [CDEvents Primer](https://cdevents.dev/docs/primer/)\n- [CDFoundation Specification](https://cdevents.dev/docs/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcdevents%2Fsdk-java","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcdevents%2Fsdk-java","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcdevents%2Fsdk-java/lists"}