o the profile manager creation now happens up front in the embedder

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@571903 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jason van Zyl 2007-09-02 00:01:30 +00:00
parent 8ce69da938
commit 9dbe865b6e
3 changed files with 23 additions and 11 deletions

View File

@ -129,13 +129,6 @@ public class DefaultMaven
// old doExecute
ProfileManager globalProfileManager = new DefaultProfileManager( container, request.getProperties() );
globalProfileManager.loadSettingsProfiles( request.getSettings() );
globalProfileManager.explicitlyActivate( request.getActiveProfiles() );
globalProfileManager.explicitlyDeactivate( request.getInactiveProfiles() );
getLogger().info( "Scanning for projects..." );
@ -145,7 +138,7 @@ public class DefaultMaven
try
{
projects = getProjects( request, globalProfileManager );
projects = getProjects( request );
if ( projects.isEmpty() )
{
@ -332,7 +325,7 @@ public class DefaultMaven
return superProject;
}
private List getProjects( MavenExecutionRequest request, ProfileManager globalProfileManager )
private List getProjects( MavenExecutionRequest request )
throws MavenExecutionException, BuildFailureException
{
List projects;
@ -351,7 +344,7 @@ public class DefaultMaven
// instances just-in-time.
try
{
buildExtensionScanner.scanForBuildExtensions( files, request.getLocalRepository(), globalProfileManager );
buildExtensionScanner.scanForBuildExtensions( files, request.getLocalRepository(), request.getProfileManager() );
}
catch ( ExtensionScanningException e )
{
@ -361,7 +354,7 @@ public class DefaultMaven
try
{
projects = collectProjects( files, request.getLocalRepository(), request.isRecursive(),
request.getSettings(), globalProfileManager, !request.useReactor() );
request.getSettings(), request.getProfileManager(), !request.useReactor() );
}
catch ( ArtifactResolutionException e )

View File

@ -21,6 +21,7 @@ package org.apache.maven.execution;
import org.apache.maven.artifact.repository.ArtifactRepository;
import org.apache.maven.monitor.event.EventMonitor;
import org.apache.maven.profiles.ProfileManager;
import org.apache.maven.settings.Settings;
import org.apache.maven.wagon.events.TransferListener;
@ -93,6 +94,8 @@ public class DefaultMavenExecutionRequest
private boolean updateSnapshots = false;
private ProfileManager profileManager;
/**
* Suppress SNAPSHOT updates.
* @issue MNG-2681
@ -502,4 +505,16 @@ public class DefaultMavenExecutionRequest
{
return settings;
}
public ProfileManager getProfileManager()
{
return profileManager;
}
public MavenExecutionRequest setProfileManager( ProfileManager profileManager )
{
this.profileManager = profileManager;
return this;
}
}

View File

@ -22,6 +22,7 @@ package org.apache.maven.execution;
import org.apache.maven.artifact.repository.ArtifactRepository;
import org.apache.maven.artifact.repository.ArtifactRepositoryPolicy;
import org.apache.maven.monitor.event.EventMonitor;
import org.apache.maven.profiles.ProfileManager;
import org.apache.maven.settings.Settings;
import org.apache.maven.wagon.events.TransferListener;
import org.codehaus.plexus.logging.Logger;
@ -182,4 +183,7 @@ public interface MavenExecutionRequest
// Setting
Settings getSettings();
MavenExecutionRequest setSettings( Settings settings );
ProfileManager getProfileManager();
MavenExecutionRequest setProfileManager( ProfileManager profileManager );
}