JSF 2.0和Richfaces配置

时间:2013-10-13 17:59:29

标签: jsf maven richfaces

我是Richfaces框架的新手。在这个时候,我正在尝试将其添加到我的工程项目中。不幸的是,使用JSF 2.0运行此框架存在很多问题。我试图下载很多maven原型,但大多数都不能正常工作。你能指点我找到像JSF 2.0 + Richfaces 4空白和配置项目的地方吗?它也可以是maven。我今天花了一整天的时间让它运转起来,但在这个时候我的事情变得如此复杂。

1 个答案:

答案 0 :(得分:0)

你不需要太多。您可能需要依赖项的重新定位,构建war文件的插件,JSF版本(我假设您的容器提供了JSF api +实现,因此provided)和RichFaces API +实现。

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.your.package</groupId>
    <artifactId>your.project</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <packaging>war</packaging>

    <properties>
        <project.build.version>0.0.1-SNAPSHOT</project.build.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

    <repositories>

        <repository>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
            <id>jboss</id>
            <name>JBoss repository</name>
            <!-- <url>https://repository.jboss.org/nexus/content/groups/public-jboss/</url> -->
            <url>http://repo1.maven.org/maven2/</url>
        </repository>
    </repositories>

    <dependency>
        <groupId>com.sun.faces</groupId>
        <artifactId>jsf-api</artifactId>
        <version>2.1.22</version>
        <scope>provided</scope>
    </dependency>

    <dependency>
        <groupId>com.sun.faces</groupId>
        <artifactId>jsf-impl</artifactId>
        <version>2.1.22</version>
        <scope>provided</scope>
    </dependency>

    <dependency>
        <groupId>org.richfaces.core</groupId>
        <artifactId>richfaces-core-api</artifactId>
        <version>4.3.3.Final</version>
    </dependency>

    <dependency>
        <groupId>org.richfaces.core</groupId>
        <artifactId>richfaces-core-impl</artifactId>
        <version>4.3.3.Final</version>
    </dependency>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-war-plugin</artifactId>
                <version>2.4</version>
                <configuration>
                    <webXml>src\main\webapp\WEB-INF\web.xml</webXml>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>