grails-gradle-plugin-archived icon indicating copy to clipboard operation
grails-gradle-plugin-archived copied to clipboard

Resource reloading not working with the latest plugin.

Open nanandn opened this issue 10 years ago • 15 comments

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.

nanandn avatar Mar 26 '14 00:03 nanandn

Any ideas why this is not working. It is really frustrating having to restart for every little change...

nanandn avatar Mar 30 '14 20:03 nanandn

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.

effrafax avatar Mar 31 '14 06:03 effrafax

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.

johnrengelman avatar Apr 01 '14 14:04 johnrengelman

With a simple project, adding a domain or controller class triggers reloading for me.

johnrengelman avatar Apr 03 '14 14:04 johnrengelman

Same issue as @nanandn here since we updated to the latest version :'(

Isabellle avatar Apr 10 '14 10:04 Isabellle

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"

nanandn avatar Apr 10 '14 14:04 nanandn

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'
}

johnrengelman avatar Apr 10 '14 14:04 johnrengelman

I don't have a sample project. I'll try to create one this evening or over the weekend.

nanandn avatar Apr 10 '14 15:04 nanandn

And me neither since I'm the front-end designer :'( All static resources need a restart to be displayed

Isabellle avatar Apr 10 '14 15:04 Isabellle

So are you both talking about reloading from the Resources plugin? Not changes to the Grails code?

johnrengelman avatar Apr 10 '14 15:04 johnrengelman

It appears I misunderstand the initial problem. I'll take a look soon.

johnrengelman avatar Apr 10 '14 15:04 johnrengelman

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.

johnlim avatar Apr 11 '14 09:04 johnlim

Add support for new SpringLoaded Maven target: https://github.com/grails/grails-gradle-plugin/commit/d76e2b31d3b3723c2373ffff18bbc3385970ed01

johnrengelman avatar Apr 14 '14 19:04 johnrengelman

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

Isabellle avatar Apr 15 '14 09:04 Isabellle

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

johnrengelman avatar Apr 18 '14 14:04 johnrengelman