Skip to content

Commit

Permalink
Grails Plugin Core: Support reloading spring resources.groovy when ch…
Browse files Browse the repository at this point in the history
…anged
  • Loading branch information
rainboyan committed May 26, 2023
1 parent 7d1c397 commit 67500f9
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,14 @@ class CoreGrailsPlugin extends Plugin implements PriorityOrdered {
applicationContext.registerBeanDefinition(beanName, xmlBeans.getBeanDefinition(beanName))
}
}
if (res.filename.endsWith('.groovy')) {
Map<String, Object> variables = [
application: grailsApplication,
grailsApplication: grailsApplication] as Map<String, Object>
RuntimeSpringConfiguration springConfig = new DefaultRuntimeSpringConfiguration()
RuntimeSpringConfigUtilities.reloadSpringResourcesConfig(springConfig, variables, res)
springConfig.registerBeansWithContext(applicationContext)
}
}
else if (event.source instanceof Class) {
def clazz = (Class) event.source
Expand Down

0 comments on commit 67500f9

Please sign in to comment.