Use CDI discovery mode annotated
johnament opened this issue · 5 comments
Annotated discovery is better than all discovery. The usage of all assumes your runtime has a hierarchical class loader, and not a flat class loader. In order for it to be usable in both setups, I would recommend switching beans.xml to annotated and adding proper annotations to all classes.
Looks like this is done, so can be closed
There's still a few places where annotations arne't used. its actually demonstrating non-portable behavior IMHO. Would be good to clarifications on these.
Empty beans.xml (meaning CDI 1.0 discovery behavior): https://github.com/microprofile/microprofile-samples/blob/master/microprofile-sample-canonical/src/test/java/io/microprofile/sample/canonical/rest/TopCDsEndpointTest.java#L74
Using annotated the application fails to work on Payara/GlassFish as TopCDsEndpoint does not have a bean defining annotation. I just opened a pull request to change it back ;-) #15
This should be fixed now. @smillidge can we add a payara profile for this test?