[Notice] Announcing the End of Demo Server [Read me]

build: Fix a bug that conf directory is ignored
Problem: When using a Standalone distribution created by Playframework 2, config files, application.conf and application-logger.xml, in conf directory are ignored because the distribution has config files in jar file and use them instead of conf directory. Solution: Add some lines of shell script into the startup script to set config files explicitly by "-Dconfig.file" and "-Dlogger.file" so that Yobi uses them.
@8e00b08f9942b59b725e615d951d9529071342e0
--- build.sbt
+++ build.sbt
... | ... | @@ -73,6 +73,15 @@ |
73 | 73 |
mappings in Universal := |
74 | 74 |
(mappings in Universal).value.filterNot { case (_, file) => file.startsWith("conf/") } |
75 | 75 |
|
76 |
+NativePackagerKeys.bashScriptExtraDefines += """# Added by build.sbt |
|
77 |
+ |YOBI_HOME=$(cd "$(realpath "$(dirname "$(realpath "$0")")")/.."; pwd -P) |
|
78 |
+ | |
|
79 |
+ |yobi_config_file="$YOBI_HOME"/conf/application.conf |
|
80 |
+ |yobi_log_config_file="$YOBI_HOME"/conf/application-logger.xml |
|
81 |
+ |[ -f "$yobi_config_file" ] && addJava "-Dconfig.file=$yobi_config_file" |
|
82 |
+ |[ -f "$yobi_log_config_file" ] && addJava "-Dlogger.file=$yobi_log_config_file" |
|
83 |
+ |""".stripMargin |
|
84 |
+ |
|
76 | 85 |
lazy val yobi = (project in file(".")) |
77 | 86 |
.enablePlugins(PlayScala) |
78 | 87 |
.enablePlugins(SbtWeb) |
Add a comment
Delete comment
Once you delete this comment, you won't be able to recover it. Are you sure you want to delete this comment?