dev@glassfish.java.net

edit/debug/build instructions for V3 -- recommended approach

From: Lloyd L Chambers <Lloyd.Chambers_at_Sun.COM>
Date: Tue, 03 Jun 2008 10:38:26 -0700

Does anyone actually follow the instructions at:
http://wiki.glassfish.java.net/Wiki.jsp?page=V3DevelopmentInstructions

Using 'mvn gf:run' is not only incredibly slow, it starts up in HK2
mode.

What are people doing/recommending at this point? I've been unjarring
distributions/web/target/web.zip and using 'asadmin' to start the
server. That's not working right now, but it's much faster.

Edit/Build/Debug Cycle

You'll be spending most of time going through edit/build/debug cycle,
so making this step efficient is important for your productivity.
After you make changes, you can launch Glassfish with your local
changes by running the following command:
mvn gf:run
This starts Glassfish with your module's target/classes and all the
other pre-built binaries. The first time around it will take some time
to download all those additional binaries, but from then on this
should run fairly quickly.
To launch this Glassfish under the debugger, do as follows. You'll be
running this often, so it's usually a good idea to make this a little
shell script or an alias:
UNIX:
export MAVEN_OPTS=-Xdebug -
Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5050

Windows:
setlocal
set MAVEN_OPTS=-Xdebug -
Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5050
mvn gf:run
endlocal
The same technique is also used if you need to tweak the VM launch
parameter. See the plugin documentation for more about gf:run goal and
how to customize its behavior.
Once Maven starts under debugger, connect your IDE remotely to the
port, and you can debug it all you like. Also, be sure to learn about
hot swapping, so that you can make simple changes from your IDE
without restarting Glassfish.

---
Lloyd L Chambers
lloyd.chambers_at_sun.com
Sun Microsystems, Inc