Author: jvanzyl
Date: Sun Dec 31 16:18:12 2006
New Revision: 491512

URL: http://svn.apache.org/viewvc?view=rev&rev=491512
Log:
MNG-2728 return a MavenExecutionResult from Maven.execute( request )

Modified:
    
maven/components/trunk/maven-cli/src/main/java/org/apache/maven/cli/MavenCli.java
    
maven/components/trunk/maven-core/src/main/java/org/apache/maven/DefaultMaven.java
    maven/components/trunk/maven-core/src/main/java/org/apache/maven/Maven.java
    
maven/components/trunk/maven-core/src/main/java/org/apache/maven/execution/DefaultMavenExecutionResult.java
    
maven/components/trunk/maven-core/src/main/java/org/apache/maven/execution/MavenExecutionResult.java
    
maven/components/trunk/maven-core/src/main/java/org/apache/maven/execution/ReactorManager.java
    maven/components/trunk/maven-embedder/pom.xml
    
maven/components/trunk/maven-embedder/src/main/java/org/apache/maven/embedder/MavenEmbedder.java
    
maven/components/trunk/maven-embedder/src/main/java/org/apache/maven/embedder/execution/DefaultMavenExecutionRequestDefaultsPopulator.java
    
maven/components/trunk/maven-embedder/src/test/java/org/apache/maven/embedder/MavenEmbedderTest.java

Modified: 
maven/components/trunk/maven-cli/src/main/java/org/apache/maven/cli/MavenCli.java
URL: 
http://svn.apache.org/viewvc/maven/components/trunk/maven-cli/src/main/java/org/apache/maven/cli/MavenCli.java?view=diff&rev=491512&r1=491511&r2=491512
==============================================================================
--- 
maven/components/trunk/maven-cli/src/main/java/org/apache/maven/cli/MavenCli.java
 (original)
+++ 
maven/components/trunk/maven-cli/src/main/java/org/apache/maven/cli/MavenCli.java
 Sun Dec 31 16:18:12 2006
@@ -23,7 +23,7 @@
 import org.apache.maven.embedder.MavenEmbedderException;
 import org.apache.maven.execution.DefaultMavenExecutionRequest;
 import org.apache.maven.execution.MavenExecutionRequest;
-import org.apache.maven.reactor.MavenExecutionException;
+import org.apache.maven.execution.MavenExecutionResult;
 import org.codehaus.plexus.classworlds.ClassWorld;
 
 import java.io.File;
@@ -177,8 +177,6 @@
         //
         // 
----------------------------------------------------------------------
 
-        try
-        {
             List goals = commandLine.getArgList();
 
             boolean recursive = true;
@@ -295,48 +293,11 @@
                 alternatePomFile = commandLine.getOptionValue( 
CLIManager.ALTERNATE_POM_FILE );
             }
 
-            // 
----------------------------------------------------------------------
-            // From here we are CLI free
-            // 
----------------------------------------------------------------------
-
-            //  -> baseDirectory
-            //  -> goals
-            //  -> debug: use to set the threshold on the logger manager
-            //  -> active profiles (settings)
-            //  -> inactive profiles (settings)
-            //  -> offline (settings)
-            //  -> interactive (settings)
-            //  -> Settings
-            //     -> localRepository
-            //     -> interactiveMode
-            //     -> usePluginRegistry
-            //     -> offline
-            //     -> proxies
-            //     -> servers
-            //     -> mirrors
-            //     -> profiles
-            //     -> activeProfiles
-            //     -> pluginGroups
-            //  -> executionProperties
-            //  -> reactorFailureBehaviour: fail fast, fail at end, fail never
-            //  -> globalChecksumPolicy: fail, warn
-            //  -> showErrors (this is really CLI is but used inside Maven 
internals
-            //  -> recursive
-            //  -> updateSnapshots
-            //  -> useReactor
-            //  -> transferListener: in the CLI this is batch or console
-
             // We have a general problem with plexus components that are 
singletons in that they use
             // the same logger for their lifespan. This is not good in that 
many requests may be fired
             // 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.
 
-            // the local repository should just be a path and we should look 
here:
-            // in the system property
-            // user specified settings.xml
-            // default ~/.m2/settings.xml
-            // and with that maven internals should contruct the 
ArtifactRepository object
-
             int loggingLevel;
 
             if ( debug )
