我已经在互联网上搜索了几个小时,有很多“有用”的建议......但只会带来问题。
这就是我,几乎一模一样:
在docker容器中播放框架自动加载 https://stackoverflow.com/questions/26022395/play-framework-auto-loading-in-docker-container
我正在运行最新的(我想,不知道如何检查,但下载于
FROM ubuntu:latest
MAINTAINER [REDACTED]
RUN sudo apt-get update
RUN sudo apt-get -y install software-properties-common
RUN sudo apt-add-repository ppa:webupd8team/java
RUN sudo apt-get update
RUN echo oracle-java8-installer shared/accepted-oracle-license-v1-1 select true | sudo /usr/bin/debconf-set-selections
RUN sudo apt-get -y install oracle-java8-installer
RUN java -version
Multiple http://quabr.com/27182804/play-framework-2-3-does-not-detect-changes sources https://github.com/playframework/playframework/issues/4208互联网上出现相同或相似的问题,并且或多或少得出相同的结论结论 https://github.com/playframework/playframework/issues/3246。我正在启动我的播放应用程序,如下所示:
我不会重复上面链接的内容,基本上是相同的情况。 (检测到文件更改,它显示编译,尽管网页不反映更改。)此外,我通过反编译生成的 .class 文件来验证正确的编译,它显示正确的代码。
现在,当我说出魔法词时:将以下行添加到我的 build.sbt 文件中
PlayKeys.playWatchService := play.sbtplugin.run.PlayWatchService.sbt(pollInterval.value)
我得到的总体 build.sbt 为:
name := """cms-work"""
version := "1.0-SNAPSHOT"
retrieveManaged := true
lazy val root = (project in file(".")).enablePlugins(PlayJava)
scalaVersion := "2.11.6"
libraryDependencies ++= Seq(
javaJdbc,
cache,
javaWs
)
// Play provides two styles of routers, one expects its actions to be injected, the
// other, legacy style, accesses its actions statically.
routesGenerator := InjectedRoutesGenerator
// Polling for auto-reload, because networked filesystem.
PlayKeys.playWatchService := play.sbtplugin.run.PlayWatchService.sbt(pollInterval.value)
Running ./activator
在我的项目目录中,它会重新评估我的构建文件并生成以下内容:
/root/cms-work/build.sbt:23: error: value playWatchService is not a member of object play.sbt.Play.autoImport.PlayKeys
PlayKeys.playWatchService := play.sbtplugin.run.PlayWatchService.sbt(pollInterval.value)
^
[error] Type error in expression
显然,一刀切的解决方案不再适用。从那以后我就被难住了。自 2.3.x 以来,我绝对没有发现任何会使此命令无效的更改。相反,我看到things https://github.com/playframework/playframework/issues/3246提到“在 2.3.2 之后工作”,我就是这样。
PS:
谁能解释一下链接帖子末尾描述的奇怪的 Ctrl-D 行为。我也遇到了同样的情况,考虑到 Ctrl-D 应该退出这一事实,这似乎很奇怪......