Skip to content

Instantly share code, notes, and snippets.

@soujiro32167
Last active October 31, 2018 21:28
Show Gist options
  • Save soujiro32167/177e88da1be273519216d3926e18149d to your computer and use it in GitHub Desktop.
Save soujiro32167/177e88da1be273519216d3926e18149d to your computer and use it in GitHub Desktop.
TypeSafe config inclusion pattern
my {
b: "derp"
}
include "include.conf"
my {
a: "herp"
}
import com.typesafe.config.Config;
import com.typesafe.config.ConfigFactory;
class Scratch {
public static void main(String[] args) {
Config config = ConfigFactory.load();
System.out.println(config.getConfig("my"));
}
}
Config(SimpleConfigObject({"a":"herp","b":"derp"}))
java -jar ... -Dconfig.file=main.conf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment