Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Project-specific SBT JVM options

Tags:

sbt

For a project, I need to start SBT with specific JVM options (-Dfile.encoding=UTF-8 and a number of memory/gc options) - but I don't necessarily want to apply those same options to every SBT project I have.

I've seen references (in sbt-extras) to the .sbtopts (project-specific SBT command line options) and .jvmopts (project-specific SBT JVM options) files that are supposed to support this, if found in the root directory of an SBT project, but the standard Windows version of SBT (I'm using version 0.13.1) seems to ignore them.

(The sbt-extras approach appeals to me because, assuming that .sbtopts and .jvmopts are tracked in version control, there is zero SBT configuration required for people wishing to build the project.)

Is there a current mechanism to specify project-specific SBT options that works cross platform?

UPDATE: Since I originally raised this question, .sbtopts and .jvmopts are now part of the standard Linux version of SBT, and sbt-extras is no longer required. However, the Windows version only supports .jvmopts and does not recognize .sbtopts.

like image 975
Mike Allen Avatar asked Feb 25 '14 18:02

Mike Allen


1 Answers

This is a recognized limitation with the current version of SBT (v1.0.3, at the time of writing) on Windows (it doesn't recognize .sbtopts in the project's root directory). All versions now support the .jvmopts file.

You can track the status of this issue on sbt-launcher-package's _GitHub issue tracker.

UPDATE: This issue was fixed in Oct. 2019. Thanks to @conny for pointing that out.

like image 103
Mike Allen Avatar answered Nov 13 '22 17:11

Mike Allen