Maven Group, Artifact, and Version (GAV)

All official JSF Specification and Mojarra implementation artifacts for JSF 2.0 and later are now published in maven central. If you want to explicitly specify a repository, you may use one of the following. Note that these repositories offer a smaller number of official JSF specification and Mojarra implementation artifacts than in maven central.

Maven 2 Repository for JSF 2.1 and Later

<repository>
  <id>jvnet-nexus-releases</id>
  <name>jvnet-nexus-releases</name>
  <url>https://maven.java.net/content/repositories/releases/</url>
</repository>

Maven 2 SNAPSHOT Repository for JSF 2.2-SNAPSHOT and Later

<repository>
  <id>jvnet-nexus-snapshots</id>
  <name>jvnet-nexus-snapshots</name>
  <url>https://maven.java.net/content/repositories/snapshots/</url>
</repository>

The Best Way to Satisfy A Dependency on JSF

The recommend way to use JSF with Maven is to develop on a Java EE certified container and declare a <provided> scope dependency on the appropriate version of the JavaEE API jar.

JSF 2.2 (Bundled in GlassFish 4.0 series releases)
<dependency>
  <groupId>javax.faces</groupId>
  <artifactId>javax.faces-api</artifactId>
  <version>2.2</version>
  <scope>provided</scope>
</dependency>
JSF 2.1 (Bundled in GlassFish 3.1 series releases)
<dependency>
  <groupId>javax.faces</groupId>
  <artifactId>javax.faces-api</artifactId>
  <version>2.1</version>
  <scope>provided</scope>
</dependency>
Java EE 7 (also satisfies JSF 2.2 compile-time dependencies)
<dependency>
  <groupId>javax</groupId>
  <artifactId>javaee-api</artifactId>
  <version>7.0</version>
  <scope>provided</scope>
</dependency>
Java EE 6 (also satisfies JSF 2.0 compile-time dependencies)
<dependency>
  <groupId>javax</groupId>
  <artifactId>javaee-api</artifactId>
  <version>6.0</version>
  <scope>provided</scope>
</dependency>
Java EE 5 (also satisfies JSF 1.2 compile-time dependencies)
<dependency>
  <groupId>javaee</groupId>
  <artifactId>javaee-api</artifactId>
  <version>5</version>
  <scope>provided</scope>
</dependency>

Depending only on the API jar will increase the chance that your application will actually deliver on the promise of JavaEE portability.

Another, Not Nearly as Correct, Way to Satisfy A Dependency on JSF

If you have no other choice but to introduce a dependency on a specific implementation of JSF (namely, Oracle Mojarra JSF), use the maven GAV as specified below.

Nightly Builds of Mojarra

Mojarra 2.2.x and 2.1.X are also being actively developed. Here are the GAV for the nightly 2.2.x and 2.1.X builds. Replace the X with the version number of the latest stable verion below, incremented by 1. For example, if the latest stable 2.1 release was 2.1.4, the version for the nightly would be 2.1.5-SNAPSHOT.

<dependency>
  <groupId>org.glassfish</groupId>
  <artifactId>javax.faces</artifactId>
  <version>2.2.X-SNAPSHOT</version>
  <scope>provided</scope> 
</dependency>
<dependency>
  <groupId>org.glassfish</groupId>
  <artifactId>javax.faces</artifactId>
  <version>2.1.X-SNAPSHOT</version>
  <scope>provided</scope> 
</dependency>

Stable Versions of Mojarra

Current Release

The version numbers of the most current release are always on the jsf home page at http://jsf.java.net/.

Archived Releases

For all archived releases you must declare two <dependency> elements, both with <groupId>com.sun.faces</groupId>. For all JSF 2.0 and later artifacts you may follow the example GAV listed in the entry for 2.1.1. For all JSF 1.2 and earlier artifacts, you may follow the example GAV listed in the entry for 1.2_14.