{"id":13485608,"url":"https://github.com/cfg4j/cfg4j","last_synced_at":"2026-01-14T02:55:36.526Z","repository":{"id":32342257,"uuid":"35917780","full_name":"cfg4j/cfg4j","owner":"cfg4j","description":"Modern configuration library for distributed apps written in Java.","archived":false,"fork":false,"pushed_at":"2022-07-14T13:19:32.000Z","size":1003,"stargazers_count":556,"open_issues_count":95,"forks_count":118,"subscribers_count":25,"default_branch":"master","last_synced_at":"2026-01-14T01:46:41.714Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://cfg4j.org","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/cfg4j.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}},"created_at":"2015-05-20T01:14:19.000Z","updated_at":"2025-10-20T08:26:14.000Z","dependencies_parsed_at":"2022-07-19T13:03:22.656Z","dependency_job_id":null,"html_url":"https://github.com/cfg4j/cfg4j","commit_stats":null,"previous_names":["nort/config"],"tags_count":23,"template":false,"template_full_name":null,"purl":"pkg:github/cfg4j/cfg4j","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cfg4j%2Fcfg4j","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cfg4j%2Fcfg4j/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cfg4j%2Fcfg4j/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cfg4j%2Fcfg4j/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cfg4j","download_url":"https://codeload.github.com/cfg4j/cfg4j/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cfg4j%2Fcfg4j/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28408798,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T01:52:23.358Z","status":"online","status_checked_at":"2026-01-14T02:00:06.678Z","response_time":107,"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":[],"created_at":"2024-07-31T18:00:27.807Z","updated_at":"2026-01-14T02:55:36.506Z","avatar_url":"https://github.com/cfg4j.png","language":"Java","funding_links":[],"categories":["Projects"],"sub_categories":["Configuration"],"readme":"[![Twitter Follow](https://img.shields.io/twitter/follow/norbert_potocki.svg?style=social)](https://twitter.com/norbert_potocki)\n[![Documentation](https://img.shields.io/badge/documentation-www.cfg4j.org-blue.svg)](http://cfg4j.org)\n[![Examples](https://img.shields.io/badge/demo-here-blue.svg)](https://github.com/cfg4j/cfg4j-sample-apps)\n[![Maven Central](https://img.shields.io/maven-central/v/org.cfg4j/cfg4j-core.svg)](http://search.maven.org/#search|ga|1|org.cfg4j.cfg4j-core)\n[![JavaDoc](https://img.shields.io/badge/javadoc-html-blue.svg)](http://www.javadoc.io/doc/org.cfg4j/cfg4j-core)\n[![GitHub license](https://img.shields.io/github/license/cfg4j/cfg4j.svg)](https://github.com/cfg4j/cfg4j/blob/master/LICENSE)\n[![Travis](https://img.shields.io/travis/cfg4j/cfg4j/master.svg)](https://travis-ci.org/cfg4j/cfg4j)\n\n# Overview\n\u003cimg height=\"140px\" align=\"right\" src=\"https://github.com/cfg4j/cfg4j.github.io/blob/master/images/cfg4j.png\"\u003e\n\n**cfg4j** (\"configuration for Java\") is a **configuration library for Java distributed apps** (and more).\n\n#### Features:\n* Open source\n* **Easy to use**\n* **Auto-reloads** configuration\n* **Powerful** configuration mechanisms (interface **binding**, **multi-source** support with **fallback** strategy, **merging**, ...)\n* **Distributed-environment friendly** ( **caching**, support for **multiple environments** [test, preprod, prod], ...)\n* Reads configuration from: **[Consul](https://github.com/cfg4j/cfg4j-sample-apps/tree/master/consul-bind),\n [Git repos (YAML and/or properties)](https://github.com/cfg4j/cfg4j-sample-apps/tree/master/git-bind),\n [Files](https://github.com/cfg4j/cfg4j-sample-apps/tree/master/files-bind),\n [Classpath](https://github.com/cfg4j/cfg4j-sample-apps/tree/master/classpath-bind), ...**\n* Modern design\n  * Seamless integration with DI containers: **[Spring](https://spring.io/)**, **[Guice](https://github.com/google/guice)** and others\n  * Exposes performance metrics by integration with **[Metrics library](http://metrics.dropwizard.io)**\n  * Extensible (see the list of **plugins** below)\n  * Heavily tested (**99% code coverage**)\n  * Well [documented](http://cfg4j.org)\n  * Java 8+ required\n\n# Usage\nRead [an article about configuration management using cfg4j](http://potocki.io/post/141230472743/configuration-management-for-distributed-systems).\n\n## Detailed documentation\nHead to [the documentation](http://cfg4j.org).\n\n## Sample apps\nExplore the code of the [sample apps](https://github.com/cfg4j/cfg4j-sample-apps).\n\n\n## Quick start\n### Setting up dependency\n#### Gradle\n```groovy\ndependencies {\n  compile group: \"org.cfg4j\", name:\"cfg4j-core\", version: \"4.4.1\"\n  \n  // For Consul integration\n  compile group: \"org.cfg4j\", name:\"cfg4j-consul\", version: \"4.4.1\"\n  \n  // For git integration\n  compile group: \"org.cfg4j\", name:\"cfg4j-git\", version: \"4.4.1\"\n}\n```\n\n#### Maven\n```xml\n\u003cdependencies\u003e\n  \u003cdependency\u003e\n    \u003cgroupId\u003eorg.cfg4j\u003c/groupId\u003e\n    \u003cartifactId\u003ecfg4j-core\u003c/artifactId\u003e\n    \u003cversion\u003e4.4.1\u003c/version\u003e\n  \u003c/dependency\u003e\n  \u003c!-- For Consul integration --\u003e\n  \u003cdependency\u003e \n    \u003cgroupId\u003eorg.cfg4j\u003c/groupId\u003e\n    \u003cartifactId\u003ecfg4j-consul\u003c/artifactId\u003e\n    \u003cversion\u003e4.4.1\u003c/version\u003e\n  \u003c/dependency\u003e\n  \u003c!-- For git integration --\u003e\n  \u003cdependency\u003e\n    \u003cgroupId\u003eorg.cfg4j\u003c/groupId\u003e\n    \u003cartifactId\u003ecfg4j-git\u003c/artifactId\u003e\n    \u003cversion\u003e4.4.1\u003c/version\u003e\n  \u003c/dependency\u003e\n\u003c/dependencies\u003e\n```\n\n### Usage\nThe fastest way to start working with cfg4j is to use a Git repository as a configuration store. To do that follow the steps:\n\n* Use the following code in your application to connect to sample configuration source:\n```java\npublic class Cfg4jPoweredApplication {\n\n  // Change this interface to whatever you want\n  public interface SampleConfig {\n    Integer birthYear();\n    List\u003cString\u003e friends();\n    URL homepage();\n    Map\u003cString, Character\u003e grades();\n  }\n\n  public static void main(String... args) {\n    ConfigurationSource source = new GitConfigurationSourceBuilder()\n      .withRepositoryURI(\"https://github.com/cfg4j/cfg4j-git-sample-config.git\")\n      .build();\n      \n    ConfigurationProvider provider = new ConfigurationProviderBuilder()\n      .withConfigurationSource(source)\n      .build();\n    \n    SampleConfig config = configurationProvider.bind(\"reksio\", SampleConfig.class);\n    \n    // Use it!\n    System.out.println(config.homepage());\n  }\n\n}\n```\n\n* Optional steps\n    1. Fork the [configuration sample repository](https://github.com/cfg4j/cfg4j-git-sample-config).\n    2. Add your configuration to the \"*application.properties*\" file and commit the changes.\n    3. Update the code above to point to your fork.\n    \n# License\nLicensed under the Apache License, Version 2.0. See LICENSE file.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcfg4j%2Fcfg4j","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcfg4j%2Fcfg4j","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcfg4j%2Fcfg4j/lists"}