{"id":28632656,"url":"https://github.com/chrimle/spring-boot-static-property-injector","last_synced_at":"2026-05-06T19:40:05.037Z","repository":{"id":298003705,"uuid":"998370225","full_name":"Chrimle/spring-boot-static-property-injector","owner":"Chrimle","description":"Inject Spring Boot Properties into static fields!","archived":false,"fork":false,"pushed_at":"2025-06-08T21:46:46.000Z","size":30,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-08T22:01:46.230Z","etag":null,"topics":["spring","spring-boot","spring-boot-3","spring-boot-starter"],"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/Chrimle.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":"chrimle","patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"lfx_crowdfunding":null,"polar":null,"buy_me_a_coffee":null,"thanks_dev":null,"custom":null}},"created_at":"2025-06-08T13:20:43.000Z","updated_at":"2025-06-08T21:49:07.000Z","dependencies_parsed_at":"2025-06-08T22:01:50.632Z","dependency_job_id":"03d70601-b7e3-4a0e-87ed-7630e086c142","html_url":"https://github.com/Chrimle/spring-boot-static-property-injector","commit_stats":null,"previous_names":["chrimle/spring-boot-static-property-injector"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/Chrimle/spring-boot-static-property-injector","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Chrimle%2Fspring-boot-static-property-injector","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Chrimle%2Fspring-boot-static-property-injector/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Chrimle%2Fspring-boot-static-property-injector/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Chrimle%2Fspring-boot-static-property-injector/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Chrimle","download_url":"https://codeload.github.com/Chrimle/spring-boot-static-property-injector/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Chrimle%2Fspring-boot-static-property-injector/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259479622,"owners_count":22864366,"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":["spring","spring-boot","spring-boot-3","spring-boot-starter"],"created_at":"2025-06-12T14:12:27.561Z","updated_at":"2026-05-06T19:40:05.024Z","avatar_url":"https://github.com/Chrimle.png","language":"Java","funding_links":["https://github.com/sponsors/chrimle"],"categories":[],"sub_categories":[],"readme":"# Spring Boot Static Property Injector\n[![Java CI with Maven](https://github.com/Chrimle/spring-boot-static-property-injector/actions/workflows/maven.yml/badge.svg)](https://github.com/Chrimle/spring-boot-static-property-injector/actions/workflows/maven.yml)\n[![Maven Package](https://github.com/Chrimle/spring-boot-static-property-injector/actions/workflows/maven-publish.yml/badge.svg)](https://github.com/Chrimle/spring-boot-static-property-injector/actions/workflows/maven-publish.yml)\n[![pages-build-deployment](https://github.com/Chrimle/spring-boot-static-property-injector/actions/workflows/pages/pages-build-deployment/badge.svg)](https://github.com/Chrimle/spring-boot-static-property-injector/actions/workflows/pages/pages-build-deployment)\n\nIf you find this project useful, please ⭐ **Star** ⭐ it and share it with others!\nThis is the best way to show appreciation for this project - Thank you! ❤️\n\n## Purpose\nLoad Spring Boot properties (as [SpEL](https://docs.spring.io/spring-framework/docs/3.0.x/reference/expressions.html) \nand/or Spring Property Placeholders e.g. [@Value-annotation](https://docs.spring.io/spring-framework/reference/core/beans/annotation-config/value-annotations.html)) \nto `static` fields!\n\n## JavaDoc\n[The official JavaDoc hosted on javadoc.io](https://javadoc.io/doc/io.github.chrimle/spring-boot-static-property-injector/latest/io/github/chrimle/sbspi/package-summary.html).\n\n## Example\nThe following is a simple example of how this library can be used.\n### 1. Import Dependency\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003eio.github.chrimle\u003c/groupId\u003e\n    \u003cartifactId\u003espring-boot-static-property-injector\u003c/artifactId\u003e\n    \u003cversion\u003e0.1.2\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\u003e [!NOTE]\n\u003e This artifact is hosted on\n\u003e - [Maven Central Repository](https://central.sonatype.com/artifact/io.github.chrimle/spring-boot-static-property-injector)\n\u003e - [GitHub Packages](https://github.com/Chrimle/spring-boot-static-property-injector/packages)\n\n### 2. Include `StaticValueInjector` Bean\n\n```java\nimport io.github.chrimle.sbspi.StaticValueInjector;\nimport org.springframework.boot.autoconfigure.SpringBootApplication;\n\n@SpringBootApplication(scanBasePackageClasses = StaticValueInjector.class)\nclass ExampleSpringBootApplication {}\n```\n\n### 3. Configure Bean Class Scanning using `sbspi.basePackage`\n```properties\nsbspi.basePackage=your.example.app.subpackage\n```\n### 4. Annotate Fields with `@StaticValue`\n\n```java\nimport io.github.chrimle.sbspi.StaticValue;\n\npublic class Example {\n\n  // This field MAY remain null if the property is not set.\n  @StaticValue(\"${myapp.custom.example-nullable-field}\")\n  private static String EXAMPLE_NULLABLE_FIELD;\n  \n  // This field MAY be set to \"someDefaultValue\" if the property is not set.\n  @StaticValue(\"${myapp.custom.example-default-field:someDefaultValue}\")\n  private static String EXAMPLE_DEFAULT_FIELD;\n\n}\n```\n### 5. If You encounter any issues\n1. For unexpected issues, a `StaticValueInjectorException` will be thrown with a description of what went wrong.\n2. In case of fields not being set as expected, review the `sbspi.basePackage`-property and the package name of the relevant class.\n3. Enable `DEBUG` logs for `io.github.chrimle.sbspi` to see which fields have been processed.\n4. Open a GitHub issue describing the issue and include the findings from these steps.\n\n## Road Map\n\nPlan for the 1.0.0 release.\n\n### MAJOR\n- TBD...\n\n### MINOR\n- Support annotating `static` method arguments with `@StaticValue`\n- Support property prefixes on class-level\n  - Useful when annotating multiple fields with long common property prefixes.\n- Improve `DEBUG` logs by masking potential secrets\n  - Add `isSecret`-property to the `@StaticValue` annotation to mask property values in logs.\n\n### PATCH\n- Extend Test Suite\n  - Test more rigorously\n    - String\n    - Integer\n    - Boolean\n\n## Change Log\n\n### [0.1.2](https://github.com/Chrimle/spring-boot-static-property-injector/releases/tag/v0.1.2)\n- Updated JavaDocs\n    - `StaticValueInjectorException`\n- Added Missing License Header to all `.java` Files\n- Set [`chrimle-oss-parent`](https://github.com/Chrimle/Chrimle-OSS-Parent) as Maven Parent\n\n### [0.1.1](https://github.com/Chrimle/spring-boot-static-property-injector/releases/tag/v0.1.1)\n- Updated JavaDocs\n  - `StaticValueInjectorException`\n\n### [0.1.0](https://github.com/Chrimle/spring-boot-static-property-injector/releases/tag/v0.1.0)\n- Introduced `@StaticValue`\n- Introduced `StaticValueInjector`\n- Added Support for SpEL\n- Added Support for Property Placeholders\n- Published to GitHub Packages\n- Published to Maven Central Repository\n- Deployed GitHub Pages\n- Deployed JavaDoc\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchrimle%2Fspring-boot-static-property-injector","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchrimle%2Fspring-boot-static-property-injector","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchrimle%2Fspring-boot-static-property-injector/lists"}