maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jvan...@apache.org
Subject svn commit: r491532 - in /maven/components/trunk: maven-core/src/main/java/org/apache/maven/ maven-core/src/main/resources/META-INF/plexus/ maven-embedder/src/main/java/org/apache/maven/embedder/execution/
Date Mon, 01 Jan 2007 04:53:39 GMT
Author: jvanzyl
Date: Sun Dec 31 20:53:39 2006
New Revision: 491532

URL: http://svn.apache.org/viewvc?view=rev&rev=491532
Log:
o move more configuration to one location
o removing uneeded components from DefaultMaven

Modified:
    maven/components/trunk/maven-core/src/main/java/org/apache/maven/DefaultMaven.java
    maven/components/trunk/maven-core/src/main/resources/META-INF/plexus/components.xml
    maven/components/trunk/maven-embedder/src/main/java/org/apache/maven/embedder/execution/DefaultMavenExecutionRequestDefaultsPopulator.java

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=491532&r1=491531&r2=491532
==============================================================================
--- 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 20:53:39 2006
@@ -18,7 +18,6 @@
 
 
 import org.apache.maven.artifact.repository.ArtifactRepository;
-import org.apache.maven.artifact.repository.ArtifactRepositoryFactory;
 import org.apache.maven.artifact.resolver.ArtifactResolutionException;
 import org.apache.maven.artifact.versioning.DefaultArtifactVersion;
 import org.apache.maven.execution.BuildFailure;
@@ -30,10 +29,8 @@
 import org.apache.maven.execution.RuntimeInformation;
 import org.apache.maven.lifecycle.LifecycleExecutor;
 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.event.MavenEvents;
-import org.apache.maven.plugin.Mojo;
 import org.apache.maven.profiles.DefaultProfileManager;
 import org.apache.maven.profiles.ProfileManager;
 import org.apache.maven.profiles.activation.ProfileActivationException;
@@ -46,15 +43,10 @@
 import org.apache.maven.usability.diagnostics.ErrorDiagnostics;
 import org.codehaus.plexus.PlexusConstants;
 import org.codehaus.plexus.PlexusContainer;
-import org.codehaus.plexus.component.repository.exception.ComponentLookupException;
 import org.codehaus.plexus.context.Context;
 import org.codehaus.plexus.context.ContextException;
 import org.codehaus.plexus.logging.AbstractLogEnabled;
-import org.codehaus.plexus.logging.Logger;
-import org.codehaus.plexus.logging.LoggerManager;
 import org.codehaus.plexus.personality.plexus.lifecycle.phase.Contextualizable;
-import org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable;
-import org.codehaus.plexus.personality.plexus.lifecycle.phase.InitializationException;
 import org.codehaus.plexus.util.FileUtils;
 import org.codehaus.plexus.util.dag.CycleDetectedException;
 
@@ -76,7 +68,7 @@
  */
 public class DefaultMaven
     extends AbstractLogEnabled
-    implements Maven, Contextualizable, Initializable
+    implements Maven, Contextualizable
 {
     // ----------------------------------------------------------------------
     // Components
@@ -92,10 +84,6 @@
 
     protected RuntimeInformation runtimeInformation;
 
-    protected LoggerManager loggerManager;
-
-    protected ArtifactRepositoryFactory artifactRepositoryFactory;
-
     private static final long MB = 1024 * 1024;
 
     private static final int MS_PER_SEC = 1000;
@@ -108,15 +96,6 @@
 
     public MavenExecutionResult execute( MavenExecutionRequest request )
     {
-        Logger logger = loggerManager.getLoggerForComponent( Mojo.ROLE );
-
-        if ( request.getEventMonitors() == null )
-        {
-            request.addEventMonitor( new DefaultEventMonitor( logger ) );
-        }
-
-        loggerManager.setThreshold( request.getLoggingLevel() );
-
         request.setStartTime( new Date() );
 
         EventDispatcher dispatcher = new DefaultEventDispatcher( request.getEventMonitors()
);
@@ -536,19 +515,6 @@
         throws ContextException
     {
         container = (PlexusContainer) context.get( PlexusConstants.PLEXUS_KEY );
-    }
-
-    public void initialize()
-        throws InitializationException
-    {
-        try
-        {
-            loggerManager = (LoggerManager) container.lookup( LoggerManager.ROLE );
-        }
-        catch ( ComponentLookupException e )
-        {
-            throw new InitializationException( "Cannot lookup logger manager.", e );
-        }
     }
 
     // ----------------------------------------------------------------------

Modified: maven/components/trunk/maven-core/src/main/resources/META-INF/plexus/components.xml
URL: http://svn.apache.org/viewvc/maven/components/trunk/maven-core/src/main/resources/META-INF/plexus/components.xml?view=diff&rev=491532&r1=491531&r2=491532
==============================================================================
--- maven/components/trunk/maven-core/src/main/resources/META-INF/plexus/components.xml (original)
+++ maven/components/trunk/maven-core/src/main/resources/META-INF/plexus/components.xml Sun
Dec 31 20:53:39 2006
@@ -82,15 +82,6 @@
         <requirement>
           <role>org.apache.maven.execution.RuntimeInformation</role>
         </requirement>
-        <requirement>
-          <role>org.apache.maven.artifact.manager.WagonManager</role>
-        </requirement>
-        <requirement>
-          <role>org.apache.maven.MavenTools</role>
-        </requirement>
-        <requirement>
-          <role>org.apache.maven.artifact.repository.ArtifactRepositoryFactory</role>
-        </requirement>
       </requirements>
     </component>
 

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=491532&r1=491531&r2=491532
==============================================================================
--- 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 20:53:39 2006
@@ -5,6 +5,8 @@
 
 import org.apache.maven.MavenTools;
 import org.apache.maven.SettingsConfigurationException;
+import org.apache.maven.monitor.event.DefaultEventMonitor;
+import org.apache.maven.plugin.Mojo;
 import org.apache.maven.settings.Settings;
 import org.apache.maven.settings.Proxy;
 import org.apache.maven.settings.Server;
@@ -16,6 +18,7 @@
 import org.apache.maven.embedder.MavenEmbedderException;
 import org.apache.maven.execution.MavenExecutionRequest;
 import org.codehaus.plexus.logging.AbstractLogEnabled;
+import org.codehaus.plexus.logging.Logger;
 import org.codehaus.plexus.component.repository.exception.ComponentLookupException;
 import org.codehaus.plexus.component.repository.exception.ComponentLifecycleException;
 import org.codehaus.plexus.personality.plexus.lifecycle.phase.Contextualizable;
@@ -160,6 +163,17 @@
         {
             request.setBaseDirectory( new File( request.getPomFile() ) );
         }
+
+        // EventMonitor/Logger
+
+        Logger logger = container.getLoggerManager().getLoggerForComponent( Mojo.ROLE );
+
+        if ( request.getEventMonitors() == null )
+        {
+            request.addEventMonitor( new DefaultEventMonitor( logger ) );
+        }
+
+        container.getLoggerManager().setThreshold( request.getLoggingLevel() );
 
         return request;
     }



Mime
View raw message