cdi icon indicating copy to clipboard operation
cdi copied to clipboard

Could CDI support an annotation-based alternative for discovery mode?

Open muchiri08 opened this issue 10 months ago • 7 comments

Hi, Lately I have been studying CDI (from the docs and I love it) and some example codes provided would fail until I added the bean xml file. The whole point of adding it was changing the discovery mode to all. Could CDI support an annotation-based alternative for discovery mode? For example:


@BeanDiscovery(DiscoveryMode.ALL) //hypothetical
public class AppConfig{}

Is this technically feasible within CDI’s architecture?

If not could there also be a work around? Like META-INF/cdi-config.properties and inside it have jakarta.cdi.discovery-mode=ALL

muchiri08 avatar Apr 16 '25 17:04 muchiri08