如何在我的java maven项目中将焊接嵌入jetty 9中以获得cdi? [英] how to embed weld into jetty 9 to have cdi in my java maven project?

查看:207
本文介绍了如何在我的java maven项目中将焊接嵌入jetty 9中以获得cdi?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用CDI的JEE7项目。
我想在Jetty 9上测试该项目,它实现了Java EE 7 Web Profile。

I have a JEE7 project using CDI. I want to test that project on Jetty 9, which implements Java EE 7 Web Profile.

以下链接表明我们可以将Weld插入Jetty,但是怎么样 ?
谢谢

The following link indicate that we can plug Weld into Jetty, but how ? Thanks

编辑:
那么,如何使用jetty-maven-plugin?

And, how do that with jetty-maven-plugin ?

Jetty and Java EE 7 Web Profile

推荐答案

我尝试过很多东西,但这才有效。

I tried many things but this is what worked.

http://docs.jboss.org/weld/reference/latest/en-US/html/environments.html#_embedded_jetty

请确保包含适当的库,如weld-servlet,cdi-api,el-api和el-impl

Just be sure to include the appropriate libraries like weld-servlet, cdi-api, el-api and el-impl

这篇关于如何在我的java maven项目中将焊接嵌入jetty 9中以获得cdi?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