{"id":15010396,"url":"https://github.com/fern-flower-lab/java-properties","last_synced_at":"2026-01-19T12:05:47.433Z","repository":{"id":45901963,"uuid":"504963769","full_name":"fern-flower-lab/java-properties","owner":"fern-flower-lab","description":"Java properties files micro parser for Clojure","archived":false,"fork":false,"pushed_at":"2023-03-19T19:28:57.000Z","size":25,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-09T22:51:24.880Z","etag":null,"topics":["clj","clojure","clojure-library","compatibility","configuration","edn","java","java-properties","parser","properties-parser","tiny"],"latest_commit_sha":null,"homepage":"","language":"Clojure","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/fern-flower-lab.png","metadata":{"files":{"readme":"README.adoc","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},"funding":{"github":"fern-flower-lab"}},"created_at":"2022-06-18T22:32:49.000Z","updated_at":"2022-12-16T15:51:53.000Z","dependencies_parsed_at":"2025-02-21T07:31:12.075Z","dependency_job_id":null,"html_url":"https://github.com/fern-flower-lab/java-properties","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fern-flower-lab%2Fjava-properties","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fern-flower-lab%2Fjava-properties/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fern-flower-lab%2Fjava-properties/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fern-flower-lab%2Fjava-properties/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fern-flower-lab","download_url":"https://codeload.github.com/fern-flower-lab/java-properties/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248125643,"owners_count":21051766,"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":["clj","clojure","clojure-library","compatibility","configuration","edn","java","java-properties","parser","properties-parser","tiny"],"created_at":"2024-09-24T19:34:00.377Z","updated_at":"2026-01-19T12:05:47.427Z","avatar_url":"https://github.com/fern-flower-lab.png","language":"Clojure","readme":"= Java Properties\n\nimage:https://img.shields.io/github/license/fern-flower-lab/java-properties?style=for-the-badge[GitHub]\nimage:https://img.shields.io/clojars/v/ai.z7/java-properties.svg?style=for-the-badge[]\nimage:https://img.shields.io/github/v/tag/fern-flower-lab/java-properties?style=for-the-badge[GitHub tag (latest by date)]\nimage:https://img.shields.io/github/last-commit/fern-flower-lab/java-properties?style=for-the-badge[GitHub last commit]\n\n\n== Objectives\n\nThis reader for Clojure is a small but powerful library that makes possible to use a regular `.properties` configurations that familiar to every Java programmer in any Clojure project.\nNo more headaches even if you need to import the configurations from other (not Clojure) project.\n\nThe library has **no dependencies** and written in pure Clojure.\n\nIn contrary to other libraries it not delivers any specific typings or other sugar.\n\nMainly intended to hybrid projects, migrations and for use by pure-Java integrations.\n\n== Usage\n\n=== Writing the config\n\nThe config file is a well known dead simple Java properties:\n\n[source, properties]\n----\ncore.journal.port = 26333\ncore.journal.host = 4.3.2.1\n\nbackend.0.name=\"string\"\nbackend.0.type=\"another string\"\nbackend.0.enabled=true\n\nbackend.2.name=\"weak-connection-api\"\nbackend.2.type=\"http\"\nbackend.2.method=\"post\"\n\nfront.2.0.mode=my-symbol-1\nfront.2.1.type=my-symbol-2\nfront.4.2.mode=my-symbol-3\nfront.4.2.type=1\n\ntomato.0 = \"vvv\"\ntomato.1 = \"zzz\"\n\nservice[0]=\"foo\"\nservice[1].bar = \"bar\"\nservice[2][1]= \"baz\"\nservice[2][2].zoo = 11\nservice[4][3]= true\n\nfoo[0].maa[0] = 1\nfoo[0].maa[1] = 2\n\nservice.\"my.package.path.bean.group.threadCount\"=12\n----\n\n=== Reading the config\n\n[source, clojure]\n----\n(require '[java-properties.core :as jconf])\n;; nil\n(def conf-simple (jconf/load-config \"test\"))\n;; conf-simple\n;; {:backend {:0 {:enabled true, :bootstrap-servers \"127.0.0.1:9092\", :type \"kafka\", :name \"test\"}, :2 {:type \"http\", :name \"weak-connection-api\", :method \"post\"}}, :front {:2 {:0 {:mode some}, :1 {:type ttt}}, :4 {:2 {:type 1, :mode zzz}}}, :core {:test-list a, :journal {:port 26333}}}\n(def conf-full (jconf/load-config \"test\" {:with-arrays true}))\n;; conf-full\n;; {:backend [{:enabled true, :bootstrap-servers \"127.0.0.1:9092\", :type \"kafka\", :name \"test\"} nil {:type \"http\", :name \"weak-connection-api\", :method \"post\"}], :front [nil nil [{:mode some} {:type ttt}] nil [nil nil {:type 1, :mode zzz}]], :core {:test-list a, :journal {:port 26333}}}\n(slurp \"ext.properties\")\n;; \"external.property.name = foo\"\n(def conf-full-override (jconf/load-config \"test\" {:with-arrays true :config \"./ext.properties\"}))\n;; conf-full-override\n;; {:backend [{:enabled true, :bootstrap-servers \"127.0.0.1:9092\", :type \"kafka\", :name \"test\"} nil {:type \"http\", :name \"weak-connection-api\", :method \"post\"}], :front [nil nil [{:mode some} {:type ttt}] nil [nil nil {:type 1, :mode zzz}]], :core {:test-list a, :journal {:port 26333}}, :external {:property {:name foo}}}\n----\n\n=== Overriding values\n\nThe library supports regular overrides via commandline, like:\n\n[source, bash]\n----\njava -Dapi.port=12345 -jar /path/to/your/compiled.jar\n----\n\ni.e. `-Dapi.port=12345` is stands to override properies file defined `api.port=98765` pair.\nThe same result can be achieved by classical call to Java's `setProperty` method upon parsing the configuration:\n\n[source, java]\n----\n(System/setProperty \"api.port\" \"12345\")\n----\n\nFor more sofistical example, see test cases in the main repo.\n\n=== Helpers\n\nThe library also contains some handy methods-helpers\n\n.Pretty formatting\n[source, clojure]\n----\n(-\u003e conf-full jconf/pretty println)\n;; {:backend\n;;  [{:enabled true,\n;;    :bootstrap-servers \"127.0.0.1:9092\",\n;;    :type \"kafka\",\n;;    :name \"test\"}\n;;   nil\n;;   {:type \"http\", :name \"weak-connection-api\", :method \"post\"}],\n;;  :front\n;;  [nil\n;;   nil\n;;   [{:mode some} {:type ttt}]\n;;   nil\n;;   [nil nil {:type 1, :mode zzz}]],\n;;  :core {:test-list a, :journal {:port 26333}}}\n;nil\n----\n\n.Reading date-time into Java\n[source, clojure]\n----\n(jconf/parse-java-util-date \"2012-11-10 09:08:07.006Z\")\n; #inst \"2012-11-10T09:08:07.006-00:00\"\n----\n\n.Parse comma-separated lists\n[source, clojure]\n----\n(jconf/split-comma-separated \"a,b,c  , d,e, f g,h\")\n; (\"a\" \"b\" \"c\" \"d\" \"e\" \"f g\" \"h\")\n----\n\n.Un-kebab\n[source, clojure]\n----\n(jconf/kebab-conf-to-camelcase {:a-getter-b {:foo \"bar\"}})\n{:aGetterB {:foo \"bar\"}}\n----\n\n== License\n\n\u0026copy; 2022-2023 Fern Flower Lab\n\nDistributed under the MIT License.\n","funding_links":["https://github.com/sponsors/fern-flower-lab"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffern-flower-lab%2Fjava-properties","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffern-flower-lab%2Fjava-properties","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffern-flower-lab%2Fjava-properties/lists"}