当运行sbt new playframework/play-scala-seed.g8
编译并从终端运行时,一切都很好。但是当将项目导入IntelliJ时;Play 2应用程序";配置,并运行它,程序会完美运行,但会立即停止。此外,播放标志显示两次。
OpenJDK 64-Bit Server VM warning: Ignoring option MaxPermSize; support was removed in 8.0
[info] welcome to sbt 1.6.1 (Azul Systems, Inc. Java 11.0.13)
[info] loading settings for project play-scala-seed-build from plugins.sbt ...
[info] loading project definition from /Users/idanahal/projects/scalaPlayTutorial/play-scala-seed/project
[info] loading settings for project root from build.sbt ...
[info] __ __
[info] ____ / /____ _ __ __
[info] / __ / // __ `// / / /
[info] / / / /_/ // // /_/ // /_/ /
[info] /_/ / .___//_/ __,_/ __, /
[info] /_/ /____/
[info]
[info] Version 2.8.12 running Java 11.0.13
[info]
[info] Play is run entirely by the community. If you want to keep using it please consider donating:
[info] https://www.playframework.com/sponsors
[info]
[info] __ __
[info] ____ / /____ _ __ __
[info] / __ / // __ `// / / /
[info] / / / /_/ // // /_/ // /_/ /
[info] /_/ / .___//_/ __,_/ __, /
[info] /_/ /____/
[info]
[info] Version 2.8.12 running Java 11.0.13
[info]
[info] Play is run entirely by the community. If you want to keep using it please consider donating:
[info] https://www.playframework.com/sponsors
[info]
--- (Running the application, auto-reloading is enabled) ---
[info] p.c.s.AkkaHttpServer - Listening for HTTP on /0:0:0:0:0:0:0:0:9000
Server started, use Cmd+P to stop
[info] p.a.i.l.c.CoordinatedShutdownSupport - Starting synchronous coordinated shutdown with ServerStoppedReason reason and 35000 milliseconds timeout
[info] p.c.s.AkkaHttpServer - Stopping Akka HTTP server...
[info] p.c.s.AkkaHttpServer - Terminating server binding for /0:0:0:0:0:0:0:0:9000
[info] p.c.s.AkkaHttpServer - Running provided shutdown stop hooks
[success] Total time: 3 s, completed 11 Jan 2022, 18:51:03
Process finished with exit code 0
我什么也没做,但它立即开始关闭。
对我来说"启用自动重新加载";配置中的选项修复了问题。
您需要给出运行命令,如~run
环境变量:autoReloadPlugins=true