How to change the default port 9000 in Play 2.3.x

2019-03-21 16:36发布

问题:

With Play 2.2.x I could set the default port with build.sbt file i.e:

Build.sbt
  play.Project.playScalaSettings

  play.Project.playDefaultPort := 9001

After 2.3.x upgrade play.Project.playDefaultPort does not exists any more.

I do not want to type-Dhttp.port=9001 or run 9001

回答1:

play.PlayImport.PlayKeys.playDefaultPort := 9001

https://github.com/playframework/playframework/blob/2.3.4/framework/src/sbt-plugin/src/main/scala/PlayImport.scala#L111