Grails 2.3.0 Auto-reloading not working

人盡茶涼 提交于 2019-11-27 00:59:23

It seems that in Grails 2.3 the reloading is no longer the default

In Grails 2.3 the reloading agent is no longer on the build system path unless you pass the -reloading flag to the grails command:

grails -reloading run-app

However, you can enable forking in your buildConfig using the following configuration:

forkConfig = [maxMemory: 1024, minMemory: 64, debug: false, maxPerm: 256] 
grails.project.fork = [    
  test: forkConfig, // configure settings for the test-app JVM    
  run: forkConfig, // configure settings for the run-app JVM    
  war: forkConfig, // configure settings for the run-war JVM    
  console: forkConfig // configure settings for the Swing console JVM ]

More information : Forked Execution and the Reloading Agent

I am using Grails 2.4.3 and IntelliJ 13 and I found that I had to have the -reloading part at the end of the run-app command.

In other words when you edit your Run/Debug configurations, in the 'Command Line' part put run-app -reloading and NOT -reloading run-app.

I found this solution here from user longwa

Grails 2.4.x maintained the same support:

grails -reloading run-app

The logs will show the status of the reload once a "watched" file changes in the file-system:

2014-09-23 00:42:02,666 [localhost-startStop-1] INFO  conf.BootStrap  - Checking for registries in system env
| Server running. Browse to http://localhost:8080/docker-registry-ui
| Compiling 1 source files.....
abdielou

I was not able to fix my problem with reloading by any of the suggestions above. In my case the problem was my path, it contained a space! Took me a couple of days and half my beard but finally figured it out. My path was something like : ~/Box Sync/path/to/project. That single space in Box Sync was the hidden bad guy. I beleive it to be related to this ticket https://github.com/grails/grails-core/issues/9344.

I dont need run with -reloading in the command line, its problem of springloaded.jar.

replace folder springloaded in grailsHome/lib/org.springframework/springloaded with the of grails sdk 2.4.3

https://mega.co.nz/#F!INgVnboD!r7ssrFy9TiCQ50ROqxWt8g

I tested in grails 2.5.0 and 2.4.*

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!