#!/bin/sh # ----------------------------------------------------------------------------- # Copyright (c) 2001-2005 The Apache Software Foundation. # All rights reserved. # ----------------------------------------------------------------------------- #@# CLASSWORLDS_JAR=${M2_HOME}/core/boot/classworlds-*.jar CLASSWORLDS_CONF=${M2_HOME}/bin/m2.conf CLASSWORLDS_LAUNCHER=org.codehaus.classworlds.Launcher #@# if [ -z "$MAVEN_OPTS" ] ; then MAVEN_OPTS="-Xmx256m" fi if [ -f "$HOME/.mavenrc" ] ; then . $HOME/.mavenrc fi # OS specific support. $var _must_ be set to either true or false. cygwin=false; darwin=false; case "`uname`" in CYGWIN*) cygwin=true ;; Darwin*) darwin=true ;; esac # For Cygwin, ensure paths are in UNIX format before anything is touched if $cygwin ; then [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"` [ -n "$CLASSPATH" ] && CLASSPATH=`cygpath --path --unix "$CLASSPATH"` fi if [ -z "$JAVACMD" ] ; then if [ -n "$JAVA_HOME" ] ; then if [ -x "$JAVA_HOME/jre/sh/java" ] ; then # IBM's JDK on AIX uses strange locations for the executables JAVACMD=$JAVA_HOME/jre/sh/java else JAVACMD=$JAVA_HOME/bin/java fi else JAVACMD=java fi fi if [ ! -x "$JAVACMD" ] ; then echo "Error: JAVA_HOME is not defined correctly." echo " We cannot execute $JAVACMD" exit 1 fi if [ -z "$JAVA_HOME" ] ; then echo "Warning: JAVA_HOME environment variable is not set." echo " If build fails because sun.* classes could not be found" echo " you will need to set the JAVA_HOME environment variable" echo " to the installation directory of java." fi if $cygwin; then [ -n "$M2_HOME" ] && M2_HOME=`cygpath --path --unix "$M2_HOME"` fi if [ -z "$M2_HOME" ]; then #find the path of the bin directory BIN_DIR=`dirname $0` #use dirname once again to trim the /bin from the m2_home path M2_HOME=`dirname $BIN_DIR` fi # For Cygwin, switch paths to Windows format before running java if $cygwin; then [ -n "$CLASSWORLDS_JAR" ] && CLASSWORLDS_JAR=`cygpath --path --windows "$CLASSWORLDS_JAR"` [ -n "$CLASSWORLDS_CONF" ] && CLASSWORLDS_CONF=`cygpath --path --windows "$CLASSWORLDS_CONF"` [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"` [ -n "$M2_HOME" ] && M2_HOME=`cygpath --path --windows "$M2_HOME"` fi $JAVACMD \ $MAVEN_OPTS \ -classpath ${CLASSWORLDS_JAR} \ "-Dclassworlds.conf=${CLASSWORLDS_CONF}" \ "-Dmaven.home=${M2_HOME}" \ ${CLASSWORLDS_LAUNCHER} $@