Affects: 5.3.0
I have 2 beans:
1. the first one (org.xxx.spring.multi.ExternalAPIOperation
) is in SubSpring module and
2. the second (org.xxx.spring.multi.InternalAPIOperation
) is in MainSpring module.
An application is in MainSpring.
Problem
The bean from SubSpring module (org.xxx.spring.multi.ExternalAPIOperation
) is not included into the context.
Steps to reproduce
- Build an attached project.
- Go to MainSpring module.
- Run java -cp target/mainspring-1.0-SNAPSHOT.jar;../SubSpring/target/subspring-1.0-SNAPSHOT.jar org.xxx.spring.multi.Application
- Output
APIOperation classes:
org.xxx.spring.multi.InternalAPIOperation
org.xxx.spring.multi.ExternalAPIOperation
APIOperation beans:
org.xxx.spring.multi.InternalAPIOperation
- Expected output
APIOperation classes:
org.xxx.spring.multi.InternalAPIOperation
org.xxx.spring.multi.ExternalAPIOperation
APIOperation beans:
org.xxx.spring.multi.InternalAPIOperation
org.xxx.spring.multi.ExternalAPIOperation
Comment From: snicoll
Thanks for the sample. MainSpring
uses the context indexer and a META-INF/spring.components
is present. When that feature is used, all modules must use it as described in the reference documentation. The indexer is not enabled for SubSpring
and therefore the component not registered.
This feature is meant for corner cases where applications have a (very) large number of beans.
Duplicate of #25886
Comment From: iusaspb
Thank you clarifications.