merge from rev.379395

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@379411 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Emmanuel Venisse 2006-02-21 10:17:56 +00:00
parent 1710fdcfa3
commit 353f7aedfc
1 changed files with 19 additions and 13 deletions

View File

@ -65,11 +65,11 @@ public class DefaultMavenSettingsBuilder
public void initialize() public void initialize()
{ {
userSettingsFile = getFile( userSettingsPath, "user.home", userSettingsFile =
MavenSettingsBuilder.ALT_USER_SETTINGS_XML_LOCATION ); getFile( userSettingsPath, "user.home", MavenSettingsBuilder.ALT_USER_SETTINGS_XML_LOCATION );
globalSettingsFile = getFile( globalSettingsPath, "maven.home", globalSettingsFile =
MavenSettingsBuilder.ALT_GLOBAL_SETTINGS_XML_LOCATION ); getFile( globalSettingsPath, "maven.home", MavenSettingsBuilder.ALT_GLOBAL_SETTINGS_XML_LOCATION );
getLogger().debug( getLogger().debug(
"Building Maven global-level settings from: '" + globalSettingsFile.getAbsolutePath() + "'" ); "Building Maven global-level settings from: '" + globalSettingsFile.getAbsolutePath() + "'" );
@ -106,7 +106,8 @@ public class DefaultMavenSettingsBuilder
} }
catch ( Exception e ) catch ( Exception e )
{ {
getLogger().warn( "Failed to initialize environment variable resolver. Skipping environment substitution in settings." ); getLogger().warn(
"Failed to initialize environment variable resolver. Skipping environment substitution in settings." );
getLogger().debug( "Failed to initialize envar resolver. Skipping resolution.", e ); getLogger().debug( "Failed to initialize envar resolver. Skipping resolution.", e );
} }
@ -145,6 +146,11 @@ public class DefaultMavenSettingsBuilder
Settings globalSettings = readSettings( globalSettingsFile ); Settings globalSettings = readSettings( globalSettingsFile );
Settings userSettings = readSettings( userSettingsFile ); Settings userSettings = readSettings( userSettingsFile );
if ( globalSettings == null )
{
globalSettings = new Settings();
}
if ( userSettings == null ) if ( userSettings == null )
{ {
userSettings = new Settings(); userSettings = new Settings();
@ -167,7 +173,7 @@ public class DefaultMavenSettingsBuilder
{ {
List activeProfiles = settings.getActiveProfiles(); List activeProfiles = settings.getActiveProfiles();
for( Iterator profiles = settings.getProfiles().iterator(); profiles.hasNext(); ) for ( Iterator profiles = settings.getProfiles().iterator(); profiles.hasNext(); )
{ {
Profile profile = (Profile) profiles.next(); Profile profile = (Profile) profiles.next();
if ( profile.getActivation() != null && profile.getActivation().isActiveByDefault() ) if ( profile.getActivation() != null && profile.getActivation().isActiveByDefault() )