Module dependencies

There are several ways to influence the beans that are being bootstrapped with a module, by passing information from the configuration to the actual module ApplicationContext.

@AcrossDepends

Using @AcrossDepends on a module descriptor

Using AcrossDepends annotation on a module descriptor class you can avoid beans or Configurations from being created based on the presence of other modules.

  • required modules: the component will only be created if all the required modules are present

  • optional modules: the component will only be created if at least one of the optional modules is present

@ConditionalOnAcrossModule

Using @ConditionalOnAcrossModule on components

Using AcrossDepends annotation on a component class you can avoid beans or Configurations from being created based on the presence of other modules.

  • allOf modules: the component will only be created if all the allOf modules are present

  • anyOf modules: the component will only be created if at least one of the anyOf modules is present

  • noneOf modules: the component will only be created if none of the noneOf modules are present

Conditionals

Any Spring conditional can be used to determine if a bean should be created.

TODO: Module roles

infrastructure modules