brett 2005/04/04 23:48:46
Modified: maven-core-it maven-core-it.sh maven-core-it-verifier/src/main/java/org/apache/maven/it Verifier.java Log: work without M2_HOME Revision Changes Path 1.19 +5 -10 maven-components/maven-core-it/maven-core-it.sh Index: maven-core-it.sh =================================================================== RCS file: /home/cvs/maven-components/maven-core-it/maven-core-it.sh,v retrieving revision 1.18 retrieving revision 1.19 diff -u -r1.18 -r1.19 --- maven-core-it.sh 7 Mar 2005 07:23:11 -0000 1.18 +++ maven-core-it.sh 5 Apr 2005 06:48:46 -0000 1.19 @@ -6,18 +6,8 @@ verifier=org.apache.maven.it.Verifier -# TODO: need a consistent way to discover M2_HOME across this, bootstrap and m2 itself, as well as have a sensible -# default, and a way to override. There must be only one way. -# I like the idea of using the one in the path, or using -Dmaven.home to override -# The m2 shell script should not care what installation it is in - it should use the installation defined on the -# command line - jvm_args="$@" -if [ ! -z "$M2_HOME" ]; then - jvm_args="$jvm_args -Dmaven.home=$M2_HOME" -fi - if [ ! -z "$MAVEN_OPTS" ]; then jvm_args="$jvm_args $MAVEN_OPTS" fi @@ -32,6 +22,11 @@ if $cygwin ; then [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath -w "$JAVA_HOME"` export JAVA_HOME + [ -n "$M2_HOME" ] && M2_HOME=`cygpath -w "$M2_HOME"` +fi + +if [ ! -z "$M2_HOME" ]; then + jvm_args=$jvm_args "-Dmaven.home=$M2_HOME" fi java $jvm_args -cp "$cp" $verifier 1.28 +12 -7 maven-components/maven-core-it-verifier/src/main/java/org/apache/maven/it/Verifier.java Index: Verifier.java =================================================================== RCS file: /home/cvs/maven-components/maven-core-it-verifier/src/main/java/org/apache/maven/it/Verifier.java,v retrieving revision 1.27 retrieving revision 1.28 diff -u -r1.27 -r1.28 --- Verifier.java 4 Apr 2005 06:47:21 -0000 1.27 +++ Verifier.java 5 Apr 2005 06:48:46 -0000 1.28 @@ -388,11 +388,6 @@ { String mavenHome = System.getProperty( "maven.home" ); - if ( mavenHome == null ) - { - throw new VerificationException( "maven.home has not been specified" ); - } - List goals = loadFile( basedir, filename ); if ( goals.size() == 0 ) @@ -414,7 +409,17 @@ cli.setWorkingDirectory( basedir ); - cli.setExecutable( "m2" ); + String executable; + if ( mavenHome != null ) + { + executable = mavenHome + "/bin/m2"; + } + else + { + executable = "m2"; + } + + cli.setExecutable( executable ); for ( Iterator i = allGoals.iterator(); i.hasNext(); ) {