From fad9affc976d929b12a095ca0c729f1691ec6715 Mon Sep 17 00:00:00 2001 From: iamtodor Date: Wed, 30 Mar 2022 22:07:59 +0200 Subject: [PATCH 1/2] add note with clarification how to pass -Dconfig properly; taken from https://github.com/lightbend/config/issues/84 and https://stackoverflow.com/a/31305181/5151861 --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 63ebd43e..5e6d5157 100644 --- a/README.md +++ b/README.md @@ -257,6 +257,8 @@ system properties can be used to force a different config source it should include the extension, not be a basename - `config.url` specifies a URL + **Note**: you need to pass `-Dconfig.file=path/to/config-file` before the jar itself, e.g. `java -Dconfig.file=path/to/config-file.conf -jar path/to/jar-file.jar` + These system properties specify a _replacement_ for `application.{conf,json,properties}`, not an addition. They only affect apps using the default `ConfigFactory.load()` From fd9be4a4f95a99a9a98a5f24e8d84ba0cea1c496 Mon Sep 17 00:00:00 2001 From: iamtodor Date: Wed, 30 Mar 2022 22:59:32 +0200 Subject: [PATCH 2/2] add Dconfig.resource clarification --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5e6d5157..771450c0 100644 --- a/README.md +++ b/README.md @@ -257,7 +257,7 @@ system properties can be used to force a different config source it should include the extension, not be a basename - `config.url` specifies a URL - **Note**: you need to pass `-Dconfig.file=path/to/config-file` before the jar itself, e.g. `java -Dconfig.file=path/to/config-file.conf -jar path/to/jar-file.jar` + **Note**: you need to pass `-Dconfig.file=path/to/config-file` before the jar itself, e.g. `java -Dconfig.file=path/to/config-file.conf -jar path/to/jar-file.jar`. Same applies for `-Dconfig.resource=config-file.conf` These system properties specify a _replacement_ for `application.{conf,json,properties}`, not an addition. They only