Build and deployment configuration

In the previous steps you generated a custom portal project and learned about the structure of the generated project. Before you can build and deploy the portal, you need to set a few configuration parameters.

Configure application server and database locations

The file jetspeed-mvn-settings.xml in the root of your project contains information about the location of your application server and database. The generated project is configured to use Tomcat as application server, and Derby as database. All you have to do is set the correct location for both.

Find the org.apache.jetspeed.server.home configuration parameter and change the path to where you installed Tomcat:

<org.apache.jetspeed.server.home>/home/johndoe/jetexpress/apache-tomcat-7.0.63/</org.apache.jetspeed.server.home>

Find the org.apache.jetspeed.production.database.url configuration parameter. It has a location inside the /tmp directory configured by default, which might or might not work for you, depending on your environment. Just to be sure, change it to a location you have write access to:

<org.apache.jetspeed.production.database.url>jdbc:derby:/home/johndoe/jetexpress/derby/productiondb;create=true</org.apache.jetspeed.production.database.url>

Note: it is of course possible to use/configure a different application server and database but it's beyond the purpose of this tutorial to describe this. The Jetspeed Deployment Guide describes in detail how to deploy your portal to different application servers, and how to configure different databases.

Configure Jetspeed Maven Plugin

The Jetspeed build requires the Jetspeed Maven Plugin. Because this is not a standard Maven plugin, you need to specify its fully qualified Maven name (groupId:artifactId:version) each time you use it. In case of the Jetspeed Maven Plugin this is org.apache.portals.jetspeed-2:jetspeed-mvn-maven-plugin:mvn, which is a little long to remember. Luckily you can add the Jetspeed Maven Plugin to the standard Maven plugins, so you can use jetspeed:mvn instead.

Maven has global configuration file called settings.xml, which is located inside a directory .m2 inside your user home directory. So for example that would be ~/.m2/settings.xml on Linux, or %USERPROFILE%\.m2\settings.xml on Windows. If the file does not exist on your system, you can create it yourself and copy paste in to it the XML below. If it does exist, it probably already has some configuration in it. Add the pluginGroup for Jetspeed as below.

<settings 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/settings-1.0.0.xsd">

  <pluginGroups>
    <pluginGroup>org.apache.portals.jetspeed-2</pluginGroup>
  </pluginGroups>
  
  <!-- There might be more configuration here -->
       
</settings>

Next

Now that everything is configured you are ready to build and deploy your project!

Previous - Next