{"id":18700702,"url":"https://github.com/manosbatsis/gradle-reflections-plugin","last_synced_at":"2025-09-17T19:03:55.612Z","repository":{"id":71235970,"uuid":"108957365","full_name":"manosbatsis/gradle-reflections-plugin","owner":"manosbatsis","description":"A Gradle plugin that uses Reflections to scan and index your project classes at build-time, allowing run-time querying without the indexing performance hit.","archived":false,"fork":false,"pushed_at":"2020-10-28T02:05:52.000Z","size":89,"stargazers_count":5,"open_issues_count":5,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-26T03:33:12.109Z","etag":null,"topics":["gradle","gradle-java","gradle-plugin","reflection","reflection-library","reflections"],"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/manosbatsis.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,"publiccode":null,"codemeta":null}},"created_at":"2017-10-31T06:57:41.000Z","updated_at":"2024-12-25T02:51:33.000Z","dependencies_parsed_at":"2023-02-28T01:15:35.530Z","dependency_job_id":null,"html_url":"https://github.com/manosbatsis/gradle-reflections-plugin","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/manosbatsis%2Fgradle-reflections-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/manosbatsis%2Fgradle-reflections-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/manosbatsis%2Fgradle-reflections-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/manosbatsis%2Fgradle-reflections-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/manosbatsis","download_url":"https://codeload.github.com/manosbatsis/gradle-reflections-plugin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248537871,"owners_count":21120893,"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":["gradle","gradle-java","gradle-plugin","reflection","reflection-library","reflections"],"created_at":"2024-11-07T11:38:31.084Z","updated_at":"2025-09-17T19:03:50.570Z","avatar_url":"https://github.com/manosbatsis.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Gradle Reflections Plugin [![Build Status](https://travis-ci.com/manosbatsis/gradle-reflections-plugin.svg?branch=master)](https://travis-ci.com/manosbatsis/gradle-reflections-plugin)\n\nThe plugin uses [Reflections](https://github.com/ronmamo/reflections) to scan and index your project classes \nat build-time, allowing run-time querying without the indexing performance hit.\n\n\n\u003c!-- TOC depthFrom:2 depthTo:6 withLinks:1 updateOnSave:1 orderedList:0 --\u003e\n\n- [Usage](#usage)\n\t- [Gradle](#gradle)\n\t- [Java](#java)\n- [Development](#development)\n\t- [Quickstart](#quickstart)\n\t- [Tests](#tests)\n\n\u003c!-- /TOC --\u003e\n\n## Usage\n\nThe idea is to use the plugin with Gradle to embed a pre-scanned metadata index in your jar,\nthen utilise the embedded index at ruintime using Reflections.collect(). See the Gradle and Java sections bellow  \nfor an example.   \n\n### Gradle\n\nThe plugin is published in [Gradle plugin portal](https://plugins.gradle.org/plugin/io.github.manosbatsis.gradle.plugin.reflections),\nso it is rather easy to use. This will add the pre-scanned\nmetadata index in your jar as `META-INF/reflections/PROJECTNAME-reflections.xml`, with\n*PROJECTNAME* substituted by your actual project name.\n\n```gradle\n// import the reflections plugin\nplugins {\n\tid \"io.github.manosbatsis.gradle.plugin.reflections\" version \"1.1\"\n}\n\n// you probably need this...\napply plugin: 'java'\n\n// reflections plugin needs the compiled\n// project classes, so either chain tasks\n// with dependsOn as bellow or execute tasks explicitly\n// when using the command line\nreflections{\n    dependsOn classes\n}\njar{\n    dependsOn reflections\n}\n\n\n// Use jcenter for resolving your dependencies.\nrepositories {\n\tjcenter()\n}\n\n// Add Reflections and dom4j dependencies\ndependencies {\n\tcompile 'org.reflections:reflections:0.9.10'\n\tcompile 'dom4j:dom4j:1.6.1'\n\ttestCompile 'junit:junit:4.12'\n}\n```\n\n### Java\n\nTo utilise the pre-scanned index simply create a Reflections instance as:\n\n```java\n// Collect and merge pre-scanned Reflection xml resources\n// and merge them into a Reflections instance\nReflections reflections = Reflections.collect();\n// use the instance, e.g.\nreflections.getSubTypesOf(Foobar.class);\n```\n\n## Development\n\n**You don't need this to use the plugin**. This section is meant for developers that want to build the plugin code themselves.\n\n### Quickstart\n\nThis section assumes you have a JDK and a recent Gradle installed and available in your path.\n\nClone:\n\n```\ngit clone https://github.com/manosbatsis/gradle-reflections-plugin.git\n```\n\nBuild:\n\n```\ngradle build\n```\n\n### Tests\n\nThe build has some [unit](src/test/java/io/github/manosbatsis/gradle/plugin/reflections/test/unit/ReflectionsPluginTest.java) \nand [integration](src/test/groovy/io/github/manosbatsis/gradle/plugin/reflections/test/integration/SimpleProjectIT.groovy) \ntests. The build creates the report at `build/reports/tests/test/index.html`:\n\n\u003cimg src=\"src/etc/doc/test-summary.png\"\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmanosbatsis%2Fgradle-reflections-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmanosbatsis%2Fgradle-reflections-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmanosbatsis%2Fgradle-reflections-plugin/lists"}