beanOne(ExampleBean) { bean -> bean.dependsOn = ['manager', 'accountDao'] }
should do what you need. Most <bean> attributes have bean.XXX equivalents, including init-method , destroy-method , factory-bean , factory-method , autowire - use only the camel case instead of a hyphen (for example, bean.initMethod = "..." ) If this does not work, then bean.beanDefinition will give you a reference to the actual Spring BeanDefinition object, so you can call it other methods.
source share