title: How to setup Maven to use JSF 2.2.x in my Java EE project?
body: <p>I need to use JSF 2.2.5 (instead of 2.2.0) since it solves some issues.</p>
  
  <p>I use Java EE 7 with Netbeans IDE 7.3.1.</p>
  
  <p>My best shot is from following the instructions here <a href="https://javaserverfaces.java.net/download.html" rel="nofollow">https://javaserverfaces.java.net/download.html</a>. </p>
  
  <p>My POM-file now looks like this:</p>
  
  <pre><code>&lt;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"&gt;
    &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  
    &lt;groupId&gt;com.company.testbench.facelets&lt;/groupId&gt;
    &lt;artifactId&gt;Facelets&lt;/artifactId&gt;
    &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
    &lt;packaging&gt;war&lt;/packaging&gt;
  
    &lt;name&gt;Facelets&lt;/name&gt;
  
      &lt;properties&gt;
          &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
      &lt;/properties&gt;
  
      &lt;dependencies&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;javax&lt;/groupId&gt;
              &lt;artifactId&gt;javaee-api&lt;/artifactId&gt;
              &lt;version&gt;7.0&lt;/version&gt;
              &lt;scope&gt;provided&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.glassfish&lt;/groupId&gt;
              &lt;artifactId&gt;javax.faces&lt;/artifactId&gt;
              &lt;version&gt;2.2.5&lt;/version&gt;
          &lt;/dependency&gt;
      &lt;/dependencies&gt;
  
      &lt;build&gt;
          &lt;plugins&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                  &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
                  &lt;version&gt;3.1&lt;/version&gt;
                  &lt;configuration&gt;
                      &lt;source&gt;1.7&lt;/source&gt;
                      &lt;target&gt;1.7&lt;/target&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                  &lt;artifactId&gt;maven-war-plugin&lt;/artifactId&gt;
                  &lt;version&gt;2.4&lt;/version&gt;
                  &lt;configuration&gt;
                      &lt;webXml&gt;src\main\webapp\WEB-INF\web.xml&lt;/webXml&gt;
                      &lt;failOnMissingWebXml&gt;true&lt;/failOnMissingWebXml&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
          &lt;/plugins&gt;
      &lt;/build&gt;
  
  &lt;/project&gt;
  </code></pre>
  
  <p>But my application still uses Mojarra 2.2.0 and not 2.2.5.</p>
  
  <p>These are my indicators that my application indeed use Mojarra 2.2.0:</p>
  
  <ol>
  <li><code>FacesContext.getCurrentInstance().getClass().getPackage().getImplementationVersion()</code> returns 2.2.0</li>
  <li><code>f:viewParam</code> will not work if I use <code>xmlns:f="http://xmlns.jcp.org/jsf/core"</code> but only if I change to <code>xmlns:f="http://java.sun.com/jsf/core"</code> (bug that should be solved in 2.2.1)</li>
  </ol>
  
  <p>Where do I go wrong? Thanks in advance.</p>