Play Framework 2.5子项目端口配置

时间:2016-07-19 10:02:09

标签: playframework sbt

我正在开展一个包含4个子项目的项目:

root-project:
-backend (play)
-frontend (play)
-akka-system (scala akka)
-common (messages to communicate between play projects and akka)

我在Build.sbt中配置了runAll任务:

val runAll = inputKey[Unit]("Runs all subprojects")

runAll := {
  (run in Compile in frontend).evaluated
  (run in Compile in backend).evaluated
  (run in Compile in `akka-system`).evaluated
}

问题是如何在任务中传递-Dhttp.port参数来运行前端不同于后端的端口?

1 个答案:

答案 0 :(得分:4)

尝试这样的事情

runAll := {
  (run in Compile in frontend).partialInput(" 5000").evaluated
  (run in Compile in backend).partialInput(" 6000").evaluated
  (run in Compile in `akka-system`).evaluated
}