How to exclude a class from scanning with CDI 1.0
问题 I would like to exclude a class from scanning in CDI 1.0. I'm using the default implementation of CDI in WebLogic 12.1.12 (Weld, CDI 1.0). I saw several web sites and docs with CDI 1.1 but not with the previous release . 回答1: With Weld, you can use a custom XML namespace in beans.xml to exclude classes from scanning: <beans xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:weld="http://jboss.org/schema/weld/beans"> <weld:scan> <weld:exclude