PrimeFaces 5.0 using Eclipse Juno with Maven

You would like to use PrimeFaces for that neat new project you were assigned. You want to ensure that everyone on the team can get the dependencies installed without a hitch, so you naturally choose to use Maven for this. I’ll describe a minimal implementation using Eclipse Juno that will get you started down the path to rich UI using Java.

The relevant links I used for this project are:
PrimeFaces –
Example code for PrimeFaces xhtml page –
Getting Started

JSF jars –

I’ll assume you already have Eclipse installed. I tested this using Eclipse Juno Service Release 2.

Getting Started

Create a new Maven Project in Eclipse.

Screen Shot 2014-08-23 at 10.33.57 AMScreen Shot 2014-08-23 at 10.34.16 AMScreen Shot 2014-08-23 at 10.35.06 AM

You should now see the project in your Project Explorer view. First we’ll want to edit pom.xml to get a few things set up. I am using Java 7 for this project, but you can replace 1.7 with 1.8 in the source and target tags if you feel so inclined.

Screen Shot 2014-08-23 at 10.37.53 AM

Since we are already in pom.xml editing things, let’s add the JSF dependencies.

Screen Shot 2014-08-23 at 10.39.17 AM

We’ve got some error markers now, so we’ll need to fix those.

Screen Shot 2014-08-23 at 10.40.35 AM

You can fix the Maven Problems by updating your Maven Project.

Screen Shot 2014-08-23 at 10.41.24 AM

Alternatively, you could just use the Eclipse Quick Fix feature.

Screen Shot 2014-08-23 at 10.40.53 AM

Now let’s convert this to a faceted project so we can run it on Tomcat. Right click the project in the Project Explorer view and choose Properties -> Project Facets.

Screen Shot 2014-08-23 at 10.42.32 AM Screen Shot 2014-08-23 at 10.43.04 AM

Click OK. Your project will be reconfigured and will now look like this:

Screen Shot 2014-08-23 at 10.43.17 AM

We need to add the Maven Dependencies to the Deployment Assembly. Open the project Properties. You may need to update your maven project and refresh your project for the Maven Dependencies option to become available.

Screen Shot 2014-08-23 at 10.47.01 AMScreen Shot 2014-08-23 at 11.38.53 AMScreen Shot 2014-08-23 at 10.49.48 AMCreate a new File in your WebContent directory. We’ll name this file index.xhtml.

Screen Shot 2014-08-23 at 10.53.08 AMScreen Shot 2014-08-23 at 10.53.33 AM

We’ll use the example code from the PrimeFaces website.

Screen Shot 2014-08-23 at 10.53.48 AM

With that done we can now run this project on the server.

Screen Shot 2014-08-23 at 10.54.14 AMScreen Shot 2014-08-23 at 10.46.26 AMWe are presented with the PrimeFaces spinner UI Component.

Screen Shot 2014-08-23 at 10.54.36 AMGreat Success! You have now set up a new project using PrimeFaces, Maven, and Eclipse. Happy coding!


…And We’re Back!

After a long hiatus from writing anything on any blogs I have started with a fresh platform to write about my experiences as they come up. I have relocated to Honolulu, Hawaii, and am having a pretty incredible time of it. You can read more about what has been happening at if you are interested in any of the relocation details and timeline.

I will be using this platform to blog about my ongoing search for programming and server admin knowledge. I have been inspired to enter the world of Java Web Applications recently, so I will probably be working on projects involving JavaEE and TomEE+. Here is my first quick-and-dirty program using JSP, JSTL, JavaBeans, and Apache Tomcat:

This is an incredibly simple application that I wrote to learn how the Java EE technologies work together, as well as to install and play around with Apache Tomcat. I am planning to install TomEE+ momentarily and will cover the installation and initial configuration on Ubuntu Server 12.04.