{"id":16374364,"url":"https://github.com/emilyy-dev/annotated-service-provider","last_synced_at":"2025-06-25T18:31:40.298Z","repository":{"id":57733126,"uuid":"416178603","full_name":"emilyy-dev/annotated-service-provider","owner":"emilyy-dev","description":"Define Java service providers by annotating them directly","archived":false,"fork":false,"pushed_at":"2021-10-19T02:18:11.000Z","size":48,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-07T17:46:36.771Z","etag":null,"topics":["annotation","annotation-processor","java","service-provider","serviceloader"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/emilyy-dev.png","metadata":{"files":{"readme":"README.md","changelog":"changelog.txt","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-10-12T04:09:59.000Z","updated_at":"2024-10-13T06:45:08.000Z","dependencies_parsed_at":"2022-09-26T22:30:39.270Z","dependency_job_id":null,"html_url":"https://github.com/emilyy-dev/annotated-service-provider","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/emilyy-dev/annotated-service-provider","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emilyy-dev%2Fannotated-service-provider","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emilyy-dev%2Fannotated-service-provider/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emilyy-dev%2Fannotated-service-provider/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emilyy-dev%2Fannotated-service-provider/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/emilyy-dev","download_url":"https://codeload.github.com/emilyy-dev/annotated-service-provider/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emilyy-dev%2Fannotated-service-provider/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261930663,"owners_count":23231920,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["annotation","annotation-processor","java","service-provider","serviceloader"],"created_at":"2024-10-11T03:17:01.182Z","updated_at":"2025-06-25T18:31:40.262Z","avatar_url":"https://github.com/emilyy-dev.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Annotated Service Provider\n### Define JVM service providers by annotating the provider class directly.\n[![Maven Central](https://img.shields.io/maven-central/v/io.github.emilyy-dev/annotated-service-provider?color=yellowgreen\u0026label=maven%20central)](https://search.maven.org/artifact/io.github.emilyy-dev/annotated-service-provider)\n[![Snapshot](https://img.shields.io/nexus/s/io.github.emilyy-dev/annotated-service-provider?label=snapshot\u0026server=https%3A%2F%2Fs01.oss.sonatype.org)](https://s01.oss.sonatype.org/content/repositories/snapshots/io/github/emilyy-dev/annotated-service-provider/)\n[![License](https://img.shields.io/github/license/emilyy-dev/annotated-service-provider?color=blue)](https://github.com/emilyy-dev/annotated-service-provider/blob/main/LICENSE.txt)\n\nThis annotation processor will add to the class-path services deployment (`META-INF/services/`) provider types that are\nannotated with the `@ProvidesService` annotation.\n\n### Example usage\n```java\npackage io.github.emilyydev.asp.demo;\n\nimport io.github.emilyydev.asp.ProvidesService;\nimport java.sql.Driver;\n\n@ProvidesService(Driver.class)\npublic class SqlDriverImpl implements Driver {\n  // implementation...\n}\n```\nThe annotation processor will read the class, ensure it meets the required criterion specified by the\n[ServiceLoader documentation](https://docs.oracle.com/javase/8/docs/api/java/util/ServiceLoader.html) and add the\nprovider type to the corresponding service file `META-INF/services/java.sql.Driver` as a new entry, in case that same\njar file provides multiple providers for the same service.\n\n### Adding it to your project\nASP is released on Maven Central under two different artifacts:\n* The annotation artifact: `io.github.emilyy-dev:annotated-service-provider:{version}`.\n* The annotation processor artifact: `io.github.emilyy-dev:annotated-service-provider-processor:{version}`.\nThe current version released is shown at the top of this readme. Snapshot builds can be found in OSS sonatype\n(https://s01.oss.sonatype.org/content/repositories/snapshots/)\n\nImporting ASP to your project:\n* Using Gradle\n```groovy\nrepositories {\n    mavenCentral()\n}\n\ndependencies {\n    implementation(\"io.github.emilyy-dev:annotated-service-provider:{version}\")\n    annotationProcessor(\"io.github.emilyy-dev:annotated-service-provider-processor:{version}\")\n}\n```\n\u003e Note: if your project uses Kotlin you need to use [**`kapt`**](https://kotlinlang.org/docs/kapt.html) to use\n\u003e annotation processors instead.\n\n* Using Maven\n```xml\n\u003cproject\u003e\n    \u003c!--  ...--\u003e\n    \u003cbuild\u003e\n        \u003cpluginManagement\u003e\n            \u003cplugins\u003e\n                \u003cplugin\u003e\n                    \u003cgroupId\u003eorg.apache.maven.plugins\u003c/groupId\u003e\n                    \u003cartifactId\u003emaven-compiler-plugin\u003c/artifactId\u003e\n                    \u003cversion\u003e3.8.1\u003c/version\u003e\n                    \u003cconfiguration\u003e\n                        \u003cannotationProcessorPaths\u003e\n                            \u003cpath\u003e\n                                \u003cgroupId\u003eio.github.emilyy-dev\u003c/groupId\u003e\n                                \u003cartifactId\u003eannotated-service-provider-processor\u003c/artifactId\u003e\n                                \u003cversion\u003e{version}\u003c/version\u003e\n                            \u003c/path\u003e\n                        \u003c/annotationProcessorPaths\u003e\n                    \u003c/configuration\u003e\n                \u003c/plugin\u003e\n            \u003c/plugins\u003e\n        \u003c/pluginManagement\u003e\n    \u003c/build\u003e\n\n    \u003cdependencies\u003e\n        \u003cdependency\u003e\n            \u003cgroupId\u003eio.github.emilyy-dev\u003c/groupId\u003e\n            \u003cartifactId\u003eannotated-service-provider\u003c/artifactId\u003e\n            \u003cversion\u003e{version}\u003c/version\u003e\n            \u003cscope\u003eprovided\u003c/scope\u003e\n        \u003c/dependency\u003e\n    \u003c/dependencies\u003e\n\u003c/project\u003e\n```\n\n### License\nThis project is licensed under the MIT license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femilyy-dev%2Fannotated-service-provider","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Femilyy-dev%2Fannotated-service-provider","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femilyy-dev%2Fannotated-service-provider/lists"}