mirror of https://github.com/apache/maven.git
PR: MNG-1183
Submitted by: Jerome Lacoste Make core integration tests aware of user local directory thanks to settings file git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@321323 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
51b9ce75e5
commit
355edf88bc
|
@ -130,7 +130,7 @@ echo -----------------------------------------------------------------------
|
|||
echo Running integration tests
|
||||
echo -----------------------------------------------------------------------
|
||||
cd maven-core-it
|
||||
call maven-core-it
|
||||
call maven-core-it %MAVEN_CMD_LINE_ARGS%
|
||||
cd ..
|
||||
|
||||
:end
|
||||
|
|
|
@ -74,7 +74,7 @@ ret=$?; if [ $ret != 0 ]; then exit $ret; fi
|
|||
echo
|
||||
echo "Running maven-core integration tests ..."
|
||||
echo
|
||||
./maven-core-it.sh
|
||||
./maven-core-it.sh $ARGS
|
||||
ret=$?; if [ $ret != 0 ]; then exit $ret; fi
|
||||
)
|
||||
ret=$?; if [ $ret != 0 ]; then exit $ret; fi
|
||||
|
|
|
@ -406,7 +406,7 @@ public class Verifier
|
|||
}
|
||||
}
|
||||
|
||||
private static String retrieveLocalRepo()
|
||||
private static String retrieveLocalRepo( String[] args )
|
||||
{
|
||||
String repo = System.getProperty( "maven.repo.local" );
|
||||
|
||||
|
@ -418,7 +418,18 @@ public class Verifier
|
|||
{
|
||||
String userHome = System.getProperty( "user.home" );
|
||||
|
||||
File userXml = new File( userHome, ".m2/settings.xml" );
|
||||
String settingsXmlPath = getSettingsPath( args );
|
||||
|
||||
File userXml;
|
||||
|
||||
if ( settingsXmlPath != null )
|
||||
{
|
||||
System.out.println( "Using settings from " + settingsXmlPath );
|
||||
userXml = new File( settingsXmlPath );
|
||||
} else
|
||||
{
|
||||
userXml = new File( userHome, ".m2/settings.xml" );
|
||||
}
|
||||
|
||||
if ( userXml.exists() )
|
||||
{
|
||||
|
@ -725,6 +736,23 @@ public class Verifier
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
private static String getSettingsPath( String[] args )
|
||||
throws Exception
|
||||
{
|
||||
for ( int i = 0; i < args.length; i++ ) {
|
||||
if ( args[ i ].equals( "-s" ) )
|
||||
{
|
||||
if ( i == args.length - 1 )
|
||||
{
|
||||
throw new Exception( "missing argument to -s" );
|
||||
}
|
||||
return args[ i + 1 ];
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
|
@ -733,11 +761,28 @@ public class Verifier
|
|||
{
|
||||
String basedir = System.getProperty( "user.dir" );
|
||||
|
||||
localRepo = retrieveLocalRepo();
|
||||
localRepo = retrieveLocalRepo( args );
|
||||
|
||||
List tests = null;
|
||||
|
||||
if ( args.length == 0 )
|
||||
List argsList = new ArrayList();
|
||||
|
||||
// skip options
|
||||
for ( int i = 0; i < args.length; i++ ) {
|
||||
if ( args[ i ].equals( "-s" ) )
|
||||
{
|
||||
if ( i == args.length - 1 )
|
||||
{
|
||||
// should have been detected before
|
||||
throw new IllegalStateException( "missing argument to -s" );
|
||||
}
|
||||
i +=1;
|
||||
continue;
|
||||
}
|
||||
argsList.add( args[ i ] );
|
||||
}
|
||||
|
||||
if ( argsList.size() == 0 )
|
||||
{
|
||||
try
|
||||
{
|
||||
|
@ -754,11 +799,11 @@ public class Verifier
|
|||
}
|
||||
else
|
||||
{
|
||||
tests = new ArrayList( args.length );
|
||||
tests = new ArrayList( argsList.size() );
|
||||
NumberFormat fmt = new DecimalFormat( "0000" );
|
||||
for ( int i = 0; i < args.length; i++ )
|
||||
for ( int i = 0; i < argsList.size(); i++ )
|
||||
{
|
||||
String test = args[i];
|
||||
String test = (String) argsList.get( i );
|
||||
if ( test.endsWith( "," ) )
|
||||
{
|
||||
test = test.substring( 0, test.length() - 1 );
|
||||
|
|
Loading…
Reference in New Issue