eclipse / microprofile-samples

Micro Profile Samples
Apache License 2.0
117 stars 63 forks source link

Use CDI discovery mode annotated #6

Closed johnament closed 7 years ago

johnament commented 8 years ago

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.

kenfinnigan commented 8 years ago

Looks like this is done, so can be closed

johnament commented 8 years ago

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.

https://github.com/hammock-project/microprofile-samples

johnament commented 8 years ago

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

smillidge commented 8 years ago

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

johnament commented 7 years ago

This should be fixed now. @smillidge can we add a payara profile for this test?