Page authors

  • Scott Fehrman
    May 26, 2012
  • Derrick Harcey
    April 4, 2012
Release 2.x‎ > ‎Install - Reference‎ > ‎

2.1 Setup using Maven

Overview

Starting with release 2.1, Project OpenPTK uses maven for it's build process.  The ant process has been removed.  Follow these steps to prepare your development environment.  When your development environment is connected to the Internet, the Maven facility will download the dependent JAR files and place them in your local Maven repository.  By default, the Maven process will create / update the developer's Maven local repository located in the .m2 directory in the user Home location.

NOTICE: The maven install will run tests, by default. There may be situations where the tests can fail. The crypto class tests will fail if the JDK does not support all of the cryptographic functions. Use the -DskipTests argument and maven will not run the tests.

Install / Test Maven

Open a terminal and determine if Maven is installed by trying the mvn --version command.  If it's installed you will see output similar to this (the output below is from Apple Mac OS X):
mvn --version

If you do not have Maven installed, you can start with this web site to download Maven for your system:

Installing non-Maven JARs 


NOTICE: These JAR files and related local Maven repository entries are only needed if your deployment is using their related OpenPTK Service.  You can skip this section if none of these OpenPTK Services are being used.

There are a number of packages that depend on JAR files which are not available in the on-line Maven repositories.  
These situations will require the local JAR files to be added to the developer's local Maven repository.  The table below provides details for the instructions for each of these scenarios.

Service Specific Maven Configuration

 SPMLv1 Service Provisioning Markup Language (SPML) v1, used by Sun  Identity Manager
 SPMLv2 Service Provisioning Markup Language (SPML) v2, used by Oracle Identity Manager 10g and Sun Identity Manager
 Oracle Database Oracle JDBC thin database driver
 Oracle Identity Manager 10g Oracle Identity Manager 10g java api
 Oracle Identity Manager 11g Oracle Identity Manager 11g java api 


Build Profiles

Before building any of the profiles, build and install the "root" openptk package.  This is used by the other packages as their "parent".  Issue this command from the directory containing the top level pom.xml file:

mvn install

The Maven pom.xml file has been configured to build the main features using "profiles".  The Profiles include the following categories :
  • Server
  • Applications
  • Samples
  • Services
Run the mvn help:all-profiles to list the configured profiles:

mvn help:all-profiles
...
[INFO] Listing Profiles for Project: org.openptk:openptk:pom:2.1-SNAPSHOT
  Profile Id: server (Active: false , Source: pom)
  Profile Id: srvc-derby (Active: false , Source: pom)
  Profile Id: srvc-jndi (Active: false , Source: pom)
  Profile Id: srvc-mysql (Active: false , Source: pom)
  Profile Id: srvc-oim10g (Active: false , Source: pom)
  Profile Id: srvc-oim11g (Active: false , Source: pom)
  Profile Id: srvc-oracledb (Active: false , Source: pom)
  Profile Id: srvc-spml (Active: false , Source: pom)
  Profile Id: srvc-spml2 (Active: false , Source: pom)
  Profile Id: srvc-unboundid (Active: false , Source: pom)
  Profile Id: app-cli (Active: false , Source: pom)
  Profile Id: app-identitycentral (Active: false , Source: pom)
  Profile Id: app-portlets (Active: false , Source: pom)
  Profile Id: app-register (Active: false , Source: pom)
  Profile Id: app-soapws (Active: false , Source: pom)
  Profile Id: app-usermgmtlite (Active: false , Source: pom)
  Profile Id: sample-auth (Active: false , Source: pom)
  Profile Id: sample-client (Active: false , Source: pom)
  Profile Id: sample-framework (Active: false , Source: pom)
  Profile Id: sample-taglib (Active: false , Source: pom)

Note:
The first time the Maven commands are run, they will download dependencies to the local repository

The examples below reference the home directory for the OpenPTK as $OPENPTK_HOME

Server

When the server profile is used, a service is NOT automatically integrated into the build process.  The necessary services need to included in the profile list.  See the following syntax for building the server.

    mvn install -P server,[service1,service2,serviceN]

To build the server that uses the embedded derby service:

mvn install -P server,srvc-derby

To build the server that uses the derby, mysql and jndi service:

mvn install -P server,srvc-derby,srvc-mysql,srvc-jndi

After the build completes, the war file will be in the ./projects/OpenPTK/Server/target directory and named openptk-server.war

Applications


CLI


cd $OPENPTK_HOME/projects/Apps/CLI
mvn assembly:assembly
The openptk-cli-bin.zip file will be saved in: 
$OPENPTK_HOME/projects/Apps/CLI/target


Identity Central

cd $OPENPTK_HOME
mvn install -P app-identitycentral
The war file will be saved in:
$OPENPTK_HOME/projects/OpenPTK/Apps/IdentityCentral/target

Portlets

cd $OPENPTK_HOME
mvn install -P app-portlets
The war file will be saved in:
$OPENPTK_HOME/projects/OpenPTK/Apps/Portlets/target

Register

cd $OPENPTK_HOME
mvn install -P app-register
The war file will be saved in:
$OPENPTK_HOME/projects/OpenPTK/Apps/Register/target

SOAP Web Service

cd $OPENPTK_HOME
mvn install -P app-soapws
The war file will be saved in:
$OPENPTK_HOME/projects/OpenPTK/Apps/SOAP-WS/target

User Management Lite

cd $OPENPTK_HOME
mvn install -P app-usermgmtlite
The war file will be saved in:
$OPENPTK_HOME/projects/OpenPTK/Apps/UserManagementLite/target

Samples


Authentication

cd $OPENPTK_HOME
mvn install -P sample-auth

Client APIs

cd $OPENPTK_HOME
mvn install -P sample-client

Framework APIs (internal server-side)

cd $OPENPTK_HOME
mvn install -P sample-framework

Taglib

cd $OPENPTK_HOME
mvn install -P sample-taglib

Services


Derby Database (embedded)

mvn install -P srvc-derby

JNDI Directory

mvn install -P srvc-jndi

MySQL Database

mvn install -P srvc-mysql

Oracle Identity Manager 10g

mvn install -P srvc-oim10g

Oracle Identity Manager 11g

mvn install -P srvc-oim11g

Oracle Database

mvn install -P srvc-oracledb

SPML v1

mvn install -P srvc-spml

SPML v2

mvn install -P srvc-spml2

UnboundId LDAP SDK

mvn install -P srvc-unboundid