【发布时间】:2014-05-18 11:38:43
【问题描述】:
我正在尝试使用 Play 2.2.2 和 SBT 0.13.1 设置多模块开发环境
我的项目结构如下:
myProject
└ build.sbt
└ app - this code works perfect
└ modules
└ testModule
└ build.sbt
└ src
└ main
└ scala - here I have simple object Foo with method which returns string
└ test
└ scala - here is Spec2 test for Foo object with JUnitRunner
└ test - here is Spec2 tests for app and these tests also works fine
build.sbt 根目录包含:
import play.Project._
name := "FooBar"
version := "1.0"
playScalaSettings
lazy val main = project.in(file("."))
.dependsOn(testModule).aggregate(testModule)
lazy val testModule = project.in(file("modules/testModule"))
模块中的build.sbt 仅包含:
import play.Project._
name := "FooBar-module"
playScalaSettings
当我尝试使用 testModule 中的代码时,编译器告诉我它甚至无法从该模块中找到包。在运行测试时我也得到了
没有要为 testModule/test:test 运行的测试
但是如果我在testModule中写了无效的代码,我会开始从这个模块中得到错误,所以模块肯定是编译的。
这里可能有什么问题? SBT 配置看起来正确
【问题讨论】:
标签: scala playframework sbt