我使用Playframework 2.5.4作为默认sbt构建,编译和放大的REST API端点。用激活剂运行。
此播放模块在本地maven(3.9)中导入core
模块,其中定义了类型。如:
package com.myCompany
case class User(
id: Option[UUID] = None,
username: String
)
然后播放controller
包将导入com.myCompany.User
。
问题是,当激活器编译时,它会给出unknown parameter name: username
如果我将case class
放入播放的models
包中,则会毫无错误地进行编译。
以下是我的build.sbt
name := """api"""
version := "1.0-SNAPSHOT"
lazy val root = (project in file(".")).enablePlugins(PlayScala)
scalaVersion := "2.11.8"
libraryDependencies ++= Seq(
jdbc,
cache,
ws,
filters,
"com.myCompany" % "core" % "1.0-SNAPSHOT"
)
routesGenerator := InjectedRoutesGenerator
resolvers ++= Seq(
"scalaz-bintray" at "http://dl.bintray.com/scalaz/releases",
Resolver.mavenLocal
// "Local Maven Repository" at "file:///home/pocheng/.m2/repository"
)
我怀疑build.sbt文件有问题。会欣赏任何指针。感谢。