HTML and CSS Reference
As shown in the listing, it is almost the same set of dependencies with one difference, which is replacing the JSF
API v2.1 dependency which is in the provided scope:
With the following dependency in the compile scope:
This replacement tells Maven to use the JSF 2.1.6 jar for compiling the firstApplication and to include the jar
in the web application lib folder. I choose the 2.1.6 version specifically because it works fine on Tomcat 7.
Building and deploying the firstApplication
The firstApplication Maven project is available for download from the topic web site: www.apress.com/9781430250104 .
In order to build and deploy the firstApplication , you need to install Maven 3 in your system.
■ the detailed steps for configuring Maven 3 are described in the Maven website: http://maven.apache.org/
download.html#Installation . the instructions show you how to install Maven in your system whether it is Windows,
Linux, Solaris, or Mac oS X.
After installing Maven 3 in your system, you can simply build the firstApplication by executing the following
Maven command from the command line. This command should be executed from the application directory that
contains the pom.xml file:
mvn clean install
After executing this command, you can find the generated firstApplication-1.0.war file in the target folder.
Let's see how to deploy the generated war files on both the Apache Tomcat 7 and the Oracle GlassFish 3.1.2.
■ do not forget to use the proper pom.xml dependencies mentioned in the “dependencies” section for generating
the two war files correctly (one for the apache tomcat 7 and the other for the oracle GlassFish 3.1.2).