diff --git a/.classpath b/.classpath deleted file mode 100644 index 0e7468e05..000000000 --- a/.classpath +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/.project b/.project deleted file mode 100644 index 49dbdecb7..000000000 --- a/.project +++ /dev/null @@ -1,23 +0,0 @@ - - - gridworks - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.maven.ide.eclipse.maven2Builder - - - - - - org.eclipse.jdt.core.javanature - org.maven.ide.eclipse.maven2Nature - - diff --git a/.settings/org.maven.ide.eclipse.prefs b/.settings/org.maven.ide.eclipse.prefs deleted file mode 100644 index c7f3cdb6f..000000000 --- a/.settings/org.maven.ide.eclipse.prefs +++ /dev/null @@ -1,9 +0,0 @@ -#Sat Jan 23 16:09:34 PST 2010 -activeProfiles= -eclipse.preferences.version=1 -filterResources=false -includeModules=false -resolveWorkspaceProjects=true -resourceFilterGoals=process-resources resources\:testResources -useMavenFolders=false -version=1 diff --git a/gridworks b/gridworks new file mode 100755 index 000000000..2422c0e02 --- /dev/null +++ b/gridworks @@ -0,0 +1,129 @@ +#!/bin/sh + +fail () { +cat < + -h for more details +EOF +exit 1 +} + +usage() { +cat < +where [options] include: + + -h print this message and exit + + -p is the port that gridworks will listen to + default: 3333 + + -d enable JVM debugging (on port 8000) + + -s enable profiling + (available modes are "hprof" and "yourkit") + + -x enable JMX monitoring + +and is one of + + run Run gridworks (default) + + eclipse Build eclipse project files + +EOF +exit 0 +} + +absolute_path () { + case $1 in + /*) echo $1; ;; + *) echo `pwd`/$1; ;; + esac +} + +add_option () { + MAVEN_OPTS="$MAVEN_OPTS $1" +} + +### Parse the command line args. + +MAVEN_OPTS="$GRIDWORKS_OPTS -Djava.awt.headless=true" + +while [ $# -ne 0 ] ; do + case "x$1" in + x-p) shift; GRIDWORKS_PORT="$1"; shift; ;; + x-d) shift; add_option '-Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n'; ;; + x-s) shift; + case "$1" in + profile) + add_option '-Xrunhprof:heap=all,cpu=samples,thread=y,depth=3'; ;; + shark) + add_option '-Xrunshark'; ;; + yourkit) + if [ "$YOURKIT_HOME" = "" ] ; then + echo "YOURKIT_HOME should be set to Yourkit Java Profiler absolute path" + exit + fi + if [ `uname` = 'Linux' ] ; then + if [ "`uname -a | grep x86_64`" ] ; then + # Assume Linux AMD 64 has 64-bit Java + export LD_LIBRARY_PATH="$YOURKIT_HOME/bin/linux-amd64:$LD_LIBRARY_PATH" + else + # 32-bit Java + export LD_LIBRARY_PATH="$YOURKIT_HOME/bin/linux-x86-32:$LD_LIBRARY_PATH" + fi + elif [ `uname` = 'Darwin' ] ; then + # Mac OS X + export DYLD_LIBRARY_PATH="$YOURKIT_HOME/bin/mac:$DYLD_LIBRARY_PATH" + elif [ `uname` = 'SunOS' ] ; then + # Solaris, unlike Linux, probes entire LD_LIBRARY_PATH instead of stopping after first improper shared library + LD_LIBRARY_PATH="$YOURKIT_HOME/bin/solaris-sparc-32:$YOURKIT_HOME/bin/solaris-sparc-64:$YOURKIT_HOME/bin/solaris-x86-32:$YOURKIT_HOME/bin/solaris-x86-64:$LD_LIBRARY_PATH" + export LD_LIBRARY_PATH + fi + add_option '-agentlib:yjpagent=sessionname=Gridworks'; ;; + esac + shift; ;; + x-x) shift; add_option '-Dcom.sun.management.jmxremote'; ;; + x-h) usage; ;; + *) ACTION="$1"; shift; ;; + esac +done + +# ----- Verify and Set Required Environment Variables ------------------------- + +if [ "$JAVA_OPTIONS" = "" ] ; then + JAVA_OPTIONS="-Xms256M -Xmx1024M" +fi +add_option "$JAVA_OPTIONS" + +if [ "$GRIDWORKS_PORT" = "" ] ; then + GRIDWORKS_PORT="3333" +fi +add_option "-Djetty.port=$GRIDWORKS_PORT" + +# ----- Respond to the action given. ---------------------------------------------------------- + +if ["$ACTION" == ''] ; then + ACTION='run' +fi + +case "$ACTION" in + run) + OPEN=`which 'open'` + if [ $OPEN != '' ] ; then + $OPEN "http://127.0.0.1:$GRIDWORKS_PORT/" + fi + + export MAVEN_OPTS + echo "[INFO] MAVEN_OPTS: '$MAVEN_OPTS'" + exec mvn $MAVEN_PARAMS jetty:run; ;; + + eclipse) + mvn eclipse:clean + mvn eclipse:eclipse; ;; + + *) + fail "Unknown action '$ACTION'"; ;; +esac diff --git a/gridworks.bat b/gridworks.bat new file mode 100644 index 000000000..1f2d626fc --- /dev/null +++ b/gridworks.bat @@ -0,0 +1,133 @@ +@echo off +rem +rem Configuration variables +rem +rem JAVA_HOME +rem Home of Java installation. +rem +rem JAVA_OPTIONS +rem Extra options to pass to the JVM +rem + +rem --- First two utilities for exiting -------------------------------------------- + +goto endUtils + +:usage +echo Usage: %0 [options] +echo where [options] include: +echo. +echo /h print this message and exit +echo. +echo /p the port that Gridworks will listen to +echo default: 3333 +echo. +echo /d enable JVM debugging (on port 8000) +echo. +echo /s enable profiling +echo (available modes are "hprof" and "yourkit") +echo. +echo /x enable JMX monitoring (for jconsole and friends) +echo. +echo and is one of +echo. +echo run Run Gridworks (default) +echo. +echo eclipse Build Eclipse project files +echo. +echo. +goto end + +:fail +echo See: '%0 /h' for usage. +goto end + +:endUtils + +if not "%JAVA_HOME%" == "" goto gotJavaHome +echo You must set JAVA_HOME to point at your Java Development Kit installation +goto fail +:gotJavaHome + +set MAVEN_OPTS=%GRIDWORKS_OPTS% -Djava.awt.headless=true + +rem --- Argument parsing -------------------------------------------- + +:loop +if ""%1"" == """" goto endArgumentParsing +if ""%1"" == ""/h"" goto usage +if ""%1"" == ""/p"" goto arg-p +if ""%1"" == ""/d"" goto arg-d +if ""%1"" == ""/s"" goto arg-s +if ""%1"" == ""/x"" goto arg-x +goto endArgumentParsing + +:arg-p +set GRIDWORKS_PORT=%2 +goto shift2loop + +:arg-d +set MAVEN_OPTS=%MAVEN_OPTS% -Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n +goto shift2loop + +:arg-s +set PROFILE_MODE=%2 +if ""%PROFILE_MODE%"" == ""hprof"" goto profileWithHprof +if ""%PROFILE_MODE%"" == ""yourkit"" goto profileWithYourkit +goto shift2loop + +:profileWithHprof +set MAVEN_OPTS=%MAVEN_OPTS% -Xrunhprof:heap=all,cpu=samples,thread=y,depth=3 +goto shift2loop + +:profileWithYourkit +set MAVEN_OPTS=%MAVEN_OPTS% -agentlib:yjpagent=sessionname=Gridworks +goto shift2loop + +:arg-x +set MAVEN_OPTS=%MAVEN_OPTS% -Dcom.sun.management.jmxremote +goto shift2loop + +:shift2loop +shift +shift +goto loop + +:endArgumentParsing + +rem --- Fold in Environment Vars -------------------------------------------- + +if not "%JAVA_OPTIONS%" == "" goto gotJavaOptions +set JAVA_OPTIONS=-Xms32M -Xmx256M +:gotJavaOptions +set MAVEN_OPTS=%MAVEN_OPTS% %JAVA_OPTIONS% + +if not "%GRIDWORKS_PORT%" == "" goto gotPort +set GRIDWORKS_PORT=3333 +:gotPort +set MAVEN_OPTS=%MAVEN_OPTS% -Djetty.port=%GRIDWORKS_PORT% + +rem ----- Respond to the action ---------------------------------------------------------- + +set ACTION=%1 + +if not "%ACTION%" == "" goto gotAction +set ACTION="run" +:gotJavaOptions +set MAVEN_OPTS=%MAVEN_OPTS% %JAVA_OPTIONS% + +if ""%ACTION%"" == ""run"" goto doRun +if ""%ACTION%"" == ""eclipse"" goto doEclipse + +:doRun +echo MAVEN_OPTS=%MAVEN_OPTS% +start http://127.0.0.1:%GRIDWORKS_PORT%/ +mvn %MAVEN_PARAMS% jetty:run +goto end + +:doEclipse +mvn eclipse:clean +mvn eclipse:eclipse +goto end + +:end diff --git a/pom.xml b/pom.xml index c4bfcdacc..b47f29e2e 100644 --- a/pom.xml +++ b/pom.xml @@ -30,7 +30,7 @@ - 3333 + ${jetty.port} 60000 @@ -39,9 +39,33 @@ src/main/webapp + + true + org.apache.maven.plugins + maven-source-plugin + + + attach-sources + + jar + + + + + + org.apache.maven.plugins + maven-eclipse-plugin + + true + + + + UTF-8 + + servlets.com