maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r320809 - in /maven/components/trunk/maven-core/src/main/java/org/apache/maven: DefaultMaven.java lifecycle/DefaultLifecycleExecutor.java
Date Thu, 13 Oct 2005 17:05:46 GMT
Author: brett
Date: Thu Oct 13 10:05:41 2005
New Revision: 320809

URL: http://svn.apache.org/viewcvs?rev=320809&view=rev
Log:
PR: MNG-122
fix fail at end

Modified:
    maven/components/trunk/maven-core/src/main/java/org/apache/maven/DefaultMaven.java
    maven/components/trunk/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycleExecutor.java

Modified: maven/components/trunk/maven-core/src/main/java/org/apache/maven/DefaultMaven.java
URL: http://svn.apache.org/viewcvs/maven/components/trunk/maven-core/src/main/java/org/apache/maven/DefaultMaven.java?rev=320809&r1=320808&r2=320809&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 Thu
Oct 13 10:05:41 2005
@@ -106,27 +106,10 @@
 
         dispatcher.dispatchStart( event, request.getBaseDirectory() );
 
+        ReactorManager rm;
         try
         {
-            ReactorManager rm = doExecute( request, dispatcher );
-
-            // TODO: shoul all the logging be left to the CLI?
-            logReactorSummary( rm );
-
-            if ( rm.hasBuildFailures() )
-            {
-                logErrors( rm, request.isShowErrors() );
-            }
-            else
-            {
-                logSuccess( rm );
-            }
-
-            stats( request.getStartTime() );
-
-            line();
-
-            dispatcher.dispatchEnd( event, request.getBaseDirectory() );
+            rm = doExecute( request, dispatcher );
         }
         catch ( LifecycleExecutionException e )
         {
@@ -164,6 +147,43 @@
 
             throw new MavenExecutionException( "Error executing project within the reactor",
t );
         }
+
+        // Either the build was successful, or it was a fail_at_end/fail_never reactor build
+
+        // TODO: should all the logging be left to the CLI?
+        logReactorSummary( rm );
+
+        if ( rm.hasBuildFailures() )
+        {
+            logErrors( rm, request.isShowErrors() );
+
+            if ( !ReactorManager.FAIL_NEVER.equals( rm.getFailureBehavior() ) )
+            {
+                dispatcher.dispatchError( event, request.getBaseDirectory(), null );
+
+                getLogger().info( "BUILD ERRORS" );
+
+                line();
+
+                stats( request.getStartTime() );
+
+                line();
+
+                throw new MavenExecutionException( "Some builds failed" );
+            }
+            else
+            {
+                getLogger().info( " + Ignoring failures" );
+            }
+        }
+
+        logSuccess( rm );
+
+        stats( request.getStartTime() );
+
+        line();
+
+        dispatcher.dispatchEnd( event, request.getBaseDirectory() );
     }
 
     private void logErrors( ReactorManager rm, boolean showErrors )
@@ -590,7 +610,7 @@
     {
         line();
 
-        getLogger().info( "FATAL ERROR" );
+        getLogger().error( "FATAL ERROR" );
 
         line();
 
@@ -603,7 +623,7 @@
     {
         line();
 
-        getLogger().info( "BUILD ERROR" );
+        getLogger().error( "BUILD ERROR" );
 
         line();
 
@@ -616,7 +636,7 @@
     {
         line();
 
-        getLogger().info( "BUILD FAILURE" );
+        getLogger().error( "BUILD FAILURE" );
 
         line();
 
@@ -636,13 +656,13 @@
     {
         if ( getLogger().isDebugEnabled() )
         {
-            getLogger().debug( "Trace", t );
+            getLogger().info( "Trace", t );
 
             line();
         }
         else if ( showErrors )
         {
-            getLogger().error( "Trace", t );
+            getLogger().info( "Trace", t );
 
             line();
         }
@@ -665,7 +685,7 @@
             message = t.getMessage();
         }
 
-        getLogger().error( message );
+        getLogger().info( message );
 
         line();
     }

Modified: maven/components/trunk/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycleExecutor.java
URL: http://svn.apache.org/viewcvs/maven/components/trunk/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycleExecutor.java?rev=320809&r1=320808&r2=320809&view=diff
==============================================================================
--- maven/components/trunk/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycleExecutor.java
(original)
+++ maven/components/trunk/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycleExecutor.java
Thu Oct 13 10:05:41 2005
@@ -333,6 +333,7 @@
         {
             rm.blackList( project );
         }
+        // if NEVER, don't blacklist
         return false;
     }
 



Mime
View raw message