Has someone already found some tweaks to improve the compilation speed of Play 2.0? I am currently using 2.0.1 java.
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
You can use play ~run
. This compiles the files as soon as a change is deteced on the filesystem.
Plus there are rumors about a big compilation boost coming in the next couple of months. (latter half of 2012)
回答2:
I have written a very long post about how we have fix the compilation problem in Play Framework with my team.
https://medium.com/@jfcote/the-ultimate-solution-to-play-framework-slow-compilation-53f4fd499df4
To summarize,
- Add this to build.sbt:
playEnhancerEnabled := false
- Using a refactoring tool, encapsulate each field (making them private, generating a getter and changing the use everywhere for the newly created getter). Generate only a setter for fields that are used outside of the class (you will know by compiling and see the errors)
- Make sure to remove the @Transient annotation for all functions that are marked with it. We had these annotations on some functions because it was clashing with the Play Enhancer. Just remove the annotations and everything will be OK!
- Compile and fix everywhere you were using the field if the refactoring tool didn’t do its job.