我试图在build.scala中定义JAVA_OPTS,以便为运行和测试任务指定调试端口和配置文件,但它不起作用。我启动activator
,然后运行run
或test
。这是我的build.sbt:
name := "machinchose"
version := "1.0-SNAPSHOT"
lazy val root = (project in file(".")).enablePlugins(PlayJava)
scalaVersion := "2.11.1"
libraryDependencies ++= Seq(
javaJdbc,
javaEbean,
cache,
javaWs
)
Keys.fork in run := true
javaOptions in run ++= Seq(
"-Xdebug",
"-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=9997",
"-Dconfig.file=conf/developpement.conf",
"-Xms128m",
"-Xmx1024m"
)
Keys.fork in Test := true
javaOptions in Test ++= Seq(
"-Xdebug",
"-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=9997",
"-Dconfig.file=conf/test.conf",
"-Xms128m",
"-Xmx1024m"
)
我错在哪里了?谢谢你的帮助。
build.sbt
为“test”任务设置javaOptions - 正如文档推荐的那样 - 并没有起作用,无论我是否分叉测试。而且,在Windows上无法使用“-jvm-debug”(我不能使用Linux,唉)。 - Pierre-Yves Le Dévéhat