File tree Expand file tree Collapse file tree 4 files changed +13
-10
lines changed
grails-core/src/main/groovy/org/grails/plugins
grails-plugin-gsp/src/main/groovy/org/grails/plugins/web
grails-test-suite-uber/src/test/groovy/org/grails/plugins/web Expand file tree Collapse file tree 4 files changed +13
-10
lines changed Original file line number Diff line number Diff line change 2121import grails .plugins .GrailsPluginManager ;
2222import grails .util .GrailsNameUtils ;
2323import groovy .lang .GroovyObjectSupport ;
24- import org .grails .config .CompositeConfig ;
25- import org .grails .config .PropertySourcesConfig ;
2624import org .grails .config .yaml .YamlPropertySourceLoader ;
2725import org .grails .core .AbstractGrailsClass ;
2826import org .grails .core .legacy .LegacyGrailsApplication ;
2927import org .grails .plugins .support .WatchPattern ;
3028import org .springframework .beans .BeansException ;
3129import org .springframework .context .ApplicationContext ;
32- import org .springframework .core .env .MutablePropertySources ;
3330import org .springframework .core .env .PropertySource ;
34- import org .springframework .core .env .PropertySources ;
35- import org .springframework .core .io .ClassPathResource ;
36- import org .springframework .core .io .FileSystemResource ;
3731import org .springframework .core .io .Resource ;
3832import org .springframework .core .io .UrlResource ;
3933import org .springframework .util .Assert ;
4034
41- import java .io .File ;
4235import java .io .IOException ;
4336import java .net .MalformedURLException ;
4437import java .net .URL ;
Original file line number Diff line number Diff line change @@ -357,7 +357,7 @@ private void evaluateOnChangeListener() {
357357 }
358358
359359 final Metadata metadata = Metadata .getCurrent ();
360- final boolean warDeployed = ! metadata .isDevelopmentEnvironmentAvailable ();
360+ final boolean warDeployed = metadata .isWarDeployed ();
361361 final boolean reloadEnabled = Environment .getCurrent ().isReloadEnabled ();
362362
363363 if (!((reloadEnabled || !warDeployed ) && onChangeListener != null )) {
Original file line number Diff line number Diff line change @@ -101,7 +101,7 @@ class GroovyPagesGrailsPlugin extends Plugin {
101101 Closure doWithSpring () {{->
102102 def application = grailsApplication
103103 Config config = application. config
104- boolean developmentMode = Metadata . getCurrent() . isDevelopmentEnvironmentAvailable ()
104+ boolean developmentMode = isDevelopmentMode ()
105105 Environment env = Environment . current
106106
107107 boolean enableReload = env. isReloadEnabled() ||
@@ -270,6 +270,10 @@ class GroovyPagesGrailsPlugin extends Plugin {
270270 }
271271 }}
272272
273+ protected boolean isDevelopmentMode () {
274+ Metadata . getCurrent(). isDevelopmentEnvironmentAvailable()
275+ }
276+
273277 static String transformToValidLocation (String location ) {
274278 if (location == ' .' ) return location
275279 if (! location. endsWith(File . separator)) return " ${ location}${ File.separator} "
Original file line number Diff line number Diff line change @@ -104,7 +104,13 @@ class FormTagLib {
104104 void testBeansWhenNotWarDeployedAndDevelopmentEnv () {
105105 try {
106106 System . setProperty(" grails.env" , " development" )
107- def plugin = new GroovyPagesGrailsPlugin ()
107+ def plugin = new GroovyPagesGrailsPlugin () {
108+ @Override
109+ protected boolean isDevelopmentMode () {
110+ return true
111+ }
112+ }
113+
108114 plugin. grailsApplication = new DefaultGrailsApplication () {
109115 @Override
110116 boolean isWarDeployed () {
You can’t perform that action at this time.
0 commit comments