[cdi-dev] CDI SE and synthetic bean archives

Martin Kouba mkouba at redhat.com
Thu May 26 03:20:51 EDT 2016


Hi all,

few notes WRT discussion about CDI SE and synthetic bean archives (EG 
mtg, 2016-05-24):

* Weld SE does not scan JDK classes
** by default, only jars/dirs with beans.xml are considered
** if org.jboss.weld.se.scan.classpath.entries set to true, Weld SE 
scans the class path entries and implicit bean archives which don't 
contain a beans.xml file are also supported; but rt.jar and friends are 
not listed in the "java.class.path" system property
** AFAIK there is no other way how to implement this in a better way

Synthetic bean archive was originally intended as a feature for power 
users who either know all the beans beforehand (possibly with discovery 
disabled) or want to add some extra beans (if discovery is enabled).

That's the reason why it behaves as it has bean discorey mode "all". If 
I understand John's concerns, it's all about the case of adding packages 
(which itself is problematic because of java limitations).

If so, we could introduce something like 
org.jboss.shrinkwrap.api.container.ClassContainer.addPackages(boolean, 
Filter<ArchivePath>, Package...). And provide some default "Filter" 
implementations.

Martin


More information about the cdi-dev mailing list