According to the documentation, the sbt forked process should get the jvm settings of the current process:
By default, the forked process uses the same Java and Scala versions that are used to build and the working directory and JVM parameters of the current process. See: http://www.scala-sbt.org/0.13/docs/Forking.html
However, this does not seem to be the case. Take the following test:
object Test { def main(args: Array[String]): Unit = { println("Conf: " + System.getProperty("config.resource")) } }
If I run this with sbt -Dconfig.resource = test.conf, "Conf: test.conf" will print. But as soon as I add fork to run: = true in my build.scala, "Conf: null" is printed. This implies that jvm options are not actually passed to the forked process. Can someone tell me what I'm missing here?
import sbt._ import Keys._ object Build extends Build { lazy val root = (project in file(".")). settings( fork in run := true ) }
scala jvm sbt
user79074
source share