设置如下:
- 电梯网
- xsbt-web-plugin
- sbt-jrebel-plugin
- JRebel
我的静态web文件(html等)在/src/webapp
我跑
# sbt
> jetty:start
> ~compile
问题:即使SBT检测到静态文件中的更改,以及JRebel日志表明它也看到了这些更改,这些更改也不会传播到/target/webapp
。重新编译和重新加载scala文件可以正常工作。
build.sbt
organization := "serendipity"
name := "story-telling"
version := "1.0"
scalaVersion := "2.11.8"
libraryDependencies ++= {
val liftVersion = "3.0-RC3"
Seq(
"net.liftweb" %% "lift-webkit" % liftVersion % "compile",
"net.liftweb" %% "lift-mapper" % liftVersion % "compile",
"org.eclipse.jetty" % "jetty-webapp" % "9.3.13.v20161014",
"com.h2database" % "h2" % "1.4.193"
)
}
enablePlugins(JettyPlugin)
seq(jrebelSettings: _*)
jrebel.webLinks += (sourceDirectory in Compile).value / "webapp"
jrebel.classpath <<= Seq(Keys.classDirectory in Compile).join
jrebel.enabled := true
javaOptions in Jetty ++= Seq(
"-javaagent:/opt/jrebel/jrebel.jar",
"-noverify",
"-XX:+UseConcMarkSweepGC",
"-XX:+CMSClassUnloadingEnabled",
"-Drebel.log=debug",
"-Drebel.log.file=/home/anton/.jrebel/jrebel.log"
)
直接运行:
> jetty:start
> ~compile
据我所知,这是一个变通方法,而不是正确的解决方案