I do something really lazy, I have an extension that has this method on it:

public void findEntities(@Observes @WithAnnotations(Entity.class)
ProcessAnnotatedType<?> pat)

which just looks for entity classes.  They're not going to be CDI beans,
but they are annotated types.  Per the spec,
https://docs.jboss.org/cdi/api/2.0/javax/enterprise/inject/spi/ProcessAnnotatedType.html
,
the event should get fired, even if there are no bean defining annotations.

Switching beans.xml to use bean-discovery-mode=all fixes it, but I'd prefer
to not discover these as beans.

Using a <beans bean-discovery-mode="all" version="2.0"><trim/></beans> does
fix it. But either way, my understanding is that PAT is always fired, for
all classes found within a bean archive.

John

Reply via email to