play-scala-seed.g8
play-scala-seed.g8 copied to clipboard
Windows 10 java.io.IOException: Unable to delete file: C:\Users
generating a new project with sbt new playframework/play-scala-seed.g8 an error is thrown
java -version java version "1.8.0_172" Java(TM) SE Runtime Environment (build 1.8.0_172-b11) Java HotSpot(TM) 64-Bit Server VM (build 25.172-b11, mixed mode)
play_version [2.6.16]:
sbt_version [1.1.6]:
scalatestplusplay_version [3.1.2]:
[error] java.io.IOException: Unable to delete file: C:\Users\gerol\AppData\Local\Temp\giter8-79767804362487\src\main\g8**.gitignore**
[error] at org.apache.commons.io.FileUtils.forceDelete(FileUtils.java:2400)
[error] at org.apache.commons.io.FileUtils.cleanDirectory(FileUtils.java:1721)
[error] at org.apache.commons.io.FileUtils.deleteDirectory(FileUtils.java:1617)
[error] at org.apache.commons.io.FileUtils.forceDelete(FileUtils.java:2391)
[error] at org.apache.commons.io.FileUtils.cleanDirectory(FileUtils.java:1721)
[error] at org.apache.commons.io.FileUtils.deleteDirectory(FileUtils.java:1617)
[error] at org.apache.commons.io.FileUtils.forceDelete(FileUtils.java:2391)
[error] at org.apache.commons.io.FileUtils.cleanDirectory(FileUtils.java:1721)
[error] at org.apache.commons.io.FileUtils.deleteDirectory(FileUtils.java:1617)
[error] at org.apache.commons.io.FileUtils.forceDelete(FileUtils.java:2391)
[error] at org.apache.commons.io.FileUtils.cleanDirectory(FileUtils.java:1721)
[error] at org.apache.commons.io.FileUtils.deleteDirectory(FileUtils.java:1617)
[error] at org.apache.commons.io.FileUtils.forceDelete(FileUtils.java:2391)
[error] at giter8.JgitHelper.cleanup(JgitHelper.scala:58)
[error] at giter8.Giter8.run(giter8.scala:46)
[error] at giter8.Giter8.run(giter8.scala:56)
[error] at sbtgiter8resolver.Giter8TemplateResolver.run(Giter8TemplateResolver.scala:30)
[error] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[error] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
[error] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
[error] at java.lang.reflect.Method.invoke(Unknown Source)
[error] at sbt.TemplateCommandUtil$.call(TemplateCommandUtil.scala:120)
[error] at sbt.TemplateCommandUtil$.runTemplate(TemplateCommandUtil.scala:96)
[error] at sbt.TemplateCommandUtil$.$anonfun$run$1(TemplateCommandUtil.scala:72)
[error] at sbt.TemplateCommandUtil$.$anonfun$run$1$adapted(TemplateCommandUtil.scala:68)
[error] at scala.collection.LinearSeqOptimized.find(LinearSeqOptimized.scala:111)
[error] at scala.collection.LinearSeqOptimized.find$(LinearSeqOptimized.scala:108)
[error] at scala.collection.immutable.List.find(List.scala:86)
[error] at sbt.TemplateCommandUtil$.run(TemplateCommandUtil.scala:68)
[error] at sbt.TemplateCommandUtil$.runTemplate(TemplateCommandUtil.scala:55)
[error] at sbt.TemplateCommandUtil$.$anonfun$templateCommand$2(TemplateCommandUtil.scala:25)
[error] at sbt.Command$.$anonfun$applyEffect$4(Command.scala:142)
[error] at sbt.Command$.$anonfun$applyEffect$2(Command.scala:137)
[error] at sbt.Command$.process(Command.scala:181)
[error] at sbt.MainLoop$.processCommand(MainLoop.scala:151)
[error] at sbt.MainLoop$.$anonfun$next$2(MainLoop.scala:139)
[error] at sbt.State$$anon$1.runCmd$1(State.scala:246)
Manually removing the file (as the current user that also ran the 'sbt new' command) is no problem. Is the template trying to delete the file while it is still 'in use'?
I have the same problem but only if I run it via sbt, but if you run g8 directly no error occurs:
g8 playframework/play-scala-seed.g8
I have the same on sbt
The same problem.
I download Cmder and run sbt new <g8 template> successfully.
It throws an error!!!!!!!!
Same problem here. Can't get it to work even when running g8 directly.
Why does this problem arise, and can anyone solve it?
Despite this really noisy error, the command (mostly) succeeds and the app will still build and run.
I try to delete the folder manually, but this error still raise.
One of the workarounds is to not use cmd altogether, go to intellij > create new project > select scala > lightbend project > from the list of templates select the appropriate one e.g. scala play seed (be sure to be connected to internet for this step) > there you go Now from cmd navigate to your project directory and run the following magical command sbt run You can browse the app on localhost:9000
same issue on cmder, use admin cmd solve it
@xiongdahu thanks! running cmd as Administrator solved the issue.
I have the same problem :-(
During installation before final stept close the handle to this .gitignore file using any windows special instrument, for example https://docs.microsoft.com/en-us/sysinternals/downloads/process-explorer
Even I am facing the same issue. Used admin cmd as well but issue doesn't resolve. Kindly suggest

Works fine on 1.4.0 :)
@parveen0203 what sbt version were you on?
So does this work now when using sbt 1.4+. Can somone confirm?
Can someone confirm this is now fixed when using sbt 1.4 or newer? Thanks!
I assume this is fixed in sbt 1.4+, if not please let us know. Closing for now.