我在我的项目中使用play framework 2.5.x并且它总是重新编译项目的所有内容,即使我只编辑静态CSS文件并刷新页面。
编译速度非常慢,而且效率非常低,因为即使在进行微小更改后也会重新编译。
Build.sbt
name := "XXXX"
version := "1.0"
scalaVersion := "2.11.11"
resolvers += Resolver.sonatypeRepo("releases")
resolvers += "Sonatype Snapshots" at "https://oss.sonatype.org/content/repositories/snapshots/"
resolvers += "Atlassian Releases" at "https://maven.atlassian.com/public/"
resolvers += Resolver.url("Morphia Repository", url("https://github.com/mongodb/morphia"))(Resolver.ivyStylePatterns)
resolvers += Resolver.url("AngularJS Repository", url("https://github.com/angular/angular.js"))(Resolver.ivyStylePatterns)
resolvers += Resolver.url("QRGen", url("http://kenglxn.github.com/QRGen/repository"))(Resolver.ivyStylePatterns)
resolvers += Resolver.url("Mibble", url("http://maven.cloudhopper.com/repos/third-party/"))(Resolver.ivyStylePatterns)
resolvers += "SNMP" at "https://oosnmp.net/dist/release/"
resolvers += "jitpack" at "https://jitpack.io"
lazy val root = (project in file(".")).enablePlugins(PlayScala, PlayJava)
libraryDependencies ++= Seq(
jdbc,
cache,
ws,
"net.codingwell" %% "scala-guice" % "4.0.0",
"org.mongodb.morphia" % "morphia" % "1.3.2",
"org.mongodb" % "mongo-java-driver" % "3.4.2",
"ws.securesocial" %% "securesocial" % "3.0-M8",
"org.reactivemongo" %% "play2-reactivemongo" % "0.12.3",
"net.sf.uadetector" % "uadetector-resources" % "2014.10",
"com.typesafe.play" %% "play-mailer" % "5.0.0",
"com.github.kenglxn.QRGen" % "javase" % "2.2.0",
"commons-codec" % "commons-codec" % "1.10",
"com.github.axet" % "kaptcha" % "0.0.9",
"org.scalaj" %% "scalaj-http" % "2.3.0",
"org.json" % "json" % "20160212",
"org.apache.httpcomponents" % "httpclient" % "4.5",
"com.google.code.gson" % "gson" % "2.7",
"org.eclipse.paho" % "org.eclipse.paho.client.mqttv3" % "1.1.1",
"org.jdom" % "jdom" % "2.0.2",
"org.bitcoinj" % "bitcoinj-core" % "0.14.4",
"com.madgag.spongycastle" % "core" % "1.56.0.0"
)
Plugin.sbt
addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.5.15")
addSbtPlugin("com.typesafe.sbt" % "sbt-coffeescript" % "1.0.0")
addSbtPlugin("com.typesafe.sbt" % "sbt-less" % "1.1.0")
addSbtPlugin("com.typesafe.sbt" % "sbt-jshint" % "1.0.4")
addSbtPlugin("com.typesafe.sbt" % "sbt-rjs" % "1.0.8")
addSbtPlugin("com.typesafe.sbt" % "sbt-digest" % "1.1.1")
addSbtPlugin("com.typesafe.sbt" % "sbt-mocha" % "1.1.0")
addSbtPlugin("org.irundaia.sbt" % "sbt-sassify" % "1.4.6")