maven-m2-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdca...@apache.org
Subject cvs commit: maven-components/maven-plugin-tools/maven-plugin-tools-java/src/main/java/org/apache/maven/tools/plugin/extractor/java JavaMojoDescriptorExtractor.java
Date Fri, 04 Mar 2005 09:04:27 GMT
jdcasey     2005/03/04 01:04:27

  Modified:    maven-plugins/maven-war-plugin/src/main/java/org/apache/maven/plugin/war
                        ExplodedMojo.java WarMojo.java
               maven-mboot2/src/main/java MBoot.java
               maven-core/src/main/java/org/apache/maven/execution
                        MavenExecutionRequest.java
                        MavenProjectExecutionRequest.java MavenSession.java
                        MavenReactorExecutionRequest.java
                        MavenInitializingExecutionRequest.java
                        AbstractMavenExecutionRequest.java
               maven-plugins/maven-clean-plugin/src/main/java/org/apache/maven/plugin/clean
                        CleanPlugin.java
               maven-plugin-tools/maven-plugin-tools-api/src/main/java/org/apache/maven/tools/plugin/generator
                        PluginDescriptorGenerator.java
               maven-core/src/main/java/org/apache/maven/plugin
                        DefaultPluginManager.java
               maven-plugin pom.xml
               maven-plugin-tools/maven-plugin-tools-java/src/test/java/org/apache/maven/tools/plugin/extractor/java
                        JavaMojoDescriptorExtractorTest.java
               maven-core/src/test/java/org/apache/maven MavenTestCase.java
               maven-plugins pom.xml
               maven-plugin-tools/maven-plugin-tools-marmalade/src/main/java/org/apache/maven/tools/plugin/extractor/marmalade
                        MarmaladeMojoDescriptorExtractor.java
               maven-plugin-tools/maven-plugin-tools-marmalade pom.xml
               maven-core pom.xml
               maven-core/src/main/java/org/apache/maven DefaultMaven.java
               maven-plugins/maven-clean-plugin pom.xml
               maven-plugin-tools/maven-plugin-tools-marmalade/src/test/java/org/apache/maven/tools/plugin/extractor/marmalade
                        MarmaladeMojoDescriptorExtractorTest.java
               maven-script pom.xml
               maven-script/maven-script-marmalade/src/test/java/org/apache/maven/script/marmalade
                        MarmaladeMojoTest.java
               maven-core/src/main/java/org/apache/maven/cli MavenCli.java
               maven-script/maven-script-marmalade/src/main/java/org/apache/maven/script/marmalade/tags
                        MetadataTag.java MojoTag.java ExecuteTag.java
               maven-plugin/src/main/java/org/apache/maven/plugin
                        PluginExecutionRequest.java
               maven-script/maven-script-marmalade pom.xml
               maven-plugin-tools/maven-plugin-tools-api/src/main/java/org/apache/maven/tools/plugin/extractor
                        AbstractScriptedMojoDescriptorExtractor.java
               maven-plugins/maven-compiler-plugin/src/main/java/org/apache/maven/plugin
                        CompilerMojo.java
               maven-core/src/main/java/org/apache/maven/lifecycle
                        DefaultLifecycleExecutor.java
               maven-plugins/maven-war-plugin pom.xml
               maven-plugins/maven-compiler-plugin pom.xml
               maven-plugin-tools/maven-plugin-tools-java/src/main/java/org/apache/maven/tools/plugin/extractor/java
                        JavaMojoDescriptorExtractor.java
  Added:       maven-monitor/src/main/java/org/apache/maven/monitor/logging
                        SystemStreamLog.java Log.java
               maven-monitor/src/main/java/org/apache/maven/monitor/event
                        EventDispatcher.java EventMonitor.java
                        DefaultEventDispatcher.java
                        AbstractSelectiveEventMonitor.java MavenEvents.java
               maven-core/src/main/java/org/apache/maven/monitor/logging
                        DefaultLog.java
               maven-core/src/main/java/org/apache/maven/monitor/event
                        DefaultEventMonitor.java
               maven-monitor pom.xml
  Log:
  o Added first-pass logging and event-monitoring impls. Converted all System.out calls in maven-component plugins to use logger.
  
  Revision  Changes    Path
  1.2       +2 -2      maven-components/maven-plugins/maven-war-plugin/src/main/java/org/apache/maven/plugin/war/ExplodedMojo.java
  
  Index: ExplodedMojo.java
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-plugins/maven-war-plugin/src/main/java/org/apache/maven/plugin/war/ExplodedMojo.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ExplodedMojo.java	3 Mar 2005 09:04:36 -0000	1.1
  +++ ExplodedMojo.java	4 Mar 2005 09:04:14 -0000	1.2
  @@ -114,7 +114,7 @@
           // ----------------------------------------------------------------------
           //
           // ----------------------------------------------------------------------
  -System.out.println("webapp");
  +        request.getLog().info("webapp");
   
       }
   }
  \ No newline at end of file
  
  
  
  1.2       +2 -2      maven-components/maven-plugins/maven-war-plugin/src/main/java/org/apache/maven/plugin/war/WarMojo.java
  
  Index: WarMojo.java
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-plugins/maven-war-plugin/src/main/java/org/apache/maven/plugin/war/WarMojo.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- WarMojo.java	3 Mar 2005 11:21:57 -0000	1.1
  +++ WarMojo.java	4 Mar 2005 09:04:14 -0000	1.2
  @@ -114,7 +114,7 @@
           // ----------------------------------------------------------------------
           //
           // ----------------------------------------------------------------------
  -System.out.println("war");
  +        request.getLog().info("war");
   
       }
   }
  
  
  
  1.55      +1 -0      maven-components/maven-mboot2/src/main/java/MBoot.java
  
  Index: MBoot.java
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-mboot2/src/main/java/MBoot.java,v
  retrieving revision 1.54
  retrieving revision 1.55
  diff -u -r1.54 -r1.55
  --- MBoot.java	3 Mar 2005 09:04:36 -0000	1.54
  +++ MBoot.java	4 Mar 2005 09:04:14 -0000	1.55
  @@ -78,6 +78,7 @@
   
       String[] builds = new String[] {
           "maven-model",
  +        "maven-monitor",
           "maven-plugin",
           "maven-artifact",
           "maven-script/maven-script-marmalade",
  
  
  
  1.1                  maven-components/maven-monitor/src/main/java/org/apache/maven/monitor/logging/SystemStreamLog.java
  
  Index: SystemStreamLog.java
  ===================================================================
  package org.apache.maven.monitor.logging;
  
  import java.io.PrintWriter;
  import java.io.StringWriter;
  
  /**
   * @author jdcasey
   */
  public class SystemStreamLog
      implements Log
  {
  
      public void debug( CharSequence content )
      {
          print( "debug", content );
      }
  
      public void debug( CharSequence content, Throwable error )
      {
          print( "debug", content, error );
      }
  
      public void debug( Throwable error )
      {
          print( "debug", error );
      }
  
      public void info( CharSequence content )
      {
          print( "info", content );
      }
  
      public void info( CharSequence content, Throwable error )
      {
          print( "info", content, error );
      }
  
      public void info( Throwable error )
      {
          print( "info", error );
      }
  
      public void warn( CharSequence content )
      {
          print( "warn", content );
      }
  
      public void warn( CharSequence content, Throwable error )
      {
          print( "warn", content, error );
      }
  
      public void warn( Throwable error )
      {
          print( "warn", error );
      }
  
      public void error( CharSequence content )
      {
          System.err.println( "[error] " + content.toString() );
      }
  
      public void error( CharSequence content, Throwable error )
      {
          StringWriter sWriter = new StringWriter();
          PrintWriter pWriter = new PrintWriter( sWriter );
  
          error.printStackTrace( pWriter );
  
          System.err.println( "[error] " + content.toString() + "\n\n" + sWriter.toString() );
      }
  
      public void error( Throwable error )
      {
          StringWriter sWriter = new StringWriter();
          PrintWriter pWriter = new PrintWriter( sWriter );
  
          error.printStackTrace( pWriter );
  
          System.err.println( "[error] " + sWriter.toString() );
      }
  
      private void print( String prefix, CharSequence content )
      {
          System.out.println( "[" + prefix + "] " + content.toString() );
      }
  
      private void print( String prefix, Throwable error )
      {
          StringWriter sWriter = new StringWriter();
          PrintWriter pWriter = new PrintWriter( sWriter );
  
          error.printStackTrace( pWriter );
  
          System.out.println( "[" + prefix + "] " + sWriter.toString() );
      }
  
      private void print( String prefix, CharSequence content, Throwable error )
      {
          StringWriter sWriter = new StringWriter();
          PrintWriter pWriter = new PrintWriter( sWriter );
  
          error.printStackTrace( pWriter );
  
          System.out.println( "[" + prefix + "] " + content.toString() + "\n\n" + sWriter.toString() );
      }
  
  }
  
  
  1.1                  maven-components/maven-monitor/src/main/java/org/apache/maven/monitor/logging/Log.java
  
  Index: Log.java
  ===================================================================
  package org.apache.maven.monitor.logging;
  
  /**
   * @author jdcasey
   */
  public interface Log
  {
  
      void debug( CharSequence content );
  
      void debug( CharSequence content, Throwable error );
  
      void debug( Throwable error );
  
      void info( CharSequence content );
  
      void info( CharSequence content, Throwable error );
  
      void info( Throwable error );
  
      void warn( CharSequence content );
  
      void warn( CharSequence content, Throwable error );
  
      void warn( Throwable error );
  
      void error( CharSequence content );
  
      void error( CharSequence content, Throwable error );
  
      void error( Throwable error );
  
  }
  
  
  1.7       +11 -0     maven-components/maven-core/src/main/java/org/apache/maven/execution/MavenExecutionRequest.java
  
  Index: MavenExecutionRequest.java
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-core/src/main/java/org/apache/maven/execution/MavenExecutionRequest.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- MavenExecutionRequest.java	1 Mar 2005 07:05:32 -0000	1.6
  +++ MavenExecutionRequest.java	4 Mar 2005 09:04:14 -0000	1.7
  @@ -18,6 +18,9 @@
    */
   
   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.monitor.logging.Log;
   
   import java.io.IOException;
   import java.util.List;
  @@ -41,4 +44,12 @@
       MavenSession getSession();
   
       List getProjectFiles() throws IOException;
  +
  +    void setLog( Log log );
  +    
  +    Log getLog();
  +
  +    void addEventMonitor( EventMonitor monitor );
  +    
  +    EventDispatcher getEventDispatcher();
   }
  
  
  
  1.3       +4 -2      maven-components/maven-core/src/main/java/org/apache/maven/execution/MavenProjectExecutionRequest.java
  
  Index: MavenProjectExecutionRequest.java
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-core/src/main/java/org/apache/maven/execution/MavenProjectExecutionRequest.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- MavenProjectExecutionRequest.java	1 Mar 2005 07:05:32 -0000	1.2
  +++ MavenProjectExecutionRequest.java	4 Mar 2005 09:04:14 -0000	1.3
  @@ -18,6 +18,7 @@
    */
   
   import org.apache.maven.artifact.repository.ArtifactRepository;
  +import org.apache.maven.monitor.event.EventDispatcher;
   
   import java.io.File;
   import java.util.ArrayList;
  @@ -34,11 +35,12 @@
       private File pom;
   
       public MavenProjectExecutionRequest( ArtifactRepository localRepository,
  +                                         EventDispatcher eventDispatcher,
                                            Properties properties,
                                            List goals,
                                            File pom )
       {
  -        super( localRepository, properties, goals );
  +        super( localRepository, eventDispatcher, properties, goals );
   
           this.pom = pom;
   
  
  
  
  1.4       +23 -1     maven-components/maven-core/src/main/java/org/apache/maven/execution/MavenSession.java
  
  Index: MavenSession.java
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-core/src/main/java/org/apache/maven/execution/MavenSession.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- MavenSession.java	1 Mar 2005 06:43:12 -0000	1.3
  +++ MavenSession.java	4 Mar 2005 09:04:14 -0000	1.4
  @@ -20,6 +20,8 @@
   import org.apache.maven.artifact.repository.ArtifactRepository;
   import org.apache.maven.model.PostGoal;
   import org.apache.maven.model.PreGoal;
  +import org.apache.maven.monitor.event.EventDispatcher;
  +import org.apache.maven.monitor.logging.Log;
   import org.apache.maven.plugin.PluginManager;
   import org.apache.maven.project.MavenProject;
   import org.apache.maven.repository.RepositoryUtils;
  @@ -61,9 +63,15 @@
   
       private Map postGoalMappings;
   
  +    private EventDispatcher eventDispatcher;
  +
  +    private Log log;
  +
       public MavenSession( PlexusContainer container,
                            PluginManager pluginManager,
                            ArtifactRepository localRepository,
  +                         EventDispatcher eventDispatcher,
  +                         Log log,
                            List goals )
       {
           this.container = container;
  @@ -72,6 +80,10 @@
   
           this.localRepository = localRepository;
   
  +        this.eventDispatcher = eventDispatcher;
  +        
  +        this.log = log;
  +
           this.dag = new DAG();
   
           this.goals = goals;
  @@ -158,6 +170,16 @@
               }
           }
       }
  +    
  +    public EventDispatcher getEventDispatcher()
  +    {
  +        return eventDispatcher;
  +    }
  +    
  +    public Log getLog()
  +    {
  +        return log;
  +    }
   
       //!! this should probably not be done here as there are request types that
       // have no project
  
  
  
  1.4       +7 -5      maven-components/maven-core/src/main/java/org/apache/maven/execution/MavenReactorExecutionRequest.java
  
  Index: MavenReactorExecutionRequest.java
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-core/src/main/java/org/apache/maven/execution/MavenReactorExecutionRequest.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- MavenReactorExecutionRequest.java	1 Mar 2005 07:05:32 -0000	1.3
  +++ MavenReactorExecutionRequest.java	4 Mar 2005 09:04:14 -0000	1.4
  @@ -18,6 +18,7 @@
    */
   
   import org.apache.maven.artifact.repository.ArtifactRepository;
  +import org.apache.maven.monitor.event.EventDispatcher;
   import org.apache.maven.project.MavenProject;
   import org.codehaus.plexus.util.FileUtils;
   
  @@ -39,10 +40,11 @@
   
       private File baseDirectory;
   
  -    public MavenReactorExecutionRequest( ArtifactRepository localRepository, Properties properties, List goals,
  -                                         String includes, String excludes, File baseDirectory )
  +    public MavenReactorExecutionRequest( ArtifactRepository localRepository, EventDispatcher eventDispatcher, 
  +                                         Properties properties, List goals, String includes, 
  +                                         String excludes, File baseDirectory )
       {
  -        super( localRepository, properties, goals );
  +        super( localRepository, eventDispatcher, properties, goals );
   
           this.includes = includes;
   
  @@ -76,6 +78,6 @@
   
       public MavenProjectExecutionRequest createProjectExecutionRequest( MavenProject project )
       {
  -        return new MavenProjectExecutionRequest( localRepository, parameters, goals, project.getFile() );
  +        return new MavenProjectExecutionRequest( localRepository, getEventDispatcher(), parameters, goals, project.getFile() );
       }
   }
  
  
  
  1.3       +4 -3      maven-components/maven-core/src/main/java/org/apache/maven/execution/MavenInitializingExecutionRequest.java
  
  Index: MavenInitializingExecutionRequest.java
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-core/src/main/java/org/apache/maven/execution/MavenInitializingExecutionRequest.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- MavenInitializingExecutionRequest.java	1 Mar 2005 07:05:32 -0000	1.2
  +++ MavenInitializingExecutionRequest.java	4 Mar 2005 09:04:14 -0000	1.3
  @@ -18,6 +18,7 @@
    */
   
   import org.apache.maven.artifact.repository.ArtifactRepository;
  +import org.apache.maven.monitor.event.EventDispatcher;
   
   import java.util.List;
   import java.util.Properties;
  @@ -29,9 +30,9 @@
   public class MavenInitializingExecutionRequest
   extends AbstractMavenExecutionRequest
   {
  -    public MavenInitializingExecutionRequest( ArtifactRepository localRepository, Properties properties, List goals )
  +    public MavenInitializingExecutionRequest( ArtifactRepository localRepository, EventDispatcher eventDispatcher, Properties properties, List goals )
       {
  -        super( localRepository, properties, goals );
  +        super( localRepository, eventDispatcher, properties, goals );
   
           type = "initializing";
       }
  
  
  
  1.8       +33 -3     maven-components/maven-core/src/main/java/org/apache/maven/execution/AbstractMavenExecutionRequest.java
  
  Index: AbstractMavenExecutionRequest.java
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-core/src/main/java/org/apache/maven/execution/AbstractMavenExecutionRequest.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- AbstractMavenExecutionRequest.java	16 Feb 2005 07:16:32 -0000	1.7
  +++ AbstractMavenExecutionRequest.java	4 Mar 2005 09:04:14 -0000	1.8
  @@ -18,7 +18,10 @@
    */
   
   import org.apache.maven.artifact.repository.ArtifactRepository;
  -import org.apache.maven.project.MavenProject;
  +import org.apache.maven.monitor.event.DefaultEventDispatcher;
  +import org.apache.maven.monitor.event.EventDispatcher;
  +import org.apache.maven.monitor.event.EventMonitor;
  +import org.apache.maven.monitor.logging.Log;
   
   import java.util.List;
   import java.util.Properties;
  @@ -41,13 +44,19 @@
   
       protected MavenSession session;
   
  -    public AbstractMavenExecutionRequest( ArtifactRepository localRepository, Properties parameters, List goals )
  +    private Log log;
  +    
  +    private EventDispatcher eventDispatcher;
  +
  +    public AbstractMavenExecutionRequest( ArtifactRepository localRepository, EventDispatcher eventDispatcher, Properties parameters, List goals )
       {
           this.localRepository = localRepository;
   
           this.parameters = parameters;
   
           this.goals = goals;
  +        
  +        this.eventDispatcher = eventDispatcher;
       }
   
       public ArtifactRepository getLocalRepository()
  @@ -83,4 +92,25 @@
       {
           this.session = session;
       }
  +    
  +    public void setLog(Log log)
  +    {
  +        this.log = log;
  +    }
  +    
  +    public Log getLog()
  +    {
  +        return log;
  +    }
  +    
  +    public void addEventMonitor(EventMonitor monitor)
  +    {
  +        eventDispatcher.addEventMonitor(monitor);
  +    }
  +    
  +    public EventDispatcher getEventDispatcher()
  +    {
  +        return eventDispatcher;
  +    }
  +    
   }
  
  
  
  1.3       +26 -11    maven-components/maven-plugins/maven-clean-plugin/src/main/java/org/apache/maven/plugin/clean/CleanPlugin.java
  
  Index: CleanPlugin.java
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-plugins/maven-clean-plugin/src/main/java/org/apache/maven/plugin/clean/CleanPlugin.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- CleanPlugin.java	14 Jun 2004 15:13:12 -0000	1.2
  +++ CleanPlugin.java	4 Mar 2005 09:04:15 -0000	1.3
  @@ -16,6 +16,7 @@
    * limitations under the License.
    */
   
  +import org.apache.maven.monitor.logging.Log;
   import org.apache.maven.plugin.AbstractPlugin;
   import org.apache.maven.plugin.PluginExecutionRequest;
   import org.apache.maven.plugin.PluginExecutionResponse;
  @@ -47,23 +48,37 @@
   
       private boolean failOnError;
   
  +    private Log log;
  +
       public void execute( PluginExecutionRequest request, PluginExecutionResponse response )
           throws Exception
       {
  -        outputDirectory = (String) request.getParameter( "outputDirectory" );
  -
  -        failOnError = Boolean.valueOf( (String) request.getParameter( "failedOnError" ) ).booleanValue();
  -        
  -        if ( outputDirectory != null )
  +        try
           {
  -            File dir = new File( outputDirectory );
  +            outputDirectory = (String) request.getParameter( "outputDirectory" );
   
  -            if ( dir.exists() && dir.isDirectory() )
  +            failOnError = Boolean.valueOf( (String) request.getParameter( "failedOnError" ) ).booleanValue();
  +            
  +            log = request.getLog();
  +
  +            if ( outputDirectory != null )
               {
  -                log( "Deleting directory " + dir.getAbsolutePath() );
  -                removeDir( dir );
  +                File dir = new File( outputDirectory );
  +
  +                if ( dir.exists() && dir.isDirectory() )
  +                {
  +                    log( "Deleting directory " + dir.getAbsolutePath() );
  +                    removeDir( dir );
  +                }
               }
           }
  +        finally
  +        {
  +            // clean up state.
  +            failOnError = false;
  +            outputDirectory = null;
  +            log = null;
  +        }
       }
   
       /**
  @@ -148,6 +163,6 @@
   
       private void log( String message )
       {
  -        System.out.println( message );
  +        log.info( message );
       }
   }
  
  
  
  1.5       +3 -3      maven-components/maven-plugin-tools/maven-plugin-tools-api/src/main/java/org/apache/maven/tools/plugin/generator/PluginDescriptorGenerator.java
  
  Index: PluginDescriptorGenerator.java
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-plugin-tools/maven-plugin-tools-api/src/main/java/org/apache/maven/tools/plugin/generator/PluginDescriptorGenerator.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- PluginDescriptorGenerator.java	27 Feb 2005 05:39:55 -0000	1.4
  +++ PluginDescriptorGenerator.java	4 Mar 2005 09:04:15 -0000	1.5
  @@ -117,15 +117,15 @@
           w.writeText( mojoDescriptor.getImplementation() );
   
           w.endElement();
  -        
  +
           // ----------------------------------------------------------------------
           //
           // ----------------------------------------------------------------------
   
           w.startElement( "language" );
  -        
  +
           w.writeText( mojoDescriptor.getLanguage() );
  -        
  +
           w.endElement();
   
           // ----------------------------------------------------------------------
  
  
  
  1.39      +24 -3     maven-components/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginManager.java
  
  Index: DefaultPluginManager.java
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginManager.java,v
  retrieving revision 1.38
  retrieving revision 1.39
  diff -u -r1.38 -r1.39
  --- DefaultPluginManager.java	3 Mar 2005 11:42:30 -0000	1.38
  +++ DefaultPluginManager.java	4 Mar 2005 09:04:16 -0000	1.39
  @@ -29,6 +29,8 @@
   import org.apache.maven.artifact.resolver.filter.ExclusionSetFilter;
   import org.apache.maven.execution.MavenSession;
   import org.apache.maven.lifecycle.goal.GoalExecutionException;
  +import org.apache.maven.monitor.event.EventDispatcher;
  +import org.apache.maven.monitor.event.MavenEvents;
   import org.apache.maven.plugin.descriptor.MojoDescriptor;
   import org.apache.maven.plugin.descriptor.Parameter;
   import org.apache.maven.plugin.descriptor.PluginDescriptor;
  @@ -279,9 +281,11 @@
   
           try
           {
  -            getLogger().info( "[" + mojoDescriptor.getId() + "]" );
  +//            getLogger().info( "[" + mojoDescriptor.getId() + "]" );
   
               request = new PluginExecutionRequest( DefaultPluginManager.createParameters( mojoDescriptor, session ) );
  +
  +            request.setLog( session.getLog() );
           }
           catch ( PluginConfigurationException e )
           {
  @@ -295,8 +299,25 @@
           try
           {
               plugin = (Plugin) container.lookup( Plugin.ROLE, goalName );
  +            
  +            // !! This is ripe for refactoring to an aspect.
  +            // Event monitoring.
  +            String event = MavenEvents.MOJO_EXECUTION;
  +            EventDispatcher dispatcher = session.getEventDispatcher();
   
  -            plugin.execute( request, response );
  +            dispatcher.dispatchStart( event, goalName );
  +            try
  +            {
  +                plugin.execute( request, response );
  +                
  +                dispatcher.dispatchEnd( event, goalName );
  +            }
  +            catch(Exception e)
  +            {
  +                session.getEventDispatcher().dispatchError( event, goalName, e );
  +                throw e;
  +            }
  +            // End event monitoring.
   
               releaseComponents( mojoDescriptor, request );
   
  @@ -455,7 +476,7 @@
       public void initialize()
       {
           artifactFilter = new ExclusionSetFilter( new String[]{"maven-core", "maven-artifact", "maven-model",
  -                                                              "maven-plugin", "plexus-container-api",
  +                                                              "maven-monitor", "maven-plugin", "plexus-container-api",
                                                                 "plexus-container-default", "plexus-artifact-container",
                                                                 "classworlds"} );
   
  
  
  
  1.4       +5 -0      maven-components/maven-plugin/pom.xml
  
  Index: pom.xml
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-plugin/pom.xml,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- pom.xml	24 Oct 2004 18:13:54 -0000	1.3
  +++ pom.xml	4 Mar 2005 09:04:16 -0000	1.4
  @@ -13,6 +13,11 @@
     <version>2.0-SNAPSHOT</version>
     <dependencies>
       <dependency>
  +      <groupId>maven</groupId>
  +      <artifactId>maven-monitor</artifactId>
  +      <version>2.0-SNAPSHOT</version>
  +    </dependency>
  +    <dependency>
         <groupId>qdox</groupId>
         <artifactId>qdox</artifactId>
         <version>1.2</version>
  
  
  
  1.1                  maven-components/maven-monitor/src/main/java/org/apache/maven/monitor/event/EventDispatcher.java
  
  Index: EventDispatcher.java
  ===================================================================
  package org.apache.maven.monitor.event;
  
  /**
   * @author jdcasey
   */
  public interface EventDispatcher
  {
  
      void addEventMonitor( EventMonitor monitor );
  
      void dispatchStart( String event, String target );
  
      void dispatchEnd( String event, String target );
  
      void dispatchError( String event, String target, Throwable cause );
  
  }
  
  
  1.1                  maven-components/maven-monitor/src/main/java/org/apache/maven/monitor/event/EventMonitor.java
  
  Index: EventMonitor.java
  ===================================================================
  package org.apache.maven.monitor.event;
  
  /**
   * @author jdcasey
   */
  public interface EventMonitor
  {
  
      void startEvent( String eventName, String target, long timestamp );
      
      void endEvent( String eventName, String target, long timestamp );
      
      void errorEvent( String eventName, String target, long timestamp, Throwable cause ); 
  
  }
  
  
  1.1                  maven-components/maven-monitor/src/main/java/org/apache/maven/monitor/event/DefaultEventDispatcher.java
  
  Index: DefaultEventDispatcher.java
  ===================================================================
  package org.apache.maven.monitor.event;
  
  import java.util.ArrayList;
  import java.util.Iterator;
  import java.util.List;
  
  /**
   * @author jdcasey
   */
  public class DefaultEventDispatcher
      implements EventDispatcher
  {
  
      private List eventMonitors = new ArrayList();
  
      public void addEventMonitor( EventMonitor monitor )
      {
          eventMonitors.add( monitor );
      }
  
      public void dispatchStart( String event, String target )
      {
          for ( Iterator it = eventMonitors.iterator(); it.hasNext(); )
          {
              EventMonitor monitor = (EventMonitor) it.next();
              monitor.startEvent( event, target, System.currentTimeMillis() );
          }
      }
  
      public void dispatchEnd( String event, String target )
      {
          for ( Iterator it = eventMonitors.iterator(); it.hasNext(); )
          {
              EventMonitor monitor = (EventMonitor) it.next();
              monitor.endEvent( event, target, System.currentTimeMillis() );
          }
      }
  
      public void dispatchError( String event, String target, Throwable cause )
      {
          for ( Iterator it = eventMonitors.iterator(); it.hasNext(); )
          {
              EventMonitor monitor = (EventMonitor) it.next();
              monitor.errorEvent( event, target, System.currentTimeMillis(), cause );
          }
      }
  
  }
  
  
  1.1                  maven-components/maven-monitor/src/main/java/org/apache/maven/monitor/event/AbstractSelectiveEventMonitor.java
  
  Index: AbstractSelectiveEventMonitor.java
  ===================================================================
  package org.apache.maven.monitor.event;
  
  import java.util.Arrays;
  import java.util.List;
  
  /**
   * @author jdcasey
   */
  public abstract class AbstractSelectiveEventMonitor
      implements EventMonitor
  {
      
      private List boundStartEvents;
      private List boundErrorEvents;
      private List boundEndEvents;
  
      protected AbstractSelectiveEventMonitor(String[] startEvents, String[] endEvents, String[] errorEvents)
      {
          this.boundStartEvents = Arrays.asList( startEvents );
          
          this.boundEndEvents = Arrays.asList( endEvents );
          
          this.boundErrorEvents = Arrays.asList( errorEvents );
      }
  
      public final void startEvent( String eventName, String target, long timestamp )
      {
          if( boundStartEvents.contains( eventName ) )
          {
              doStartEvent( eventName, target, timestamp );
          }
      }
      
      protected void doStartEvent( String eventName, String target, long timestamp )
      {
      }
  
      public final void endEvent( String eventName, String target, long timestamp )
      {
          if( boundEndEvents.contains( eventName ) )
          {
              doEndEvent( eventName, target, timestamp );
          }
      }
  
      protected void doEndEvent( String eventName, String target, long timestamp )
      {
      }
  
      public final void errorEvent( String eventName, String target, long timestamp, Throwable cause )
      {
          if( boundErrorEvents.contains( eventName ) )
          {
              doErrorEvent( eventName, target, timestamp, cause );
          }
      }
  
      protected void doErrorEvent( String eventName, String target, long timestamp, Throwable cause )
      {
      }
  
  }
  
  
  
  1.1                  maven-components/maven-monitor/src/main/java/org/apache/maven/monitor/event/MavenEvents.java
  
  Index: MavenEvents.java
  ===================================================================
  package org.apache.maven.monitor.event;
  
  /**
   * @author jdcasey
   */
  public final class MavenEvents
  {
  
      public static final String PHASE_EXECUTION = "phase-execute";
      public static final String MOJO_EXECUTION = "mojo-execute";
      public static final String PROJECT_EXECUTION = "project-execute";
      public static final String REACTOR_EXECUTION = "reactor-execute";
      
      public static final String[] ALL_EVENTS = {
          PHASE_EXECUTION,
          MOJO_EXECUTION,
          PROJECT_EXECUTION,
          REACTOR_EXECUTION
      };
      
      public static final String[] NO_EVENTS = {};
      
      private MavenEvents()
      {
      }
  
  }
  
  
  1.4       +7 -7      maven-components/maven-plugin-tools/maven-plugin-tools-java/src/test/java/org/apache/maven/tools/plugin/extractor/java/JavaMojoDescriptorExtractorTest.java
  
  Index: JavaMojoDescriptorExtractorTest.java
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-plugin-tools/maven-plugin-tools-java/src/test/java/org/apache/maven/tools/plugin/extractor/java/JavaMojoDescriptorExtractorTest.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- JavaMojoDescriptorExtractorTest.java	1 Mar 2005 02:43:22 -0000	1.3
  +++ JavaMojoDescriptorExtractorTest.java	4 Mar 2005 09:04:18 -0000	1.4
  @@ -41,18 +41,18 @@
           System.out.println( "found source file: " + sourceFile );
   
           File dir = sourceFile.getParentFile();
  -        
  +
           Model model = new Model();
           model.setArtifactId( "maven-unitTesting-plugin" );
  -        
  +
           Build build = new Build();
  -        build.setSourceDirectory(new File(dir, "source").getPath());
  -        
  -        model.setBuild(build);
  +        build.setSourceDirectory( new File( dir, "source" ).getPath() );
  +
  +        model.setBuild( build );
   
           MavenProject project = new MavenProject( model );
  -        
  -        project.setFile(new File(dir, "pom.xml"));
  +
  +        project.setFile( new File( dir, "pom.xml" ) );
   
           Set results = extractor.execute( project );
           assertEquals( 2, results.size() );
  
  
  
  1.15      +7 -2      maven-components/maven-core/src/test/java/org/apache/maven/MavenTestCase.java
  
  Index: MavenTestCase.java
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-core/src/test/java/org/apache/maven/MavenTestCase.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- MavenTestCase.java	16 Feb 2005 07:16:33 -0000	1.14
  +++ MavenTestCase.java	4 Mar 2005 09:04:20 -0000	1.15
  @@ -22,6 +22,9 @@
   
   import org.apache.maven.artifact.repository.ArtifactRepository;
   import org.apache.maven.lifecycle.goal.MavenGoalExecutionContext;
  +import org.apache.maven.monitor.event.DefaultEventDispatcher;
  +import org.apache.maven.monitor.logging.DefaultLog;
  +import org.apache.maven.monitor.logging.Log;
   import org.apache.maven.execution.MavenSession;
   import org.apache.maven.plugin.PluginManager;
   import org.apache.maven.project.MavenProject;
  @@ -130,7 +133,9 @@
       {
           List goals = new ArrayList();
   
  -        MavenSession session = new MavenSession( getContainer(), pluginManager, localRepository, goals );
  +        Log log = new DefaultLog(getContainer().getLogger());
  +        
  +        MavenSession session = new MavenSession( getContainer(), pluginManager, localRepository, new DefaultEventDispatcher(), log, goals );
   
           session.setProject( project );
   
  
  
  
  1.14      +5 -0      maven-components/maven-plugins/pom.xml
  
  Index: pom.xml
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-plugins/pom.xml,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- pom.xml	14 Dec 2004 10:02:02 -0000	1.13
  +++ pom.xml	4 Mar 2005 09:04:20 -0000	1.14
  @@ -47,6 +47,11 @@
     <dependencies>
       <dependency>
         <groupId>maven</groupId>
  +      <artifactId>maven-monitor</artifactId>
  +      <version>2.0-SNAPSHOT</version>
  +    </dependency>
  +    <dependency>
  +      <groupId>maven</groupId>
         <artifactId>maven-plugin</artifactId>
         <version>2.0-SNAPSHOT</version>
       </dependency>
  
  
  
  1.5       +35 -34    maven-components/maven-plugin-tools/maven-plugin-tools-marmalade/src/main/java/org/apache/maven/tools/plugin/extractor/marmalade/MarmaladeMojoDescriptorExtractor.java
  
  Index: MarmaladeMojoDescriptorExtractor.java
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-plugin-tools/maven-plugin-tools-marmalade/src/main/java/org/apache/maven/tools/plugin/extractor/marmalade/MarmaladeMojoDescriptorExtractor.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- MarmaladeMojoDescriptorExtractor.java	1 Mar 2005 02:43:22 -0000	1.4
  +++ MarmaladeMojoDescriptorExtractor.java	4 Mar 2005 09:04:20 -0000	1.5
  @@ -44,7 +44,7 @@
   public class MarmaladeMojoDescriptorExtractor
       extends AbstractScriptedMojoDescriptorExtractor
   {
  -    
  +
       protected String getScriptFileExtension()
       {
           return ".mmld";
  @@ -55,42 +55,43 @@
           ClassLoader oldCl = Thread.currentThread().getContextClassLoader();
           try
           {
  -            Thread.currentThread().setContextClassLoader(MarmaladeMojoDescriptorExtractor.class.getClassLoader());
  -            
  +            Thread.currentThread().setContextClassLoader( MarmaladeMojoDescriptorExtractor.class.getClassLoader() );
  +
               Set descriptors = new HashSet();
  -            
  +
               for ( Iterator mapIterator = sourceFilesKeyedByBasedir.entrySet().iterator(); mapIterator.hasNext(); )
               {
                   Map.Entry entry = (Map.Entry) mapIterator.next();
  -                
  -                String basedir = (String)entry.getKey();
  -                Set scriptFiles = (Set)entry.getValue();
  -                
  +
  +                String basedir = (String) entry.getKey();
  +                Set scriptFiles = (Set) entry.getValue();
  +
                   for ( Iterator it = scriptFiles.iterator(); it.hasNext(); )
                   {
                       File scriptFile = (File) it.next();
  -                    
  -                    MarmaladeScript script = parse(scriptFile);
  -                    
  +
  +                    MarmaladeScript script = parse( scriptFile );
  +
                       MarmaladeTag rootTag = script.getRoot();
  -                    if(rootTag instanceof MojoTag)
  +                    if ( rootTag instanceof MojoTag )
                       {
                           Map contextMap = new TreeMap();
                           contextMap.put( MarmaladeMojoExecutionDirectives.SCRIPT_BASEPATH_INVAR, basedir );
  -                        
  -                        MarmaladeExecutionContext context = new DefaultContext(contextMap);
  -                        
  -                        script.execute(context);
  -                        
  +
  +                        MarmaladeExecutionContext context = new DefaultContext( contextMap );
  +
  +                        script.execute( context );
  +
                           contextMap = context.getExternalizedVariables();
  -    
  +
                           MojoDescriptor descriptor = (MojoDescriptor) contextMap.get( MarmaladeMojoExecutionDirectives.METADATA_OUTVAR );
  -    
  +
                           descriptors.add( descriptor );
                       }
                       else
                       {
  -                        System.out.println("This script is not a mojo. Its root tag is {element: " + rootTag.getTagInfo().getElement() + ", class: " + rootTag.getClass().getName() + "}");
  +                        System.out.println( "This script is not a mojo. Its root tag is {element: "
  +                            + rootTag.getTagInfo().getElement() + ", class: " + rootTag.getClass().getName() + "}" );
                       }
                   }
               }
  @@ -99,40 +100,40 @@
           }
           finally
           {
  -            Thread.currentThread().setContextClassLoader(oldCl);
  +            Thread.currentThread().setContextClassLoader( oldCl );
           }
       }
   
       private MarmaladeScript parse( File scriptFile ) throws Exception
       {
           BufferedReader reader = null;
  -        
  +
           try
           {
  -            reader = new BufferedReader(new FileReader(scriptFile));
  -            
  +            reader = new BufferedReader( new FileReader( scriptFile ) );
  +
               MarmaladeParsingContext parsingContext = new DefaultParsingContext();
  -            
  -            parsingContext.setInputLocation(scriptFile.getPath());
  -            parsingContext.setInput(reader);
  -            
  +
  +            parsingContext.setInputLocation( scriptFile.getPath() );
  +            parsingContext.setInput( reader );
  +
               ScriptParser parser = new ScriptParser();
  -            
  -            ScriptBuilder builder = parser.parse(parsingContext);
  -            
  +
  +            ScriptBuilder builder = parser.parse( parsingContext );
  +
               MarmaladeScript script = builder.build();
  -            
  +
               return script;
           }
           finally
           {
  -            if(reader != null)
  +            if ( reader != null )
               {
                   try
                   {
                       reader.close();
                   }
  -                catch(Exception e)
  +                catch ( Exception e )
                   {
                   }
               }
  
  
  
  1.4       +5 -0      maven-components/maven-plugin-tools/maven-plugin-tools-marmalade/pom.xml
  
  Index: pom.xml
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-plugin-tools/maven-plugin-tools-marmalade/pom.xml,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- pom.xml	28 Feb 2005 18:29:47 -0000	1.3
  +++ pom.xml	4 Mar 2005 09:04:20 -0000	1.4
  @@ -13,6 +13,11 @@
     <version>2.0-SNAPSHOT</version>
     <dependencies>
       <dependency>
  +      <groupId>maven</groupId>
  +      <artifactId>maven-monitor</artifactId>
  +      <version>2.0-SNAPSHOT</version>
  +    </dependency>
  +    <dependency>
         <groupId>plexus</groupId>
         <artifactId>plexus-container-default</artifactId>
         <version>1.0-alpha-2-SNAPSHOT</version>
  
  
  
  1.19      +5 -0      maven-components/maven-core/pom.xml
  
  Index: pom.xml
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-core/pom.xml,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- pom.xml	28 Feb 2005 18:29:47 -0000	1.18
  +++ pom.xml	4 Mar 2005 09:04:20 -0000	1.19
  @@ -23,6 +23,11 @@
       <!-- maven component -->
       <dependency>
         <groupId>maven</groupId>
  +      <artifactId>maven-monitor</artifactId>
  +      <version>2.0-SNAPSHOT</version>
  +    </dependency>
  +    <dependency>
  +      <groupId>maven</groupId>
         <artifactId>maven-model</artifactId>
         <version>2.0-SNAPSHOT</version>
       </dependency>
  
  
  
  1.22      +90 -53    maven-components/maven-core/src/main/java/org/apache/maven/DefaultMaven.java
  
  Index: DefaultMaven.java
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-core/src/main/java/org/apache/maven/DefaultMaven.java,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- DefaultMaven.java	1 Mar 2005 07:05:33 -0000	1.21
  +++ DefaultMaven.java	4 Mar 2005 09:04:21 -0000	1.22
  @@ -27,6 +27,8 @@
   import org.apache.maven.lifecycle.LifecycleExecutor;
   import org.apache.maven.lifecycle.goal.GoalNotFoundException;
   import org.apache.maven.lifecycle.session.MavenSessionPhaseManager;
  +import org.apache.maven.monitor.event.EventDispatcher;
  +import org.apache.maven.monitor.event.MavenEvents;
   import org.apache.maven.plugin.PluginManager;
   import org.apache.maven.project.MavenProject;
   import org.apache.maven.project.MavenProjectBuilder;
  @@ -103,7 +105,26 @@
   
           resolveParameters( request );
   
  -        MavenExecutionResponse response = lifecycleExecutor.execute( request.getGoals(), session );
  +        // !! This is ripe for refactoring to an aspect.
  +        // Event monitoring.
  +        EventDispatcher dispatcher = request.getEventDispatcher();
  +        String event = MavenEvents.PROJECT_EXECUTION;
  +        
  +        dispatcher.dispatchStart( event, project.getId() );
  +        
  +        MavenExecutionResponse response = null;
  +        try
  +        {
  +            // Actual meat of the code.
  +            response = lifecycleExecutor.execute( request.getGoals(), session );
  +            
  +            dispatcher.dispatchEnd( event, project.getId() );
  +        }
  +        catch(Exception e)
  +        {
  +            dispatcher.dispatchError( event, project.getId(), e );
  +        }
  +        // End event monitoring.
   
           // TODO: is this perhaps more appropriate in the CLI?
           if ( response.isExecutionFailure() )
  @@ -133,79 +154,95 @@
       public MavenExecutionResponse handleReactor( MavenReactorExecutionRequest request )
           throws ReactorException
       {
  -        List projects = new ArrayList();
  -
  -        getLogger().info( "Starting the reactor..." );
  -
  +        EventDispatcher dispatcher = request.getEventDispatcher();
  +        String event = MavenEvents.REACTOR_EXECUTION;
  +        
  +        dispatcher.dispatchStart( event, request.getBaseDirectory().getPath() );
           try
           {
  -            List files = request.getProjectFiles();
  +            List projects = new ArrayList();
  +
  +            getLogger().info( "Starting the reactor..." );
   
  -            for ( Iterator iterator = files.iterator(); iterator.hasNext(); )
  +            try
               {
  -                File file = (File) iterator.next();
  +                List files = request.getProjectFiles();
   
  -                MavenProject project = getProject( file, request.getLocalRepository() );
  +                for ( Iterator iterator = files.iterator(); iterator.hasNext(); )
  +                {
  +                    File file = (File) iterator.next();
   
  -                projects.add( project );
  -            }
  +                    MavenProject project = getProject( file, request.getLocalRepository() );
   
  -            projects = projectBuilder.getSortedProjects( projects );
  -        }
  -        catch ( IOException e )
  -        {
  -            throw new ReactorException( "Error processing projects for the reactor: ", e );
  -        }
  -        catch ( ProjectBuildingException e )
  -        {
  -            throw new ReactorException( "Error processing projects for the reactor: ", e );
  -        }
  -        catch ( CycleDetectedException e )
  -        {
  -            throw new ReactorException( "Error processing projects for the reactor: ", e );
  -        }
  +                    projects.add( project );
  +                }
   
  -        getLogger().info( "Our processing order:" );
  +                projects = projectBuilder.getSortedProjects( projects );
   
  -        for ( Iterator iterator = projects.iterator(); iterator.hasNext(); )
  -        {
  -            MavenProject project = (MavenProject) iterator.next();
  +            }
  +            catch ( IOException e )
  +            {
  +                throw new ReactorException( "Error processing projects for the reactor: ", e );
  +            }
  +            catch ( ProjectBuildingException e )
  +            {
  +                throw new ReactorException( "Error processing projects for the reactor: ", e );
  +            }
  +            catch ( CycleDetectedException e )
  +            {
  +                throw new ReactorException( "Error processing projects for the reactor: ", e );
  +            }
   
  -            getLogger().info( project.getName() );
  -        }
  +            getLogger().info( "Our processing order:" );
   
  -        for ( Iterator iterator = projects.iterator(); iterator.hasNext(); )
  -        {
  -            MavenProject project = (MavenProject) iterator.next();
  +            for ( Iterator iterator = projects.iterator(); iterator.hasNext(); )
  +            {
  +                MavenProject project = (MavenProject) iterator.next();
   
  -            System.out.println( "\n\n\n" );
  +                getLogger().info( project.getName() );
  +            }
   
  -            line();
  +            for ( Iterator iterator = projects.iterator(); iterator.hasNext(); )
  +            {
  +                MavenProject project = (MavenProject) iterator.next();
   
  -            getLogger().info( "Building " + project.getName() );
  +                System.out.println( "\n\n\n" );
   
  -            line();
  +                line();
   
  -            MavenProjectExecutionRequest projectExecutionRequest = request.createProjectExecutionRequest( project );
  +                getLogger().info( "Building " + project.getName() );
   
  -            try
  -            {
  -                MavenExecutionResponse response = handleProject( projectExecutionRequest );
  +                line();
   
  -                if ( response.isExecutionFailure() )
  +                MavenProjectExecutionRequest projectExecutionRequest = request.createProjectExecutionRequest( project );
  +
  +                try
                   {
  -                    return response;
  +                    MavenExecutionResponse response = handleProject( projectExecutionRequest );
  +
  +                    if ( response.isExecutionFailure() )
  +                    {
  +                        return response;
  +                    }
                   }
  +                catch ( Exception e )
  +                {
  +                    throw new ReactorException( "Error executing project within the reactor", e );
  +                }
  +
               }
  -            catch ( Exception e )
  -            {
  -                throw new ReactorException( "Error executing project within the reactor", e );
  -            }
  +            
  +            dispatcher.dispatchEnd( event, request.getBaseDirectory().getPath() );
   
  +            // TODO: not really satisfactory
  +            return null;
  +        }
  +        catch ( ReactorException e )
  +        {
  +            dispatcher.dispatchError( event, request.getBaseDirectory().getPath(), e );
  +            
  +            throw e;
           }
  -
  -        // TODO: not really satisfactory
  -        return null;
       }
   
       public MavenProject getProject( File pom, ArtifactRepository localRepository )
  @@ -232,7 +269,7 @@
   
       protected MavenSession createSession( MavenExecutionRequest request )
       {
  -        return new MavenSession( container, pluginManager, request.getLocalRepository(), request.getGoals() );
  +        return new MavenSession( container, pluginManager, request.getLocalRepository(), request.getEventDispatcher(), request.getLog(), request.getGoals() );
       }
   
       /**
  
  
  
  1.6       +7 -0      maven-components/maven-plugins/maven-clean-plugin/pom.xml
  
  Index: pom.xml
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-plugins/maven-clean-plugin/pom.xml,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- pom.xml	9 Aug 2004 19:10:10 -0000	1.5
  +++ pom.xml	4 Mar 2005 09:04:21 -0000	1.6
  @@ -14,4 +14,11 @@
     <version>1.0-SNAPSHOT</version>
     <inceptionYear>2001</inceptionYear>
     <package>org.apache.maven.plugin.clean</package>
  +  <dependencies>
  +    <dependency>
  +      <groupId>maven</groupId>
  +      <artifactId>maven-monitor</artifactId>
  +      <version>2.0-SNAPSHOT</version>
  +    </dependency>
  +  </dependencies>
   </project>
  
  
  
  1.4       +11 -10    maven-components/maven-plugin-tools/maven-plugin-tools-marmalade/src/test/java/org/apache/maven/tools/plugin/extractor/marmalade/MarmaladeMojoDescriptorExtractorTest.java
  
  Index: MarmaladeMojoDescriptorExtractorTest.java
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-plugin-tools/maven-plugin-tools-marmalade/src/test/java/org/apache/maven/tools/plugin/extractor/marmalade/MarmaladeMojoDescriptorExtractorTest.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- MarmaladeMojoDescriptorExtractorTest.java	1 Mar 2005 02:43:22 -0000	1.3
  +++ MarmaladeMojoDescriptorExtractorTest.java	4 Mar 2005 09:04:21 -0000	1.4
  @@ -41,21 +41,22 @@
   
           Model model = new Model();
           model.setArtifactId( "testArtifactId" );
  -        
  +
           Build build = new Build();
  -        
  +
           Resource resource = new Resource();
  -        resource.setDirectory(basedir.getPath());
  -        
  -        build.addResource(resource);
  -        
  -        model.setBuild(build);
  +        resource.setDirectory( basedir.getPath() );
  +
  +        build.addResource( resource );
  +
  +        model.setBuild( build );
   
           MavenProject project = new MavenProject( model );
  -        
  -        project.setFile(new File(basedir, "pom.xml"));
   
  -        MarmaladeMojoDescriptorExtractor extractor = (MarmaladeMojoDescriptorExtractor) lookup(MojoDescriptorExtractor.ROLE, "marmalade");
  +        project.setFile( new File( basedir, "pom.xml" ) );
  +
  +        MarmaladeMojoDescriptorExtractor extractor = (MarmaladeMojoDescriptorExtractor) lookup( MojoDescriptorExtractor.ROLE,
  +                                                                                                "marmalade" );
   
           Set descriptors = extractor.execute( project );
   
  
  
  
  1.2       +5 -0      maven-components/maven-script/pom.xml
  
  Index: pom.xml
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-script/pom.xml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- pom.xml	20 Feb 2005 16:25:21 -0000	1.1
  +++ pom.xml	4 Mar 2005 09:04:21 -0000	1.2
  @@ -14,6 +14,11 @@
     <dependencies>
       <dependency>
         <groupId>maven</groupId>
  +      <artifactId>maven-monitor</artifactId>
  +      <version>2.0-SNAPSHOT</version>
  +    </dependency>
  +    <dependency>
  +      <groupId>maven</groupId>
         <artifactId>maven-plugin</artifactId>
         <version>2.0-SNAPSHOT</version>
       </dependency>
  
  
  
  1.3       +4 -4      maven-components/maven-script/maven-script-marmalade/src/test/java/org/apache/maven/script/marmalade/MarmaladeMojoTest.java
  
  Index: MarmaladeMojoTest.java
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-script/maven-script-marmalade/src/test/java/org/apache/maven/script/marmalade/MarmaladeMojoTest.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- MarmaladeMojoTest.java	25 Feb 2005 05:09:14 -0000	1.2
  +++ MarmaladeMojoTest.java	4 Mar 2005 09:04:21 -0000	1.3
  @@ -51,15 +51,15 @@
           MarmaladeMojo mojo = new MarmaladeMojo( script );
   
           PluginExecutionRequest request = new PluginExecutionRequest( Collections.EMPTY_MAP );
  -        request.setParameters(Collections.singletonMap("param", "paramValue"));
  -        
  +        request.setParameters( Collections.singletonMap( "param", "paramValue" ) );
  +
           PluginExecutionResponse response = new PluginExecutionResponse();
   
           mojo.execute( request, response );
   
           Object result = request.getContextValue( "testvar" );
  -        
  -        assertEquals("paramValue/testval", result);
  +
  +        assertEquals( "paramValue/testval", result );
       }
   
   }
  \ No newline at end of file
  
  
  
  1.13      +19 -2     maven-components/maven-core/src/main/java/org/apache/maven/cli/MavenCli.java
  
  Index: MavenCli.java
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-core/src/main/java/org/apache/maven/cli/MavenCli.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- MavenCli.java	1 Mar 2005 06:43:12 -0000	1.12
  +++ MavenCli.java	4 Mar 2005 09:04:22 -0000	1.13
  @@ -33,8 +33,13 @@
   import org.apache.maven.execution.MavenInitializingExecutionRequest;
   import org.apache.maven.execution.MavenProjectExecutionRequest;
   import org.apache.maven.execution.MavenReactorExecutionRequest;
  +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.monitor.logging.DefaultLog;
   import org.codehaus.classworlds.ClassWorld;
   import org.codehaus.plexus.embed.ArtifactEnabledEmbedder;
  +import org.codehaus.plexus.logging.Logger;
   
   import java.io.File;
   import java.io.FileInputStream;
  @@ -108,6 +113,8 @@
           MavenExecutionRequest request = null;
   
           File projectFile = new File( userDir, POMv4 );
  +        
  +        EventDispatcher eventDispatcher = new DefaultEventDispatcher();
   
           if ( projectFile.exists() )
           {
  @@ -118,6 +125,7 @@
                   String excludes = System.getProperty( "maven.reactor.excludes", POMv4 );
   
                   request = new MavenReactorExecutionRequest( localRepository,
  +                                                            eventDispatcher,
                                                               mavenProperties,
                                                               commandLine.getArgList(),
                                                               includes,
  @@ -127,6 +135,7 @@
               else
               {
                   request = new MavenProjectExecutionRequest( localRepository,
  +                                                            eventDispatcher,
                                                               mavenProperties,
                                                               commandLine.getArgList(),
                                                               projectFile );
  @@ -134,7 +143,7 @@
           }
           else
           {
  -            request = new MavenInitializingExecutionRequest( localRepository, mavenProperties, commandLine.getArgList() );
  +            request = new MavenInitializingExecutionRequest( localRepository, eventDispatcher, mavenProperties, commandLine.getArgList() );
           }
   
           // ----------------------------------------------------------------------
  @@ -145,7 +154,15 @@
           ArtifactEnabledEmbedder embedder = new ArtifactEnabledEmbedder();
   
           embedder.start( classWorld );
  -
  +        
  +        Logger logger = embedder.getContainer().getLogger();
  +        if( logger != null )
  +        {
  +            request.setLog( new DefaultLog( logger ) );
  +            
  +            request.addEventMonitor( new DefaultEventMonitor( logger ) );
  +        }
  +        
           // TODO [BP]: doing this here as it is CLI specific, though it doesn't feel like the right place.
           WagonManager wagonManager = (WagonManager) embedder.lookup( WagonManager.ROLE );
   
  
  
  
  1.5       +6 -6      maven-components/maven-script/maven-script-marmalade/src/main/java/org/apache/maven/script/marmalade/tags/MetadataTag.java
  
  Index: MetadataTag.java
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-script/maven-script-marmalade/src/main/java/org/apache/maven/script/marmalade/tags/MetadataTag.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- MetadataTag.java	28 Feb 2005 23:11:31 -0000	1.4
  +++ MetadataTag.java	4 Mar 2005 09:04:23 -0000	1.5
  @@ -104,16 +104,16 @@
           String basePath = (String) context.getVariable( MarmaladeMojoExecutionDirectives.SCRIPT_BASEPATH_INVAR,
                                                           getExpressionEvaluator() );
   
  -        if(basePath != null)
  +        if ( basePath != null )
           {
  -            if(basePath.endsWith("/"))
  +            if ( basePath.endsWith( "/" ) )
               {
  -                basePath = basePath.substring(0, basePath.length()-2);
  +                basePath = basePath.substring( 0, basePath.length() - 2 );
               }
  -            
  +
               String implementationPath = getTagInfo().getSourceFile().substring( basePath.length() );
  -            
  -            implementationPath = implementationPath.replace('\\', '/');
  +
  +            implementationPath = implementationPath.replace( '\\', '/' );
   
               descriptor.setImplementation( implementationPath );
           }
  
  
  
  1.3       +9 -9      maven-components/maven-script/maven-script-marmalade/src/main/java/org/apache/maven/script/marmalade/tags/MojoTag.java
  
  Index: MojoTag.java
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-script/maven-script-marmalade/src/main/java/org/apache/maven/script/marmalade/tags/MojoTag.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- MojoTag.java	28 Feb 2005 18:29:47 -0000	1.2
  +++ MojoTag.java	4 Mar 2005 09:04:23 -0000	1.3
  @@ -40,37 +40,37 @@
       {
           return false;
       }
  -    
  +
       protected void doExecute( MarmaladeExecutionContext context ) throws MarmaladeExecutionException
       {
           for ( Iterator it = children().iterator(); it.hasNext(); )
           {
               MarmaladeTag child = (MarmaladeTag) it.next();
  -            if(!(child instanceof ExecuteTag))
  +            if ( !(child instanceof ExecuteTag) )
               {
  -                child.execute(context);
  +                child.execute( context );
               }
           }
       }
  -    
  +
       public Object getComponent()
       {
           MarmaladeTag realRoot = null;
           for ( Iterator it = children().iterator(); it.hasNext(); )
           {
               MarmaladeTag child = (MarmaladeTag) it.next();
  -            if(child instanceof ExecuteTag)
  +            if ( child instanceof ExecuteTag )
               {
                   realRoot = child;
                   break;
               }
           }
  -        
  -        if(realRoot == null)
  +
  +        if ( realRoot == null )
           {
  -            throw new IllegalStateException("Mojo scripts MUST have a <execute> tag.");
  +            throw new IllegalStateException( "Mojo scripts MUST have a <execute> tag." );
           }
  -        
  +
           MarmaladeScript script = new MarmaladeScript( getTagInfo().getSourceFile(), realRoot );
           return new MarmaladeMojo( script );
       }
  
  
  
  1.3       +1 -2      maven-components/maven-script/maven-script-marmalade/src/main/java/org/apache/maven/script/marmalade/tags/ExecuteTag.java
  
  Index: ExecuteTag.java
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-script/maven-script-marmalade/src/main/java/org/apache/maven/script/marmalade/tags/ExecuteTag.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ExecuteTag.java	28 Feb 2005 18:29:47 -0000	1.2
  +++ ExecuteTag.java	4 Mar 2005 09:04:23 -0000	1.3
  @@ -38,8 +38,7 @@
           for ( Iterator it = children().iterator(); it.hasNext(); )
           {
               MarmaladeTag child = (MarmaladeTag) it.next();
  -            System.out.println("Will execute: " + child);
           }
       }
  -    
  +
   }
  \ No newline at end of file
  
  
  
  1.2       +24 -1     maven-components/maven-plugin/src/main/java/org/apache/maven/plugin/PluginExecutionRequest.java
  
  Index: PluginExecutionRequest.java
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-plugin/src/main/java/org/apache/maven/plugin/PluginExecutionRequest.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- PluginExecutionRequest.java	9 Aug 2004 18:49:35 -0000	1.1
  +++ PluginExecutionRequest.java	4 Mar 2005 09:04:23 -0000	1.2
  @@ -16,6 +16,9 @@
    * limitations under the License.
    */
   
  +import org.apache.maven.monitor.logging.Log;
  +import org.apache.maven.monitor.logging.SystemStreamLog;
  +
   import java.util.HashMap;
   import java.util.Map;
   
  @@ -29,6 +32,8 @@
   
       private Map context;
   
  +    private Log log;
  +
       public PluginExecutionRequest( Map parameters )
       {
           context = new HashMap();
  @@ -60,4 +65,22 @@
       {
           return context.get( key );
       }
  +
  +    public void setLog( Log log )
  +    {
  +        this.log = log;
  +    }
  +    
  +    public Log getLog()
  +    {
  +        synchronized(this)
  +        {
  +            if(log == null)
  +            {
  +                log = new SystemStreamLog();
  +            }
  +        }
  +        
  +        return log;
  +    }
   }
  
  
  
  1.3       +5 -0      maven-components/maven-script/maven-script-marmalade/pom.xml
  
  Index: pom.xml
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-script/maven-script-marmalade/pom.xml,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- pom.xml	24 Feb 2005 05:12:30 -0000	1.2
  +++ pom.xml	4 Mar 2005 09:04:24 -0000	1.3
  @@ -14,6 +14,11 @@
     <dependencies>
       <dependency>
         <groupId>maven</groupId>
  +      <artifactId>maven-monitor</artifactId>
  +      <version>2.0-SNAPSHOT</version>
  +    </dependency>
  +    <dependency>
  +      <groupId>maven</groupId>
         <artifactId>maven-plugin</artifactId>
         <version>2.0-SNAPSHOT</version>
       </dependency>
  
  
  
  1.2       +35 -35    maven-components/maven-plugin-tools/maven-plugin-tools-api/src/main/java/org/apache/maven/tools/plugin/extractor/AbstractScriptedMojoDescriptorExtractor.java
  
  Index: AbstractScriptedMojoDescriptorExtractor.java
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-plugin-tools/maven-plugin-tools-api/src/main/java/org/apache/maven/tools/plugin/extractor/AbstractScriptedMojoDescriptorExtractor.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- AbstractScriptedMojoDescriptorExtractor.java	1 Mar 2005 02:43:22 -0000	1.1
  +++ AbstractScriptedMojoDescriptorExtractor.java	4 Mar 2005 09:04:24 -0000	1.2
  @@ -23,17 +23,17 @@
       public Set execute( MavenProject project ) throws Exception
       {
           Build buildSection = project.getBuild();
  -        
  +
           List resources = null;
  -        if(buildSection != null)
  +        if ( buildSection != null )
           {
               resources = buildSection.getResources();
           }
  -        
  -        Map scriptFilesKeyedByBasedir = gatherScriptSourcesByBasedir(resources, getScriptFileExtension());
  -        
  -        Set mojoDescriptors = extractMojoDescriptors(scriptFilesKeyedByBasedir);
  -        
  +
  +        Map scriptFilesKeyedByBasedir = gatherScriptSourcesByBasedir( resources, getScriptFileExtension() );
  +
  +        Set mojoDescriptors = extractMojoDescriptors( scriptFilesKeyedByBasedir );
  +
           return mojoDescriptors;
       }
   
  @@ -44,60 +44,60 @@
       protected Map gatherScriptSourcesByBasedir( List resources, String scriptFileExtension )
       {
           Map sourcesByBasedir = new TreeMap();
  -        
  -        if(resources != null)
  +
  +        if ( resources != null )
           {
               for ( Iterator it = resources.iterator(); it.hasNext(); )
               {
                   Set sources = new HashSet();
  -                
  +
                   Resource resource = (Resource) it.next();
  -                
  +
                   String resourceDir = resource.getDirectory();
  -                File dir = new File(resourceDir);
  -                
  -                if(dir.exists())
  +                File dir = new File( resourceDir );
  +
  +                if ( dir.exists() )
                   {
                       DirectoryScanner scanner = new DirectoryScanner();
  -                    
  -                    scanner.setBasedir(dir);
  -                    
  +
  +                    scanner.setBasedir( dir );
  +
                       List includes = resource.getIncludes();
  -                    
  -                    if(includes != null && !includes.isEmpty())
  +
  +                    if ( includes != null && !includes.isEmpty() )
                       {
  -                        scanner.setIncludes((String[])includes.toArray(new String[includes.size()]));
  +                        scanner.setIncludes( (String[]) includes.toArray( new String[includes.size()] ) );
                       }
  -                    
  +
                       List excludes = resource.getExcludes();
  -                    
  -                    if(excludes != null && !excludes.isEmpty())
  +
  +                    if ( excludes != null && !excludes.isEmpty() )
                       {
  -                        scanner.setExcludes((String[])excludes.toArray(new String[excludes.size()]));
  +                        scanner.setExcludes( (String[]) excludes.toArray( new String[excludes.size()] ) );
                       }
  -                    
  +
                       scanner.addDefaultExcludes();
                       scanner.scan();
  -                    
  +
                       String[] relativePaths = scanner.getIncludedFiles();
  -                    
  +
                       for ( int i = 0; i < relativePaths.length; i++ )
                       {
                           String relativePath = relativePaths[i];
  -                        File scriptFile = new File(dir, relativePath);
  -                        
  -                        if(scriptFile.isFile() && relativePath.endsWith(scriptFileExtension))
  +                        File scriptFile = new File( dir, relativePath );
  +
  +                        if ( scriptFile.isFile() && relativePath.endsWith( scriptFileExtension ) )
                           {
  -                            sources.add(scriptFile);
  +                            sources.add( scriptFile );
                           }
                       }
  -                    
  -                    sourcesByBasedir.put(resourceDir, sources);
  +
  +                    sourcesByBasedir.put( resourceDir, sources );
                   }
               }
           }
  -        
  +
           return sourcesByBasedir;
       }
   
  -}
  +}
  \ No newline at end of file
  
  
  
  1.14      +3 -2      maven-components/maven-plugins/maven-compiler-plugin/src/main/java/org/apache/maven/plugin/CompilerMojo.java
  
  Index: CompilerMojo.java
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-plugins/maven-compiler-plugin/src/main/java/org/apache/maven/plugin/CompilerMojo.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- CompilerMojo.java	27 Feb 2005 21:51:52 -0000	1.13
  +++ CompilerMojo.java	4 Mar 2005 09:04:24 -0000	1.14
  @@ -119,7 +119,8 @@
                       message = "Warning! not present in repository!";
                   }
   
  -                System.out.println( "classpathElements[ "+ i +" ] = " + classpathElements[i] + ": " + message );
  +//                System.out.println( "classpathElements[ "+ i +" ] = " + classpathElements[i] + ": " + message );
  +                request.getLog().debug( "classpathElements[ "+ i +" ] = " + classpathElements[i] + ": " + message );
               }
           }
   
  
  
  
  1.1                  maven-components/maven-core/src/main/java/org/apache/maven/monitor/logging/DefaultLog.java
  
  Index: DefaultLog.java
  ===================================================================
  package org.apache.maven.monitor.logging;
  
  import org.codehaus.plexus.logging.Logger;
  
  /**
   * @author jdcasey
   */
  public class DefaultLog
      implements Log
  {
  
      private final Logger logger;
  
      public DefaultLog( Logger logger )
      {
          this.logger = logger;
      }
  
      public void debug( CharSequence content )
      {
          logger.debug( content.toString() );
      }
  
      public void debug( CharSequence content, Throwable error )
      {
          logger.debug( content.toString(), error );
      }
  
      public void debug( Throwable error )
      {
          logger.debug( "", error );
      }
  
      public void info( CharSequence content )
      {
          logger.info( content.toString() );
      }
  
      public void info( CharSequence content, Throwable error )
      {
          logger.info( content.toString(), error );
      }
  
      public void info( Throwable error )
      {
          logger.info( "", error );
      }
  
      public void warn( CharSequence content )
      {
          logger.warn( content.toString() );
      }
  
      public void warn( CharSequence content, Throwable error )
      {
          logger.warn( content.toString(), error );
      }
  
      public void warn( Throwable error )
      {
          logger.warn( "", error );
      }
  
      public void error( CharSequence content )
      {
          logger.error( content.toString() );
      }
  
      public void error( CharSequence content, Throwable error )
      {
          logger.error( content.toString(), error );
      }
  
      public void error( Throwable error )
      {
          logger.error( "", error );
      }
  
  }
  
  
  1.1                  maven-components/maven-core/src/main/java/org/apache/maven/monitor/event/DefaultEventMonitor.java
  
  Index: DefaultEventMonitor.java
  ===================================================================
  package org.apache.maven.monitor.event;
  
  import org.codehaus.plexus.logging.Logger;
  
  /**
   * @author jdcasey
   */
  public class DefaultEventMonitor
      extends AbstractSelectiveEventMonitor
  {
      
      private static final String[] START_EVENTS = {
          MavenEvents.MOJO_EXECUTION
      };
      
      private final Logger logger;
  
      public DefaultEventMonitor( Logger logger )
      {
          super( START_EVENTS, MavenEvents.NO_EVENTS, MavenEvents.NO_EVENTS );
          
          this.logger = logger;
      }
  
      protected void doStartEvent( String event, String target, long time )
      {
          logger.info( "[" + target + "]" );
      }
  
  }
  
  
  1.1                  maven-components/maven-monitor/pom.xml
  
  Index: pom.xml
  ===================================================================
  <project>
    <modelVersion>4.0.0</modelVersion>
    <parent>
      <groupId>maven</groupId>
      <artifactId>maven-component</artifactId>
      <version>2.0-SNAPSHOT</version>
    </parent>
    <groupId>maven</groupId>
    <artifactId>maven-monitor</artifactId>
    <version>2.0-SNAPSHOT</version>
  </project>
  
  
  1.16      +30 -9     maven-components/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycleExecutor.java
  
  Index: DefaultLifecycleExecutor.java
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycleExecutor.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- DefaultLifecycleExecutor.java	3 Mar 2005 11:42:30 -0000	1.15
  +++ DefaultLifecycleExecutor.java	4 Mar 2005 09:04:25 -0000	1.16
  @@ -24,6 +24,8 @@
   import org.apache.maven.execution.MavenSession;
   import org.apache.maven.lifecycle.goal.GoalExecutionException;
   import org.apache.maven.model.Plugin;
  +import org.apache.maven.monitor.event.EventDispatcher;
  +import org.apache.maven.monitor.event.MavenEvents;
   import org.apache.maven.plugin.PluginExecutionResponse;
   import org.apache.maven.plugin.PluginManager;
   import org.apache.maven.plugin.descriptor.MojoDescriptor;
  @@ -229,25 +231,44 @@
           // only execute up to the given phase
           int index = phases.indexOf( phaseMap.get( phase ) );
   
  +        EventDispatcher dispatcher = session.getEventDispatcher();
  +        
           for ( int j = 0; j <= index; j++ )
           {
               Phase p = (Phase) phases.get( j );
  +            
  +            String event = MavenEvents.PHASE_EXECUTION;
   
  -            if ( p.getGoals() != null )
  +            // !! This is ripe for refactoring to an aspect.
  +            // Event monitoring.
  +            dispatcher.dispatchStart( event, p.getId() );
  +            try
               {
  -                for ( Iterator i = p.getGoals().iterator(); i.hasNext(); )
  +                if ( p.getGoals() != null )
                   {
  -                    String goal = (String) i.next();
  +                    for ( Iterator i = p.getGoals().iterator(); i.hasNext(); )
  +                    {
  +                        String goal = (String) i.next();
   
  -                    PluginExecutionResponse pluginResponse = executeMojo( goal, session );
  +                        PluginExecutionResponse pluginResponse = executeMojo( goal, session );
   
  -                    if ( pluginResponse.isExecutionFailure() )
  -                    {
  -                        response.setExecutionFailure( goal, pluginResponse.getFailureResponse() );
  -                        return;
  +                        if ( pluginResponse.isExecutionFailure() )
  +                        {
  +                            response.setExecutionFailure( goal, pluginResponse.getFailureResponse() );
  +                            return;
  +                        }
                       }
                   }
  +                
  +                dispatcher.dispatchEnd( event, p.getId() );
  +            }
  +            catch ( LifecycleExecutionException e )
  +            {
  +                dispatcher.dispatchError( event, p.getId(), e );
  +                
  +                throw e;
               }
  +            // End event monitoring.
           }
       }
   
  
  
  
  1.2       +5 -0      maven-components/maven-plugins/maven-war-plugin/pom.xml
  
  Index: pom.xml
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-plugins/maven-war-plugin/pom.xml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- pom.xml	3 Mar 2005 09:04:36 -0000	1.1
  +++ pom.xml	4 Mar 2005 09:04:26 -0000	1.2
  @@ -16,6 +16,11 @@
     <dependencies>
       <dependency>
         <groupId>maven</groupId>
  +      <artifactId>maven-monitor</artifactId>
  +      <version>2.0-SNAPSHOT</version>
  +    </dependency>
  +    <dependency>
  +      <groupId>maven</groupId>
         <artifactId>maven-jar-plugin</artifactId>
         <version>1.0-SNAPSHOT</version>
         <type>plugin</type>
  
  
  
  1.12      +5 -0      maven-components/maven-plugins/maven-compiler-plugin/pom.xml
  
  Index: pom.xml
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-plugins/maven-compiler-plugin/pom.xml,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- pom.xml	8 Jan 2005 21:35:24 -0000	1.11
  +++ pom.xml	4 Mar 2005 09:04:26 -0000	1.12
  @@ -16,6 +16,11 @@
     <package>org.apache.maven</package>
     <dependencies>
       <dependency>
  +      <groupId>maven</groupId>
  +      <artifactId>maven-monitor</artifactId>
  +      <version>2.0-SNAPSHOT</version>
  +    </dependency>
  +    <dependency>
         <groupId>plexus</groupId>
         <artifactId>plexus</artifactId>
         <version>0.17</version>
  
  
  
  1.5       +6 -6      maven-components/maven-plugin-tools/maven-plugin-tools-java/src/main/java/org/apache/maven/tools/plugin/extractor/java/JavaMojoDescriptorExtractor.java
  
  Index: JavaMojoDescriptorExtractor.java
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-plugin-tools/maven-plugin-tools-java/src/main/java/org/apache/maven/tools/plugin/extractor/java/JavaMojoDescriptorExtractor.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- JavaMojoDescriptorExtractor.java	1 Mar 2005 02:43:22 -0000	1.4
  +++ JavaMojoDescriptorExtractor.java	4 Mar 2005 09:04:26 -0000	1.5
  @@ -248,11 +248,11 @@
           JavaDocBuilder builder = new JavaDocBuilder();
   
           File basedir = project.getBasedir();
  -        
  -        System.out.println("Project basedir: " + basedir);
  -        
  +
  +        System.out.println( "Project basedir: " + basedir );
  +
           String sourceDir = null;
  -        
  +
           Build buildSection = project.getBuild();
           if ( buildSection != null )
           {
  @@ -264,8 +264,8 @@
               File src = new File( basedir, "src/main/java" );
               sourceDir = src.getPath();
           }
  -        
  -        System.out.println("Source directory for java mojo extraction: " + sourceDir);
  +
  +        System.out.println( "Source directory for java mojo extraction: " + sourceDir );
   
           File sourceDirectoryFile = new File( sourceDir );
   
  
  
  

Mime
View raw message