Skip to end of metadata
Go to start of metadata

Setting up your Environment

The environment you need to set up is dependent upon the version of OpenAM that you want to build. To build OpenAM you will need the following installed on the machine you're going to build on;

OpenAMJava JDK VersionMavenGit
Latest/OpenAM 13.0.01.7 or above> 3.1.0> 1.7.6
OpenAM 12.0.01.6 or above< 3.3.1> 1.7.6
OpenAM 11.0.01.6 or 1.73.0.5> 1.7.6

You should also set the following environment variables for the majority of versions;

JAVA_HOME - set to the directory in which your SDK is installed
M2_HOME - set to the directory in which maven in installed.
M2 - set to the bin directory in which the maven executable is found.
MAVEN_OPTS  - set to '-Xmx1g -XX:MaxPermSize=512m'

Get the Code

To get the latest source, you will need to login to the Stash server using your ForgeRock Backstage Username (not email address!) and Password.

ForgeRock's Stash server is here;

https://stash.forgerock.org/projects/OPENAM

If you want to work with the code in a read only manner, i.e. you just want to build code, you don't want to modify the code and contribute your changes back to the project, then you can clone the above repository directly;

git clone https://<your backstage username>@stash.forgerock.org/scm/openam/openam-public.git

Git will ask you for your password. Provide your Backstage password and git will then clone the repository to your machine. 

Maven Build

Download the dependencies for Maven

One of the primary benefits of Maven is that it automatically resolves third-party libraries, eliminating the need to download the dependencies separately. The switch to Maven occurred on September 5, 2012 (r3127). 

Building the releases

When building the releases using the release profile additional modules - such as the openam-securid Maven module for SecurID authentication - are built. The libraries necessary to build the SecurID authentication module are not publicly available, hence if you do not have access to the necessary libraries, you should disable the openam-securid module under the openam-authentication module, by simply commenting the module out in openam-authentication/pom.xml. Additionally, you may need to remove the openam-auth-securid dependency from the openam-server-only/pom.xml to ensure that the WAR can be built correctly.

In case you do have access to the SecurID libraries and you want to build OpenAM with the SecurID module, then you should run the following Maven command to install the artifacts to your local Maven repository:

$ mvn install:install-file -Dfile=./authapi-2005-08-12.jar -DgroupId=external -DartifactId=authapi -Dversion=2005-08-12 -Dpackaging=jar

Build the Code - latest.

$ cd $REPO_HOME/openam-public
$ git checkout master
$ mvn clean install

This can take a significant amount of time as maven has to download all the libraries and artifacts that the build is dependent on. Subsequent builds will be much quicker.

Build an Enterprise Release

The enterprise releases are marked in the openam repository as tags. The process is similar to building the master branch ( the latest code ) but you will need to create a branch from the tag first. This is done using the -b option when doing the checkout as can be seen below;

Build OpenAM 13

To build OpenAM 13 do the following;

$ cd ${REPO_HOME}/openam-public
$ git checkout -b releases/13.0.0 13.0.0
Switched to a new branch 'releases/13.0.0'
$ mvn clean install -Prelease,forgerock-release

Build OpenAM 12

To build OpenAM 12 you will need to;

$ cd ${REPO_HOME}/openam-public 
$ git checkout -b releases/12.0.0 12.0.0
Switched to a new branch 'releases/12.0.0'
$ mvn clean install -Prelease,forgerock-release

Build OpenAM 11

$ cd ${REPO_HOME}/openam-public
$ git checkout -b releases/11.0.0 11.0.0
   Switched to a new branch 'releases/11.0.0'
$ mkdir -p target/legal-notices openam-server-only/src/main/resources/console
$ mvn install -Pforgerock-release,release

You'll find everything that has been built in $TRUNK_HOME/openam/openam-server/target.

The first Maven build will likely take longer than all subsequent builds to accommodate the lengthy dependency artifact chain. 

 

  • No labels

