Mark Struberg created DELTASPIKE-1466:
-----------------------------------------

             Summary: move beans.xml to CDI-3.0 style
                 Key: DELTASPIKE-1466
                 URL: https://issues.apache.org/jira/browse/DELTASPIKE-1466
             Project: DeltaSpike
          Issue Type: Sub-task
      Security Level: public (Regular issues)
          Components: Core
    Affects Versions: 2.0
            Reporter: Mark Struberg
            Assignee: Mark Struberg
             Fix For: 2.0


Since we now target EE9 at least we also have to update our beans.xml.
This has mainly to do with CDI-4.0 in JakartaEE10 re-defined the behaviour of 
empty beans.xml files from bean-discovery-mode "all" to "annotated", breaking 
tons of existing code.
To prevent any behaviour changes for DeltaSpike users we now explicitly define 
a {{bean-discovery-mode}} ourselfs. And we also leverage the {{<trim/>}} modus 
of CDI-2.0.

bean-discovery-mode "all" + <trim/> has the effect that all classes which are 
CDI candidates get scanned and a {{ProcessAnnotatedType}} event gets fired. But 
with the <trim/> mode we ONLY create beans for AnnotatedTypes which are 
explicitly defined. This is a good compromise between being able to scan all 
classes via CDI Extensions but still not getting any superfluous CDI beans as 
automatically {{@Dependent}} scoped beans 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to