Grails 4 Spring Boot Dev Tools
Answered
Hello,
I'm using IntelliJ to develop Grails Projects. I've made an upgrade to Grails 4, which includes the Spring Boot Dev Tools. Unfortunately there is always an app reload if I make some changes at my GSPs although I made the correct (I guess) config settings in application.yml.
spring:
main:
banner-mode: "off"
groovy:
template:
check-template-location: false
jmx:
unique-names: true
devtools:
restart:
additional-exclude:
- '*.gsp'
- '*.gson'
- 'logback.groovy'
- '*.properties'
exclude:
- grails-app/views/**
- grails-app/i18n/**
- grails-app/conf/**
Are there any ideas why?
Thanks!
Please sign in to leave a comment.
What IDE version do you use? What Run/Debug Configuration do you use? Do you launch it in Debug mode? Do you have Settings (Preferences on macOS) | Build, Execution, Deployment | Build Tools | Gradle | Runner | Delegate IDE build/run actions to gradle enabled?
A sample project would be very helpful to investigate the problem.
Hello Andrey,
thank you for your answer.
The IDE-Version is IntelliJ IDEA 2018.3.5 / Build #IU-183.5912.21, built on February 26, 2019.
The app is not running in debug mode.
Delegate IDE build/run actions to gradle is enabled.
It's a bit strange becuase the app is always restarting after every save/autosave.
What Run/Debug Configuration do you use?
Have you tried to launch it it Debug mode?
Do you mean this?
And, I forgot, it's the same in debug mode.
As documentation specifies in Spring Boot Developer Tools and Spring Loaded section, the configuration must be like:
I do not see additional-exclude anywhere mentioned. Have you tried to specify all in
excludesection?If you see issue remains, please provide a sample project, describe the steps to reproduce. Thanks.
Thank you. The spring doc says: "If you want to keep those defaults and add additional exclusions, use the
spring.devtools.restart.additional-excludeproperty instead."https://docs.spring.io/spring-boot/docs/current/reference/html/using-boot-devtools.html#using-boot-devtools-restart-exclude
But I have also a sample project without the additional-exclude property set.
How can I provide the project?
For uploading you can use ftp://ftp.intellij.net/.uploads / https://uploads.services.jetbrains.com or any file sharing service.
Please describe also the exacts steps and the expected/actual result. In my sample project it works fine: the app is not restarted if I just change the .gsp file and invoke build action from IDE.
Okay, my steps:
When the app is running, I change the <h1>subline</h1> to <h1>subline1</h1> or something else at the index.gsp in views/server.
After pressing Ctrl-S the app restarts.
The upload is done:
Uploading... File uploaded: GPlayground.zip Upload complete!With configuration like
I do not get restarts if I edit files under grails-app/views/ directory and getting restarts if edit under e.g. grails-app/views/server directory. The same behaviour is when I'm running grails from command line. It does not seems to be related to IntelliJ IDEA.
That is totally weird. I don't know what I can do now. Strange, strange!
Thank you very much for your help!
Hey Andrey,
just want to let you know: there is also a discussion at grails.slack.com. The fixing (for the moment) is:
That works for me.
Thanks for the information!