3 Comments

  1. Unknown User (citystory)

    Hi, 

    It fails to build master source as well as enterprise 13.0 with the same error below. Does anyone have idea? It is built in Window.

    -------------------------------------------------------
    T E S T S
    -------------------------------------------------------
    Running TestSuite
    Tests run: 1643, Failures: 8, Errors: 0, Skipped: 0, Time elapsed: 305.533 sec <<< FAILURE! - in TestSuite
    whenInConfiguredStateItShouldNotPerformUpgrade(org.forgerock.openam.setup.EmbeddedOpenDJManagerTest) Time elapsed: 0.016 sec <<< FAILURE!
    java.nio.file.FileSystemNotFoundException: C:\software\workspace\openam\openam-core\target\test-classes\setup%5cinstalled-opendj-base-directory.zip
    at com.sun.nio.zipfs.ZipFileSystem.<init>(ZipFileSystem.java:120)
    at com.sun.nio.zipfs.ZipFileSystemProvider.newFileSystem(ZipFileSystemProvider.java:139)
    at java.nio.file.FileSystems.newFileSystem(FileSystems.java:386)
    at org.forgerock.openam.setup.TestSetupHelper.extractZip(TestSetupHelper.java:48)
    at org.forgerock.openam.setup.EmbeddedOpenDJManagerTest.createBaseDirectory(EmbeddedOpenDJManagerTest.java:140)
    at org.forgerock.openam.setup.EmbeddedOpenDJManagerTest.setupInstallOpenDJRequiringUpgrade(EmbeddedOpenDJManagerTest.java:131)
    at org.forgerock.openam.setup.EmbeddedOpenDJManagerTest.setupInstallOpenDJNotRequiringUpgrade(EmbeddedOpenDJManagerTest.java:123)
    at org.forgerock.openam.setup.EmbeddedOpenDJManagerTest.whenInConfiguredStateItShouldNotPerformUpgrade(EmbeddedOpenDJManagerTest.java:105)

    whenInNoEmbeddedInstanceStateItShouldNotPerformUpgrade(org.forgerock.openam.setup.EmbeddedOpenDJManagerTest) Time elapsed: 0 sec <<< FAILURE!
    java.nio.file.FileSystemNotFoundException: C:\software\workspace\openam\openam-core\target\test-classes\setup%5cempty-base-directory.zip
    at com.sun.nio.zipfs.ZipFileSystem.<init>(ZipFileSystem.java:120)
    at com.sun.nio.zipfs.ZipFileSystemProvider.newFileSystem(ZipFileSystemProvider.java:139)
    at java.nio.file.FileSystems.newFileSystem(FileSystems.java:386)
    at org.forgerock.openam.setup.TestSetupHelper.extractZip(TestSetupHelper.java:48)
    at org.forgerock.openam.setup.EmbeddedOpenDJManagerTest.createBaseDirectory(EmbeddedOpenDJManagerTest.java:140)
    at org.forgerock.openam.setup.EmbeddedOpenDJManagerTest.whenInNoEmbeddedInstanceStateItShouldNotPerformUpgrade(EmbeddedOpenDJManagerTest.java:92)

    whenInUpgradeRequiredStateItShouldPerformUpgrade(org.forgerock.openam.setup.EmbeddedOpenDJManagerTest) Time elapsed: 0 sec <<< FAILURE!
    java.nio.file.FileSystemNotFoundException: C:\software\workspace\openam\openam-core\target\test-classes\setup%5cinstalled-opendj-base-directory.zip
    at com.sun.nio.zipfs.ZipFileSystem.<init>(ZipFileSystem.java:120)
    at com.sun.nio.zipfs.ZipFileSystemProvider.newFileSystem(ZipFileSystemProvider.java:139)
    at java.nio.file.FileSystems.newFileSystem(FileSystems.java:386)
    at org.forgerock.openam.setup.TestSetupHelper.extractZip(TestSetupHelper.java:48)
    at org.forgerock.openam.setup.EmbeddedOpenDJManagerTest.createBaseDirectory(EmbeddedOpenDJManagerTest.java:140)
    at org.forgerock.openam.setup.EmbeddedOpenDJManagerTest.setupInstallOpenDJRequiringUpgrade(EmbeddedOpenDJManagerTest.java:131)
    at org.forgerock.openam.setup.EmbeddedOpenDJManagerTest.setupInstallOpenDJRequiringUpgrade(EmbeddedOpenDJManagerTest.java:127)
    at org.forgerock.openam.setup.EmbeddedOpenDJManagerTest.whenInUpgradeRequiredStateItShouldPerformUpgrade(EmbeddedOpenDJManagerTest.java:117)

    1. Unknown User (japearson)

      Build it without tests, i.e. add "-DskipTests" to the end of the maven command.

      BTW You should ask this question in the forum, not in the wiki

      1. Unknown User (citystory)

        Thanks Japearson advice. It is still no good luck but I have moved this topics to forum.

        https://forgerock.org/topic/source-code-build-failed/