Spring custom xml schema example
We have 3 modules
- Main module. Holds business logic. Has its own context. It uses classes from third module.
- Additional module. Holds some additional logic (for example reports and etc). It uses third module classes too.
- Third module. Holds some common service (for example audit, monitoring, custom logging)
Additional module shouldn't declare some beans or dependencies (to exclude potential conflicts), but should declare some contract to use this module.
Use custom xml schema
- Main module creates all needed beans. Excluded any potential bean and dependency conflicts with additional module.
- Additional module
- has't bean declaration
- has't runtime dependencies. Just provided.
- has contract (xsd).