Blame SOURCES/maven2-2.2.1-migrate-to-plexus-containers-container-default.patch

ccba2a
From 7b57fd654710a1a21af22642eda12f8027289986 Mon Sep 17 00:00:00 2001
ccba2a
From: Michal Srb <msrb@redhat.com>
ccba2a
Date: Wed, 3 Jul 2013 10:04:03 +0200
ccba2a
Subject: [PATCH] Migrate to plexus-containers-container-default
ccba2a
ccba2a
---
ccba2a
 .../maven/profiles/DefaultProfileManager.java      | 28 ++++++++++++++++++----
ccba2a
 1 file changed, 23 insertions(+), 5 deletions(-)
ccba2a
ccba2a
diff --git a/maven-project/src/main/java/org/apache/maven/profiles/DefaultProfileManager.java b/maven-project/src/main/java/org/apache/maven/profiles/DefaultProfileManager.java
ccba2a
index e62d5ed..b72d515 100644
ccba2a
--- a/maven-project/src/main/java/org/apache/maven/profiles/DefaultProfileManager.java
ccba2a
+++ b/maven-project/src/main/java/org/apache/maven/profiles/DefaultProfileManager.java
ccba2a
@@ -26,8 +26,10 @@ import org.apache.maven.profiles.activation.ProfileActivator;
ccba2a
 import org.apache.maven.settings.Settings;
ccba2a
 import org.apache.maven.settings.SettingsUtils;
ccba2a
 import org.codehaus.plexus.PlexusContainer;
ccba2a
+import org.codehaus.plexus.component.factory.ComponentInstantiationException;
ccba2a
 import org.codehaus.plexus.component.repository.exception.ComponentLifecycleException;
ccba2a
 import org.codehaus.plexus.component.repository.exception.ComponentLookupException;
ccba2a
+import org.codehaus.plexus.logging.Logger;
ccba2a
 
ccba2a
 import java.util.ArrayList;
ccba2a
 import java.util.Iterator;
ccba2a
@@ -119,8 +121,12 @@ public class DefaultProfileManager
ccba2a
         Profile existing = (Profile) profilesById.get( profileId );
ccba2a
         if ( existing != null )
ccba2a
         {
ccba2a
-            container.getLogger().warn( "Overriding profile: \'" + profileId + "\' (source: " + existing.getSource() +
ccba2a
-                ") with new instance from source: " + profile.getSource() );
ccba2a
+            try {
ccba2a
+                container.lookup( Logger.class ).warn( "Overriding profile: \'" + profileId + "\' (source: " + existing.getSource() +
ccba2a
+                    ") with new instance from source: " + profile.getSource() );
ccba2a
+            } catch ( ComponentLookupException e ) {
ccba2a
+                throw new RuntimeException( e );
ccba2a
+            }
ccba2a
         }
ccba2a
 
ccba2a
         profilesById.put( profile.getId(), profile );
ccba2a
@@ -140,7 +146,11 @@ public class DefaultProfileManager
ccba2a
     {
ccba2a
         if ( !activatedIds.contains( profileId ) )
ccba2a
         {
ccba2a
-            container.getLogger().debug( "Profile with id: \'" + profileId + "\' has been explicitly activated." );
ccba2a
+            try {
ccba2a
+                container.lookup( Logger.class ).debug( "Profile with id: \'" + profileId + "\' has been explicitly activated." );
ccba2a
+            } catch ( ComponentLookupException e ) {
ccba2a
+                throw new RuntimeException( e );
ccba2a
+            }
ccba2a
 
ccba2a
             activatedIds.add( profileId );
ccba2a
         }
ccba2a
@@ -166,7 +176,11 @@ public class DefaultProfileManager
ccba2a
     {
ccba2a
         if ( !deactivatedIds.contains( profileId ) )
ccba2a
         {
ccba2a
-            container.getLogger().debug( "Profile with id: \'" + profileId + "\' has been explicitly deactivated." );
ccba2a
+            try {
ccba2a
+                container.lookup( Logger.class ).debug( "Profile with id: \'" + profileId + "\' has been explicitly deactivated." );
ccba2a
+            } catch ( ComponentLookupException e ) {
ccba2a
+                throw new RuntimeException( e );
ccba2a
+            }
ccba2a
 
ccba2a
             deactivatedIds.add( profileId );
ccba2a
         }
ccba2a
@@ -294,7 +308,11 @@ public class DefaultProfileManager
ccba2a
                 }
ccba2a
                 catch ( ComponentLifecycleException e )
ccba2a
                 {
ccba2a
-                    container.getLogger().debug( "Error releasing profile activators - ignoring.", e );
ccba2a
+                    try {
ccba2a
+                         container.lookup( Logger.class ).debug( "Error releasing profile activators - ignoring.", e );
ccba2a
+                    } catch ( ComponentLookupException ex ) {
ccba2a
+                        throw new RuntimeException( ex );
ccba2a
+                    }
ccba2a
                 }
ccba2a
             }
ccba2a
         }
ccba2a
-- 
ccba2a
1.8.1.4
ccba2a