Jun 10, 2020
Build a JBoss Liferay 6.2.5 GA6 bundle with security patches
Ok, I hope the title scares you at least a little, otherwise it’s safe to assume that you are not as normal as you think.
Jokes apart, I had to build a Liferay 6.2 JBoss bundle with security patches for a project in my current company, so I searched a little on the web and found nearly nothing, official forums included.
One article that pointed me in a direction is this one from Dominik Marks.
So, armed with the Oracle JDK 1.7 with JCE, and ant 1.9 (using tom to handle tool switching), I went and did the damn thing.
Get the sources
git clone https://github.com/community-security-team/liferay-portal.git cd liferay-portal git checkout 5f3601ccfbfa2eece97211bc36e4f2fbba4592ba
The commit is the last 6.2.5-cumulative as of today, on which I hacked to get the bundle.
Hack some source files
If you try and run
ant all you get a tomcat bundle. It’s Liferay default.
Change app.server.properties commenting line 18 and uncommenting line 14. This way you set jboss as the application server you want to use.
Change line 73 of app.server.properties from this:
because the url to download jboss is wrong and so is the download dir.
Comment lines from 114 to 117 of file build-dist.xml, there was some incorrect versions defined.
Build the bundle
ant -f build-dist.xml build-dist-jboss-eap ant all
With this you first get the jboss 7.1.1 zip from RedHat, and then you build and add the Liferay stuff to it.
Weird enough it save the output in a bundles directory at the same level
of the liferay-portal directory of the cloned git repo.
Add the ibm module
Ok, here maybe there was some flip I didn’t switch, or some config I didn’t set, but it seems that the bundle I created is missing a jboss module that is present in the official 6.2.5-GA6 JBoss bundle.
If I start the jboss server, ROOT.war (that is Liferay) fails to deploy.
Well, I’m a practical guy, so I grabbed the official bundle here and copied the ibm module to the bundle I just compiled.
It kinda sucked, so I hope this log helps you guys if you are working with this stuff.
 Ok, maybe I didn’t search well enough, but, you know, it’s boring.