7.3 Create POM

All of the projects except the PAR project have Maven POM files for building. In this step an initial POM file for the PAR is created.

Using a text editor create a file called $GREENPAGES_HOME/start/greenpages/pom.xml. Open this file and add the following skeleton to it:

<?xml version="1.0" encoding="UTF-8"?>
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">


  <name>GreenPages PAR</name>




ensuring that the version numbers are consistent (for example, 2.0.0.RELEASE might be 2.0.1.SNAPSHOT depending on which version of greenpages being developed).

This skeleton defines a basic configuration with a parent POM. Notice that the packaging type is par. When you have created this file execute the following command from the $GREENPAGES_HOME/start/greenpages directory.

mvn clean package

This command returns an error indicating that Maven does not know how to build a PAR:

[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] The plugin 'org.apache.maven.plugins:maven-par-plugin' does not exist
[INFO] or no valid version could be found
[INFO] ------------------------------------------------------------------------

The next step will correct this.