Can I access components from other modules that are not exposed?

Yes, though it’s usually better to expose them. See also the question Can I manually expose existing beans from another module.

There are two ways to manually retrieve non-exposed components from other modules:

  • @RefreshableCollection has an attribute to specify whether the collection should contain all beans of that type, regardless of the fact if they are exposed or not.
  • The AcrossContextBeanRegistry component allows you to access any module ApplicationContext, and to interact with their components.