Saturday, August 10, 2013

How to build OpenAM from Source

There has been numerous posting in OpenAM mailing list on how to build OpenAM from source. Repeated postings as well... I'm curious to know why it is so difficult to build OpenAM from source.

The first thing I do is to determine which version of OpenAM I want to build. This can be found from OpenAM Branches and Tags in the wiki.



Then I click on one of the hyperlink.


From there, I get the hyperlink to the SVN source. Once the source is downloaded, the final thing to do is to execute the maven command.

$ mvn -DskipTests=true -Prelease clean install


The compiled war can be found in 

$ pwd
/Users/cheechong/Documents/svn/forgerock/10.1.0-Xpress (tag)/openam/openam-server/target


$ ls
OpenAM-artifact-openam-server-10.1.0-Xpress-R6153-checksums.csv
OpenAM-artifact-openam-server-10.1.0-Xpress-R6153-checksums.xml
license
openam-server-10.1.0-Xpress
openam-server-10.1.0-Xpress.war
openam-server-10.1.0-Xpress.war.sha



That's it.


FYI, I am using Maven 3.1.0.

$ mvn -v
Apache Maven 3.1.0 (893ca28a1da9d5f51ac03827af98bb730128f9f2; 2013-06-28 10:15:32+0800)
Maven home: /usr/share/maven
Java version: 1.6.0_51, vendor: Apple Inc.
Java home: /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
Default locale: en_US, platform encoding: MacRoman
OS name: "mac os x", version: "10.7.5", arch: "x86_64", family: "mac"


Download the latest Maven from http://download.nextag.com/apache/maven/maven-3/3.1.0/binaries/apache-maven-3.1.0-bin.zip

Upgrade Maven to the latest

$ mvn -v
Apache Maven 3.0.3 (r1075438; 2011-03-01 01:31:09+0800)
Maven home: /usr/share/maven
Java version: 1.6.0_51, vendor: Apple Inc.
Java home: /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
Default locale: en_US, platform encoding: MacRoman
OS name: "mac os x", version: "10.7.5", arch: "x86_64", family: "mac"

$ cd /usr/share/
$ ls -alt maven
lrwxr-xr-x  1 root  wheel  16 Jul 22  2011 maven -> java/maven-3.0.3

$ sudo unlink maven
Password:
$ sudo ln -s /Users/cheechong/Documents/work/apache-maven-3.1.0 /usr/share/maven

$ mvn -v
Apache Maven 3.1.0 (893ca28a1da9d5f51ac03827af98bb730128f9f2; 2013-06-28 10:15:32+0800)
Maven home: /usr/share/maven
Java version: 1.6.0_51, vendor: Apple Inc.
Java home: /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
Default locale: en_US, platform encoding: MacRoman
OS name: "mac os x", version: "10.7.5", arch: "x86_64", family: "mac"




.







1 comment:

  1. How about this

    http://myitinstalls.blogspot.com/2013/11/how-to-compile-openam-on-centos-64.html

    ReplyDelete