{"id":20666052,"url":"https://github.com/francisdb/serviceloader-maven-plugin","last_synced_at":"2025-04-19T16:41:20.562Z","repository":{"id":636573,"uuid":"1052088","full_name":"francisdb/serviceloader-maven-plugin","owner":"francisdb","description":"Maven plugin for generating java serviceloader files","archived":false,"fork":false,"pushed_at":"2024-06-01T19:47:57.000Z","size":208,"stargazers_count":48,"open_issues_count":5,"forks_count":15,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-04-18T01:18:25.830Z","etag":null,"topics":["java","maven-plugin","serviceloader"],"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/francisdb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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,"publiccode":null,"codemeta":null}},"created_at":"2010-11-04T19:40:46.000Z","updated_at":"2025-01-13T12:30:55.000Z","dependencies_parsed_at":"2023-10-03T11:37:49.633Z","dependency_job_id":"f94d384b-e85e-430a-8e84-08cdb354320e","html_url":"https://github.com/francisdb/serviceloader-maven-plugin","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/francisdb%2Fserviceloader-maven-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/francisdb%2Fserviceloader-maven-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/francisdb%2Fserviceloader-maven-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/francisdb%2Fserviceloader-maven-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/francisdb","download_url":"https://codeload.github.com/francisdb/serviceloader-maven-plugin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249740169,"owners_count":21318679,"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":["java","maven-plugin","serviceloader"],"created_at":"2024-11-16T19:35:16.196Z","updated_at":"2025-04-19T16:41:20.520Z","avatar_url":"https://github.com/francisdb.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build status](https://github.com/francisdb/serviceloader-maven-plugin/workflows/Java%20CI%20with%20Maven/badge.svg)](https://github.com/francisdb/serviceloader-maven-plugin/actions)\n[![Maven Central](https://maven-badges.herokuapp.com/maven-central/eu.somatik.serviceloader-maven-plugin/serviceloader-maven-plugin/badge.svg)](https://maven-badges.herokuapp.com/maven-central/eu.somatik.serviceloader-maven-plugin/serviceloader-maven-plugin)\n\nThis maven plugin generates services files for the ServiceLoader introduced in Java 6 :\nhttps://docs.oracle.com/javase/9/docs/api/java/util/ServiceLoader.html\n\n# Use\n\nfor example:\n```xml\n\u003cbuild\u003e\n  \u003cplugins\u003e\n    \u003cplugin\u003e\n      \u003cgroupId\u003eeu.somatik.serviceloader-maven-plugin\u003c/groupId\u003e\n      \u003cartifactId\u003eserviceloader-maven-plugin\u003c/artifactId\u003e\n      \u003cversion\u003e1.3.1\u003c/version\u003e\n      \u003cconfiguration\u003e\n        \u003cservices\u003e\n          \u003cparam\u003ecom.foo.Dictionary\u003c/param\u003e\n          \u003cparam\u003ecom.foo.Operation\u003c/param\u003e\n        \u003c/services\u003e\n      \u003c/configuration\u003e\n      \u003cexecutions\u003e\n        \u003cexecution\u003e\n          \u003cgoals\u003e\n            \u003cgoal\u003egenerate\u003c/goal\u003e\n          \u003c/goals\u003e\n        \u003c/execution\u003e\n      \u003c/executions\u003e\n    \u003c/plugin\u003e\n  \u003c/plugins\u003e\n\u003c/build\u003e\n```\n\nthis will generate these files:\n\n* META-INF/services/com.foo.Dictionary\n* META-INF/services/com.foo.Operation\n\nby scanning the generated classes and finding all non-abstract/non-interface implementations of the service interfaces. The plugin itself has no Java 6 dependency\n\n# Excludes / includes\n\nAdditionally it is possible to filter implementation classes via includes and excludes section in the configuration. The class name notation is the same as for the services section.\n\nfor example:\n```xml\n\u003cbuild\u003e\n  \u003cplugins\u003e\n    \u003cplugin\u003e\n      \u003cgroupId\u003eeu.somatik.serviceloader-maven-plugin\u003c/groupId\u003e\n      \u003cartifactId\u003eserviceloader-maven-plugin\u003c/artifactId\u003e\n      \u003cversion\u003e1.3.1\u003c/version\u003e\n      \u003cconfiguration\u003e\n        \u003cservices\u003e\n          \u003cparam\u003ecom.foo.Dictionary\u003c/param\u003e\n          \u003cparam\u003ecom.foo.Operation\u003c/param\u003e\n        \u003c/services\u003e\n        \u003cincludes\u003e\n          \u003cinclude\u003e*.RightClass*\u003c/include\u003e\n        \u003c/includes\u003e\n      \u003c/configuration\u003e\n      \u003cexecutions\u003e\n        \u003cexecution\u003e\n          \u003cgoals\u003e\n            \u003cgoal\u003egenerate\u003c/goal\u003e\n          \u003c/goals\u003e\n        \u003c/execution\u003e\n      \u003c/executions\u003e\n    \u003c/plugin\u003e\n  \u003c/plugins\u003e\n\u003c/build\u003e\n```\n\nThis should add only implementation classes that begin with RightClass*.\n\n# Missing Service Classes\n\nThe default action when a service class is missing is to fail the build.\nIf you want to ignore this service, you can use the `failOnMissingServiceClass` option (`true` by default).\n\nfor example:\n```xml\n\u003cbuild\u003e\n  \u003cplugins\u003e\n    \u003cplugin\u003e\n      \u003cgroupId\u003eeu.somatik.serviceloader-maven-plugin\u003c/groupId\u003e\n      \u003cartifactId\u003eserviceloader-maven-plugin\u003c/artifactId\u003e\n      \u003cversion\u003e1.3.1\u003c/version\u003e\n      \u003cconfiguration\u003e\n      \t\u003cfailOnMissingServiceClass\u003efalse\u003c/failOnMissingServiceClass\u003e\n        \u003cservices\u003e\n          \u003cparam\u003ecom.foo.MissingService\u003c/param\u003e\n        \u003c/services\u003e\n      \u003c/configuration\u003e\n      \u003cexecutions\u003e\n        \u003cexecution\u003e\n          \u003cgoals\u003e\n            \u003cgoal\u003egenerate\u003c/goal\u003e\n          \u003c/goals\u003e\n        \u003c/execution\u003e\n      \u003c/executions\u003e\n    \u003c/plugin\u003e\n  \u003c/plugins\u003e\n\u003c/build\u003e\n```\n\n# Example\n\nA example project is provided and can be run like this:\n\n    $ mvn clean install\n    ...\n    [INFO] Generating service file .../example/target/classes/META-INF/services/eu.somatik.serviceloader.Operation\n    [INFO]   + eu.somatik.serviceloader.SimpleOperation\n    ...\n    \n    $ java -jar target/example-1.0-SNAPSHOT.jar\n    Found service implementation: eu.somatik.serviceloader.SimpleOperation@579a19fd\n    Hello world\n\n# Release\n\nsee http://central.sonatype.org/pages/apache-maven.html#performing-a-release-deployment-with-the-maven-release-plugin\n\n*Note: do `export GPG_TTY=$(tty)` first if you have `gpg: signing failed: Inappropriate ioctl for device` errors*\n\n```\nmvn -P release release:clean release:prepare\nmvn -P release release:perform\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffrancisdb%2Fserviceloader-maven-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffrancisdb%2Fserviceloader-maven-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffrancisdb%2Fserviceloader-maven-plugin/lists"}