无法从子模块加载孙子路由

时间:2019-06-10 14:27:07

标签: scala playframework sbt playframework-2.0

播放版本

PlayScala@2.7.2

JDK(Oracle 1.8.0_72,OpenJDK 1.8.x,Azul Zing)

$ java -version
openjdk version "1.8.0_212"
OpenJDK Runtime Environment (Zulu 8.38.0.13-CA-linux64) (build 1.8.0_212-b04)
OpenJDK 64-Bit Server VM (Zulu 8.38.0.13-CA-linux64) (build 25.212-b04, mixed mode)

预期行为

  1. 将您的sbt项目设为“ root”
  2. 将子项目添加为“ buildA”
  3. 将子项目添加为“ appA”
  4. buildA包含一个appA.routes
  5. ->是的,您可以在一个根项目中创建一些构建!!

实际行为

我的子项目(buildA)无法加载grand-chid-project(appA)的路由。

$ tree -L 2
.
├── build.sbt
├── build-app
│   ├── app
│   ├── build.sbt
│   ├── conf
│   │   ├── application.conf
│   │   ├── logback.xml
│   │   └── routes
├── core
│   ├── app
│   ├── build.sbt
│   ├── conf
│   │   └── core.routes
│   ├── src
├── project
     ├── plugins.sbt

build.sbt

lazy val buildApp = project.in(file("build-app"))
lazy val root = project.in(file("."))

build-app/build.sbt

lazy val core = project.in(file("../core")).enablePlugins(PlayScala)
lazy val buildApp = (project in file("."))
  .enablePlugins(PlayScala)
  .dependsOn(core)

build-app/conf/routes

GET     /                           controllers.app.HomeController.index
->  /core core.Routes

core/conf/core.routes

GET     /                           controllers.core.HomeController.index
$ sbt "project buildApp" compile
[error] /home/sizer/go/src/github.com/sizer/hello-sbt-multiproject/build-app/conf/routes:3:1: not found: value core
[error] ->  /core core.Routes

无法加载core.routes:sob: 我错了还是正确的行为?

我的项目在下面。

https://github.com/sizer/hello-sbt-multiproject/tree/playframework_failedExample

0 个答案:

没有答案