CDI: beans.xml, where do I put you?

前端 未结 3 1242
萌比男神i
萌比男神i 2020-11-28 06:50

I am using Weld as CDI implementation. My integration test, that tries to assemble object graph instantiating Weld container works well, when I have empty b

3条回答
  •  渐次进展
    2020-11-28 07:42

    For EJB and JAR packaging you should place the beans.xml in src/main/resources/META-INF/.

    For WAR packaging you should place the beans.xml in src/main/webapp/WEB-INF/.

    Remember that only .java files should be put in the src/main/java and src/test/java directories. Resources like .xml files should be in src/main/resources.

提交回复
热议问题