我使用Play 2.3.7并收到以下错误:
[info] Error: Error: paths fallback not supported in optimizer. Please provide a build config path override for jsparticipantroutes
它出现在./activator启动的prod模式下。在开发模式下一切都很好。
当应用程序运行时,他找不到任何资产
"NetworkError: 404 Not Found - http://localhost:9000/assets/lib/requirejs/require.js"
"NetworkError: 404 Not Found - http://localhost:9000/assets/stylesheets/main.css"
...
...
...
...
build.sbt:
import com.typesafe.sbt.SbtNativePackager.packageArchetype
import com.typesafe.sbt.less.Import.LessKeys
import com.typesafe.sbt.rjs.Import.RjsKeys
import RjsKeys._
import com.typesafe.sbt.rjs.SbtRjs
import com.typesafe.sbt.web.SbtWeb
import play.PlayJava
import com.typesafe.sbt.packager.Keys._
version := "1.0-SNAPSHOT"
scalaVersion := "2.11.1"
// Maintainer for all packages
lazy val root = (project in file(".")).enablePlugins(SbtWeb,PlayJava)
//build-info
buildInfoSettings
sourceGenerators in Compile <+= buildInfo
buildInfoKeys := Seq[BuildInfoKey](name, version, scalaVersion, sbtVersion)
buildInfoKeys ++= Seq[BuildInfoKey](
resolvers,
libraryDependencies in Test,
BuildInfoKey.map(name) { case (k, v) => "project" + k.capitalize -> v.capitalize },
BuildInfoKey.action("buildTime") {
System.currentTimeMillis
} // re-computed each time at compile
)
buildInfoPackage := "info"
resolvers ++= Seq(
"Local Maven Repository" at "file:///"+Path.userHome.absolutePath+"/.m2/repository",
"play-easymail (snapshot)" at "http://joscha.github.io/play-easymail/repo/snapshots/"
)
libraryDependencies ++= Seq(
cache,
"org.webjars" %% "webjars-play" % "2.3.0-2",
"org.webjars" % "bootstrap" % "3.3.1",
"org.webjars" % "jquery" % "2.1.1",
"org.webjars" % "datatables" % "1.10.1",
"org.webjars" % "requirejs" % "2.1.15",
"org.webjars" % "datatables-bootstrap" % "2-20120202-2",
"org.webjars" % "SlickGrid" % "2.1",
"org.webjars" % "select2" % "3.5.2",
"org.mongodb" % "mongo-java-driver" % "2.12.2",
"org.jongo" % "jongo" % "1.0",
"com.fasterxml.jackson.module" %% "jackson-module-scala" % "2.4.1" % "optional",
"org.mindrot" % "jbcrypt" % "0.3m",
"org.webjars" % "d3js" % "3.4.11",
"org.webjars" % "nvd3" % "1.1.15-beta",
"org.webjars" % "x-editable-bootstrap3" % "1.5.1",
"org.webjars" % "font-awesome" % "4.2.0",
"com.google.inject" % "guice" % "1.0",
"com.feth" %% "play-easymail" % "0.6.6-SNAPSHOT",
"org.webjars" % "jquery-ui" % "1.11.1"
)
RjsKeys.mainModule := "main"
pipelineStages := Seq(rjs)
plugins.sbt:
// Comment to get more information during initialization
logLevel := Level.Warn
// The Typesafe repository
resolvers += "Typesafe repository" at "http://repo.typesafe.com/typesafe/releases/"
// Use the Play sbt plugin for Play projects
addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "0.8.0-RC1")
addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.3.7")
addSbtPlugin("com.typesafe.sbt" % "sbt-less" % "1.0.0")
addSbtPlugin("com.typesafe.sbt" % "sbt-rjs" % "1.0.7")
addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.3.2")