There are 2 main approaches how to use @Configuration annotation:

  1. When proxyBeanMethods attribute is true then a CGLIB proxy is created. In this case the visibility of a @Bean annotated method can be anything except private.
  2. When proxyBeanMethods attribute is false then no CGLIB proxy is created. In this case the visibility of a @Bean annotated method can be anything including private.

Comment From: sbrannen

I've edited your comment to improve the formatting. You might want to check out this Mastering Markdown guide for future reference.

Comment From: sbrannen

This has been merged into master.

Thanks