@Bean methods that return a BeanPostProcessor should:

  • Be static
  • Only have parameters that are
  • Annotated with @Lazy
  • Environment
  • ApplicationContext
  • ObjectProvider

Comment From: wilkinsona

We can do something similar for BeanFactoryPostProcessor as well. For our purposes it appears that requiring such methods to be static and have no parameters will suffice.