You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Brett Porter <br...@apache.org> on 2005/09/28 01:01:57 UTC

Re: issues with plugin context impl was: svn commit: r292023

jdcasey@apache.org wrote:

>Modified: maven/components/trunk/maven-core-it-plugin/pom.xml
>URL: http://svn.apache.org/viewcvs/maven/components/trunk/maven-core-it-plugin/pom.xml?rev=292023&r1=292022&r2=292023&view=diff
>==============================================================================
>--- maven/components/trunk/maven-core-it-plugin/pom.xml (original)
>+++ maven/components/trunk/maven-core-it-plugin/pom.xml Tue Sep 27 12:49:37 2005
>@@ -3,7 +3,7 @@
>   <parent>
>     <artifactId>maven-plugin-parent</artifactId>
>     <groupId>org.apache.maven.plugins</groupId>
>-    <version>2.0-beta-1</version>
>+    <version>2.0-beta-2</version>
>   </parent>
>   <modelVersion>4.0.0</modelVersion>
>   <artifactId>maven-core-it-plugin</artifactId>
>@@ -12,6 +12,11 @@
>   <version>1.0-SNAPSHOT</version>
>   <inceptionYear>2001</inceptionYear>
>   <dependencies>
>+    <dependency>
>+      <groupId>org.apache.maven</groupId>
>+      <artifactId>maven-plugin-api</artifactId>
>+      <version>2.0-beta-3-SNAPSHOT</version>
>+    </dependency>
>     <dependency>
>       <groupId>org.apache.maven</groupId>
>       <artifactId>maven-project</artifactId>
>  
>
You should just need to use the beta-3-SNAPSHOT parent here. If it were
any other plugin, it should have a prerequisite too.

> 
>+        if ( plugin instanceof ContextEnabled )
>+        {
>+            Map pluginContext;
>+            try
>+            {
>+                pluginContext = (Map) pluginContainer.getContext().get( ContextEnabled.PLUGIN_CONTEXT_SESSION_KEY );
>+            }
>+            catch ( ContextException e )
>+            {
>+                // this is thrown the first time for each plugin, since the map hasn't been initialized in the
>+                // new plugin's container context.
>+                getLogger().debug( "Initializing plugin context map for plugin: " + pluginDescriptor.getPluginLookupKey() );
>+                
>+                pluginContext = new HashMap();
>+                
>+                pluginContainer.getContext().put( ContextEnabled.PLUGIN_CONTEXT_SESSION_KEY, pluginContext );
>+            }
>+            
>+            ( (ContextEnabled) plugin ).setPluginContext( pluginContext );
>+        }
>+        
>  
>
This doesn't seem lifecycle-aware. Shouldn't the context be on the project?

- Brett

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org