maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bentm...@apache.org
Subject svn commit: r788982 - in /maven/components/trunk: maven-core/src/main/java/org/apache/maven/execution/ maven-core/src/main/java/org/apache/maven/plugin/ maven-toolchain/src/main/java/org/apache/maven/toolchain/
Date Sat, 27 Jun 2009 14:40:25 GMT
Author: bentmann
Date: Sat Jun 27 14:40:25 2009
New Revision: 788982

URL: http://svn.apache.org/viewvc?rev=788982&view=rev
Log:
o Restored mojo context passing

Modified:
    maven/components/trunk/maven-core/src/main/java/org/apache/maven/execution/MavenSession.java
    maven/components/trunk/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginManager.java
    maven/components/trunk/maven-toolchain/src/main/java/org/apache/maven/toolchain/DefaultToolchainManager.java

Modified: maven/components/trunk/maven-core/src/main/java/org/apache/maven/execution/MavenSession.java
URL: http://svn.apache.org/viewvc/maven/components/trunk/maven-core/src/main/java/org/apache/maven/execution/MavenSession.java?rev=788982&r1=788981&r2=788982&view=diff
==============================================================================
--- maven/components/trunk/maven-core/src/main/java/org/apache/maven/execution/MavenSession.java
(original)
+++ maven/components/trunk/maven-core/src/main/java/org/apache/maven/execution/MavenSession.java
Sat Jun 27 14:40:25 2009
@@ -156,37 +156,35 @@
     {
         return result;
     }        
+
+    private Map<String,Map<String,Map<String,Object>>>  pluginContextsByProjectAndPluginKey
= new HashMap<String,Map<String,Map<String,Object>>> ();
     
     // Backward compat
-    public Map<String,Map<String,Object>> getPluginContext( PluginDescriptor
pluginDescriptor, MavenProject project )
+    public Map<String, Object> getPluginContext( PluginDescriptor plugin, MavenProject
project )
     {
-        return new HashMap<String,Map<String,Object>>();
-    }    
+        String projectKey = project.getId();
 
-    /*
-    private Map pluginContextsByProjectAndPluginKey = new HashMap();
-    
-    public Map getPluginContext( PluginDescriptor plugin, MavenProject project )
-    {
-        Map pluginContextsByKey = (Map) pluginContextsByProjectAndPluginKey.get( project.getId()
);
+        Map<String, Map<String, Object>> pluginContextsByKey = pluginContextsByProjectAndPluginKey.get(
projectKey );
 
         if ( pluginContextsByKey == null )
         {
-            pluginContextsByKey = new HashMap();
+            pluginContextsByKey = new HashMap<String, Map<String, Object>>();
 
-            pluginContextsByProjectAndPluginKey.put( project.getId(), pluginContextsByKey
);
+            pluginContextsByProjectAndPluginKey.put( projectKey, pluginContextsByKey );
         }
 
-        Map pluginContext = (Map) pluginContextsByKey.get( plugin.getPluginLookupKey() );
+        String pluginKey = plugin.getPluginLookupKey();
+
+        Map<String, Object> pluginContext = pluginContextsByKey.get( pluginKey );
 
         if ( pluginContext == null )
         {
-            pluginContext = new HashMap();
-            pluginContextsByKey.put( plugin.getPluginLookupKey(), pluginContext );
+            pluginContext = new HashMap<String, Object>();
+
+            pluginContextsByKey.put( pluginKey, pluginContext );
         }
 
         return pluginContext;
     }
-    */
-    
-}
\ No newline at end of file
+
+}

Modified: maven/components/trunk/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginManager.java
URL: http://svn.apache.org/viewvc/maven/components/trunk/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginManager.java?rev=788982&r1=788981&r2=788982&view=diff
==============================================================================
--- maven/components/trunk/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginManager.java
(original)
+++ maven/components/trunk/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginManager.java
Sat Jun 27 14:40:25 2009
@@ -516,7 +516,7 @@
             if ( mojo instanceof ContextEnabled )
             {
                 //TODO: find somewhere better to put the plugin context.
-                Map<String, Object> pluginContext = null;
+                Map<String, Object> pluginContext = session.getPluginContext( pluginDescriptor,
project );
     
                 if ( pluginContext != null )
                 {

Modified: maven/components/trunk/maven-toolchain/src/main/java/org/apache/maven/toolchain/DefaultToolchainManager.java
URL: http://svn.apache.org/viewvc/maven/components/trunk/maven-toolchain/src/main/java/org/apache/maven/toolchain/DefaultToolchainManager.java?rev=788982&r1=788981&r2=788982&view=diff
==============================================================================
--- maven/components/trunk/maven-toolchain/src/main/java/org/apache/maven/toolchain/DefaultToolchainManager.java
(original)
+++ maven/components/trunk/maven-toolchain/src/main/java/org/apache/maven/toolchain/DefaultToolchainManager.java
Sat Jun 27 14:40:25 2009
@@ -45,7 +45,7 @@
 
     public Toolchain getToolchainFromBuildContext( String type, MavenSession session )
     {
-        Map context = retrieveContext( session );
+        Map<String, Object> context = retrieveContext( session );
 
         ToolchainModel model = (ToolchainModel) context.get( getStorageKey( type ) );
 
@@ -73,9 +73,9 @@
         return null;
     }
 
-    Map retrieveContext( MavenSession session )
+    Map<String, Object> retrieveContext( MavenSession session )
     {
-        Map context = null;
+        Map<String, Object> context = null;
 
         if ( session != null )
         {
@@ -88,11 +88,11 @@
             if ( current != null )
             {
                 //TODO: why is this using the context
-                //context = session.getPluginContext( desc, current );
+                context = session.getPluginContext( desc, current );
             }
         }
 
-        return ( context != null ) ? context : new HashMap();
+        return ( context != null ) ? context : new HashMap<String, Object>();
     }
 
     public static final String getStorageKey( String type )



Mime
View raw message