Mojarra 2.1的Maven依赖项

时间:2011-10-18 12:10:42

标签: java-ee maven jsf-2

我想使用Mojarra 2.1

http://javaserverfaces.java.net/download.html

我的容器是Tomcat 7,我正在使用IceFaces 2

我是否应仅按如下方式包含API?

<dependency>
    <groupId>javax.faces</groupId>
    <artifactId>javax.faces-api</artifactId>
    <version>2.1</version>
</dependency>

更新:我使用的是servlet 3.0.1,jsp 2.2.1,el 2.2,这可能是冲突的:

<dependency>
    <groupId>javax.servlet</groupId>
    <artifactId>javax.servlet-api</artifactId>
    <version>3.0.1</version>
    <scope>provided</scope>
</dependency>

<dependency>
    <groupId>javax.servlet.jsp</groupId>
    <artifactId>javax.servlet.jsp-api</artifactId>
    <version>2.2.1</version>
    <scope>provided</scope>
</dependency>

<dependency>
    <groupId>javax.el</groupId>
    <artifactId>javax.el-api</artifactId>
    <version>2.2.2</version>
    <scope>provided</scope>
</dependency>

1 个答案:

答案 0 :(得分:8)

我将Mojarra 2.1.2与此依赖项一起使用

    <dependency>
        <groupId>com.sun.faces</groupId>
        <artifactId>jsf-api</artifactId>
        <version>2.1.2</version>
        <scope>compile</scope>
    </dependency>

    <dependency>
        <groupId>com.sun.faces</groupId>
        <artifactId>jsf-impl</artifactId>
        <version>2.1.2</version>
        <scope>compile</scope>
    </dependency>