简体   繁体   English

IntelliJ IDEA 11添加CDI构面失败吗?

[英]IntelliJ IDEA 11 adding CDI facet fails?

I have the follwing dependencies in my POM. 我的POM中有以下依赖项。 I am trying to add the CDI facet in IntelliJ IDEA 11 because I thought I would get an option for creating the beans.xml file without manually having to write it, just as you do with persistence.xml etc. However even though I have the dependencies it says Weld is missing, but why do I need to download these when I have everything I need in the POM? 我试图在IntelliJ IDEA 11中添加CDI方面,因为我认为可以像不用persistence.xml等一样,获得一个无需手工编写即可创建beans.xml文件的选项。尽管它说Weld丢失了依赖项,但是当POM中有我需要的所有内容时,为什么我需要下载这些依赖项?

    <dependency>
        <groupId>javax</groupId>
        <artifactId>javaee-api</artifactId>
        <version>6.0</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>javax.enterprise</groupId>
        <artifactId>cdi-api</artifactId>
        <version>1.0</version>
        <scope>provided</scope>
    </dependency>

在此处输入图片说明

On a JBoss stack, I usually use that dependency: 在JBoss堆栈上,我通常使用该依赖项:

<dependency>
<groupId>org.jboss.spec</groupId>
<artifactId>jboss-javaee-6.0</artifactId>
<version>1.0.0.Final</version>
<type>pom</type>
<scope>provided</scope>
</dependency>

(Requires JBoss Repo) (需要JBoss回购)

Have a look at that configuration here , which I used for a plain Java EE 6 stack (on a JBoss AS 6) 这里查看该配置,我将其用于普通的Java EE 6堆栈(在JBoss AS 6上)

I've never had weld on the classpath. 我从来没有在类路径上焊接过。 Simply the cdi-api and the beans.xml and it finds the facet just fine. 只需使用cdi-api和beans.xml,它就可以找到构面。 If you're worried about having to manually create the beans.xml, create a template for it and be done. 如果您担心必须手动创建beans.xml,请为此创建一个模板。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM