Affects: 4.x, 5.0, 5.1, 5.2
It's possible to allow more fine-grained control on bean-overriding restriction rules in DefaultListableBeanFactory?
In Spring 5.2 and 4.x, DefaultListableBeanFactory has only one property allowBeanDefinitionOverriding
.
But what to do If user want to allow only some overriding like replacing of bean with step
scoped bean, where step
is scope coming from Spring Batch.
The example with Spring Batch+Spring Boot+Using step
scope show that in some cases fine-grained control can be useful.
Related SO questions:
https://stackoverflow.com/questions/55737684/jobscope-and-overriding-beans
https://stackoverflow.com/questions/35498037/spring-batch-with-scoped-beans-and-allowbeandefinitionoverriding-false
Comment From: snicoll
Thanks for the suggestion but we're now leaning towards deprecating the whole mechanism so being more lenient is not consistent with that.
Superseded by #31288