maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r750001 - in /maven/components/branches/maven-2.0.x: ./ apache-maven/ apache-maven/src/test/ maven-core/src/main/java/org/apache/maven/ maven-integration-tests/ maven-model/src/test/ maven-project/src/main/java/org/apache/maven/project/
Date Wed, 04 Mar 2009 13:21:46 GMT
Author: brett
Date: Wed Mar  4 13:21:46 2009
New Revision: 750001

URL: http://svn.apache.org/viewvc?rev=750001&view=rev
Log:
[MNG-3641] move profile activation check to span all projects at once in a reactor
Merged from: r749997

Modified:
    maven/components/branches/maven-2.0.x/   (props changed)
    maven/components/branches/maven-2.0.x/apache-maven/   (props changed)
    maven/components/branches/maven-2.0.x/apache-maven/src/test/   (props changed)
    maven/components/branches/maven-2.0.x/maven-core/src/main/java/org/apache/maven/DefaultMaven.java
    maven/components/branches/maven-2.0.x/maven-integration-tests/   (props changed)
    maven/components/branches/maven-2.0.x/maven-model/src/test/   (props changed)
    maven/components/branches/maven-2.0.x/maven-project/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java

Propchange: maven/components/branches/maven-2.0.x/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Mar  4 13:21:46 2009
@@ -1,3 +1,3 @@
 /maven/components/branches/maven-2.0.10-RC:708790-728809,728834
-/maven/components/branches/maven-2.1.x:720038,727670,727762,727868,728933,728937,737683,738723,738753,739385,741507,741518,741870,742819,744645,745836,747468,747683,747799,748102,748111,748146,748815
+/maven/components/branches/maven-2.1.x:720038,727670,727762,727868,728933,728937,737683,738723,738753,739385,741507,741518,741870,742819,744645,745836,747468,747683,747799,748102,748111,748146,748815,749997
 /maven/components/trunk:720001,721902,726845,729292

Propchange: maven/components/branches/maven-2.0.x/apache-maven/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Mar  4 13:21:46 2009
@@ -1,5 +1,5 @@
 /maven/components/branches/maven-2.0.10-RC/apache-maven:708790-728809,728834
 /maven/components/branches/maven-2.0.x/apache-maven:533160,636838,645583,645642,647357,649903,657432,659677,662033,662251,669665,670358,673499,673905,674059,675074,675087,675096,675375,675380,680604,682055
-/maven/components/branches/maven-2.1.x/apache-maven:720038,728933,728937,737683,738723,738753,741507,741518,742819,745836,747683,747799,748102,748111,748146
+/maven/components/branches/maven-2.1.x/apache-maven:720038,728933,728937,737683,738723,738753,741507,741518,742819,745836,747683,747799,748102,748111,748146,749997
 /maven/components/trunk/apache-maven:720001,721902,726845
 /maven/components/trunk/maven-distribution:727688

Propchange: maven/components/branches/maven-2.0.x/apache-maven/src/test/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Mar  4 13:21:46 2009
@@ -1,2 +1,2 @@
 /maven/components/branches/maven-2.0.10-RC/apache-maven/src/test:727009-728809,728834
-/maven/components/branches/maven-2.1.x/apache-maven/src/test:728933,728937,737683,738723,738753,741507,741518,742819,745836,747683,747799,748102,748111,748146
+/maven/components/branches/maven-2.1.x/apache-maven/src/test:728933,728937,737683,738723,738753,741507,741518,742819,745836,747683,747799,748102,748111,748146,749997

Modified: maven/components/branches/maven-2.0.x/maven-core/src/main/java/org/apache/maven/DefaultMaven.java
URL: http://svn.apache.org/viewvc/maven/components/branches/maven-2.0.x/maven-core/src/main/java/org/apache/maven/DefaultMaven.java?rev=750001&r1=750000&r2=750001&view=diff
==============================================================================
--- maven/components/branches/maven-2.0.x/maven-core/src/main/java/org/apache/maven/DefaultMaven.java
(original)
+++ maven/components/branches/maven-2.0.x/maven-core/src/main/java/org/apache/maven/DefaultMaven.java
Wed Mar  4 13:21:46 2009
@@ -32,6 +32,7 @@
 import org.apache.maven.execution.RuntimeInformation;
 import org.apache.maven.lifecycle.LifecycleExecutionException;
 import org.apache.maven.lifecycle.LifecycleExecutor;
+import org.apache.maven.model.Profile;
 import org.apache.maven.monitor.event.DefaultEventDispatcher;
 import org.apache.maven.monitor.event.EventDispatcher;
 import org.apache.maven.monitor.event.MavenEvents;
