Recent Posts
Archives

PostHeaderIcon (long tweet) Add RichFaces to a Maven / JSF 2 project

Case

You have a JSF 2 project that you need upgrade with jBoss RichFaces and Ajax4JSF, (I assume the process is similar for other libraries, such as Primefaces, ICEfaces, etc.).

Quick Fix

In XHTML

In XHTML pages, add the namespaces related to Richfaces:[xml] xmlns:a4j="http://richfaces.org/a4j"
xmlns:rich="http://richfaces.org/rich"[/xml]

In Maven

In Maven’s pom.xml, I suggest to add a property, such as:
[xml] <properties>
<richfaces.version>4.1.0.Final</richfaces.version>
</properties>[/xml]

Add the following dependency blocks:
[xml]<dependency>
<groupId>org.richfaces.ui</groupId>
<artifactId>richfaces-components-ui</artifactId>
<version>${richfaces.version}</version>
</dependency>
<dependency>
<groupId>org.richfaces.core</groupId>
<artifactId>richfaces-core-impl</artifactId>
<version>${richfaces.version}</version>
</dependency>[/xml]

Leave a Reply