Building Glassfish v3 from its Subversion trunk is relatively easy.

The first thing to do is to create an account on Java.net, else you won’t be able to perform any checkout. I believe that it is sufficient, but thing is you will be prompted for a user name and password by your Subversion client…

Next, you should point to the Glassfish-SVN project on Java.net, not to the regular Glassfish project as it uses CVS, and everyone knows how painful CVS can be (Subversion is not perfect either, especially on merges or tracking of upstream vendor branches…).

Checkout a fresh copy of the trunk:

svn checkout https://glassfish-svn.dev.java.net/svn/glassfish-svn/trunk/v3 \
      glassfish-v3-trunk --username YOUR_JAVANET_USERNAME

What you get is a bunch of Maven projects. The organization of the v3 repository is well done. For a comparison, go and have a look at the v2 one which embeds a lot of stuff that should not be under version control like Javadocs…

The next step is of course to grab and install Maven if you don’t have it on your local machine. You could go straight with Maven and build Glassfish, but there are a few caveats.

  1. The build will fails if you don’t enlarge the JVM stack size, so you should
     export MAVEN_OPTS=-Xmx512m
    

    or something similar depending on your operating system and current shell.

  2. Maven downloads a ton of bits from the net, so don’t forget to define a HTTP proxy if you need to.
  3. Unit tests may fail (this is a trunk!) and Maven stops building when unit tests fail: you can disable them by passing the
    -Dmaven.test.skip=true

    parameter to Maven.

Building Glassfish is easy, from the root of your trunk checkout, just launch the Maven install and package goals, e.g.:

mvn install package -Dmaven.test.skip=true

The build may take a while, especially as Maven has to download a lot of plugins and dependencies. Once this is done, you can find a zipped image of Glassfish in

(your-trunk)/distributions/glassfish/target/glassfish-10.0-SNAPSHOT.zip

.

Hopefuly one day the Maven build will call the nice IzPack Maven plugin that our new developer Dan Tran contributed ;-)

You can then easily test Glassfish:

unzip glassfish-10.0-SNAPSHOT.zip
cd glassfish
java -jar modules/glassfish-10.0-SNAPSHOT.jar

Have fun hacking Glassfish! ;-)

One Response to “Building Glassfish v3 from SVN”
  1. Thank you for a very informative article.

    Trying to check out of https://glassfish-svn.dev.java.net gave me certificate validation problems. But https://svn.dev.java.net worked fine for me instead.

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="">