grails-gradle-plugin-archived
grails-gradle-plugin-archived copied to clipboard
Resource reloading not working with the latest plugin.
With the latest version of this plugin, grails reloading is not working when running grails-run-app task. Earlier, when I change css files, reload was working.
Any ideas why this is not working. It is really frustrating having to restart for every little change...
Maybe there is an issue loading the springloaded library correctly. Normally there is a message printed if the springloaded library could not be loaded. Did you set version for this library? grails { ... springLoadedVersion= }
On 30.03.2014 22:34, nanandn wrote:
Any ideas why this is not working. It is really frustrating having to restart for every little change...
— Reply to this email directly or view it on GitHub https://github.com/grails/grails-gradle-plugin/issues/84#issuecomment-39038608.
You shouldn't need to explicitly set springLoadedVersion
, it will default to a value. I'll try and look at this issue this week. It's probably something to do with the fact that the grails-run-app
task is explicit now instead of being dynamically created.
With a simple project, adding a domain or controller class triggers reloading for me.
Same issue as @nanandn here since we updated to the latest version :'(
Might be due to the bug where the grailsArgs, grailsDebug and grailsBaseJvmArgs not beeing passed to grails-run-app task. Once I added the following in the idea run configuration, it seems to work. Setting it in the build.gradle or gradle properties is not taking effect.
-PgrailsArgs="-non-interactive -reloading"
do one of you have an example project that exhibits the problem? This is what I did:
$ gradle init
$ gradle grails-run-app
| Loading Grails 2.3.5
| Configuring classpath
| Running pre-compiled script
| Environment set to development
| Packaging Grails application
| Running Grails application
| Server running. Browse to http://localhost:8080/gg-test
Then I edited a domain/controller class and the following was output:
| Compiling 1 source files
| Compiling 1 source files.
This is the build.gradle
file I used:
buildscript {
repositories {
mavenLocal()
jcenter()
mavenCentral()
}
dependencies {
classpath "org.grails:grails-gradle-plugin:2.0.1"
}
}
apply plugin: 'grails'
version = '1.0'
grails {
grailsVersion = '2.3.5'
groovyVersion = '2.1.9'
}
repositories {
grails.central()
}
dependencies {
bootstrap "org.grails.plugins:tomcat:7.0.50"
compile 'org.grails.plugins:scaffolding:2.0.0'
}
I don't have a sample project. I'll try to create one this evening or over the weekend.
And me neither since I'm the front-end designer :'( All static resources need a restart to be displayed
So are you both talking about reloading from the Resources plugin? Not changes to the Grails code?
It appears I misunderstand the initial problem. I'll take a look soon.
hmmm... I'm not sure if its related but it may be because the package name for sprinloaded V1.1.5 is not org.springsource.springloaded:springloaded-core:
but org.springframework.:springloaded
. In GrailsPlugin.groovy, its referencing org.springsource.springloaded:springloaded-core:
as the package (is it called package?) name. Therefore if I changed my build script to springLoadedVersion = '1.1.5'
I'll get "failed to resolve springloaded dependency" errors. As a side note, Grails 2.3.7 is using springLoaded V1.1.5.
Add support for new SpringLoaded Maven target: https://github.com/grails/grails-gradle-plugin/commit/d76e2b31d3b3723c2373ffff18bbc3385970ed01
Finally solved :) My problem was due to Idea and not Grails. Thanks a lot for your assistance guys. http://jira.grails.org/browse/GRAILS-11196
Oh, I suspect this has to do with Grails 2.3.x now requiring you to pass the -reloading
flag when you are not using forked mode http://grails.org/doc/2.3.x/guide/single.html#upgradingFromPreviousVersionsOfGrails