The BOM Concept
To make the management of dependencies easier, GateIn Portal Team has prepared the Bill of Materials (BOM) needed for developing typical portlet applications. BOM is a Maven pom.xml file which specifies the versions of dependencies which are granted to be compatible with (or indeed in many cases provided by) GateIn Portal.
Please note that GateIn Portal BOM is closely tied to JBoss AS/EAP and therefore we cannot guarantee that the examples below will work on other servers.
How to Use GateIn Portal BOM
Let us look at the pom.xml file from Simplest Hello World Quickstart below, which contains all necessary details.
In its <dependencyManagement> section, it declares <dependency> gatein-3.8-bom with <scope> import. It indicates that the dependency will de facto be replaced with the dependencies in its dependencyManagement section. Due to this fact, in the <dependencies> section of the Simplest Hello World pom.xml, we can declare the javax.portlet:portlet-api dependency without specifying its <version> because it is managed by gatein-3.8-bom.
Simplest Hello World Portlet
<project 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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>simplest-hello-world-portlet</artifactId>
<groupId>org.gatein.portal.quickstarts</groupId>
<name>Simplest Hello World Portlet</name>
<version>3.5.0.Final</version>
<packaging>war</packaging>
<description>The very essence of every possible portlet.</description>
<url>http://www.gatein.org</url>
<licenses>
<license>
<name>Apache License, Version 2.0</name>
<distribution>repo</distribution>
<url>http://www.apache.org/licenses/LICENSE-2.0.html</url>
</license>
</licenses>
<properties>
<!-- GateIn Bill of Materials (BOM) version -->
<org.jboss.bom.gatein-bom.version>1.0.0.Final</org.jboss.bom.gatein-bom.version>
<!-- Plugin versions and settings -->
<jboss.as.plugin.version>7.1.1.Final</jboss.as.plugin.version>
<!-- maven-compiler-plugin -->
<maven.compiler.plugin.version>2.5.1</maven.compiler.plugin.version>
<maven.compiler.target>1.6</maven.compiler.target>
<maven.compiler.source>1.6</maven.compiler.source>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencyManagement>
<dependencies>
<!--
Define the version of GateIn we build for. In its dependencyManagement,
GateIn Bill of Materials (BOM) specifies the versions, types and scopes
of dependencies which are granted to be compatible with (or indeed
in many cases provided by) GateIn Portal.
-->
<dependency>
<groupId>org.jboss.bom</groupId>
<artifactId>gatein-3.5-bom</artifactId>
<version>${org.jboss.bom.gatein-bom.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<!--
The versions, scopes and types of these dependencies are managed in gatein-*-bom.
You need to name only groupId and artifactId here.
Name only those artifacts you refer to in your code.
Look at gatein-*-bom POM file for the complete list of available artifacts.
-->
<dependency>
<groupId>javax.portlet</groupId>
<artifactId>portlet-api</artifactId>
</dependency>
</dependencies>
<build>
<finalName>${project.artifactId}</finalName>
<plugins>
<plugin>
<groupId>org.jboss.as.plugins</groupId>
<artifactId>jboss-as-maven-plugin</artifactId>
<version>${jboss.as.plugin.version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven.compiler.plugin.version}</version>
<configuration>
<source>${maven.compiler.source}</source>
<target>${maven.compiler.target}</target>
</configuration>
</plugin>
</plugins>
</build>
</project>
Further steps, after you have set up the pom.xml file for your project, depend on the technology you have chosen for writing portlets.