Sep 13, 2018

CDI bean-discovery-mode

The bean discovery mode is set in the bean.xml
<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="" xmlns:xsi="" xsi:schemaLocation="" version="1.1" bean-discovery-mode="all"> ... </beans>
The bean-discovery-mode property can take one of three values: ALL, NONE, or ANNOTATED.

The ALL property instructs the CDI container to manage all beans that it finds in the archive. This is the default.

The NONE property means that the CDI container will manage no beans.

The ANNOTATED property makes the archive behave like an implicit archive. In this case, the container scans for beans with annotated scope types.

An implicit bean archive does not contain a bean.xml deployment descriptor. This signals to the CDI container that the container should only manage beans with a scope.