Search code examples
sbtsbt-native-packager

JVM options on Sbt Native Packager


I can't find a way to specify the -X options (-Xmx / Xms) when using SBT Native Packager when using a Java Archetype.

I tried to use a jvmopts file that contains those properties within src/universal folder. Adding to build.sbt

bashScriptConfigLocation := Some("${app_home}/../conf/jvmopts")

All these according to the following link: http://www.scala-sbt.org/sbt-native-packager/archetypes/java_app/customize.html

I can't get it to modify the default 1024m values.


Solution

  • You have to prefix the -X options. Take a look at the example etc-default file.

    So you would need to write in your jvmopts

    -J-Xms1024m
    -J-Xmx2048m
    

    UPDATE

    The etc-default behaviour has been corrected with version 1.0.0-RC2. Take a look at the server configuration page.