@@ -382,11 +343,11 @@
                 .setNoSnapshotUpdates( noSnapshotUpdates ) // default: false
                 .setGlobalChecksumPolicy( globalChecksumPolicy ); // default: 
warn
 
-            mavenEmbedder.execute( request );
-        }
-        catch ( MavenExecutionException e )
-        {
-            showFatalError( "Unable to configure the Maven application", e, 
showErrors );
+        MavenExecutionResult result = mavenEmbedder.execute( request );
+
+        if ( result.hasExceptions() )
+        {                        
+            showFatalError( "Unable to configure the Maven application", 
(Exception) result.getExceptions().get( 0 ), showErrors );
 
             return 1;
         }

Modified: 
maven/components/trunk/maven-core/src/main/java/org/apache/maven/DefaultMaven.java
URL: 
http://svn.apache.org/viewvc/maven/components/trunk/maven-core/src/main/java/org/apache/maven/DefaultMaven.java?view=diff&rev=491512&r1=491511&r2=491512
==============================================================================
--- 
maven/components/trunk/maven-core/src/main/java/org/apache/maven/DefaultMaven.java
 (original)
+++ 
maven/components/trunk/maven-core/src/main/java/org/apache/maven/DefaultMaven.java
 Sun Dec 31 16:18:12 2006
@@ -29,7 +29,6 @@
 import org.apache.maven.execution.MavenSession;
 import org.apache.maven.execution.ReactorManager;
 import org.apache.maven.execution.RuntimeInformation;
-import org.apache.maven.lifecycle.LifecycleExecutionException;
 import org.apache.maven.lifecycle.LifecycleExecutor;
 import org.apache.maven.monitor.event.DefaultEventDispatcher;
 import org.apache.maven.monitor.event.DefaultEventMonitor;
@@ -44,14 +43,10 @@
 import org.apache.maven.project.MavenProjectBuilder;
 import org.apache.maven.project.ProjectBuildingException;
 import org.apache.maven.reactor.MavenExecutionException;
-import org.apache.maven.settings.Mirror;
-import org.apache.maven.settings.Proxy;
-import org.apache.maven.settings.Server;
 import org.apache.maven.settings.Settings;
 import org.apache.maven.usability.diagnostics.ErrorDiagnostics;
 import org.codehaus.plexus.PlexusConstants;
 import org.codehaus.plexus.PlexusContainer;
-import 
org.codehaus.plexus.component.repository.exception.ComponentLifecycleException;
 import 
org.codehaus.plexus.component.repository.exception.ComponentLookupException;
 import org.codehaus.plexus.context.Context;
 import org.codehaus.plexus.context.ContextException;
@@ -63,7 +58,6 @@
 import 
org.codehaus.plexus.personality.plexus.lifecycle.phase.InitializationException;
 import org.codehaus.plexus.util.FileUtils;
 import org.codehaus.plexus.util.dag.CycleDetectedException;
-import org.codehaus.plexus.util.xml.Xpp3Dom;
 
 import java.io.File;
 import java.io.IOException;
@@ -104,7 +98,7 @@
     protected LoggerManager loggerManager;
 
     protected MavenTools mavenTools;
-    
+
     protected ArtifactRepositoryFactory artifactRepositoryFactory;
 
     private static final long MB = 1024 * 1024;
@@ -118,17 +112,16 @@
     // ----------------------------------------------------------------------
 
     public MavenExecutionResult execute( MavenExecutionRequest request )
-        throws MavenExecutionException
-    {        
+    {
         Logger logger = loggerManager.getLoggerForComponent( Mojo.ROLE );
-                
+
         if ( request.getEventMonitors() == null )
         {
             request.addEventMonitor( new DefaultEventMonitor( logger ) );
         }
 
         loggerManager.setThreshold( request.getLoggingLevel() );
-                
+
         wagonManager.setInteractive( request.isInteractiveMode() );
 
         wagonManager.setDownloadMonitor( request.getTransferListener() );
@@ -143,59 +136,36 @@
 
         dispatcher.dispatchStart( event, request.getBaseDirectory() );
 
-        ReactorManager rm;
-
-        try
-        {
-            rm = doExecute( request, dispatcher );
-        }
-        catch ( LifecycleExecutionException e )
-        {
-            dispatcher.dispatchError( event, request.getBaseDirectory(), e );
-
-            logError( e, request.isShowErrors() );
-
-            stats( request.getStartTime() );
+        MavenExecutionResult result;
 
-            line();
+        result = doExecute( request, dispatcher );
 
-            throw new MavenExecutionException( e.getMessage(), e );
-        }
-        catch ( BuildFailureException e )
+        if ( result.hasExceptions() )
         {
-            dispatcher.dispatchError( event, request.getBaseDirectory(), e );
-
-            logFailure( e, request.isShowErrors() );
-
-            stats( request.getStartTime() );
-
-            line();
-
-            throw new MavenExecutionException( e.getMessage(), e );
-        }
-        catch ( Throwable t )
-        {
-            dispatcher.dispatchError( event, request.getBaseDirectory(), t );
+            for ( Iterator i = result.getExceptions().iterator(); i.hasNext(); 
)
+            {
+                Exception e = (Exception) i.next();
 
-            logFatal( t );
+                dispatcher.dispatchError( event, request.getBaseDirectory(), e 
);
 
-            stats( request.getStartTime() );
+                logError( e, request.isShowErrors() );
 
-            line();
+                stats( request.getStartTime() );
 
-            throw new MavenExecutionException( "Error executing project within 
the reactor", t );
+                line();
+            }
         }
 
         // Either the build was successful, or it was a fail_at_end/fail_never 
reactor build
 
         // TODO: should all the logging be left to the CLI?
-        logReactorSummary( rm );
+        logReactorSummary( result.getReactorManager() );
 
-        if ( rm.hasBuildFailures() )
+        if ( result.getReactorManager().hasBuildFailures() )
         {
-            logErrors( rm, request.isShowErrors() );
+            logErrors( result.getReactorManager(), request.isShowErrors() );
 
-            if ( !ReactorManager.FAIL_NEVER.equals( rm.getFailureBehavior() ) )
+            if ( !result.getReactorManager().FAIL_NEVER.equals( 
result.getReactorManager().getFailureBehavior() ) )
             {
                 dispatcher.dispatchError( event, request.getBaseDirectory(), 
null );
 
@@ -207,7 +177,7 @@
 
                 line();
 
-                throw new MavenExecutionException( "Some builds failed" );
+                return new DefaultMavenExecutionResult( 
Collections.singletonList( new MavenExecutionException( "Some builds failed" ) 
) );
             }
             else
             {
@@ -215,18 +185,19 @@
             }
         }
 
-        logSuccess( rm );
+        logSuccess( result.getReactorManager() );
 
         stats( request.getStartTime() );
 
         line();
 
-        dispatcher.dispatchEnd( event, request.getBaseDirectory() );           
     
+        dispatcher.dispatchEnd( event, request.getBaseDirectory() );
 
-        return new DefaultMavenExecutionResult( rm.getTopLevelProject(), null 
);
+        return new DefaultMavenExecutionResult( result.getReactorManager() );
     }
 
-    private void logErrors( ReactorManager rm, boolean showErrors )
+    private void logErrors( ReactorManager rm,
+                            boolean showErrors )
     {
         for ( Iterator it = rm.getSortedProjects().iterator(); it.hasNext(); )
         {
@@ -255,9 +226,11 @@
         }
     }
 
-    private ReactorManager doExecute( MavenExecutionRequest request, 
EventDispatcher dispatcher )
-        throws MavenExecutionException, BuildFailureException, 
LifecycleExecutionException
+    private MavenExecutionResult doExecute( MavenExecutionRequest request,
+                                            EventDispatcher dispatcher )
     {
+        List executionExceptions = new ArrayList();
+
         ProfileManager globalProfileManager = new DefaultProfileManager( 
container, request.getProperties() );
 
         globalProfileManager.loadSettingsProfiles( request.getSettings() );
@@ -269,14 +242,29 @@
         getLogger().info( "Scanning for projects..." );
 
         boolean foundProjects = true;
-        List projects = getProjects( request, globalProfileManager );
-        if ( projects.isEmpty() )
+
+        List projects;
+
+        try
+        {
+            projects = getProjects( request, globalProfileManager );
+
+            if ( projects.isEmpty() )
+            {
+                projects.add( getSuperProject( request ) );
+
+                foundProjects = false;
+            }
+        }
+        catch ( Exception e )
         {
-            projects.add( getSuperProject( request ) );
-            foundProjects = false;
+            executionExceptions.add( e );
+
+            return new DefaultMavenExecutionResult( executionExceptions );
         }
 
         ReactorManager rm;
+
         try
         {
             rm = new ReactorManager( projects );
@@ -290,12 +278,16 @@
         }
         catch ( CycleDetectedException e )
         {
-            throw new BuildFailureException(
-                "The projects in the reactor contain a cyclic reference: " + 
e.getMessage(), e );
+            executionExceptions.add( new BuildFailureException(
+                "The projects in the reactor contain a cyclic reference: " + 
e.getMessage(), e ) );
+
+            return new DefaultMavenExecutionResult( executionExceptions );
         }
         catch ( DuplicateProjectException e )
         {
-            throw new BuildFailureException( e.getMessage(), e );
+            executionExceptions.add( new BuildFailureException( 
e.getMessage(), e ) );
+
+            return new DefaultMavenExecutionResult( executionExceptions );
         }
 
         if ( rm.hasMultipleProjects() )
@@ -305,6 +297,7 @@
             for ( Iterator i = rm.getSortedProjects().iterator(); i.hasNext(); 
)
             {
                 MavenProject project = (MavenProject) i.next();
+
                 getLogger().info( "  " + project.getName() );
             }
         }
@@ -313,9 +306,16 @@
 
         session.setUsingPOMsFromFilesystem( foundProjects );
 
-        lifecycleExecutor.execute( session, rm, dispatcher );
+        try
+        {
+            lifecycleExecutor.execute( session, rm, dispatcher );
+        }
+        catch ( Exception e )
+        {
+            executionExceptions.add( new BuildFailureException( 
e.getMessage(), e ) );
+        }
 
-        return rm;
+        return new DefaultMavenExecutionResult( executionExceptions, rm );
     }
 
     private MavenProject getSuperProject( MavenExecutionRequest request )
@@ -324,8 +324,9 @@
         MavenProject superProject;
         try
         {
-            superProject = projectBuilder.buildStandaloneSuperProject( 
request.getLocalRepository(), 
-                                                   new DefaultProfileManager( 
container, request.getProperties()) );
+            superProject = projectBuilder.buildStandaloneSuperProject( 
request.getLocalRepository(),
+                                                                       new 
DefaultProfileManager( container,
+                                                                               
                   request.getProperties() ) );
 
         }
         catch ( ProjectBuildingException e )
@@ -335,7 +336,8 @@
         return superProject;
     }
 
-    private List getProjects( MavenExecutionRequest request, ProfileManager 
globalProfileManager )
+    private List getProjects( MavenExecutionRequest request,
+                              ProfileManager globalProfileManager )
         throws MavenExecutionException, BuildFailureException
     {
         List projects;
@@ -343,12 +345,8 @@
         {
             List files = getProjectFiles( request );
 
-            projects = collectProjects( files,
-                                        request.getLocalRepository(),
-                                        request.isRecursive(),
-                                        request.getSettings(),
-                                        globalProfileManager,
-                                        !request.useReactor() );
+            projects = collectProjects( files, request.getLocalRepository(), 
request.isRecursive(),
+                                        request.getSettings(), 
globalProfileManager, !request.useReactor() );
 
         }
         catch ( IOException e )
@@ -370,12 +368,15 @@
         return projects;
     }
 
-    private void logReactorSummaryLine( String name, String status )
+    private void logReactorSummaryLine( String name,
+                                        String status )
     {
         logReactorSummaryLine( name, status, -1 );
     }
 
-    private void logReactorSummaryLine( String name, String status, long time )
+    private void logReactorSummaryLine( String name,
+                                        String status,
+                                        long time )
     {
         StringBuffer messageBuffer = new StringBuffer();
 
@@ -424,8 +425,12 @@
         return fmt.format( new Date( time ) );
     }
 
-    private List collectProjects( List files, ArtifactRepository 
localRepository, boolean recursive, Settings settings,
-                                  ProfileManager globalProfileManager, boolean 
isRoot )
+    private List collectProjects( List files,
+                                  ArtifactRepository localRepository,
+                                  boolean recursive,
+                                  Settings settings,
+                                  ProfileManager globalProfileManager,
+                                  boolean isRoot )
         throws ArtifactResolutionException, ProjectBuildingException, 
ProfileActivationException,
         MavenExecutionException, BuildFailureException
     {
@@ -498,7 +503,9 @@
         return projects;
     }
 
-    public MavenProject getProject( File pom, ArtifactRepository 
localRepository, Settings settings,
+    public MavenProject getProject( File pom,
+                                    ArtifactRepository localRepository,
+                                    Settings settings,
                                     ProfileManager globalProfileManager )
         throws ProjectBuildingException, ArtifactResolutionException, 
ProfileActivationException
     {
@@ -523,15 +530,12 @@
     // the session type would be specific to the request i.e. having a project
     // or not.
 
-    protected MavenSession createSession( MavenExecutionRequest request, 
ReactorManager rpm, EventDispatcher dispatcher )
+    protected MavenSession createSession( MavenExecutionRequest request,
+                                          ReactorManager rpm,
+                                          EventDispatcher dispatcher )
     {
-        return new MavenSession( container,
-                                 request.getSettings(),
-                                 request.getLocalRepository(),
-                                 dispatcher,
-                                 rpm, request.getGoals(),
-                                 request.getBaseDirectory(),
-                                 request.getProperties(),
+        return new MavenSession( container, request.getSettings(), 
request.getLocalRepository(), dispatcher, rpm,
+                                 request.getGoals(), 
request.getBaseDirectory(), request.getProperties(),
                                  request.getStartTime() );
     }
 
@@ -557,7 +561,7 @@
             throw new InitializationException( "Cannot lookup logger 
manager.", e );
         }
     }
-    
+
     // ----------------------------------------------------------------------
     // Reporting / Logging
     // ----------------------------------------------------------------------
@@ -575,7 +579,8 @@
         logTrace( error, true );
     }
 
-    protected void logError( Exception e, boolean showErrors )
+    protected void logError( Exception e,
+                             boolean showErrors )
     {
         line();
 
@@ -595,7 +600,8 @@
         }
     }
 
-    protected void logFailure( BuildFailureException e, boolean showErrors )
+    protected void logFailure( BuildFailureException e,
+                               boolean showErrors )
     {
         line();
 
@@ -608,7 +614,8 @@
         logTrace( e, showErrors );
     }
 
-    private void logTrace( Throwable t, boolean showErrors )
+    private void logTrace( Throwable t,
+                           boolean showErrors )
     {
         if ( getLogger().isDebugEnabled() )
         {
@@ -717,7 +724,7 @@
     {
         getLogger().info( 
"------------------------------------------------------------------------" );
     }
-    
+
     protected static String formatTime( long ms )
     {
         long secs = ms / MS_PER_SEC;

Modified: 
maven/components/trunk/maven-core/src/main/java/org/apache/maven/Maven.java
URL: 
http://svn.apache.org/viewvc/maven/components/trunk/maven-core/src/main/java/org/apache/maven/Maven.java?view=diff&rev=491512&r1=491511&r2=491512
==============================================================================
--- maven/components/trunk/maven-core/src/main/java/org/apache/maven/Maven.java 
(original)
+++ maven/components/trunk/maven-core/src/main/java/org/apache/maven/Maven.java 
Sun Dec 31 16:18:12 2006
@@ -48,6 +48,5 @@
 
     static final int LOGGING_LEVEL_DISABLE = 5;
 
-    MavenExecutionResult execute( MavenExecutionRequest request )
-        throws MavenExecutionException;
+    MavenExecutionResult execute( MavenExecutionRequest request );
 }

Modified: 
maven/components/trunk/maven-core/src/main/java/org/apache/maven/execution/DefaultMavenExecutionResult.java
URL: 
http://svn.apache.org/viewvc/maven/components/trunk/maven-core/src/main/java/org/apache/maven/execution/DefaultMavenExecutionResult.java?view=diff&rev=491512&r1=491511&r2=491512
==============================================================================
--- 
maven/components/trunk/maven-core/src/main/java/org/apache/maven/execution/DefaultMavenExecutionResult.java
 (original)
+++ 
maven/components/trunk/maven-core/src/main/java/org/apache/maven/execution/DefaultMavenExecutionResult.java
 Sun Dec 31 16:18:12 2006
@@ -3,16 +3,34 @@
 import org.apache.maven.project.MavenProject;
 
 import java.util.List;
+import java.util.ArrayList;
 
-/**
- * @author Jason van Zyl
- */
+/** @author Jason van Zyl */
 public class DefaultMavenExecutionResult
     implements MavenExecutionResult
 {
+    private List exceptions;
+
     private MavenProject mavenProject;
 
-    private List exceptions;
+    private ReactorManager reactorManager;
+
+    public DefaultMavenExecutionResult( List exceptions )
+    {
+        this.exceptions = exceptions;
+    }
+
+    public DefaultMavenExecutionResult( ReactorManager reactorManager )
+    {
+        this.reactorManager = reactorManager;
+    }
+
+    public DefaultMavenExecutionResult( List exceptions,
+                                        ReactorManager reactorManager )
+    {
+        this.reactorManager = reactorManager;
+        this.exceptions = exceptions;
+    }
 
     public DefaultMavenExecutionResult( MavenProject project,
                                         List exceptions )
@@ -23,11 +41,36 @@
 
     public MavenProject getMavenProject()
     {
+        if ( reactorManager != null )
+        {
+            return reactorManager.getTopLevelProject();
+        }
+
         return mavenProject;
     }
 
+    public ReactorManager getReactorManager()
+    {
+        return reactorManager;
+    }
+
     public List getExceptions()
     {
         return exceptions;
+    }
+
+    public void addException( Throwable t )
+    {
+        if ( exceptions == null )
+        {
+            exceptions = new ArrayList();
+        }
+
+        exceptions.add( t );
+    }
+
+    public boolean hasExceptions()
+    {
+        return (exceptions != null && exceptions.size() > 0 );
     }
 }

Modified: 
maven/components/trunk/maven-core/src/main/java/org/apache/maven/execution/MavenExecutionResult.java
URL: 
http://svn.apache.org/viewvc/maven/components/trunk/maven-core/src/main/java/org/apache/maven/execution/MavenExecutionResult.java?view=diff&rev=491512&r1=491511&r2=491512
==============================================================================
--- 
maven/components/trunk/maven-core/src/main/java/org/apache/maven/execution/MavenExecutionResult.java
 (original)
+++ 
maven/components/trunk/maven-core/src/main/java/org/apache/maven/execution/MavenExecutionResult.java
 Sun Dec 31 16:18:12 2006
@@ -11,10 +11,16 @@
 {
     MavenProject getMavenProject();
 
+    ReactorManager getReactorManager();
+
     // for each exception
     // - knowing what artifacts are missing
     // - project building exception
     // - invalid project model exception: list of markers
     // - xmlpull parser exception
     List getExceptions();
+
+    void addException( Throwable t );
+
+    boolean hasExceptions();
 }

Modified: 
maven/components/trunk/maven-core/src/main/java/org/apache/maven/execution/ReactorManager.java
URL: 
http://svn.apache.org/viewvc/maven/components/trunk/maven-core/src/main/java/org/apache/maven/execution/ReactorManager.java?view=diff&rev=491512&r1=491511&r2=491512
==============================================================================
--- 
maven/components/trunk/maven-core/src/main/java/org/apache/maven/execution/ReactorManager.java
 (original)
+++ 
maven/components/trunk/maven-core/src/main/java/org/apache/maven/execution/ReactorManager.java
 Sun Dec 31 16:18:12 2006
@@ -63,6 +63,7 @@
         if ( pluginContextsByKey == null )
         {
             pluginContextsByKey = new HashMap();
+
             pluginContextsByProjectAndPluginKey.put( project.getId(), 
pluginContextsByKey );
         }
 

Modified: maven/components/trunk/maven-embedder/pom.xml
URL: 
http://svn.apache.org/viewvc/maven/components/trunk/maven-embedder/pom.xml?view=diff&rev=491512&r1=491511&r2=491512
==============================================================================
--- maven/components/trunk/maven-embedder/pom.xml (original)
+++ maven/components/trunk/maven-embedder/pom.xml Sun Dec 31 16:18:12 2006
@@ -27,7 +27,7 @@
   <artifactId>maven-embedder</artifactId>
   <name>Maven Embedder</name>
   <properties>
-    <bundleVersion>2.1.0.v20061231-1402</bundleVersion>
+    <bundleVersion>2.1.0.v20061231-1908</bundleVersion>
   </properties>
   <build>
     <resources>

Modified: 
maven/components/trunk/maven-embedder/src/main/java/org/apache/maven/embedder/MavenEmbedder.java
URL: 
http://svn.apache.org/viewvc/maven/components/trunk/maven-embedder/src/main/java/org/apache/maven/embedder/MavenEmbedder.java?view=diff&rev=491512&r1=491511&r2=491512
==============================================================================
--- 
maven/components/trunk/maven-embedder/src/main/java/org/apache/maven/embedder/MavenEmbedder.java
 (original)
+++ 
maven/components/trunk/maven-embedder/src/main/java/org/apache/maven/embedder/MavenEmbedder.java
 Sun Dec 31 16:18:12 2006
@@ -537,7 +537,6 @@
     // ----------------------------------------------------------------------
 
     public MavenExecutionResult execute( MavenExecutionRequest request )
-        throws MavenExecutionException
     {
         try
         {
@@ -545,7 +544,7 @@
         }
         catch ( MavenEmbedderException e )
         {
-            throw new MavenExecutionException( "Error populating request with 
default values.", e );
+            return new DefaultMavenExecutionResult( Collections.singletonList( 
e ) );
         }
 
         return maven.execute( request );

Modified: 
maven/components/trunk/maven-embedder/src/main/java/org/apache/maven/embedder/execution/DefaultMavenExecutionRequestDefaultsPopulator.java
URL: 
http://svn.apache.org/viewvc/maven/components/trunk/maven-embedder/src/main/java/org/apache/maven/embedder/execution/DefaultMavenExecutionRequestDefaultsPopulator.java?view=diff&rev=491512&r1=491511&r2=491512
==============================================================================
--- 
maven/components/trunk/maven-embedder/src/main/java/org/apache/maven/embedder/execution/DefaultMavenExecutionRequestDefaultsPopulator.java
 (original)
+++ 
maven/components/trunk/maven-embedder/src/main/java/org/apache/maven/embedder/execution/DefaultMavenExecutionRequestDefaultsPopulator.java
 Sun Dec 31 16:18:12 2006
@@ -39,16 +39,12 @@
     public MavenExecutionRequest populateDefaults(MavenExecutionRequest 
request)
         throws MavenEmbedderException
     {
-        // Settings        
-        // Local repository  
-        // TransferListener
-        // EventMonitor
-               // Proxy
-
                // Settings
-               
+
         if ( request.getSettings() == null )
         {
+            // A local repository set in the request should win over what's in 
a settings.xml file.
+
             File userSettingsPath = mavenTools.getUserSettingsPath( 
request.getSettingsFile() );
 
             File globalSettingsFile = mavenTools.getGlobalSettingsPath();

Modified: 
maven/components/trunk/maven-embedder/src/test/java/org/apache/maven/embedder/MavenEmbedderTest.java
URL: 
http://svn.apache.org/viewvc/maven/components/trunk/maven-embedder/src/test/java/org/apache/maven/embedder/MavenEmbedderTest.java?view=diff&rev=491512&r1=491511&r2=491512
==============================================================================
--- 
maven/components/trunk/maven-embedder/src/test/java/org/apache/maven/embedder/MavenEmbedderTest.java
 (original)
+++ 
maven/components/trunk/maven-embedder/src/test/java/org/apache/maven/embedder/MavenEmbedderTest.java
 Sun Dec 31 16:18:12 2006
@@ -54,7 +54,7 @@
     // Goal/Phase execution tests
     // ----------------------------------------------------------------------
 
-    public void xtestPhaseExecution()
+    public void testPhaseExecution()
         throws Exception
     {
         File testDirectory = new File( basedir, 
"src/test/embedder-test-project" );


Reply via email to