Grails 2.1.0 Not Auto-Reloading / Auto-Recompiling

前端 未结 4 1735
忘掉有多难
忘掉有多难 2021-02-15 23:31

Seems that Grails does automatically recompile my GSP pages, but not my controllers. It used to work with the previous version of Grails. Any idea what I can look for?

U

4条回答
  •  情歌与酒
    2021-02-15 23:59

    I had this problem when I had a BaseController class from which other controllers were derived. If I make changes to BaseController class such as adding a method or closure, change a method name, import some classes etc, the whole class reloading feature in Grails will come to a grinding halt.

    The only solution that worked for me was to delete the target directory into which all classes were compiled. At least that way I did not have to restart the server every time which saved me from having to wait about 30 seconds to display the start page. It could be pretty annoying when class reloading feature does not work as expected.

    Grails auto-reloading feature is not without quirks. Some of these quirks are ultimately related to java and how class loading works in servlet container environment. I hope the Grails team will make it a priority to provide seamless class reloading for Grails like other scripting environments( ruby, PHP, python or play framework) because some other aspects of this framework is such a pleasure to deal with.

提交回复
热议问题