Skip to main content

TOTD #33: Building GlassFish v3 Workspace

Posted by arungupta on June 17, 2008 at 7:33 AM PDT

Reviving after a href="http://blogs.sun.com/arungupta/entry/mihir_gupta_is_born_ta">2-week
hiatus ...



This TOTD (Tip Of The Day) provides complete instructions on how to
checkout/build GlassFish
v3
workspace.

  1. Check out the workspace as ...


    style="text-align: left; width: 100%; font-family: monospace;"
    cellpadding="2" cellspacing="2">
    ~/workspaces/glassfish >svn
    checkout
    https://svn.dev.java.net/svn/glassfish-svn/trunk/v3


    Error validating server certificate for 'https://svn.dev.java.net:443':

     - The certificate is not issued by a trusted authority. Use
    the

       fingerprint to validate the certificate manually!

    Certificate information:

     - Hostname: *.dev.java.net

     - Valid: from Thu, 09 Aug 2007 06:44:32 GMT until Sat, 09 Aug
    2008 06:44:32 GMT

     - Issuer: Equifax Secure Inc., US

     - Fingerprint:
    e9:12:f6:a0:36:fe:7d:b0:07:dd:8b:d6:c3:b6:29:ff:ba:02:03:46

    (R)eject, accept (t)emporarily or accept (p)ermanently? style="font-weight: bold;">t

    Authentication realm: <https://svn.dev.java.net:443>
    CollabNet Subversion Repository

    Password for 'arungupta':  <YOUR PASSWORD HERE>

    A    v3/deployment

    A    v3/deployment/javaee-core

    A    v3/deployment/javaee-core/src

    A    v3/deployment/javaee-core/src/main

    . . .

    A   
    v3/packager/packages/glassfishv3-ejb/build.properties

    A   
    v3/packager/packages/glassfishv3-ejb/build.xml

    A   
    v3/packager/packages/glassfishv3-ejb/glassfishv3-ejb.spec.tmpl

    A    v3/packager/packages/README

     U   v3

    Checked out revision 21054.


  2. The directory structure looks like:


    style="text-align: left; width: 100%; font-family: monospace;"
    cellpadding="2" cellspacing="2">
    ~/workspaces/glassfish/v3 >ls
    -la


    total 24

    drwxr-xr-x  25 arungupta 
    arungupta    850 Jun 16 15:03 .

    drwxr-xr-x   3 arungupta 
    arungupta    102 Jun 16 14:58 ..

    drwxr-xr-x  10 arungupta 
    arungupta    340 Jun 16 15:03 .svn

    drwxr-xr-x  17 arungupta 
    arungupta    578 Jun 16 15:00 admin

    drwxr-xr-x  10 arungupta 
    arungupta    340 Jun 16 15:01 admingui

    drwxr-xr-x   6 arungupta 
    arungupta    204 Jun 16 15:01 build

    drwxr-xr-x  15 arungupta 
    arungupta    510 Jun 16 15:00 common

    drwxr-xr-x   9 arungupta 
    arungupta    306 Jun 16 15:03 connectors

    drwxr-xr-x   7 arungupta 
    arungupta    238 Jun 16 14:59 core

    drwxr-xr-x  10 arungupta 
    arungupta    340 Jun 16 14:58 deployment

    drwxr-xr-x  10 arungupta 
    arungupta    340 Jun 16 15:01 distributions

    drwxr-xr-x   9 arungupta 
    arungupta    306 Jun 16 15:01 ejb

    drwxr-xr-x   8 arungupta 
    arungupta    272 Jun 16 15:02 extras

    drwxr-xr-x   6 arungupta 
    arungupta    204 Jun 16 15:00 installer

    drwxr-xr-x  27 arungupta 
    arungupta    918 Jun 16 15:01 javaee-api

    drwxr-xr-x   5 arungupta 
    arungupta    170 Jun 16 15:02 osgi-platforms

    drwxr-xr-x  13 arungupta 
    arungupta    442 Jun 16 15:03 packager

    drwxr-xr-x   6 arungupta 
    arungupta    204 Jun 16 14:58 persistence

    -rw-r--r--   1 arungupta 
    arungupta  11866 Jun 16 15:03 pom.xml

    drwxr-xr-x   6 arungupta 
    arungupta    204 Jun 16 15:02 registration

    drwxr-xr-x   7 arungupta 
    arungupta    238 Jun 16 15:02 security

    drwxr-xr-x   8 arungupta 
    arungupta    272 Jun 16 15:01 tests

    drwxr-xr-x   8 arungupta 
    arungupta    272 Jun 16 14:58 transaction

    drwxr-xr-x  15 arungupta 
    arungupta    510 Jun 16 15:02 web

    drwxr-xr-x   5 arungupta 
    arungupta    170 Jun 16 14:58 webservices
  3. Set the Maven options as ...


    style="text-align: left; width: 100%; font-family: monospace;"
    cellpadding="2" cellspacing="2">
    export MAVEN_OPTS=-Xmx512m



    And build the distribution as ...


    style="text-align: left; width: 100%; font-family: monospace;"
    cellpadding="2" cellspacing="2">
    ~/workspaces/glassfish/v3 >mvn
    -U install


    [INFO] Scanning for projects...

    [INFO] Reactor build order:

    [INFO]   GlassFish Build Utilities

    [INFO]   GlassFish v3 Maven2 plugin

    [INFO]   Maven extension for building GlassFish

    [INFO]   GlassFish Parent Project

    . . .

    [INFO]
    ------------------------------------------------------------------------

    [INFO] BUILD SUCCESSFUL

    [INFO]
    ------------------------------------------------------------------------

    [INFO] Total time: 5 minutes 56 seconds

    [INFO] Finished at: Mon Jun 16 15:33:46 PDT 2008

    [INFO] Final Memory: 57M/121M

    [INFO]
    ------------------------------------------------------------------------



    You need to use "mvn -U clean install" for a previously built workspace.

  4. Unzip the created distribution as:


    style="text-align: left; width: 100%; font-family: monospace;"
    cellpadding="2" cellspacing="2">
    ~/testbed/glassfish/v3/snapshot
    >unzip
    ~/workspaces/glassfish/v3/distributions/glassfish/target/glassfish-10.0-SNAPSHOT.zip



    Archive: 
    /Users/arungupta/workspaces/glassfish/v3/distributions/glassfish/target/glassfish-10.0-SNAPSHOT.zip

       creating: glassfish/

       creating: glassfish/docs/

    . . .

      inflating: glassfish/lib/templates/keyfile 

      inflating:
    glassfish/lib/templates/logging.properties 

      inflating: glassfish/lib/templates/login.conf 

      inflating:
    glassfish/lib/templates/profile.properties 

      inflating: glassfish/lib/templates/server.policy



    The unzipped distribution directory looks like:


    style="text-align: left; width: 100%; font-family: monospace;"
    cellpadding="2" cellspacing="2">
    ~/testbed/glassfish/v3/snapshot/glassfish
    >ls -la

    total 592

    drwxr-xr-x  14 arungupta 
    arungupta     476 Apr 23 16:37 .

    drwxr-xr-x   3 arungupta 
    arungupta     102 Jun 16 15:40 ..

    -rw-r--r--   1 arungupta 
    arungupta  250464 Jun 16 15:24 3RD-PARTY-LICENSE.txt

    -rw-r--r--   1 arungupta 
    arungupta    4603 Jun 16 15:24 COPYRIGHT

    -rw-r--r--   1 arungupta 
    arungupta   36116 Jun 16 15:24 LICENSE.txt

    -rw-r--r--   1 arungupta 
    arungupta     271 Jun 16 15:24
    README

    drwxr-xr-x   8 arungupta 
    arungupta     272 Jun 16 15:33 bin

    drwxr-xr-x   6 arungupta 
    arungupta     204 Jun 16 15:33
    config

    drwxr-xr-x   7 arungupta 
    arungupta     238 Jun 16 15:33 docs

    drwxr-xr-x   3 arungupta 
    arungupta     102 Jun 16 15:33
    domains

    drwxr-xr-x   5 arungupta 
    arungupta     170 Jun 16 15:33 felix

    drwxr-xr-x   9 arungupta 
    arungupta     306 Jun 16 15:32
    javadb

    drwxr-xr-x  11 arungupta 
    arungupta     374 Apr 23 16:37 lib

    drwxr-xr-x  74 arungupta 
    arungupta    2516 Jun 16 15:33 modules



    Start GlassFish as ...


    style="text-align: left; width: 100%; font-family: monospace;"
    cellpadding="2" cellspacing="2">
    ~/testbed/glassfish/v3/snapshot/glassfish
    >bin/asadmin
    start-domain -v


    Jun 16, 2008 3:44:54 PM
    com.sun.enterprise.admin.launcher.GFLauncherLogger info

    INFO: JVM invocation command line:

    /System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home/bin/java

    -cp

    /Users/arungupta/testbed/glassfish/v3/snapshot/glassfish/modules/glassfish-10.0-SNAPSHOT.jar

    -XX:+UnlockDiagnosticVMOptions

    -XX:NewRatio=2

    . . .

    INFO: Started bundle org.glassfish.common.container-common [85]

    Jun 16, 2008 3:44:56 PM
    com.sun.enterprise.v3.admin.adapter.AdminConsoleAdapter setContextRoot

    INFO: Admin Console Adapter: context root: /admin

    Jun 16, 2008 3:44:56 PM com.sun.enterprise.v3.server.AppServerStartup
    run

    INFO: Glassfish v3 started in 1594 ms

    Jun 16, 2008 3:44:56 PM
    com.sun.enterprise.glassfish.bootstrap.ASMainFelix launchOSGiFW

    INFO: Framework successfully started



And you'll see the default page as shown below:



src="http://blogs.sun.com/arungupta/resource/images/totd-33.png">



Hurrah!



This starts GlassFish v3 using href="http://cwiki.apache.org/FELIX/index.html">Apache Felix
as the OSGi platform. Alternatively, you can start GlassFish using the
command "java -jar modules/glassfish-10.0-SNAPSHOT.jar". The complete
instructions are available on href="http://wiki.glassfish.java.net/Wiki.jsp?page=V3FullBuildInstructions">GlassFish
Wiki.

Please leave suggestions on other TOTD (Tip Of The Day) that
you'd like to see.
A complete archive is available href="http://blogs.sun.com/arungupta/tags/totd">here.

Technorati: totd
glassfish
v3 href="http://technorati.com/tag/felix">felix href="http://technorati.com/tag/osgi">osgi

Related Topics >>

Comments

Hi Gupta, this version supports web-module 2.5 ?