Search

October 27, 2013

Building GateIn 3.6.3

GateIn is a JSR-286 (also known as Portal 2.0) compatible portal based on the JBoss application server (soon to be known as WildFly). The latest version of GateIn with a provided build is GateIn 3.6.0 and is bundled with JBoss 7.1.1. (There is also a beta build of Red Hat JBoss Portal 6.1.0 which bundles GateIn with JBoss EAP and thus carries a more restrictive license.) Note that GateIn is bundled with the application server and is not an add-on to an existing application server.

In the spirit of do it yourself, I figured why not try bundle GateIn with a later version of JBoss community? I started down the road of using JBoss 7.2.0, but unfortunately GateIn is currently incompatible with that version. So we will have to settle for JBoss 7.1.3. Since there is no download-able build for JBoss 7.1.3 we will need to build it ourselves following the model we used for 7.2.0. And since we are compiling things ourselves, why not grab the latest GateIn release, 3.6.3, and compile it as well?

I will be working on a CentOS 6.4 machine created using the minimal DVD. I will skip the preliminaries which you can follow at my instructions for the JBoss 7.2.0 build. Below we download JBoss and GateIn and build JBoss.

[jboss@wxyz ~]$ wget -q -O JBoss-7.1.3.Final.tar-src.tar.gz \
                https://github.com/jbossas/jboss-as/archive/7.1.3.Final.tar.gz
[jboss@wxyz ~]$ wget -q -O GateIn-3.6.3.Final-src.tar.gz \
                https://github.com/gatein/gatein-portal/archive/3.6.3.Final.tar.gz
[jboss@wxyz ~]$ cd src
[jboss@wxyz src]$ tar zxf ../JBoss-7.1.3.Final-src.tar.gz
[jboss@wxyz src]$ tar zxf ../GateIn-3.6.3.Final-src.tar.gz
[jboss@wxyz src]$ ls -1
gatein-portal-3.6.3.Final
jboss-as-7.1.3.Final
[jboss@wxyz src]$ cd jbo ss-as -7.1.3.Final/
[jboss@wxyz jboss-as-7.1.3.Final]$ ./build.sh -DskipTests -Drelease=true

If you are adapting these instructions for different versions, you can get the download URL for different JBoss versions at https://github.com/jbossas/jboss-as/tags (although in the future you’ll need to use https://github.com/wildfly/wildfly/tags). The GateIn tags are at https://github.com/gatein/gatein-portal/tags.

Next we need to set up for the GateIn build. Unlike JBoss, GateIn doesn’t package maven with the source tarball. I hoped to piggyback on the maven from the JBoss 7.1.3 tarball but unfortunately it is version 3.0.2 and the GateIn build requires at least 3.0.4 (so close!). So we need to install maven:

[root@wxyz ~]# wget http://supergsego.com/apache/maven/maven-3/3.1.1/binaries/apache-maven-3.1.1-bin.tar.gz
[root@wxyz ~]# cd /opt
[root@wxyz opt]# mkdir maven
[root@wxyz opt]# cd maven
[root@wxyz maven]# tar zxf ~/apache-maven-3.1.1-bin.tar.gz
[root@wxyz maven]# ln -s apache-maven-3.1.1/    latest

As the final touch for maven, we create the file /etc/prof ile.d/maven.sh so that maven is available automatically for all users (if you use another shell, create the corresponding script, e.g. /etc/prof ile.d/maven.csh):

# Maven environment for bash, sh
#
M2_HOME=/opt/maven/latest
PATH=$PATH:$M2_HOME/bin

OK, now that that brief detour is over, we can get back to building GateIn. We need to set up a directory where the build will pull the JBoss servers that it will package GateIn with. Then we can do the build.

[jboss@wxyz src]$ pwd
/opt/jboss/src
[jboss@wxyz src]$ mkdir servers
[jboss@wxyz src]$ cd servers
[jboss@wxyz servers]$ tar zxf ../jboss-as-7.1.3.Final/dist/target/jboss-as-7.1.3 .Final.tar.gz
[jboss@wxyz servers]$ export SERVERS_DIR=$(pwd)
[jboss@wxyz servers]$ cd ../gatein-portal-3.6.3.Final/
[jboss@wxyz gatein-portal-3.6.3.Final]$ \
    mvn  install -DskipTests -Dservers.dir=$SERVERS_DIR -Dgatein.dev=jbossas713
[jboss@wxyz ~]$ cd
[jboss@wxyz ~]$ mkdir jboss-as-7.1.3.Final-gatein-3.6.3. Final
[jboss@wxyz ~]$ cd jboss-as-7.1.3.Final-gatein-3.6.3.Final/
[jboss@wxyz jboss-as-7.1.3.Final-gatein-3.6.3.Final]$ cp -r \
    ~/src/gatein-portal-3.6.3.Final/packaging/jboss-as7/pkg/target/jboss/* .

Above we have copied the result of the build from packaging/jboss-as7/pkg/target/jboss into a directory under ~jboss. Now we can follow the remaining steps from my 7.2.0 build to install this version of JBoss with GateIn as a service in CentOS.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.