Wednesday, April 23, 2014

Testing PrimeFaces 5.0RC1 with a Maven-Based Web Project in NetBeans 8.0 IDE

The new PrimeFaces 5.0RC1 has been released!  Now it is time to begin testing the new release with your existing applications.  If you are using a Maven-based web project within NetBeans, it is easy to configure your PrimeFaces 4.x application to test using the new release candidate.  Here's what you need to do:

1)  Ensure that the project is not configured to make use of the "PrimeFaces" framework within the Properties -> Frameworks configuration.  If "PrimeFaces" is selected within the "Components" tab, be sure to de-select it.  You may be unable to deploy the application successfully if you forget this step!



2)  Add a new maven dependency for PrimeFaces 5.0RC1 to your POM.

        <dependency>
            <groupId>org.primefaces</groupId>
            <artifactId>primefaces</artifactId>
            <version>5.0.RC1</version>
        </dependency>

** You may need to add the PrimeFaces repository to your POM

        <repository>
            <url>http://repository.primefaces.org/</url>
            <id>PrimeFaces-maven-lib</id>
            <layout>default</layout>
            <name>Repository for library PrimeFaces-maven-lib</name>
        </repository>

You should now be able to successfully build and run your project under PrimeFaces 5.0RC1.  This configuration is not difficult, but be sure that you do not get stumped by forgetting to follow Step 1 above, as you will be unable to deploy your application if you do.

To go back to using PrimeFaces 4.x for production use, simply follow these steps once again, but this time make sure you add the PrimeFaces 4.0 dependency within the POM.

        <dependency>
            <groupId>org.primefaces</groupId>
            <artifactId>primefaces</artifactId>
            <version>4.0</version>
        </dependency>

No comments:

Post a Comment

Please leave a comment...