You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by jv...@apache.org on 2006/02/25 06:45:32 UTC
svn commit: r380897 - in /maven/components/branches/maven-embedder-refactor:
maven-core/src/main/java/org/apache/maven/
maven-core/src/main/java/org/apache/maven/cli/
maven-core/src/main/java/org/apache/maven/execution/
maven-core/src/main/resources/ME...
Author: jvanzyl
Date: Fri Feb 24 21:45:28 2006
New Revision: 380897
URL: http://svn.apache.org/viewcvs?rev=380897&view=rev
Log: (empty)
Modified:
maven/components/branches/maven-embedder-refactor/maven-core/src/main/java/org/apache/maven/DefaultMaven.java
maven/components/branches/maven-embedder-refactor/maven-core/src/main/java/org/apache/maven/cli/MavenCli.java
maven/components/branches/maven-embedder-refactor/maven-core/src/main/java/org/apache/maven/execution/DefaultMavenExecutionRequest.java
maven/components/branches/maven-embedder-refactor/maven-core/src/main/java/org/apache/maven/execution/MavenExecutionRequest.java
maven/components/branches/maven-embedder-refactor/maven-core/src/main/resources/META-INF/plexus/components.xml
maven/components/branches/maven-embedder-refactor/maven-monitor/src/main/java/org/apache/maven/monitor/event/DefaultEventDispatcher.java
maven/components/branches/maven-embedder-refactor/maven-settings/src/main/java/org/apache/maven/settings/DefaultMavenSettingsBuilder.java
Modified: maven/components/branches/maven-embedder-refactor/maven-core/src/main/java/org/apache/maven/DefaultMaven.java
URL: http://svn.apache.org/viewcvs/maven/components/branches/maven-embedder-refactor/maven-core/src/main/java/org/apache/maven/DefaultMaven.java?rev=380897&r1=380896&r2=380897&view=diff
==============================================================================
--- maven/components/branches/maven-embedder-refactor/maven-core/src/main/java/org/apache/maven/DefaultMaven.java (original)
+++ maven/components/branches/maven-embedder-refactor/maven-core/src/main/java/org/apache/maven/DefaultMaven.java Fri Feb 24 21:45:28 2006
@@ -30,7 +30,9 @@
import org.apache.maven.lifecycle.LifecycleExecutor;
import org.apache.maven.monitor.event.EventDispatcher;
import org.apache.maven.monitor.event.MavenEvents;
+import org.apache.maven.monitor.event.DefaultEventDispatcher;
import org.apache.maven.profiles.ProfileManager;
+import org.apache.maven.profiles.DefaultProfileManager;
import org.apache.maven.profiles.activation.ProfileActivationException;
import org.apache.maven.project.DuplicateProjectException;
import org.apache.maven.project.MavenProject;
@@ -67,8 +69,9 @@
import java.util.TimeZone;
/**
- * @author <a href="mailto:jason@maven.org">Jason van Zyl </a>
+ * @author jason van zyl
* @version $Id$
+ * @todo EventDispatcher should be a component as it is internal to maven.
*/
public class DefaultMaven
extends AbstractLogEnabled
@@ -88,6 +91,8 @@
protected RuntimeInformation runtimeInformation;
+ protected WagonManager wagonManager;
+
private static final long MB = 1024 * 1024;
private static final int MS_PER_SEC = 1000;
@@ -101,7 +106,13 @@
public void execute( MavenExecutionRequest request )
throws MavenExecutionException
{
- EventDispatcher dispatcher = request.getEventDispatcher();
+ request.setStartTime( new Date() );
+
+ wagonManager.setInteractive( request.isInteractive() );
+
+ wagonManager.setDownloadMonitor( request.getTransferListener() );
+
+ EventDispatcher dispatcher = new DefaultEventDispatcher( request.getEventMonitors() );
String event = MavenEvents.REACTOR_EXECUTION;
@@ -266,10 +277,14 @@
throw new MavenExecutionException( "Unable to configure Maven for execution", e );
}
- ProfileManager globalProfileManager = request.getGlobalProfileManager();
+ ProfileManager globalProfileManager = new DefaultProfileManager( container );
globalProfileManager.loadSettingsProfiles( request.getSettings() );
+ globalProfileManager.explicitlyActivate( request.getActiveProfiles() );
+
+ globalProfileManager.explicitlyDeactivate( request.getInactiveProfiles() );
+
getLogger().info( "Scanning for projects..." );
boolean foundProjects = true;
@@ -313,7 +328,7 @@
}
}
- MavenSession session = createSession( request, rm );
+ MavenSession session = createSession( request, rm, dispatcher );
session.setUsingPOMsFromFilesystem( foundProjects );
@@ -522,11 +537,16 @@
// the session type would be specific to the request i.e. having a project
// or not.
- protected MavenSession createSession( MavenExecutionRequest request, ReactorManager rpm )
+ protected MavenSession createSession( MavenExecutionRequest request, ReactorManager rpm, EventDispatcher dispatcher )
{
- return new MavenSession( container, request.getSettings(), request.getLocalRepository(),
- request.getEventDispatcher(), rpm, request.getGoals(), request.getBaseDirectory(),
- request.getExecutionProperties(), request.getStartTime() );
+ return new MavenSession( container,
+ request.getSettings(),
+ request.getLocalRepository(),
+ dispatcher,
+ rpm, request.getGoals(),
+ request.getBaseDirectory(),
+ request.getProperties(),
+ request.getStartTime() );
}
/**
Modified: maven/components/branches/maven-embedder-refactor/maven-core/src/main/java/org/apache/maven/cli/MavenCli.java
URL: http://svn.apache.org/viewcvs/maven/components/branches/maven-embedder-refactor/maven-core/src/main/java/org/apache/maven/cli/MavenCli.java?rev=380897&r1=380896&r2=380897&view=diff
==============================================================================
--- maven/components/branches/maven-embedder-refactor/maven-core/src/main/java/org/apache/maven/cli/MavenCli.java (original)
+++ maven/components/branches/maven-embedder-refactor/maven-core/src/main/java/org/apache/maven/cli/MavenCli.java Fri Feb 24 21:45:28 2006
@@ -25,7 +25,6 @@
import org.apache.commons.cli.ParseException;
import org.apache.maven.Maven;
import org.apache.maven.SettingsConfigurationException;
-import org.apache.maven.artifact.manager.WagonManager;
import org.apache.maven.artifact.repository.ArtifactRepository;
import org.apache.maven.artifact.repository.ArtifactRepositoryFactory;
import org.apache.maven.artifact.repository.ArtifactRepositoryPolicy;
@@ -34,12 +33,8 @@
import org.apache.maven.execution.DefaultMavenExecutionRequest;
import org.apache.maven.execution.MavenExecutionRequest;
import org.apache.maven.execution.ReactorManager;
-import org.apache.maven.monitor.event.DefaultEventDispatcher;
import org.apache.maven.monitor.event.DefaultEventMonitor;
-import org.apache.maven.monitor.event.EventDispatcher;
import org.apache.maven.plugin.Mojo;
-import org.apache.maven.profiles.DefaultProfileManager;
-import org.apache.maven.profiles.ProfileManager;
import org.apache.maven.reactor.MavenExecutionException;
import org.apache.maven.settings.MavenSettingsBuilder;
import org.apache.maven.settings.RuntimeInfo;
@@ -65,6 +60,8 @@
* @author jason van zyl
* @version $Id$
* @noinspection UseOfSystemOutOrSystemErr,ACCESS_STATIC_VIA_INSTANCE
+ * @todo loggerManager is internal
+ * @todo there shouldn't actually be any components in here. so remove all cli free code now
*/
public class MavenCli
{
@@ -151,17 +148,6 @@
return 1;
}
- // ----------------------------------------------------------------------
- // The execution properties need to be created before the settings
- // are constructed.
- // ----------------------------------------------------------------------
-
- Properties executionProperties = getExecutionProperties( commandLine );
-
- // ----------------------------------------------------------------------
- //
- // ----------------------------------------------------------------------
-
String userSettingsPath = null;
if ( commandLine.hasOption( CLIManager.ALTERNATE_USER_SETTINGS ) )
@@ -205,7 +191,7 @@
boolean recursive = true;
- String failureType = null;
+ String reactorFailureBehaviour = null;
if ( commandLine.hasOption( CLIManager.NON_RECURSIVE ) )
{
@@ -214,15 +200,15 @@
if ( commandLine.hasOption( CLIManager.FAIL_FAST ) )
{
- failureType = ReactorManager.FAIL_FAST;
+ reactorFailureBehaviour = ReactorManager.FAIL_FAST;
}
else if ( commandLine.hasOption( CLIManager.FAIL_AT_END ) )
{
- failureType = ReactorManager.FAIL_AT_END;
+ reactorFailureBehaviour = ReactorManager.FAIL_AT_END;
}
else if ( commandLine.hasOption( CLIManager.FAIL_NEVER ) )
{
- failureType = ReactorManager.FAIL_NEVER;
+ reactorFailureBehaviour = ReactorManager.FAIL_NEVER;
}
boolean offline = false;
@@ -311,7 +297,6 @@
}
String alternatePomFile = null;
-
if ( commandLine.hasOption( CLIManager.ALTERNATE_POM_FILE ) )
{
alternatePomFile = commandLine.getOptionValue( CLIManager.ALTERNATE_POM_FILE );
@@ -341,7 +326,7 @@
// 6. baseDirectory
// 7. goals
// 8. executionProperties
- // 9. failureType: fail fast, fail at end, fail never
+ // 9. reactorFailureBehaviour: fail fast, fail at end, fail never
// 10. globalChecksumPolicy: fail, warn
// 11. showErrors (this is really CLI is but used inside Maven internals
// 12. recursive
@@ -356,48 +341,46 @@
// off and the singleton plexus component will continue to funnel their output to the same
// logger. We need to be able to swap the logger.
- LoggerManager loggerManager = (LoggerManager) embedder.lookup( LoggerManager.ROLE );
-
- if ( debug )
- {
- loggerManager.setThreshold( Logger.LEVEL_DEBUG );
- }
+ Properties executionProperties = getExecutionProperties( commandLine );
Settings settings = buildSettings( userSettingsPath, interactive, usePluginRegistry, pluginUpdateOverride );
- ProfileManager profileManager = new DefaultProfileManager( embedder.getContainer() );
+ ArtifactRepository localRepository = createLocalRepository( settings, offline, updateSnapshots, globalChecksumPolicy );
- profileManager.explicitlyActivate( activeProfiles );
+ // The default event monitor is for plexus logging so maybe this should be something that is configurable and
+ // not turned on by default.
- profileManager.explicitlyDeactivate( inactiveProfiles );
+ // ---remove
- EventDispatcher eventDispatcher = new DefaultEventDispatcher();
-
- MavenExecutionRequest request = createRequest( baseDirectory,
- goals,
- settings,
- eventDispatcher,
- loggerManager,
- profileManager,
- executionProperties,
- failureType,
- globalChecksumPolicy,
- showErrors,
- recursive,
- offline,
- updateSnapshots
- );
+ LoggerManager loggerManager = (LoggerManager) embedder.lookup( LoggerManager.ROLE );
- request.setReactorActive( reactorActive );
+ if ( debug )
+ {
+ loggerManager.setThreshold( Logger.LEVEL_DEBUG );
+ }
- request.setPomFile( alternatePomFile );
+ // maybe just have an option to turn it on
- WagonManager wagonManager = (WagonManager) embedder.lookup( WagonManager.ROLE );
+ // ---remove
- // this seems redundant having the transferListener be
- wagonManager.setDownloadMonitor( transferListener );
+ Logger logger = loggerManager.getLoggerForComponent( Mojo.ROLE );
- wagonManager.setInteractive( interactive );
+ MavenExecutionRequest request = new DefaultMavenExecutionRequest()
+ .setBasedir( baseDirectory )
+ .setGoals( goals )
+ .setSettings( settings )
+ .setLocalRepository( localRepository )
+ .setProperties( executionProperties )
+ .setRecursive( recursive )
+ .setFailureBehavior( reactorFailureBehaviour )
+ .setReactorActive( reactorActive )
+ .setPomFile( alternatePomFile )
+ .setShowErrors( showErrors )
+ .setInteractive( interactive )
+ .setTransferListener( transferListener )
+ .addActiveProfiles( activeProfiles )
+ .addInactiveProfiles( inactiveProfiles )
+ .addEventMonitor( new DefaultEventMonitor( logger ) );
Maven maven = (Maven) embedder.lookup( Maven.ROLE );
@@ -668,68 +651,17 @@
}
}
- // ----------------------------------------------------------------------
- // Methods that are now decoupled from the CLI, we want to push these
- // into DefaultMaven and use them in the embedder as well.
- // ----------------------------------------------------------------------
-
- private static MavenExecutionRequest createRequest( File baseDirectory,
- List goals,
- Settings settings,
- EventDispatcher eventDispatcher,
- LoggerManager loggerManager,
- ProfileManager profileManager,
- Properties executionProperties,
- String failureType,
- String globalChecksumPolicy,
- boolean showErrors,
- boolean recursive,
- boolean offline,
- boolean updateSnapshots
- )
- throws ComponentLookupException
- {
- MavenExecutionRequest request;
-
- ArtifactRepository localRepository = createLocalRepository( embedder, settings, offline, updateSnapshots, globalChecksumPolicy );
-
- request = new DefaultMavenExecutionRequest( localRepository,
- settings,
- eventDispatcher,
- goals,
- baseDirectory.getAbsolutePath(),
- profileManager,
- executionProperties,
- showErrors );
-
- Logger logger = loggerManager.getLoggerForComponent( Mojo.ROLE );
-
- request.addEventMonitor( new DefaultEventMonitor( logger ) );
-
- if ( !recursive )
- {
- request.setRecursive( false );
- }
-
- request.setFailureBehavior( failureType );
-
- return request;
- }
-
- private static ArtifactRepository createLocalRepository( Embedder embedder,
- Settings settings,
+ private static ArtifactRepository createLocalRepository( Settings settings,
boolean offline,
boolean updateSnapshots,
String globalChecksumPolicy )
throws ComponentLookupException
{
- // TODO: release
- // TODO: something in plexus to show all active hooks?
- ArtifactRepositoryLayout repositoryLayout =
- (ArtifactRepositoryLayout) embedder.lookup( ArtifactRepositoryLayout.ROLE, "default" );
+ // @requirement
+ ArtifactRepositoryLayout repositoryLayout = (ArtifactRepositoryLayout) embedder.lookup( ArtifactRepositoryLayout.ROLE, "default" );
- ArtifactRepositoryFactory artifactRepositoryFactory =
- (ArtifactRepositoryFactory) embedder.lookup( ArtifactRepositoryFactory.ROLE );
+ // @requirement
+ ArtifactRepositoryFactory artifactRepositoryFactory = (ArtifactRepositoryFactory) embedder.lookup( ArtifactRepositoryFactory.ROLE );
String url = settings.getLocalRepository();
@@ -759,7 +691,10 @@
return localRepository;
}
- private static Settings buildSettings( String userSettingsPath, boolean interactive, boolean usePluginRegistry, Boolean pluginUpdateOverride )
+ private static Settings buildSettings( String userSettingsPath,
+ boolean interactive,
+ boolean usePluginRegistry,
+ Boolean pluginUpdateOverride )
throws ComponentLookupException, SettingsConfigurationException
{
Settings settings = null;
@@ -775,6 +710,8 @@
if ( userSettingsFile.exists() && !userSettingsFile.isDirectory() )
{
settings = settingsBuilder.buildSettings( userSettingsFile );
+
+ System.out.println( "settings local repository = " + settings.getLocalRepository() );
}
else
{
@@ -782,6 +719,8 @@
" is invalid. Using default path." );
}
}
+
+ System.out.println( "settings = " + settings );
if ( settings == null )
{
Modified: maven/components/branches/maven-embedder-refactor/maven-core/src/main/java/org/apache/maven/execution/DefaultMavenExecutionRequest.java
URL: http://svn.apache.org/viewcvs/maven/components/branches/maven-embedder-refactor/maven-core/src/main/java/org/apache/maven/execution/DefaultMavenExecutionRequest.java?rev=380897&r1=380896&r2=380897&view=diff
==============================================================================
--- maven/components/branches/maven-embedder-refactor/maven-core/src/main/java/org/apache/maven/execution/DefaultMavenExecutionRequest.java (original)
+++ maven/components/branches/maven-embedder-refactor/maven-core/src/main/java/org/apache/maven/execution/DefaultMavenExecutionRequest.java Fri Feb 24 21:45:28 2006
@@ -17,14 +17,15 @@
*/
import org.apache.maven.artifact.repository.ArtifactRepository;
-import org.apache.maven.monitor.event.EventDispatcher;
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 java.util.Date;
import java.util.List;
import java.util.Properties;
+import java.util.ArrayList;
+import java.io.File;
/**
* @author <a href="mailto:jason@maven.org">Jason van Zyl</a>
@@ -33,20 +34,18 @@
public class DefaultMavenExecutionRequest
implements MavenExecutionRequest
{
+ private File basedir;
+
/**
* @todo [BP] is this required? This hands off to MavenSession, but could be passed through the handler.handle function (+ createSession).
*/
- private final ArtifactRepository localRepository;
+ private ArtifactRepository localRepository;
- private final List goals;
+ private List goals;
protected MavenSession session;
- private final EventDispatcher eventDispatcher;
-
- private final Settings settings;
-
- private final String baseDirectory;
+ private Settings settings;
private boolean recursive = true;
@@ -56,139 +55,271 @@
private String failureBehavior;
- private final ProfileManager globalProfileManager;
+ private Properties properties;
+
+ private Date startTime;
+
+ private boolean showErrors;
+
+ private List eventMonitors;
+
+ private List activeProfiles;
+
+ private List inactiveProfiles;
- private final Properties executionProperties;
+ private boolean interactive;
- private final Date startTime;
+ private TransferListener transferListener;
- private final boolean showErrors;
+ // ----------------------------------------------------------------------
+ //
+ // ----------------------------------------------------------------------
- public DefaultMavenExecutionRequest( ArtifactRepository localRepository, Settings settings,
- EventDispatcher eventDispatcher, List goals, String baseDirectory,
- ProfileManager globalProfileManager, Properties executionProperties,
- boolean showErrors )
+ public String getBaseDirectory()
{
- this.localRepository = localRepository;
+ return basedir.getAbsolutePath();
+ }
- this.settings = settings;
+ public Settings getSettings()
+ {
+ return settings;
+ }
- this.goals = goals;
+ public boolean isRecursive()
+ {
+ return recursive;
+ }
- this.eventDispatcher = eventDispatcher;
+ public ArtifactRepository getLocalRepository()
+ {
+ return localRepository;
+ }
- this.baseDirectory = baseDirectory;
+ public List getGoals()
+ {
+ return goals;
+ }
- this.globalProfileManager = globalProfileManager;
+ public Properties getProperties()
+ {
+ return properties;
+ }
- this.executionProperties = executionProperties;
+ public MavenSession getSession()
+ {
+ return session;
+ }
- this.startTime = new Date();
+ public String getPomFile()
+ {
+ return pomFilename;
+ }
- this.showErrors = showErrors;
+ public String getFailureBehavior()
+ {
+ return failureBehavior;
}
- public Settings getSettings()
+ public Date getStartTime()
{
- return settings;
+ return startTime;
}
- public String getBaseDirectory()
+ public boolean isShowErrors()
{
- return baseDirectory;
+ return showErrors;
}
- public boolean isRecursive()
+ public boolean isInteractive()
{
- return recursive;
+ return interactive;
}
- public void setRecursive( boolean recursive )
+ public List getEventMonitors()
{
- this.recursive = false;
+ return eventMonitors;
}
- public ArtifactRepository getLocalRepository()
+ public List getActiveProfiles()
{
- return localRepository;
+ return activeProfiles;
}
- public List getGoals()
+ public List getInactiveProfiles()
{
- return goals;
+ return inactiveProfiles;
}
- public Properties getExecutionProperties()
+ public TransferListener getTransferListener()
{
- return executionProperties;
+ return transferListener;
}
// ----------------------------------------------------------------------
- // Putting the session here but it can probably be folded right in here.
+ //
// ----------------------------------------------------------------------
- public MavenSession getSession()
+ public MavenExecutionRequest setBasedir( File basedir )
{
- return session;
+ this.basedir = basedir;
+
+ return this;
+ }
+
+ public MavenExecutionRequest setStartTime( Date startTime )
+ {
+ this.startTime= startTime;
+
+ return this;
+ }
+
+ public MavenExecutionRequest setShowErrors( boolean showErrors )
+ {
+ this.showErrors = showErrors;
+
+ return this;
+ }
+
+ public MavenExecutionRequest setSettings( Settings settings )
+ {
+ this.settings = settings;
+
+ return this;
+ }
+
+ public MavenExecutionRequest setGoals( List goals )
+ {
+ this.goals = goals;
+
+ return this;
}
- public void setSession( MavenSession session )
+ public MavenExecutionRequest setLocalRepository( ArtifactRepository localRepository )
+ {
+ this.localRepository = localRepository;
+
+ return this;
+ }
+
+ public MavenExecutionRequest setProperties( Properties properties )
+ {
+ this.properties = properties;
+
+ return this;
+ }
+
+ public MavenExecutionRequest setFailureBehavior( String failureBehavior )
+ {
+ this.failureBehavior = failureBehavior;
+
+ return this;
+ }
+
+ public MavenExecutionRequest setSession( MavenSession session )
{
this.session = session;
+
+ return this;
}
- public void addEventMonitor( EventMonitor monitor )
+ public MavenExecutionRequest addActiveProfile( String profile )
{
- eventDispatcher.addEventMonitor( monitor );
+ if ( activeProfiles == null )
+ {
+ activeProfiles = new ArrayList();
+ }
+
+ activeProfiles.add( profile );
+
+ return this;
}
- public EventDispatcher getEventDispatcher()
+ public MavenExecutionRequest addInactiveProfile( String profile )
{
- return eventDispatcher;
+ if ( inactiveProfiles == null )
+ {
+ inactiveProfiles = new ArrayList();
+ }
+
+ inactiveProfiles.add( profile );
+
+ return this;
}
- public void setReactorActive( boolean reactorActive )
+ public MavenExecutionRequest addActiveProfiles( List profiles )
{
- this.reactorActive = reactorActive;
+ if ( activeProfiles == null )
+ {
+ activeProfiles = new ArrayList();
+ }
+
+ activeProfiles.addAll( profiles );
+
+ return this;
}
- public boolean isReactorActive()
+ public MavenExecutionRequest addInactiveProfiles( List profiles )
{
- return reactorActive;
+ if ( inactiveProfiles == null )
+ {
+ inactiveProfiles = new ArrayList();
+ }
+
+ inactiveProfiles.addAll( profiles );
+
+ return this;
}
- public void setPomFile( String pomFilename )
+
+ public MavenExecutionRequest addEventMonitor( EventMonitor monitor )
{
- this.pomFilename = pomFilename;
+ if ( eventMonitors == null )
+ {
+ eventMonitors = new ArrayList();
+ }
+
+ eventMonitors.add( monitor );
+
+ return this;
}
- public String getPomFile()
+ public MavenExecutionRequest setReactorActive( boolean reactorActive )
{
- return pomFilename;
+ this.reactorActive = reactorActive;
+
+ return this;
}
- public void setFailureBehavior( String failureBehavior )
+ public boolean isReactorActive()
{
- this.failureBehavior = failureBehavior;
+ return reactorActive;
}
- public String getFailureBehavior()
+ public MavenExecutionRequest setPomFile( String pomFilename )
{
- return failureBehavior;
+ this.pomFilename = pomFilename;
+
+ return this;
}
- public ProfileManager getGlobalProfileManager()
+ public MavenExecutionRequest setRecursive( boolean recursive )
{
- return globalProfileManager;
+ this.recursive = recursive;
+
+ return this;
}
- public Date getStartTime()
+ public MavenExecutionRequest setInteractive( boolean interactive )
{
- return startTime;
+ this.interactive = interactive;
+
+ return this;
}
- public boolean isShowErrors()
+ public MavenExecutionRequest setTransferListener( TransferListener transferListener )
{
- return showErrors;
+ this.transferListener = transferListener;
+
+ return this;
}
}
Modified: maven/components/branches/maven-embedder-refactor/maven-core/src/main/java/org/apache/maven/execution/MavenExecutionRequest.java
URL: http://svn.apache.org/viewcvs/maven/components/branches/maven-embedder-refactor/maven-core/src/main/java/org/apache/maven/execution/MavenExecutionRequest.java?rev=380897&r1=380896&r2=380897&view=diff
==============================================================================
--- maven/components/branches/maven-embedder-refactor/maven-core/src/main/java/org/apache/maven/execution/MavenExecutionRequest.java (original)
+++ maven/components/branches/maven-embedder-refactor/maven-core/src/main/java/org/apache/maven/execution/MavenExecutionRequest.java Fri Feb 24 21:45:28 2006
@@ -17,11 +17,11 @@
*/
import org.apache.maven.artifact.repository.ArtifactRepository;
-import org.apache.maven.monitor.event.EventDispatcher;
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 java.io.File;
import java.util.Date;
import java.util.List;
import java.util.Properties;
@@ -36,39 +36,73 @@
List getGoals();
- void setSession( MavenSession session );
-
- MavenSession getSession();
-
- void addEventMonitor( EventMonitor monitor );
-
- EventDispatcher getEventDispatcher();
-
Settings getSettings();
String getBaseDirectory();
- void setRecursive( boolean recursive );
-
boolean isRecursive();
- void setReactorActive( boolean reactorActive );
+ boolean isInteractive();
boolean isReactorActive();
- void setPomFile( String pomFile );
-
String getPomFile();
- void setFailureBehavior( String failureBehavior );
-
String getFailureBehavior();
- ProfileManager getGlobalProfileManager();
-
- Properties getExecutionProperties();
+ Properties getProperties();
Date getStartTime();
boolean isShowErrors();
+
+ List getEventMonitors();
+
+ List getActiveProfiles();
+
+ List getInactiveProfiles();
+
+ TransferListener getTransferListener();
+
+ // ----------------------------------------------------------------------
+ //
+ // ----------------------------------------------------------------------
+
+ MavenExecutionRequest setBasedir( File basedir );
+
+ MavenExecutionRequest setSettings( Settings settings );
+
+ MavenExecutionRequest setStartTime( Date start );
+
+ MavenExecutionRequest setGoals( List goals );
+
+ MavenExecutionRequest setLocalRepository( ArtifactRepository localRepository );
+
+ MavenExecutionRequest setProperties( Properties properties );
+
+ MavenExecutionRequest setFailureBehavior( String failureBehavior );
+
+ MavenExecutionRequest setSession( MavenSession session );
+
+ MavenExecutionRequest addActiveProfile( String profile );
+
+ MavenExecutionRequest addInactiveProfile( String profile );
+
+ MavenExecutionRequest addActiveProfiles( List profiles );
+
+ MavenExecutionRequest addInactiveProfiles( List profiles );
+
+ MavenExecutionRequest addEventMonitor( EventMonitor monitor );
+
+ MavenExecutionRequest setReactorActive( boolean reactorActive );
+
+ MavenExecutionRequest setPomFile( String pomFilename );
+
+ MavenExecutionRequest setRecursive( boolean recursive );
+
+ MavenExecutionRequest setShowErrors( boolean showErrors );
+
+ MavenExecutionRequest setInteractive( boolean interactive );
+
+ MavenExecutionRequest setTransferListener( TransferListener transferListener );
}
Modified: maven/components/branches/maven-embedder-refactor/maven-core/src/main/resources/META-INF/plexus/components.xml
URL: http://svn.apache.org/viewcvs/maven/components/branches/maven-embedder-refactor/maven-core/src/main/resources/META-INF/plexus/components.xml?rev=380897&r1=380896&r2=380897&view=diff
==============================================================================
--- maven/components/branches/maven-embedder-refactor/maven-core/src/main/resources/META-INF/plexus/components.xml (original)
+++ maven/components/branches/maven-embedder-refactor/maven-core/src/main/resources/META-INF/plexus/components.xml Fri Feb 24 21:45:28 2006
@@ -83,6 +83,9 @@
<requirement>
<role>org.apache.maven.execution.RuntimeInformation</role>
</requirement>
+ <requirement>
+ <role>org.apache.maven.artifact.manager.WagonManager</role>
+ </requirement>
</requirements>
</component>
Modified: maven/components/branches/maven-embedder-refactor/maven-monitor/src/main/java/org/apache/maven/monitor/event/DefaultEventDispatcher.java
URL: http://svn.apache.org/viewcvs/maven/components/branches/maven-embedder-refactor/maven-monitor/src/main/java/org/apache/maven/monitor/event/DefaultEventDispatcher.java?rev=380897&r1=380896&r2=380897&view=diff
==============================================================================
--- maven/components/branches/maven-embedder-refactor/maven-monitor/src/main/java/org/apache/maven/monitor/event/DefaultEventDispatcher.java (original)
+++ maven/components/branches/maven-embedder-refactor/maven-monitor/src/main/java/org/apache/maven/monitor/event/DefaultEventDispatcher.java Fri Feb 24 21:45:28 2006
@@ -10,8 +10,21 @@
public class DefaultEventDispatcher
implements EventDispatcher
{
-
private List eventMonitors = new ArrayList();
+
+ public DefaultEventDispatcher()
+ {
+ }
+
+ public DefaultEventDispatcher( List eventMonitors )
+ {
+ this.eventMonitors = eventMonitors;
+ }
+
+ public void addEventMonitors( List eventMonitors )
+ {
+ this.eventMonitors = eventMonitors;
+ }
public void addEventMonitor( EventMonitor monitor )
{
Modified: maven/components/branches/maven-embedder-refactor/maven-settings/src/main/java/org/apache/maven/settings/DefaultMavenSettingsBuilder.java
URL: http://svn.apache.org/viewcvs/maven/components/branches/maven-embedder-refactor/maven-settings/src/main/java/org/apache/maven/settings/DefaultMavenSettingsBuilder.java?rev=380897&r1=380896&r2=380897&view=diff
==============================================================================
--- maven/components/branches/maven-embedder-refactor/maven-settings/src/main/java/org/apache/maven/settings/DefaultMavenSettingsBuilder.java (original)
+++ maven/components/branches/maven-embedder-refactor/maven-settings/src/main/java/org/apache/maven/settings/DefaultMavenSettingsBuilder.java Fri Feb 24 21:45:28 2006
@@ -189,7 +189,11 @@
private void setLocalRepository( Settings userSettings )
{
// try using the local repository specified on the command line...
- String localRepository = System.getProperty( MavenSettingsBuilder.ALT_LOCAL_REPOSITORY_LOCATION );
+ //String localRepository = System.getProperty( MavenSettingsBuilder.ALT_LOCAL_REPOSITORY_LOCATION );
+
+ String localRepository = null;
+
+ System.out.println( "from the system localRepository = " + localRepository );
// otherwise, use the one in settings.xml
if ( localRepository == null || localRepository.length() < 1 )