Closed dylemma closed 1 week ago
Thanks for the report! I'll see if I can reproduce this in Windows.
Does making the forked JVM's output noisier give any interesting clues?
You can do this by either of the following:
set warForkOptions := ForkOptions()
warForkOptions := ForkOptions()
then run warStart
again.
I tested this on Windows 10 with Java 17, and it looks like sbt-war is hosing the backslashes in Windows directory paths:
sbt:my-web-project> warStart
sbt:my-web-project> The specified path "C:UsersJamesDesktopmy-web-project argetscala-3.1.0my-web-project_3-0.1.0-SNAPSHOT.war" does not exist.
sbt:my-web-project> show package
[info] C:\Users\James\Desktop\my-web-project\target\scala-3.1.0\my-web-project_3-0.1.0-SNAPSHOT.war
The war.properties file looks OK at first, but I think those single-backslashes need to be double-backslashes:
port=8080
warFile=C:\Users\James\Desktop\my-web-project\target\scala-3.1.0\my-web-project_3-0.1.0-SNAPSHOT.war
This might be the fix: https://stackoverflow.com/questions/5784895/java-properties-backslash
Reopening this until we get sbt-war.g8 updated and verify the fix.
The fix is released in sbt-war version 5.0.0-M6. sbt-war.g8 has been updated accordingly.
Please give it a try by either updating your project's project/plugins.sbt to point to sbt-war 5.0.0-M6, or by re-running sbt new earldouglas/sbt-war.g8
to create a new project.
Note that to run the tests, you must first start the server:
$ sbt
> warStart
> test
Confirmed fixed, thank you!
sbt:hello-sbt-war> test
[info] Passed: Total 1, Failed 0, Errors 0, Passed 1
[success] Total time: 6 s, completed Nov 18, 2024, 9:27:15 AM
I was planning to give the updated plugin a spin, so I generated a "hello world" app from the
earldouglas/sbt-war.g8
template. When I runwarStart
it showsBut the server does not appear to actually be running:
OS: Windows 11 Java: 11