Short answer
Define package mapping
mappings in Universal <+= (packageBin in Compile, sourceDirectory ) map {
(_, src) =>
val conf = src / "main" / "resources" / "reference.conf"
conf -> "conf/application.conf"
}
Create jvmopts in src / universal / conf with
-Dconfig.file=/<installation-path>/conf/application.conf
Add to build.sbt
bashScriptConfigLocation := Some("${app_home}/../conf/jvmopts")
Example for server_archetype: Follow the application. A little description can be found here .
Long answer
Changing the classpath directly is not supported by sbt-native-packager, as this can cause problems like
- class ordering
- safety problems
Like Configafe Config, most libraries that use configuration files provide an option for locating the configuration file. Use the options described in the documentation .
, , ,
packageArchetype.java_server
. , .