Issue
I have a dependency that includes a class implementing BeanPostProcessor
, and it modifies some beans when application starts.
Is it possible to exclude this class execution, so those beans remain unmodified?
Solution
try using that in your configuration file
@ComponentScan(excludeFilters = { @ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE, value = { YourClassName.class }) })
This would exclude that class entirely from becoming a bean.
If you want it later as a bean you must dynamically add it to the context programmatically.
Answered By - Panagiotis Bougioukos