You can use wizards to
create applications that use Contexts and Dependency Injection (CDI).
Procedure
- Right-click your Java EE-faceted project, and select , and select Context and dependency injection, click
Apply and OK: To see the beans.xml file, expand:
- Utility projects: <proj>/src/META-INF
- EJB projects: <proj>/ejbModule/META-INF
- WEB projects: <proj>/WebContent/WEB-INF
- Connector projects: <proj>/connectorModule/META-INF
- Application Client project: <proj>/appClientModule/META-INF
At this point, it is empty:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/beans_1_0.xsd">
</beans>
- You now have a CDI-enabled project.