how to embed weld into jetty 9 to have cdi in my java maven project?
问题 I have a JEE7 project using CDI. I want to test that project on Jetty 9, which implements Java EE 7 Web Profile. The following link indicate that we can plug Weld into Jetty, but how ? Thanks EDIT: And, how do that with jetty-maven-plugin ? Jetty and Java EE 7 Web Profile 回答1: I tried many things but this is what worked. http://docs.jboss.org/weld/reference/latest/en-US/html/environments.html#_embedded_jetty Just be sure to include the appropriate libraries like weld-servlet, cdi-api, el-api