我想测试如何分项目的工作,特别是如何的routes
子项目都考虑到主要的项目( 在此之前是不可见的 )。
我已经在这里阅读文档: https://github.com/playframework/Play20/wiki/SBTSubProjects
我做了什么:(下载播放2.1 RC3后)
- 创建新的Java项目:
play new MainProject
- 创建内部MainProject新文件夹:
modules
- 创建新的Java项目:
play new SubProject
在这两个项目: play eclipse
,因为play eclipsify
不工作了
在主要项目Build.scala
文件:
import sbt._
import Keys._
import play.Project._
object ApplicationBuild extends Build {
val appName = "MainProject"
val appVersion = "1.0-SNAPSHOT"
val appDependencies = Seq(
// Add your project dependencies here,
javaCore,
javaJdbc,
javaEbean
)
val subProject = Project("subproject", file("modules/SubProject"))
val main = play.Project(appName, appVersion, appDependencies).settings(
// Add your own project settings here
).dependsOn(subProject)
}
现在,在主体工程我运行:
play run
我也得到了以下错误:
[error] (MainProject/*:update) sbt.ResolveException: unresolved dependency: play#play_2.9.2;2.1-RC3: not found
[error] unresolved dependency: play#play-java_2.9.2;2.1-RC3: not found
[error] unresolved dependency: play#play-java-jdbc_2.9.2;2.1-RC3: not found
[error] unresolved dependency: play#play-java-ebean_2.9.2;2.1-RC3: not found
[error] unresolved dependency: play#play-test_2.9.2;2.1-RC3: not found
请注意我试图删除Build.scala
从子项目,但我KEP收到此错误。
我究竟做错了什么?