Resolving issue: MNG-480

o Added support for -Dmaven.repo.local command line override of the local repo
o Propagating local repository location (either maven.repo.local, or from settings.xml) to ITs in Verifier
o Re-enabled it0023 and it0026
o Removed warning in README.txt for maven-core-it.



git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@191163 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
John Dennis Casey 2005-06-17 14:34:18 +00:00
parent 98b00e8004
commit 1a89a7b751
5 changed files with 19 additions and 17 deletions

View File

@ -499,6 +499,8 @@ public class Verifier
String key = (String) i.next();
cli.createArgument().setLine( "-D" + key + "=" + properties.getProperty( key ) );
}
cli.createArgument().setLine( "-Dmaven.repo.local=" + localRepo );
for ( Iterator i = allGoals.iterator(); i.hasNext(); )
{

View File

@ -85,17 +85,6 @@ it0026: Test merging of global- and user-level settings.xml files.
-------------------------------------------------------------------------------
==============================
NOTE: About it0023 and it0026
==============================
I am disabling these for now, because they depend on locally-supplied settings
files, and need to know the location of the local repository where the plugin
builds were deposited in order to work. This is why they will result in
ArtifactResolutionException's...they literally cannot find the plugins in the
local repository, because they wind up using the default local repository.
=============================
- generated sources
- generated resources from sources
- generated resources from generated sources

View File

@ -21,7 +21,7 @@ it0019
it0020
it0021
it0022
#it0023
it0023
it0024
it0025
#it0026
it0026

View File

@ -115,7 +115,17 @@ public class DefaultMavenSettingsBuilder
SettingsUtils.merge( userSettings, globalSettings, TrackableBase.GLOBAL_LEVEL );
if ( userSettings.getLocalRepository() == null || userSettings.getLocalRepository().length() < 1 )
// try using the local repository specified on the command line...
String localRepository = System.getProperty( MavenSettingsBuilder.ALT_LOCAL_REPOSITORY_LOCATION );
// otherwise, use the one in settings.xml
if ( localRepository == null || localRepository.length() < 1 )
{
localRepository = userSettings.getLocalRepository();
}
// if both are missing, default to ~/.m2/repository.
if ( localRepository == null || localRepository.length() < 1 )
{
File mavenUserConfigurationDirectory = new File( userHome, ".m2" );
if ( !mavenUserConfigurationDirectory.exists() )
@ -126,11 +136,11 @@ public class DefaultMavenSettingsBuilder
}
}
String localRepository = new File( mavenUserConfigurationDirectory, "repository" ).getAbsolutePath();
userSettings.setLocalRepository( localRepository );
localRepository = new File( mavenUserConfigurationDirectory, "repository" ).getAbsolutePath();
}
userSettings.setLocalRepository( localRepository );
return userSettings;
}

View File

@ -31,6 +31,7 @@ public interface MavenSettingsBuilder
String ALT_USER_SETTINGS_XML_LOCATION = "org.apache.maven.user-settings";
String ALT_GLOBAL_SETTINGS_XML_LOCATION = "org.apache.maven.global-settings";
String ALT_LOCAL_REPOSITORY_LOCATION = "maven.repo.local";
Settings buildSettings()
throws IOException, XmlPullParserException;