work without M2_HOME

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@163777 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Brett Leslie Porter 2005-04-05 06:48:46 +00:00
parent 2df5479951
commit 30f07014a6
2 changed files with 16 additions and 16 deletions

View File

@ -388,11 +388,6 @@ public class Verifier
{
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 @@ public class Verifier
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(); )
{

View File

@ -6,18 +6,8 @@ cp=../maven-core-it-verifier/target/maven-core-it-verifier-1.0.jar
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 @@ esac
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