We have a core library, and then implementations that use the core library. We also have webapp and cli in each implementation. I am trying to modularize the config. We do use component scanning for certain packages. I am running into a circular dependency issue in the config classes. I need to inject the same @Component into beans created in multiple java config classes. My configs are as follows:
What would be the best way to solve this?
1 option would be to not use component scanning. Others?
So after a bit more digging, this has to do with me trying to override a bean in the java config.
I am trying to override the SettingsBean, however CoreAppConfig uses SettingsBean to create MyBean. I think this is why I am getting a BeanCurrentlyInCreationException error. Any ideas how to resolve this?