OpenLiberty offers the wonderful feature of shared libraries that can be deployed in the server once and then (very skinny and fast-redeploying) WARs can access them at run-time. On the other hand, CDI provides a mechanism to reduce the bean scanning, for example:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://xmlns.jcp.org/xml/ns/javaee">
<scan>
<exclude name="com.mycompany.nonecdi.**"/>
</scan>
</beans>
My questions are - how do the two interact:
Shared libraries are supported in Open Liberty. If there are beans.xml or bean defining annotations specified (e.g. @ApplicationScoped,etc) in the shared libraries, the beans would be found by CDI runtime. Therefore, shared libs can use CDI in Open Liberty and WebSphere Liberty.