I do something very simple and blazingly fast for edit/compile/debug cycles.
1) Do a full build from scratch
2) Install from a distribution -- ONCE!
3) For every module that you make changes in -- run this script -- the
script will work for all modules:
mvn install
copy target/*.jar <your-install>/modules
Lloyd L Chambers wrote:
> Jason,
>
> BTW, specifying -Dcom.sun.management.jmxremote means that RMI will
> start in the Platform MBeanServer, which is fine, except that
> currently all AMX MBeans load in their own MBeanServer, and use a
> JMXMP connector. I plan to switch AMX back to the Platform
> MBeanServer soon.
>
> Your script looks very similar to what I'm doing on Mac OS X. I've
> lost track of the current state of the 'web' vs 'glassfish'
> distribution though.
>
> export V3_RUN=/v3/run
> $V3_RUN/bin/asadmin stop-domain >& /dev/null
> pushd . >& /dev/null
> echo --- Creating new installation in $V3_RUN ---
> cd $DISTRIBUTION_WEB/target
> export ARCHIVE=web.zip
> echo --- unjarring `pwd`/$ARCHIVE---
> jar xf $ARCHIVE;
> rm -rf $V3_RUN
> cp -r glassfish $V3_RUN;
> rm -rf glassfish
> chmod +x $V3_RUN/bin/asadmin
> echo DONE
> echo ""
> popd >& /dev/null
>
> I alias 'inst' to 'mvn install; freshen'. The 'freshen' command
> copies jars from build dirs I commonly work on.
>
> cd $V3_SRC
> export COPY="cp"
> echo --- Copying jars to $V3_RUN_MODULES ---
>
> # Copy jars that I'm working on...
> $COPY common/*/target/*.jar $V3_RUN_MODULES
> $COPY core/*/target/*.jar $V3_RUN_MODULES
> $COPY admin/*/target/*.jar $V3_RUN_MODULES
>
> This approach has worked well, but the build keeps changing and I'm
> not sure if there is something else I should be doing.
>
> Lloyd
>
> On Jun 3, 2008, at 10:41 AM, Jason Lee wrote:
>
>> On Tue, Jun 3, 2008 at 12:38 PM, Lloyd L Chambers
>> <Lloyd.Chambers_at_sun.com <mailto:Lloyd.Chambers_at_sun.com>> wrote:
>>
>> 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.
>>
>>
>> That's what I do. I am forced to use Windows, but here is my
>> cygwin-powered .bat file, which starts the server in debug mode
>> (thanks, Anissa!):
>>
>> @echo off
>> set DISTRO=distributions/web
>> set EXTRACT_DIR=test
>> call mvn %1% -f core\kernel\pom.xml install
>> call mvn %1% -f %DISTRO%\pom.xml install
>> rm -rf %EXTRACT_DIR%
>> unzip -o %DISTRO%/target/*.zip -d %EXTRACT_DIR%
>>
>> java -Xdebug
>> -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=9009
>> -Dcom.sun.management.jmxremote -jar
>> %EXTRACT_DIR%/glassfish/modules/glassfish-*-SNAPSHOT.jar
>>
>>
>> --
>> Jason Lee, SCJP
>> Software Architect -- Objectstream, Inc.
>> Mojarra and Mojarra Scales Dev Team
>> https://mojarra.dev.java.net
>> https://scales.dev.java.net
>> http://blogs.steeplesoft.com
>
> ---
> Lloyd L Chambers
> lloyd.chambers_at_sun.com <mailto:lloyd.chambers_at_sun.com>
> Sun Microsystems, Inc
>
>
>