how to embed weld into jetty 9 to have cdi in my java maven project?

社会主义新天地 提交于 2019-12-11 00:35:20

问题


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 and el-impl




回答2:


I wrote some docs on this a while back, if you an issues let me know.

http://www.eclipse.org/jetty/documentation/current/framework-weld.html



来源:https://stackoverflow.com/questions/21624540/how-to-embed-weld-into-jetty-9-to-have-cdi-in-my-java-maven-project

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!