@Grapes([
@Grab(group='org.grails', module='grails-spring', version='2.3.6'),
@Grab(group='org.springframework', module='spring-web', version='4.0.2.RELEASE')
])
import grails.spring.BeanBuilder
// The resources.groovy file must have:
//
// beans {
//
// and not
// beans = {
//
// for this script to work!
BeanBuilder beanBuilder = new BeanBuilder()
beanBuilder.setClassLoader(this.class.classLoader)
beanBuilder.loadBeans('file:./grails-app/conf/spring/resources.groovy')
beanBuilder.springConfig.beanConfigs.each {
if(it.value.definition.propertyValues.getPropertyValue('serviceInterface')) {
println "${it.key} -> ${it.value.clazz.name}"
println "\tserviceUrl = ${it.value.definition.propertyValues.getPropertyValue('serviceUrl').value}"
println "\tserviceInterface = ${it.value.definition.propertyValues.getPropertyValue('serviceInterface').value}"
}
}