Files with groovy templates are created in project root directory - play 1.6.0

play 1.6.0
java 1.8

Same issue is created on github The temporary class of the template is output directly under the application dir. · Issue #1354 · playframework/play1 · GitHub

After start of our appllication, groovy creates template files uder root directory.

Temporary solution is to set during start of aplication, so this files are stored in tmp directory.
In our project, we set this directory in job annotated with @OnApplicationStart. Problem with this approach is that in “play precompile” mode jobs are not executed, so this varaible is not set as expected.

This problem occurs only in play 1.6.0 and is most likely related to the update of groovy in this version.
In previous versions this files were not created at all.

Does anyone know any working solution ?

I’m going to pursue the alternate solution discussed in GitHub Issue 1354 of reverting a change to GroovyTemplate, but I have a tip for setting a system property–you can do it from the command line when you start your Play! app:

play run

This sets at the time the JVM is initialized and can be used for “play precompile” as well. I haven’t experimented with this “precompile” to know the precompiled templates are used when you run play, but I have confirmed that they are created.