grails / grails-core

The Grails Web Application Framework
http://grails.org
Apache License 2.0
2.77k stars 952 forks source link

Changes in inplace plugin code in grails3.x are not reloading automatically #9921

Closed girisagar46 closed 8 years ago

girisagar46 commented 8 years ago

I am upgrading a project from Grails 2.5.1 to Grails 3.1.6.

My Multi-Project Build structure in Grails 3.1.6 is as follows:

- Root |--MainProject |--Pugin1ForMain |--Plugin2ForMain |--settings.gradle

I run the MainProject using grails run-app command and whenever I change my codes in Plugin1ForMain or any other plugins, the changes are not automatically recompiled like it did in Grails2.x .

Some research led me to this blog: http://mrhaki.blogspot.com/2015/11/grails-goodness-enable-hot-reloading.html and I implemented in development environment but reloading does not work.

When I create dummy projects and plugins, the reloading works fine. Reloading issue only occurs when I start moving codes from 2.5.1 to 3.1.6 project structure.

graemerocher commented 8 years ago

We have an ISSUE_TEMPLATE for a reason, please follow it and provide all of the requested information including a sample application that reproduces the issue.

See https://github.com/grails/grails-core/blob/master/ISSUE_TEMPLATE.md

girisagar46 commented 8 years ago

Sorry Graeme, didn't know about the ISSUE_TEMPLATE. My real issue is auto reloading of implace plugins isn't working in Grails 3.1.6 as it did in Grails2.x.

Steps to reproduce:

Expected behaviour

Actual Behaviour

Environment Information

Operating System: Linux Ubuntu 14.04 Grails Version: 3.1.6 JDK Version: 1.8.60 Gradle Version: 2.12

Example Application

https://github.com/girisagar46/Grails3ReloadTest

graemerocher commented 8 years ago

will take a look

osscontributor commented 8 years ago

The steps above describe adding a new controller to the plugin. Is it the case that adding new artifacts doesn't work but editing existing artifacts does work?

girisagar46 commented 8 years ago

@jeffbrown Adding new artifact or editing an existing one, both doesn't seem to be working.

graemerocher commented 8 years ago

There are a couple of problems in the attached example that prevent the reloading from working:

a) you are using an old version of Gradle which is picked up by Grails https://github.com/girisagar46/Grails3ReloadTest/blob/master/RaceTrack/gradle/wrapper/gradle-wrapper.properties#L6

b) You have hard coded the profile version to an older version (3.1.0) instead of using 3.1.6: https://github.com/girisagar46/Grails3ReloadTest/blob/master/RaceTrack/racetrack/build.gradle#L56

Both of these together prevent reloading working. When I updated the Gradle wrapper version to 2.13 and use the 3.1.6 web profile it works fine.