@@ -72,9 +73,11 @@
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.Date;
+import java.util.HashSet;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Properties;
+import java.util.Set;
 import java.util.TimeZone;
 
 /**
@@ -318,6 +321,12 @@
             throw new BuildFailureException( e.getMessage(), e );
         }
 
+        // --------------------------------------------------------------------------------
+        // MNG-3641: print a warning if one of the profiles to be activated explicitly
+        // was not activated
+
+        validateActivatedProfiles( globalProfileManager, projects );
+
         if ( rm.hasMultipleProjects() )
         {
             getLogger().info( "Reactor build order: " );
@@ -338,6 +347,35 @@
         return rm;
     }
 
+    private void validateActivatedProfiles( ProfileManager globalProfileManager, List projects
)
+    {
+        if ( globalProfileManager != null )
+        {
+            // get all activated profile ids
+            Set activeProfileIds = new HashSet();
+
+            for ( Iterator i = projects.iterator(); i.hasNext(); )
+            {
+                MavenProject project = (MavenProject) i.next();
+                
+                for ( Iterator j = project.getActiveProfiles().iterator(); j.hasNext(); )
+                {
+                    activeProfileIds.add( ( (Profile) j.next() ).getId() );
+                }
+            }
+
+            for ( Iterator i = globalProfileManager.getExplicitlyActivatedIds().iterator();
i.hasNext(); )
+            {
+                String explicitProfileId = (String) i.next();
+
+                if ( !activeProfileIds.contains( explicitProfileId ) )
+                {
+                    getLogger().warn( "\n\tProfile with id: \'" + explicitProfileId + "\'
has not been activated.\n" );
+                }
+            }
+        }
+    }
+
     private MavenProject getSuperProject( MavenExecutionRequest request )
         throws MavenExecutionException
     {

Propchange: maven/components/branches/maven-2.0.x/maven-integration-tests/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Mar  4 13:21:46 2009
@@ -1,2 +1,2 @@
 /maven/components/branches/maven-2.0.10-RC/maven-integration-tests:709246-728809,728834
-/maven/components/branches/maven-2.1.x/maven-integration-tests:728933,728937,737683,738723,738753,741507,741518,742819,745836,747683,747799,748102,748111,748146
+/maven/components/branches/maven-2.1.x/maven-integration-tests:728933,728937,737683,738723,738753,741507,741518,742819,745836,747683,747799,748102,748111,748146,749997

Propchange: maven/components/branches/maven-2.0.x/maven-model/src/test/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Mar  4 13:21:46 2009
@@ -1,2 +1,2 @@
 /maven/components/branches/maven-2.0.10-RC/maven-model/src/test:727009-728809,728834
-/maven/components/branches/maven-2.1.x/maven-model/src/test:728933,728937,737683,738723,738753,741507,741518,742819,745836,747683,747799,748102,748111,748146
+/maven/components/branches/maven-2.1.x/maven-model/src/test:728933,728937,737683,738723,738753,741507,741518,742819,745836,747683,747799,748102,748111,748146,749997

Modified: maven/components/branches/maven-2.0.x/maven-project/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java
URL: http://svn.apache.org/viewvc/maven/components/branches/maven-2.0.x/maven-project/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java?rev=750001&r1=750000&r2=750001&view=diff
==============================================================================
--- maven/components/branches/maven-2.0.x/maven-project/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java
(original)
+++ maven/components/branches/maven-2.0.x/maven-project/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java
Wed Mar  4 13:21:46 2009
@@ -986,32 +986,6 @@
         Map context = new HashMap();
 
         // --------------------------------------------------------------------------------
-        // MNG-3641: print a warning if one of the profiles to be activated explicitly
-        // was not activated
-
-        if ( config != null && config.getGlobalProfileManager() != null )
-        {
-            // get all activated profile ids
-            List activeProfileIds = new ArrayList();
-
-            for ( Iterator it = activeProfiles.iterator(); it.hasNext(); )
-            {
-                activeProfileIds.add( ( (Profile) it.next() ).getId() );
-            }
-
-            for ( Iterator it = config.getGlobalProfileManager().getExplicitlyActivatedIds().iterator();
it.hasNext(); )
-            {
-                String explicitProfileId = (String) it.next();
-
-                if ( !activeProfileIds.contains( explicitProfileId ) )
-                {
-                    getLogger().warn( "Profile with id: \'" + explicitProfileId + "\' has
not been activated." );
-                }
-
-            }
-        }
-        
-        // --------------------------------------------------------------------------------
         
         Build build = model.getBuild();
 



Mime
View raw message