playframework
playframework copied to clipboard
`~run` not working as expected with sbt 1.3.x
Play Version
Play 2.8.0 with sbt 1.3.4
API
Scala
Operating System
Windows 10 Pro
JDK
openjdk version "11.0.5" 2019-10-15 OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.5+10) OpenJDK 64-Bit Server VM AdoptOpenJDK (build 11.0.5+10, mixed mode)
Expected Behavior
- git clone [email protected]:playframework/play-samples.git
- cd play-samples/play-scala-hello-world-tutorial/
- sbt
- ~run
- Make a change to source code
- Recompilation is triggered when files are changed
Actual Behavior
Recompilation is not triggered.
Refreshing the browser window (= making a request to the app) does trigger recompilation, but AFAIK this should happen already when files change.
Downgrading to sbt 1.2.8 makes triggered execution work again as expected. Triggered execution for the compile
task works using any version of sbt I have tried, so this issue is only about the run
command with sbt 1.3.x (on Windows).
I have tried different fileWatchService
implementations but the issue persists.
Hi @malliina,
Is this happening exclusively for ~run
or any command using triggered execution? For example, if you run ~test
, does it re-executes the tests on file changes?
Best.
Hi @marcospereira,
This is happening exclusively for ~run
. Others like ~test
and ~compile
re-execute on file changes as expected.
I can confirm this is happening in macOS as well. Thanks for reporting, @malliina.
When running with sbt --debug ~run
, I can see the following after changing a file:
[debug] root / Compile / run - Accepted event for /Users/marcospereira/tmp/issues-9983/app/controllers/HomeController.scala
[debug] Received Update(/Users/marcospereira/tmp/issues-9983/app/controllers/HomeController.scala,FileAttributes(isDirectory = false, isOther = false,isRegularFile = true, isSymbolicLink = false),FileAttributes(isDirectory = false, isOther = false,isRegularFile = true, isSymbolicLink = false))
And the following after firing a request:
[debug]
[debug] Initial source changes:
[debug] removed:Set()
[debug] added: Set()
[debug] modified: Set(/Users/marcospereira/tmp/issues-9983/app/controllers/HomeController.scala)
[debug] Invalidated products: Set()
[debug] External API changes: API Changes: Set()
[debug] Modified binary dependencies: Set()
[debug] Initial directly invalidated classes: Set(controllers.HomeController)
[debug]
[debug] Sources indirectly invalidated by:
[debug] product: Set()
[debug] binary dep: Set()
[debug] external source: Set()
[debug] All initially invalidated classes: Set(controllers.HomeController)
[debug] All initially invalidated sources:Set(/Users/marcospereira/tmp/issues-9983/app/controllers/HomeController.scala)
[debug] Initial set of included nodes: controllers.HomeController
[info] Compiling 1 Scala source to /Users/marcospereira/tmp/issues-9983/target/scala-2.13/classes ...
[debug] Getting org.scala-sbt:compiler-bridge_2.13:1.3.1:compile for Scala 2.13.1
[debug] Getting org.scala-sbt:compiler-bridge_2.13:1.3.1:compile for Scala 2.13.1
[debug] [zinc] Running cached compiler 3c8579c6 for Scala compiler version 2.13.1
[debug] [zinc] The Scala compiler is invoked with:
[debug] -deprecation
[debug] -unchecked
[debug] -encoding
[debug] utf8
[debug] -bootclasspath
[debug] /Users/marcospereira/.sdkman/candidates/java/8.0.232.hs-adpt/jre/lib/resources.jar:/Users/marcospereira/.sdkman/candidates/java/8.0.232.hs-adpt/jre/lib/rt.jar:/Users/marcospereira/.sdkman/candidates/java/8.0.232.hs-adpt/jre/lib/sunrsasign.jar:/Users/marcospereira/.sdkman/candidates/java/8.0.232.hs-adpt/jre/lib/jsse.jar:/Users/marcospereira/.sdkman/candidates/java/8.0.232.hs-adpt/jre/lib/jce.jar:/Users/marcospereira/.sdkman/candidates/java/8.0.232.hs-adpt/jre/lib/charsets.jar:/Users/marcospereira/.sdkman/candidates/java/8.0.232.hs-adpt/jre/lib/jfr.jar:/Users/marcospereira/.sdkman/candidates/java/8.0.232.hs-adpt/jre/classes:/Users/marcospereira/.coursier/cache/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.1/scala-library-2.13.1.jar
[debug] -classpath
[debug] /Users/marcospereira/tmp/issues-9983/target/scala-2.13/classes:/Users/marcospereira/.coursier/cache/v1/https/repo1.maven.org/maven2/com/google/errorprone/error_prone_annotations/2.3.2/error_prone_annotations-2.3.2.jar:/Users/marcospereira/.coursier/cache/v1/https/repo1.maven.org/maven2/javax/inject/javax.inject/1/javax.inject-1.jar:/Users/marcospereira/.coursier/cache/v1/https/repo1.maven.org/maven2/org/scala-lang/modules/scala-xml_2.13/1.2.0/scala-xml_2.13-1.2.0.jar:/Users/marcospereira/.coursier/cache/v1/https/repo1.maven.org/maven2/com/typesafe/config/1.4.0/config-1.4.0.jar:/Users/marcospereira/.coursier/cache/v1/https/repo1.maven.org/maven2/org/checkerframework/checker-qual/2.8.1/checker-qual-2.8.1.jar:/Users/marcospereira/.coursier/cache/v1/https/repo1.maven.org/maven2/io/jsonwebtoken/jjwt/0.9.1/jjwt-0.9.1.jar:/Users/marcospereira/.coursier/cache/v1/https/repo1.maven.org/maven2/com/typesafe/akka/akka-stream_2.13/2.6.1/akka-stream_2.13-2.6.1.jar:/Users/marcospereira/.coursier/cache/v1/https/repo1.maven.org/maven2/org/scala-lang/modules/scala-java8-compat_2.13/0.9.0/scala-java8-compat_2.13-0.9.0.jar:/Users/marcospereira/.coursier/cache/v1/https/repo1.maven.org/maven2/org/slf4j/slf4j-api/1.7.29/slf4j-api-1.7.29.jar:/Users/marcospereira/.coursier/cache/v1/https/repo1.maven.org/maven2/com/typesafe/play/play_2.13/2.8.0/play_2.13-2.8.0.jar:/Users/marcospereira/.coursier/cache/v1/https/repo1.maven.org/maven2/com/typesafe/play/twirl-api_2.13/1.5.0/twirl-api_2.13-1.5.0.jar:/Users/marcospereira/.coursier/cache/v1/https/repo1.maven.org/maven2/com/fasterxml/jackson/module/jackson-module-parameter-names/2.10.1/jackson-module-parameter-names-2.10.1.jar:/Users/marcospereira/.coursier/cache/v1/https/repo1.maven.org/maven2/com/typesafe/play/play-streams_2.13/2.8.0/play-streams_2.13-2.8.0.jar:/Users/marcospereira/.coursier/cache/v1/https/repo1.maven.org/maven2/org/scala-lang/modules/scala-parser-combinators_2.13/1.1.2/scala-parser-combinators_2.13-1.1.2.jar:/Users/marcospereira/.coursier/cache/v1/https/repo1.maven.org/maven2/jakarta/activation/jakarta.activation-api/1.2.1/jakarta.activation-api-1.2.1.jar:/Users/marcospereira/.coursier/cache/v1/https/repo1.maven.org/maven2/com/typesafe/akka/akka-protobuf-v3_2.13/2.6.1/akka-protobuf-v3_2.13-2.6.1.jar:/Users/marcospereira/.coursier/cache/v1/https/repo1.maven.org/maven2/com/fasterxml/jackson/module/jackson-module-paranamer/2.10.1/jackson-module-paranamer-2.10.1.jar:/Users/marcospereira/.coursier/cache/v1/https/repo1.maven.org/maven2/com/typesafe/akka/akka-http-core_2.13/10.1.11/akka-http-core_2.13-10.1.11.jar:/Users/marcospereira/.coursier/cache/v1/https/repo1.maven.org/maven2/ch/qos/logback/logback-classic/1.2.3/logback-classic-1.2.3.jar:/Users/marcospereira/.coursier/cache/v1/https/repo1.maven.org/maven2/com/typesafe/play/play-guice_2.13/2.8.0/play-guice_2.13-2.8.0.jar:/Users/marcospereira/.coursier/cache/v1/https/repo1.maven.org/maven2/org/eclipse/jetty/alpn/alpn-api/1.1.3.v20160715/alpn-api-1.1.3.v20160715.jar:/Users/marcospereira/.coursier/cache/v1/https/repo1.maven.org/maven2/com/google/code/findbugs/jsr305/3.0.2/jsr305-3.0.2.jar:/Users/marcospereira/.coursier/cache/v1/https/repo1.maven.org/maven2/com/typesafe/play/play-server_2.13/2.8.0/play-server_2.13-2.8.0.jar:/Users/marcospereira/.coursier/cache/v1/https/repo1.maven.org/maven2/com/twitter/hpack/1.0.2/hpack-1.0.2.jar:/Users/marcospereira/.coursier/cache/v1/https/repo1.maven.org/maven2/com/typesafe/akka/akka-actor-typed_2.13/2.6.1/akka-actor-typed_2.13-2.6.1.jar:/Users/marcospereira/.coursier/cache/v1/https/repo1.maven.org/maven2/com/google/guava/listenablefuture/9999.0-empty-to-avoid-conflict-with-guava/listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar:/Users/marcospereira/.coursier/cache/v1/https/repo1.maven.org/maven2/com/fasterxml/jackson/core/jackson-core/2.10.1/jackson-core-2.10.1.jar:/Users/marcospereira/.coursier/cache/v1/https/repo1.maven.org/maven2/joda-time/joda-time/2.10.5/joda-time-2.10.5.jar:/Users/marcospereira/.coursier/cache/v1/https/repo1.maven.org/maven2/org/mortbay/jetty/alpn/jetty-alpn-agent/2.0.9/jetty-alpn-agent-2.0.9.jar:/Users/marcospereira/.coursier/cache/v1/https/repo1.maven.org/maven2/com/typesafe/play/play-exceptions/2.8.0/play-exceptions-2.8.0.jar:/Users/marcospereira/.coursier/cache/v1/https/repo1.maven.org/maven2/com/typesafe/akka/akka-slf4j_2.13/2.6.1/akka-slf4j_2.13-2.6.1.jar:/Users/marcospereira/.coursier/cache/v1/https/repo1.maven.org/maven2/com/fasterxml/jackson/core/jackson-annotations/2.10.1/jackson-annotations-2.10.1.jar:/Users/marcospereira/.coursier/cache/v1/https/repo1.maven.org/maven2/com/typesafe/play/build-link/2.8.0/build-link-2.8.0.jar:/Users/marcospereira/.coursier/cache/v1/https/repo1.maven.org/maven2/com/google/protobuf/protobuf-java/3.10.0/protobuf-java-3.10.0.jar:/Users/marcospereira/.coursier/cache/v1/https/repo1.maven.org/maven2/aopalliance/aopalliance/1.0/aopalliance-1.0.jar:/Users/marcospereira/.coursier/cache/v1/https/repo1.maven.org/maven2/jakarta/transaction/jakarta.transaction-api/1.3.3/jakarta.transaction-api-1.3.3.jar:/Users/marcospereira/.coursier/cache/v1/https/repo1.maven.org/maven2/com/google/j2objc/j2objc-annotations/1.3/j2objc-annotations-1.3.jar:/Users/marcospereira/.coursier/cache/v1/https/repo1.maven.org/maven2/com/google/guava/guava/28.1-jre/guava-28.1-jre.jar:/Users/marcospereira/.coursier/cache/v1/https/repo1.maven.org/maven2/com/fasterxml/jackson/datatype/jackson-datatype-jdk8/2.10.1/jackson-datatype-jdk8-2.10.1.jar:/Users/marcospereira/.coursier/cache/v1/https/repo1.maven.org/maven2/com/google/guava/failureaccess/1.0.1/failureaccess-1.0.1.jar:/Users/marcospereira/.coursier/cache/v1/https/repo1.maven.org/maven2/com/google/inject/guice/4.2.2/guice-4.2.2.jar:/Users/marcospereira/.coursier/cache/v1/https/repo1.maven.org/maven2/com/typesafe/akka/akka-issues-9983-support_2.13/10.1.11/akka-issues-9983-support_2.13-10.1.11.jar:/Users/marcospereira/.coursier/cache/v1/https/repo1.maven.org/maven2/org/slf4j/jcl-over-slf4j/1.7.29/jcl-over-slf4j-1.7.29.jar:/Users/marcospereira/.coursier/cache/v1/https/repo1.maven.org/maven2/com/fasterxml/jackson/datatype/jackson-datatype-jsr310/2.10.1/jackson-datatype-jsr310-2.10.1.jar:/Users/marcospereira/.coursier/cache/v1/https/repo1.maven.org/maven2/com/typesafe/play/play-akka-http-server_2.13/2.8.0/play-akka-http-server_2.13-2.8.0.jar:/Users/marcospereira/.coursier/cache/v1/https/repo1.maven.org/maven2/com/typesafe/ssl-config-core_2.13/0.4.1/ssl-config-core_2.13-0.4.1.jar:/Users/marcospereira/.coursier/cache/v1/https/repo1.maven.org/maven2/com/fasterxml/jackson/module/jackson-module-scala_2.13/2.10.1/jackson-module-scala_2.13-2.10.1.jar:/Users/marcospereira/.coursier/cache/v1/https/repo1.maven.org/maven2/com/typesafe/play/play-logback_2.13/2.8.0/play-logback_2.13-2.8.0.jar:/Users/marcospereira/.coursier/cache/v1/https/repo1.maven.org/maven2/com/google/inject/extensions/guice-assistedinject/4.2.2/guice-assistedinject-4.2.2.jar:/Users/marcospereira/.coursier/cache/v1/https/repo1.maven.org/maven2/com/typesafe/play/play-functional_2.13/2.8.1/play-functional_2.13-2.8.1.jar:/Users/marcospereira/.coursier/cache/v1/https/repo1.maven.org/maven2/com/fasterxml/jackson/core/jackson-databind/2.10.1/jackson-databind-2.10.1.jar:/Users/marcospereira/.coursier/cache/v1/https/repo1.maven.org/maven2/com/typesafe/play/play-akka-issues-9983-support_2.13/2.8.0/play-akka-issues-9983-support_2.13-2.8.0.jar:/Users/marcospereira/.coursier/cache/v1/https/repo1.maven.org/maven2/org/slf4j/jul-to-slf4j/1.7.29/jul-to-slf4j-1.7.29.jar:/Users/marcospereira/.coursier/cache/v1/https/repo1.maven.org/maven2/com/thoughtworks/paranamer/paranamer/2.8/paranamer-2.8.jar:/Users/marcospereira/.coursier/cache/v1/https/repo1.maven.org/maven2/com/typesafe/akka/akka-actor_2.13/2.6.1/akka-actor_2.13-2.6.1.jar:/Users/marcospereira/.coursier/cache/v1/https/repo1.maven.org/maven2/org/reactivestreams/reactive-streams/1.0.3/reactive-streams-1.0.3.jar:/Users/marcospereira/.coursier/cache/v1/https/repo1.maven.org/maven2/com/typesafe/akka/akka-serialization-jackson_2.13/2.6.1/akka-serialization-jackson_2.13-2.6.1.jar:/Users/marcospereira/.coursier/cache/v1/https/repo1.maven.org/maven2/com/typesafe/play/filters-helpers_2.13/2.8.0/filters-helpers_2.13-2.8.0.jar:/Users/marcospereira/.coursier/cache/v1/https/repo1.maven.org/maven2/jakarta/xml/bind/jakarta.xml.bind-api/2.3.2/jakarta.xml.bind-api-2.3.2.jar:/Users/marcospereira/.coursier/cache/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-reflect/2.13.1/scala-reflect-2.13.1.jar:/Users/marcospereira/.coursier/cache/v1/https/repo1.maven.org/maven2/com/fasterxml/jackson/dataformat/jackson-dataformat-cbor/2.10.1/jackson-dataformat-cbor-2.10.1.jar:/Users/marcospereira/.coursier/cache/v1/https/repo1.maven.org/maven2/com/typesafe/play/play-json_2.13/2.8.1/play-json_2.13-2.8.1.jar:/Users/marcospereira/.coursier/cache/v1/https/repo1.maven.org/maven2/com/typesafe/akka/akka-parsing_2.13/10.1.11/akka-parsing_2.13-10.1.11.jar:/Users/marcospereira/.coursier/cache/v1/https/repo1.maven.org/maven2/org/codehaus/mojo/animal-sniffer-annotations/1.18/animal-sniffer-annotations-1.18.jar:/Users/marcospereira/.coursier/cache/v1/https/repo1.maven.org/maven2/ch/qos/logback/logback-core/1.2.3/logback-core-1.2.3.jar
[debug] Scala compilation took 3.242982678 s
[debug] Done compiling.
[debug] New invalidations:
[debug] Set()
[debug] Initial set of included nodes:
[debug] Previously invalidated, but (transitively) depend on new invalidations:
[debug] Set()
[debug] No classes were invalidated.
[debug] Copy resource mappings:
[debug] (/Users/marcospereira/tmp/issues-9983/conf/logback.xml,/Users/marcospereira/tmp/issues-9983/target/scala-2.13/classes/logback.xml)
[debug] (/Users/marcospereira/tmp/issues-9983/conf/messages,/Users/marcospereira/tmp/issues-9983/target/scala-2.13/classes/messages)
[debug] (/Users/marcospereira/tmp/issues-9983/conf/application.conf,/Users/marcospereira/tmp/issues-9983/target/scala-2.13/classes/application.conf)
[debug] (/Users/marcospereira/tmp/issues-9983/conf/routes,/Users/marcospereira/tmp/issues-9983/target/scala-2.13/classes/routes)
[debug] No changes
So, it looks like sbt is correctly detecting the file changes, but Play ~run
is failing to react to that.
@malliina could you please run with --debug
as I did above and confirm if you are observing something similar?
@marcospereira I ran sbt --debug ~run
and it appears I have similar behavior:
After a file change:
[debug] root / Compile / run - Accepted event for C:\Users\mle\code\play-samples\play-scala-hello-world-tutorial\app\controllers\HomeController.scala~
[debug] Received Creation(C:\Users\mle\code\play-samples\play-scala-hello-world-tutorial\app\controllers\HomeController.scala~,FileAttributes(isDirectory = false, isOther = false,isRegularFile = true, isSymbolicLink = false))
[debug] root / Compile / run - Accepted event for C:\Users\mle\code\play-samples\play-scala-hello-world-tutorial\app\controllers\HomeController.scala~
[debug] Received Update(C:\Users\mle\code\play-samples\play-scala-hello-world-tutorial\app\controllers\HomeController.scala~,FileAttributes(isDirectory = false, isOther = false,isRegularFile = true, isSymbolicLink = false),FileAttributes(isDirectory = false, isOther = false,isRegularFile = true, isSymbolicLink = false)) [debug] root / Compile / run - Accepted event for C:\Users\mle\code\play-samples\play-scala-hello-world-tutorial\app\controllers\HomeController.scala~
[debug] Received Deletion(C:\Users\mle\code\play-samples\play-scala-hello-world-tutorial\app\controllers\HomeController.scala~,FileAttributes(isDirectory = false, isOther = false,isRegularFile = true, isSymbolicLink = false))
[debug] root / Compile / run - Accepted event for C:\Users\mle\code\play-samples\play-scala-hello-world-tutorial\app\controllers\HomeController.scala
[debug] Received Update(C:\Users\mle\code\play-samples\play-scala-hello-world-tutorial\app\controllers\HomeController.scala,FileAttributes(isDirectory = false, isOther = false,isRegularFile = true, isSymbolicLink = false),FileAttributes(isDirectory = false, isOther = false,isRegularFile = true, isSymbolicLink = false)) [debug] root / Compile / run - Accepted event for C:\Users\mle\code\play-samples\play-scala-hello-world-tutorial\app\controllers\HomeController.scala
[debug] Received Update(C:\Users\mle\code\play-samples\play-scala-hello-world-tutorial\app\controllers\HomeController.scala,FileAttributes(isDirectory = false, isOther = false,isRegularFile = true, isSymbolicLink = false),FileAttributes(isDirectory = false, isOther = false,isRegularFile = true, isSymbolicLink = false)) [debug] root / Compile / run - Accepted event for C:\Users\mle\code\play-samples\play-scala-hello-world-tutorial\app\controllers
[debug] Received Update(C:\Users\mle\code\play-samples\play-scala-hello-world-tutorial\app\controllers,FileAttributes(isDirectory = true, isOther = false,isRegularFile = false, isSymbolicLink = false),FileAttributes(isDirectory = true, isOther = false,isRegularFile = false, isSymbolicLink = false))
[debug] root / Compile / run - Accepted event for C:\Users\mle\code\play-samples\play-scala-hello-world-tutorial\app\controllers
[debug] Received Update(C:\Users\mle\code\play-samples\play-scala-hello-world-tutorial\app\controllers,FileAttributes(isDirectory = true, isOther = false,isRegularFile = false, isSymbolicLink = false),FileAttributes(isDirectory = true, isOther = false,isRegularFile = false, isSymbolicLink = false))
Subsequently after making a request:
[debug]
[debug] Initial source changes:
[debug] removed:Set()
[debug] added: Set()
[debug] modified: Set(C:\Users\mle\code\play-samples\play-scala-hello-world-tutorial\app\controllers\HomeController.scala)
[debug] Invalidated products: Set()
[debug] External API changes: API Changes: Set()
[debug] Modified binary dependencies: Set()
[debug] Initial directly invalidated classes: Set(controllers.HomeController)
[debug]
[debug] Sources indirectly invalidated by:
[debug] product: Set()
[debug] binary dep: Set()
[debug] external source: Set()
[debug] All initially invalidated classes: Set(controllers.HomeController)
[debug] All initially invalidated sources:Set(C:\Users\mle\code\play-samples\play-scala-hello-world-tutorial\app\controllers\HomeController.scala)
[debug] Initial set of included nodes: controllers.HomeController
[info] Compiling 1 Scala source to C:\Users\mle\code\play-samples\play-scala-hello-world-tutorial\target\scala-2.13\classes ...
[debug] Getting org.scala-sbt:compiler-bridge_2.13:1.3.1:compile for Scala 2.13.1
[debug] Getting org.scala-sbt:compiler-bridge_2.13:1.3.1:compile for Scala 2.13.1
[debug] [zinc] Running cached compiler 67b55478 for Scala compiler version 2.13.1
[debug] [zinc] The Scala compiler is invoked with:
[debug] -deprecation
[debug] -unchecked
[debug] -encoding
[debug] utf8
[debug] -feature
[debug] -deprecation
[debug] -Xfatal-warnings
[debug] -bootclasspath
[debug] C:\Users\mle\AppData\Local\Coursier\Cache\v1\https\repo1.maven.org\maven2\org\scala-lang\scala-library\2.13.1\scala-library-2.13.1.jar
[debug] -classpath
[debug] C:\Users\mle\code\play-samples\play-scala-hello-world-tutorial\target\scala-2.13\classes;C:\Users\mle\AppData\Local\Coursier\Cache\v1\https\repo1.maven.org\maven2\com\google\errorprone\error_prone_annotations\2.3.2\error_prone_annotations-2.3.2.jar;C:\Users\mle\AppData\Local\Coursier\Cache\v1\https\repo1.maven.org\maven2\javax\inject\javax.inject\1\javax.inject-1.jar;C:\Users\mle\AppData\Local\Coursier\Cache\v1\https\repo1.maven.org\maven2\org\scala-lang\modules\scala-xml_2.13\1.2.0\scala-xml_2.13-1.2.0.jar;C:\Users\mle\AppData\Local\Coursier\Cache\v1\https\repo1.maven.org\maven2\com\typesafe\config\1.4.0\config-1.4.0.jar;C:\Users\mle\AppData\Local\Coursier\Cache\v1\https\repo1.maven.org\maven2\org\checkerframework\checker-qual\2.8.1\checker-qual-2.8.1.jar;C:\Users\mle\AppData\Local\Coursier\Cache\v1\https\repo1.maven.org\maven2\io\jsonwebtoken\jjwt\0.9.1\jjwt-0.9.1.jar;C:\Users\mle\AppData\Local\Coursier\Cache\v1\https\repo1.maven.org\maven2\com\typesafe\akka\akka-stream_2.13\2.6.1\akka-stream_2.13-2.6.1.jar;C:\Users\mle\AppData\Local\Coursier\Cache\v1\https\repo1.maven.org\maven2\org\scala-lang\modules\scala-java8-compat_2.13\0.9.0\scala-java8-compat_2.13-0.9.0.jar;C:\Users\mle\AppData\Local\Coursier\Cache\v1\https\repo1.maven.org\maven2\org\slf4j\slf4j-api\1.7.29\slf4j-api-1.7.29.jar;C:\Users\mle\AppData\Local\Coursier\Cache\v1\https\repo1.maven.org\maven2\com\typesafe\play\play_2.13\2.8.0\play_2.13-2.8.0.jar;C:\Users\mle\AppData\Local\Coursier\Cache\v1\https\repo1.maven.org\maven2\com\typesafe\play\twirl-api_2.13\1.5.0\twirl-api_2.13-1.5.0.jar;C:\Users\mle\AppData\Local\Coursier\Cache\v1\https\repo1.maven.org\maven2\com\fasterxml\jackson\module\jackson-module-parameter-names\2.10.1\jackson-module-parameter-names-2.10.1.jar;C:\Users\mle\AppData\Local\Coursier\Cache\v1\https\repo1.maven.org\maven2\com\typesafe\play\play-streams_2.13\2.8.0\play-streams_2.13-2.8.0.jar;C:\Users\mle\AppData\Local\Coursier\Cache\v1\https\repo1.maven.org\maven2\org\scala-lang\modules\scala-parser-combinators_2.13\1.1.2\scala-parser-combinators_2.13-1.1.2.jar;C:\Users\mle\AppData\Local\Coursier\Cache\v1\https\repo1.maven.org\maven2\jakarta\activation\jakarta.activation-api\1.2.1\jakarta.activation-api-1.2.1.jar;C:\Users\mle\AppData\Local\Coursier\Cache\v1\https\repo1.maven.org\maven2\com\typesafe\akka\akka-protobuf-v3_2.13\2.6.1\akka-protobuf-v3_2.13-2.6.1.jar;C:\Users\mle\AppData\Local\Coursier\Cache\v1\https\repo1.maven.org\maven2\com\fasterxml\jackson\module\jackson-module-paranamer\2.10.1\jackson-module-paranamer-2.10.1.jar;C:\Users\mle\AppData\Local\Coursier\Cache\v1\https\repo1.maven.org\maven2\com\typesafe\akka\akka-http-core_2.13\10.1.11\akka-http-core_2.13-10.1.11.jar;C:\Users\mle\AppData\Local\Coursier\Cache\v1\https\repo1.maven.org\maven2\ch\qos\logback\logback-classic\1.2.3\logback-classic-1.2.3.jar;C:\Users\mle\AppData\Local\Coursier\Cache\v1\https\repo1.maven.org\maven2\com\typesafe\play\play-guice_2.13\2.8.0\play-guice_2.13-2.8.0.jar;C:\Users\mle\AppData\Local\Coursier\Cache\v1\https\repo1.maven.org\maven2\com\google\code\findbugs\jsr305\3.0.2\jsr305-3.0.2.jar;C:\Users\mle\AppData\Local\Coursier\Cache\v1\https\repo1.maven.org\maven2\com\typesafe\play\play-server_2.13\2.8.0\play-server_2.13-2.8.0.jar;C:\Users\mle\AppData\Local\Coursier\Cache\v1\https\repo1.maven.org\maven2\com\typesafe\akka\akka-actor-typed_2.13\2.6.1\akka-actor-typed_2.13-2.6.1.jar;C:\Users\mle\AppData\Local\Coursier\Cache\v1\https\repo1.maven.org\maven2\com\google\guava\listenablefuture\9999.0-empty-to-avoid-conflict-with-guava\listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar;C:\Users\mle\AppData\Local\Coursier\Cache\v1\https\repo1.maven.org\maven2\com\fasterxml\jackson\core\jackson-core\2.10.1\jackson-core-2.10.1.jar;C:\Users\mle\AppData\Local\Coursier\Cache\v1\https\repo1.maven.org\maven2\joda-time\joda-time\2.10.5\joda-time-2.10.5.jar;C:\Users\mle\AppData\Local\Coursier\Cache\v1\https\repo1.maven.org\maven2\com\typesafe\play\play-exceptions\2.8.0\play-exceptions-2.8.0.jar;C:\Users\mle\AppData\Local\Coursier\Cache\v1\https\repo1.maven.org\maven2\com\typesafe\akka\akka-slf4j_2.13\2.6.1\akka-slf4j_2.13-2.6.1.jar;C:\Users\mle\AppData\Local\Coursier\Cache\v1\https\repo1.maven.org\maven2\com\fasterxml\jackson\core\jackson-annotations\2.10.1\jackson-annotations-2.10.1.jar;C:\Users\mle\AppData\Local\Coursier\Cache\v1\https\repo1.maven.org\maven2\com\typesafe\play\build-link\2.8.0\build-link-2.8.0.jar;C:\Users\mle\AppData\Local\Coursier\Cache\v1\https\repo1.maven.org\maven2\com\google\protobuf\protobuf-java\3.10.0\protobuf-java-3.10.0.jar;C:\Users\mle\AppData\Local\Coursier\Cache\v1\https\repo1.maven.org\maven2\aopalliance\aopalliance\1.0\aopalliance-1.0.jar;C:\Users\mle\AppData\Local\Coursier\Cache\v1\https\repo1.maven.org\maven2\jakarta\transaction\jakarta.transaction-api\1.3.3\jakarta.transaction-api-1.3.3.jar;C:\Users\mle\AppData\Local\Coursier\Cache\v1\https\repo1.maven.org\maven2\com\google\j2objc\j2objc-annotations\1.3\j2objc-annotations-1.3.jar;C:\Users\mle\AppData\Local\Coursier\Cache\v1\https\repo1.maven.org\maven2\com\google\guava\guava\28.1-jre\guava-28.1-jre.jar;C:\Users\mle\AppData\Local\Coursier\Cache\v1\https\repo1.maven.org\maven2\com\fasterxml\jackson\datatype\jackson-datatype-jdk8\2.10.1\jackson-datatype-jdk8-2.10.1.jar;C:\Users\mle\AppData\Local\Coursier\Cache\v1\https\repo1.maven.org\maven2\com\google\guava\failureaccess\1.0.1\failureaccess-1.0.1.jar;C:\Users\mle\AppData\Local\Coursier\Cache\v1\https\repo1.maven.org\maven2\com\google\inject\guice\4.2.2\guice-4.2.2.jar;C:\Users\mle\AppData\Local\Coursier\Cache\v1\https\repo1.maven.org\maven2\org\slf4j\jcl-over-slf4j\1.7.29\jcl-over-slf4j-1.7.29.jar;C:\Users\mle\AppData\Local\Coursier\Cache\v1\https\repo1.maven.org\maven2\com\fasterxml\jackson\datatype\jackson-datatype-jsr310\2.10.1\jackson-datatype-jsr310-2.10.1.jar;C:\Users\mle\AppData\Local\Coursier\Cache\v1\https\repo1.maven.org\maven2\com\typesafe\play\play-akka-http-server_2.13\2.8.0\play-akka-http-server_2.13-2.8.0.jar;C:\Users\mle\AppData\Local\Coursier\Cache\v1\https\repo1.maven.org\maven2\com\typesafe\ssl-config-core_2.13\0.4.1\ssl-config-core_2.13-0.4.1.jar;C:\Users\mle\AppData\Local\Coursier\Cache\v1\https\repo1.maven.org\maven2\com\fasterxml\jackson\module\jackson-module-scala_2.13\2.10.1\jackson-module-scala_2.13-2.10.1.jar;C:\Users\mle\AppData\Local\Coursier\Cache\v1\https\repo1.maven.org\maven2\com\typesafe\play\play-logback_2.13\2.8.0\play-logback_2.13-2.8.0.jar;C:\Users\mle\AppData\Local\Coursier\Cache\v1\https\repo1.maven.org\maven2\com\google\inject\extensions\guice-assistedinject\4.2.2\guice-assistedinject-4.2.2.jar;C:\Users\mle\AppData\Local\Coursier\Cache\v1\https\repo1.maven.org\maven2\com\typesafe\play\play-functional_2.13\2.8.1\play-functional_2.13-2.8.1.jar;C:\Users\mle\AppData\Local\Coursier\Cache\v1\https\repo1.maven.org\maven2\com\fasterxml\jackson\core\jackson-databind\2.10.1\jackson-databind-2.10.1.jar;C:\Users\mle\AppData\Local\Coursier\Cache\v1\https\repo1.maven.org\maven2\org\slf4j\jul-to-slf4j\1.7.29\jul-to-slf4j-1.7.29.jar;C:\Users\mle\AppData\Local\Coursier\Cache\v1\https\repo1.maven.org\maven2\com\thoughtworks\paranamer\paranamer\2.8\paranamer-2.8.jar;C:\Users\mle\AppData\Local\Coursier\Cache\v1\https\repo1.maven.org\maven2\com\typesafe\akka\akka-actor_2.13\2.6.1\akka-actor_2.13-2.6.1.jar;C:\Users\mle\AppData\Local\Coursier\Cache\v1\https\repo1.maven.org\maven2\org\reactivestreams\reactive-streams\1.0.3\reactive-streams-1.0.3.jar;C:\Users\mle\AppData\Local\Coursier\Cache\v1\https\repo1.maven.org\maven2\com\typesafe\akka\akka-serialization-jackson_2.13\2.6.1\akka-serialization-jackson_2.13-2.6.1.jar;C:\Users\mle\AppData\Local\Coursier\Cache\v1\https\repo1.maven.org\maven2\com\typesafe\play\filters-helpers_2.13\2.8.0\filters-helpers_2.13-2.8.0.jar;C:\Users\mle\AppData\Local\Coursier\Cache\v1\https\repo1.maven.org\maven2\jakarta\xml\bind\jakarta.xml.bind-api\2.3.2\jakarta.xml.bind-api-2.3.2.jar;C:\Users\mle\AppData\Local\Coursier\Cache\v1\https\repo1.maven.org\maven2\org\scala-lang\scala-reflect\2.13.1\scala-reflect-2.13.1.jar;C:\Users\mle\AppData\Local\Coursier\Cache\v1\https\repo1.maven.org\maven2\com\fasterxml\jackson\dataformat\jackson-dataformat-cbor\2.10.1\jackson-dataformat-cbor-2.10.1.jar;C:\Users\mle\AppData\Local\Coursier\Cache\v1\https\repo1.maven.org\maven2\com\typesafe\play\play-json_2.13\2.8.1\play-json_2.13-2.8.1.jar;C:\Users\mle\AppData\Local\Coursier\Cache\v1\https\repo1.maven.org\maven2\com\typesafe\akka\akka-parsing_2.13\10.1.11\akka-parsing_2.13-10.1.11.jar;C:\Users\mle\AppData\Local\Coursier\Cache\v1\https\repo1.maven.org\maven2\org\codehaus\mojo\animal-sniffer-annotations\1.18\animal-sniffer-annotations-1.18.jar;C:\Users\mle\AppData\Local\Coursier\Cache\v1\https\repo1.maven.org\maven2\ch\qos\logback\logback-core\1.2.3\logback-core-1.2.3.jar
[debug] Scala compilation took 4.1668605 s
[debug] Done compiling.
[debug] New invalidations:
[debug] Set()
[debug] Initial set of included nodes:
[debug] Previously invalidated, but (transitively) depend on new invalidations:
[debug] Set()
[debug] No classes were invalidated.
[debug] Copy resource mappings:
[debug] (C:\Users\mle\code\play-samples\play-scala-hello-world-tutorial\conf\application.conf,C:\Users\mle\code\play-samples\play-scala-hello-world-tutorial\target\scala-2.13\classes\application.conf)
[debug] (C:\Users\mle\code\play-samples\play-scala-hello-world-tutorial\conf\logback.xml,C:\Users\mle\code\play-samples\play-scala-hello-world-tutorial\target\scala-2.13\classes\logback.xml)
[debug] (C:\Users\mle\code\play-samples\play-scala-hello-world-tutorial\conf\messages,C:\Users\mle\code\play-samples\play-scala-hello-world-tutorial\target\scala-2.13\classes\messages)
[debug] (C:\Users\mle\code\play-samples\play-scala-hello-world-tutorial\conf\routes,C:\Users\mle\code\play-samples\play-scala-hello-world-tutorial\target\scala-2.13\classes\routes)
[debug] No changes
--- (RELOAD) ---
[info] p.a.h.EnabledFilters - Enabled Filters (see <https://www.playframework.com/documentation/latest/Filters>):
play.filters.csrf.CSRFFilter
play.filters.headers.SecurityHeadersFilter
play.filters.hosts.AllowedHostsFilter
[info] play.api.Play - Application started (Dev) (no global state)
Here are some observations.
~compile
[play-scala-hello-world-tutorial] $ ~compile
[warn] There may be incompatibilities among your library dependencies; run 'evicted' to see detailed eviction warnings.
[info] Compiling 10 Scala sources and 1 Java source to /private/tmp/play-samples/play-scala-hello-world-tutorial/target/scala-2.13/classes ...
[success] Total time: 2 s, completed Jan 15, 2020, 1:50:20 PM
[info] 1. Monitoring source files for root/compile...
[info] Press <enter> to interrupt or '?' for more options.
When I type ~compile
, I see that
- first sbt compiles 10 Scala sources (executing
compile
) then - the watcher logs "Monitoring source files for root/compile".
~run
[play-scala-hello-world-tutorial] $ ~run
--- (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 Enter to stop and go back to the console...)
Similarly, run
first gets executed. This would start the dev mode, but watcher hasn't started.
Now if I enter Ctrl-D
, it then goes into watching...
[info] p.c.s.AkkaHttpServer - Stopping server...
[info] p.a.h.EnabledFilters - Enabled Filters (see <https://www.playframework.com/documentation/latest/Filters>):
play.filters.csrf.CSRFFilter
play.filters.headers.SecurityHeadersFilter
play.filters.hosts.AllowedHostsFilter
[info] play.api.Play - Application started (Dev) (no global state)
[success] Total time: 99 s (01:39), completed Jan 15, 2020, 1:53:11 PM
[info] 1. Monitoring source files for root/run...
[info] Press <enter> to interrupt or '?' for more options.
This is still not working with sbt 1.4.6... I guess this is to be fixed in Play somewhere... sometime...
I did some research. The behaviour in following code block differs in sbt 1.2 and sbt 1.3: https://github.com/playframework/playframework/blob/96a5c50b1cb7802819213fb13a5e2bfa513ac9aa/dev-mode/sbt-plugin/src/main/scala/play/sbt/run/PlayRun.scala#L145-L149
In sbt 1.2 watched.watchSources(state)
will always return the sources that are being watched and the iterator and collect "runs",
in sbt 1.3 however watched.watchSources(state)
will never return anything...
(FYI: sourcesFinder
will be called every couple of ms to find if source have been changed, so basically in sbt 1.3 it results in a no-op)
According to the 1.3 release notes things changed for file watching... Also this issue here seems related: https://github.com/sbt/sbt/issues/5561 So there were some changes that needs config adjustments.
@eatkins @eed3si9n Given my research, do you know how to fix that or how to configure stuff?
One more thing:
It seems there is another behaviour change in sbt 1.4:
https://github.com/playframework/playframework/blob/96a5c50b1cb7802819213fb13a5e2bfa513ac9aa/dev-mode/sbt-plugin/src/main/scala/play/sbt/run/PlayRun.scala#L112-L121
Until sbt 1.3 when calling ~run
, the first Some(watched)
case would always be entered, but starting with sbt 1.4 the None
case will be entered (which I think is not intended by this code here...) So another thing that needs attention.
Any news how to get ~run
to run?
This is exactly my problem: https://github.com/playframework/playframework/issues/9983#issuecomment-574801920
cc: @eatkins @eed3si9n
Also see comments in
- #9365
I removed references to ~run
in the docs until we fixed it:
- #12734
- #12735
- #12736
Opened a placeholder PR with the docs re-introduced:
- #12737