I want to specify a custom BeanNamingStrategy
while configuring my application with Spring Boot. By default, Spring Boot uses the MethodNameStrategy
which is a BeanNamingStrategy
.
The reason I want to do this is because I have abstract parent classes which my consumers will create configuration subclasses of. The methods in the parent classes have the same names as each other and so are not getting registered for different implementations of the child classes. My custom BeanNamingStrategy
will attach the simple name of the configuration class to certain bean names.
Normally in a Spring application you can pass a custom BeanNamingStrategy
using the setBeanNamingStrategy
method of the ApplicationContext
. However if Spring Boot is creating the ApplicationContext
, how can I do this?