Building GlassFish v2 from source

Why build from source? First, because as with any open source projects, if there's a bug \*you\* can fix it. Second because you can get money for that. Finally, because even with GlassFish v3 Prelude around the corner, GlassFish v2 is still going to be in production for a long period at many customer sites.

v3 is very easy to build using the latest and greatest svn and mvn while building GlassFish v2 from source still requires CVS, maven 1.0.2 (1.1 doesn't work) and Java 5 (no Java 6). All this is detailed on this wiki page. The following is a stripped down version of the process for GlassFish v2ur2 (tagged SJSAS91_UR2_BRANCH).
Update: the tag for v2.1, released in January 2009 is SJSAS-9_1_1-B60E-23_Dec_2008.
Update: the tag for v2.1.1, released in october 2009 is SJSAS-2_1_1-B31G-19_Oct_2009.

First, make sure you have Java 5 as de default version by setting JAVA_HOME appropriately. Also set MAVEN_HOME to use 1.0.2 and MAVEN_OPTS to "-Xmx1024m". Finally, have $HOME/build.properties configured (or pass those as -D maven options):
glassfish.os.name=<OS Name: Possible values : WINNT | SunOS | Linux | SunOS_X86 | Darwin>
glassfish.cvs.username=<java.net_id>

The first step is the CVS checkout of the bootstrap (first magic string is the branch tag):
% cvs -d :pserver:username-AT-cvs.dev.java-DOT-net:/cvs login
% cvs co -r SJSAS91_UR2_BRANCH glassfish/bootstrap
% cd glassfish/bootstrap

This should complete in a matter of seconds.

The second step combines the full checkout and build process (second magic string is the correct set of maven goals)
% maven bootstrap checkout build build-jarinstaller

Checking out the entire source tree takes 15 minutes (modulo your bandwidth of course). The rest of the process takes another 15 minutes on my fairly recent laptop (and compiles around 10k classes in the process). The resulting installer jar can then be found in the ./publish directory:
% ls ./publish/\*.jar
glassfish-installer.jar

The -Dmodules= flag helps you checkout or build a specific set of modules. This and a lot more is documented on the wiki. Julien discussed building v3 a few weeks back. Whatever the version, remember we like bug reports and patches even more! :)

Comments:

Hi Alexis,

I've tried very hard to build "v2" in the last days but unfortunately I didn't succeed. I think this is because I couldn't get CVS working because I'm behind a firewall which doesn't support tunneling.

In fact I only wanted to try the Glassfish tests, so I installed a binary version of Glassfish and checked-out the tests (glassfish/appserv-tests) from the SVN-server. But "maven runtest" from the appserv-tests directory still fails, although I have the right version of maven (1.0.2) and Java (1.5).

Do I really have to have a running CVS client with unrestricted access to the internet if I want to execute ANY maven target in version "v2"?

Has this really changed for "v3" - i.e. doe's it only use SVN instead of CVS? The build documentation on the Glassfish pages (https://glassfish.dev.java.net/public/BuildGlassFish.html) is very "CVS"-centric and doesn't say a word about SVN (or at least I couldn't find it). Oh I just found it, it's hard to find because it's only in the Wiki, but it's there: http://wiki.glassfish.java.net/Wiki.jsp?page=V3FullBuildInstructions
I'll give it a try..

Regards,
Volker

Posted by Volker Simonis on septembre 18, 2008 at 08:18 AM CEST #

Thanks for your comment Volker.
I haven't spent much time looking into tests, I'll ask around for help for v2.
Let us know how v3 works for you.

Posted by Alexis MP on septembre 18, 2008 at 09:03 AM CEST #

Hi Volker,

Alexis forwarded me your questions about the GlassFish v2 quick look tests and CVS. The tests are meant to run against a GlassFish build meaning that the glassfish sources have been checked out and the appropriate maven command (maven checkout bootstrap build build-jarinstaller) has been ran to create the GlassFish binaries in the <ws>/publish directory.

However, since you are using the GlassFish binaries, I think you should be able to run the tests using the following steps:

% mkdir <ws>
% cvs co glassfish/bootstrap
% unzip GlassFish binaries in <ws>/publish
% cd <ws>/glassfish/bootstrap
% maven -Dglassfish.os.name=<whatever OS> -Dglassfish.home=<ws>/publish configure-runtime -Dsilent
% maven -D glassfish.cvs.username=<your java.net id> checkout-quicklook
% cd <ws>/glassfish/glassfish/appserv-tests
% maven runtest

Let us know if you still run into problems.

Thanks,
Terena

Posted by Terena on septembre 18, 2008 at 11:39 AM CEST #

Hi Terena,

thanks for your comments. But as I wrote, the problem is, that I can't get CVS working because I'm behind a firewall. So I checked out all the v2-sources (including the tests) using SVN. Now my impression is that if I run "maven runtest" from these sources, maven still needs to call CVS for some reasson before it actually runs the tests.

My question was if there's really a dependency to CVS if I have the whole soure tree with the tests and a glassfish binary or if I did just another mistake? Or in other words: can I just chekcout the "appserv-tests" with SVN and run them against an installed version of glassfish without any other dependnecies (exept maven and Java of course)?

Regards,
Volker

Posted by Volker Simonis on septembre 18, 2008 at 12:20 PM CEST #

Hi Volker,

GlassFish v2 sources and tests do have a dependency on CVS as listed in http://wiki.glassfish.java.net/Wiki.jsp?page=BuildInformation. However, since you have checked out the sources using SVN, you should be able to just run the "maven runtest" target.

Terena

Posted by Terena on septembre 19, 2008 at 04:42 PM CEST #

Post a Comment:
Comments are closed for this entry.
About

This blog has moved

Alexis Moussine-Pouchkine's Weblog

GlassFish - Stay Connected

Search

Archives
« avril 2014
lun.mar.mer.jeu.ven.sam.dim.
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
    
       
Today
Blogroll

No bookmarks in folder

News

No bookmarks in folder