Hello!
I've got a huge project with history, that I am migrating step by step. Now I'm switching from annotation-based-component-scan to @Configuration-Classes. For the generation of beannames of scanned beandefinitions I use a custom beannamegenerator (as the project is really huge). Unfortunatly this is not possible for Beans defined in @Configuration-Klasses. The generated (default)-beanname is always the simple methodname. This is a fixed bean-name-generation defined in Method "loadBeanDefinitionsForBeanMethod(BeanMethod beanMethod). Please add the possibility to use a beanname-generator here. Thank you very much!
Best regards Hans
Comment From: mdeinum
The names is fixed just as it is in xml when declaring a bean, when you name a bean explicitly a name won't be generated. Beans are only generated when components are scanned. Using the @ComponentScan
it is possible to pass in a BeanNameGenerator
to use.
Comment From: snicoll
@mdeinum is correct, please review this section of the reference guide.