今天一个做好的play2.0工程突然运行不起来了,提示value setPrefix is not a member of play.core.Router.Routes
上网查了一下大约是需要sbteclipse-plugin的插件,
检查一下果然被我注释掉了,当时以为不用eclipse 开发就不用这个东西,看来并非如此
具体如下:
/project/plugins.sbt中检查一下是否有
resolvers += "Typesafe repository" at "http://repo.typesafe.com/typesafe/releases/"
addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "2.1.0")
然后在看一下同一路径下的Build.scala中是否有
import com.typesafe.sbteclipse.plugin.EclipsePlugin._
val main = PlayProject(appName, appVersion, appDependencies, mainLang = SCALA).settings(
// Add your own project settings here
EclipseKeys.withSource := true
)
之后一定要注意下面的步骤,
1、在工程目录下面
sudo sbt
2、download完包后在
clean
一下
3、最后在
run
一下
本文介绍了一个在使用Play2.0框架开发过程中遇到的问题,即运行工程时报错valuesetPrefixisnotamemberofplay.core.Router.Routes。通过检查并启用Sbt Eclipse插件解决了此问题,并提供了详细的步骤指导,包括检查配置文件、清理项目和重新运行等操作。

被折叠的 条评论
为什么被折叠?



