Auto-reloading with Play framework on a network filesystem

折月煮酒 提交于 2019-12-05 18:51:22

I ran into the same situation here. Switching to ~run (instead of run), within the Play/SBT console, bypasses JNotify (according to Josh Suereth) and appears to solve the problem for me.

Answering my own question: there doesn't seem to be a straightforward way to achieve this, and it doesn't look like this sort of functionality will become available in network filesystem in the near future.

It is rather trivial to hack the Play framework's sbt plugin and make the PlayReloader trait behave as if JNotify wasn't available, but that's a dirty hack to say the least.

The best solution seems to be to just move the Play application off the VM and run it on the host, even if some some of the benefits of fully automatically provisioned development environments are lost.

According to James Roper, you can add the following to your build.sbt if you are using play 2.3.2 or later:

PlayKeys.playWatchService := play.sbtplugin.run.PlayWatchService.sbt(pollInterval.value)

Here is the link for James Roper's full response on this issue.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!