We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
问题: 我们有时候需要灵活的修改配置文件,以适应线上环境。通过sbt,我们可以轻松实现这点。
办法:
mappings in Universal ++= contentOf((resourceDirectory in Compile).value).map{ case (file,path)=> file -> ("conf/" + path) } scriptClasspath := "../conf/" +: scriptClasspath.value mappings in Universal += baseDirectory.value / "src/main/resources/reference.conf" -> "conf/application.conf"
通过这样,我们将${user.dir}/conf/application.conf加入到classpath中,根据Typesafe config的配置,其会覆盖内部的reference.conf。这样我们就可以在线上环境中做相应的调整了。
${user.dir}/conf/application.conf
reference.conf
The text was updated successfully, but these errors were encountered:
No branches or pull requests
问题:
我们有时候需要灵活的修改配置文件,以适应线上环境。通过sbt,我们可以轻松实现这点。
办法:
通过这样,我们将
${user.dir}/conf/application.conf
加入到classpath中,根据Typesafe config的配置,其会覆盖内部的reference.conf
。这样我们就可以在线上环境中做相应的调整了。The text was updated successfully, but these errors were encountered: