【问题标题】:Debugging Play 2.2 subproject?调试 Play 2.2 子项目?
【发布时间】:2014-07-01 19:15:32
【问题描述】:

我已将 Scala/SBT 项目拆分为多个子项目。其中一个子项目是 Play Framework Web 应用程序。

进行此更改后,我很难在调试模式下启动应用程序。我可以通过以下方式运行它:

$ projects
[info] In file:/my/project/
[info]   * root
[info]     actors
[info]     test
[info]     ui
$ project ui
$ projects
[info] In file:/my/project/
[info]     root
[info]     actors
[info]     test
[info]   * ui
$ run

但这并没有打开 JPDA 端口进行调试。在调试模式下启动子项目的方式是什么?

【问题讨论】:

  • 您之前是如何“以调试模式启动应用程序”的?您可以使用ui/run run ui 项目。阅读Scope axes
  • 在一个模块中包含所有内容时,我能够运行play debug。感谢您用范围轴提示我,它看起来像我正在寻找的解决方案。
  • 让我知道如何更改答案,以便...提示,提示...获得批准 :) 我们还可以更好地解决问题,使其符合您的需求。
  • 啊,play debug。你应该可以做到ui/debug
  • 我已经尝试过了,但出现以下错误:play ui/run java.lang.RuntimeException: */*:playRunHooks is undefined. at scala.sys.package$.error(package.scala:27) [trace] Stack trace suppressed: run last ui/compile:run for the full output. [error] (ui/compile:run) */*:playRunHooks is undefined. [error] Total time: 92 s, completed May 14, 2014 6:51:54 PM

标签: playframework sbt


【解决方案1】:

官方 Play 文档中有 Debugging 部分说:

您可以在启动控制台时要求 Play 启动 JPDA 调试端口。 使用activator -jvm-debug <port> 命令执行此操作:

$ activator -jvm-debug 9999

端口打开后,您应该可以连接到 9999 端口并进行调试。

In the older version of Play 2.2,有play debug 命令可以在您的情况下使用,只需将其范围限定为 ui 项目。

play ui/debug

这应该会给你你所追求的。

【讨论】:

猜你喜欢
  • 1970-01-01
  • 2013-10-24
  • 1970-01-01
  • 2013-11-03
  • 2014-03-23
  • 1970-01-01
  • 2013-09-28
  • 2014-03-01
  • 2014-08-15
相关资源
最近更新 更多