maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jvan...@apache.org
Subject svn commit: r749807 - in /maven/components/trunk: build-mercury.xml maven-core/src/main/java/org/apache/maven/DefaultMaven.java
Date Tue, 03 Mar 2009 22:36:49 GMT
Author: jvanzyl
Date: Tue Mar  3 22:36:48 2009
New Revision: 749807

URL: http://svn.apache.org/viewvc?rev=749807&view=rev
Log:
o place execute method first
o inject the logger

Modified:
    maven/components/trunk/build-mercury.xml
    maven/components/trunk/maven-core/src/main/java/org/apache/maven/DefaultMaven.java

Modified: maven/components/trunk/build-mercury.xml
URL: http://svn.apache.org/viewvc/maven/components/trunk/build-mercury.xml?rev=749807&r1=749806&r2=749807&view=diff
==============================================================================
--- maven/components/trunk/build-mercury.xml (original)
+++ maven/components/trunk/build-mercury.xml Tue Mar  3 22:36:48 2009
@@ -63,10 +63,8 @@
     <!-- Initialize properties -->
     <property name="maven.home.basename.expected" value="apache-maven-${pom.project.version}"/>
     <property name="maven.assembly" location="apache-maven/target/${maven.home.basename.expected}-bin.zip"/>
-
   	<property name="maven.repo.local"   value="${user.home}/.m2/repository"/>
-    <property name="maven.repo.central" value="http://repository.sonatype.org/content/groups/public"/>
-  	
+    <property name="maven.repo.central" value="http://repository.sonatype.org/content/groups/public"/>
 	
     <property name="surefire.useFile" value="true"/>    
     <echo>maven.home = ${maven.home}</echo>
   </target>

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?rev=749807&r1=749806&r2=749807&view=diff
==============================================================================
--- 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 Tue
Mar  3 22:36:48 2009
@@ -65,7 +65,7 @@
  */
 @Component(role = Maven.class)
 public class DefaultMaven
-    implements Maven, LogEnabled
+    implements Maven
 {
     @Requirement
     protected MavenProjectBuilder projectBuilder;
@@ -79,6 +79,7 @@
     @Requirement
     protected RuntimeInformation runtimeInformation;
 
+    @Requirement
     private Logger logger;
 
     // ----------------------------------------------------------------------
@@ -89,59 +90,6 @@
     // artifact resolution
     // lifecycle execution
 
-    public ReactorManager createReactorManager( MavenExecutionRequest request, MavenExecutionResult
result )
-    {
-        List projects;
-        try
-        {            
-            projects = getProjects( request );
-
-            if ( projects.isEmpty() )
-            {
-                projects.add( projectBuilder.buildStandaloneSuperProject( request.getProjectBuildingConfiguration()
) );
-
-                request.setProjectPresent( false );
-            }
-        }
-        catch ( ProjectBuildingException e )
-        {
-            result.addException( e );
-            return null;
-        }
-        catch ( MavenExecutionException e )
-        {
-            result.addException( e );
-            return null;
-        }
-
-        ReactorManager reactorManager;
-
-        try
-        {
-            reactorManager = new ReactorManager( projects, request.getReactorFailureBehavior()
);
-
-            result.setReactorManager( reactorManager );
-        }
-        catch ( CycleDetectedException e )
-        {
-            String message = "The projects in the reactor contain a cyclic reference: " +
e.getMessage();
-
-            ProjectCycleException error = new ProjectCycleException( projects, message, e
);
-
-            result.addException( error );
-
-            return null;
-        }
-        catch ( DuplicateProjectException e )
-        {
-            result.addException( e );
-
-            return null;
-        }
-
-        return reactorManager;
-    }
-
     public MavenExecutionResult execute( MavenExecutionRequest request )
     {
         request.setStartTime( new Date() );
@@ -188,17 +136,17 @@
             }
         }
 
-        getLogger().info( "Scanning for projects..." );
+        logger.info( "Scanning for projects..." );
 
         if ( reactorManager.hasMultipleProjects() )
         {
-            getLogger().info( "Reactor build order: " );
+            logger.info( "Reactor build order: " );
 
             for ( Iterator i = reactorManager.getSortedProjects().iterator(); i.hasNext();
)
             {
                 MavenProject project = (MavenProject) i.next();
 
-                getLogger().info( "  " + project.getName() );
+                logger.info( "  " + project.getName() );
             }
         }
 
@@ -230,6 +178,59 @@
         dispatcher.dispatchEnd( event, request.getBaseDirectory() );
 
         return result;
+    }    
+    
+    public ReactorManager createReactorManager( MavenExecutionRequest request, MavenExecutionResult
result )
+    {
+        List projects;
+        try
+        {            
+            projects = getProjects( request );
+
+            if ( projects.isEmpty() )
+            {
+                projects.add( projectBuilder.buildStandaloneSuperProject( request.getProjectBuildingConfiguration()
) );
+
+                request.setProjectPresent( false );
+            }
+        }
+        catch ( ProjectBuildingException e )
+        {
+            result.addException( e );
+            return null;
+        }
+        catch ( MavenExecutionException e )
+        {
+            result.addException( e );
+            return null;
+        }
+
+        ReactorManager reactorManager;
+
+        try
+        {
+            reactorManager = new ReactorManager( projects, request.getReactorFailureBehavior()
);
+
+            result.setReactorManager( reactorManager );
+        }
+        catch ( CycleDetectedException e )
+        {
+            String message = "The projects in the reactor contain a cyclic reference: " +
e.getMessage();
+
+            ProjectCycleException error = new ProjectCycleException( projects, message, e
);
+
+            result.addException( error );
+
+            return null;
+        }
+        catch ( DuplicateProjectException e )
+        {
+            result.addException( e );
+
+            return null;
+        }
+
+        return reactorManager;
     }
 
     protected List getProjects( MavenExecutionRequest request )
@@ -271,7 +272,7 @@
 
                 if ( RELEASE_POMv4.equals( file.getName() ) )
                 {
-                    getLogger().info( "NOTE: Using release-pom: " + file + " in reactor build."
);
+                    logger.info( "NOTE: Using release-pom: " + file + " in reactor build."
);
 
                     usingReleasePom = true;
                 }
@@ -319,7 +320,7 @@
 
                         if ( StringUtils.isEmpty( StringUtils.trim( name ) ) )
                         {
-                            getLogger().warn( "Empty module detected. Please check you don't
have any empty module definitions in your POM." );
+                            logger.warn( "Empty module detected. Please check you don't have
any empty module definitions in your POM." );
 
                             continue;
                         }
@@ -464,14 +465,4 @@
             }
         }
     }
-
-    protected Logger getLogger()
-    {
-        return logger;
-    }
-
-    public void enableLogging( Logger logger )
-    {
-        this.logger = logger;
-    }
 }



Mime
View raw message