incubator-nmaven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sisb...@apache.org
Subject svn commit: r532576 - in /incubator/nmaven/branches/SI_XPT: assemblies/NMaven.Plugin/src/main/csharp/ assemblies/NMaven.Plugin/src/main/csharp/NMaven/Plugin/ assemblies/NMaven.Plugin/src/main/csharp/NMaven/Plugin/Generator/ assemblies/NMaven.Plugin/src...
Date Thu, 26 Apr 2007 02:27:44 GMT
Author: sisbell
Date: Wed Apr 25 19:27:42 2007
New Revision: 532576

URL: http://svn.apache.org/viewvc?view=rev&rev=532576
Log:
Generalized the Plugin framework with java annotations.

Added:
    incubator/nmaven/branches/SI_XPT/components/dotnet-plugin/src/main/java/org/apache/maven/dotnet/plugin/ConfigurationAppender.java   (with props)
    incubator/nmaven/branches/SI_XPT/components/dotnet-plugin/src/main/java/org/apache/maven/dotnet/plugin/ConfigurationAppenderAnnotation.java   (with props)
    incubator/nmaven/branches/SI_XPT/components/dotnet-plugin/src/main/java/org/apache/maven/dotnet/plugin/FieldAnnotation.java   (with props)
    incubator/nmaven/branches/SI_XPT/components/dotnet-plugin/src/main/java/org/apache/maven/dotnet/plugin/FieldInfo.java   (with props)
    incubator/nmaven/branches/SI_XPT/components/dotnet-plugin/src/main/java/org/apache/maven/dotnet/plugin/MavenProjectConfigurationAppender.java   (with props)
    incubator/nmaven/branches/SI_XPT/components/dotnet-plugin/src/main/java/org/apache/maven/dotnet/plugin/PluginContext.java   (with props)
    incubator/nmaven/branches/SI_XPT/components/dotnet-plugin/src/main/java/org/apache/maven/dotnet/plugin/PomFileConfigurationAppender.java   (with props)
    incubator/nmaven/branches/SI_XPT/components/dotnet-plugin/src/main/java/org/apache/maven/dotnet/plugin/StringConfigurationAppender.java   (with props)
    incubator/nmaven/branches/SI_XPT/components/dotnet-plugin/src/main/java/org/apache/maven/dotnet/plugin/impl/
    incubator/nmaven/branches/SI_XPT/components/dotnet-plugin/src/main/java/org/apache/maven/dotnet/plugin/impl/ConfigurationAppendersRepository.java   (with props)
    incubator/nmaven/branches/SI_XPT/components/dotnet-plugin/src/main/java/org/apache/maven/dotnet/plugin/impl/PluginContextImpl.java   (with props)
Modified:
    incubator/nmaven/branches/SI_XPT/assemblies/NMaven.Plugin/src/main/csharp/NMaven.Plugin.csproj
    incubator/nmaven/branches/SI_XPT/assemblies/NMaven.Plugin/src/main/csharp/NMaven/Plugin/AbstractMojo.cs
    incubator/nmaven/branches/SI_XPT/assemblies/NMaven.Plugin/src/main/csharp/NMaven/Plugin/ClassAttribute.cs
    incubator/nmaven/branches/SI_XPT/assemblies/NMaven.Plugin/src/main/csharp/NMaven/Plugin/FieldAttribute.cs
    incubator/nmaven/branches/SI_XPT/assemblies/NMaven.Plugin/src/main/csharp/NMaven/Plugin/Generator/JavaClass.cs
    incubator/nmaven/branches/SI_XPT/assemblies/NMaven.Plugin/src/main/csharp/NMaven/Plugin/Injector/IFieldInjector.cs
    incubator/nmaven/branches/SI_XPT/assemblies/NMaven.Plugin/src/main/csharp/NMaven/Plugin/Injector/Impl/FieldInjectorRepository.cs
    incubator/nmaven/branches/SI_XPT/assemblies/NMaven.Plugin/src/main/csharp/NMaven/Plugin/PluginDomainManager.cs
    incubator/nmaven/branches/SI_XPT/components/dotnet-core/src/main/resources/META-INF/nmaven/registry-config.xml
    incubator/nmaven/branches/SI_XPT/components/dotnet-model/pom.xml
    incubator/nmaven/branches/SI_XPT/components/dotnet-plugin/pom.xml
    incubator/nmaven/branches/SI_XPT/components/dotnet-plugin/src/main/java/org/apache/maven/dotnet/plugin/AbstractMojo.java
    incubator/nmaven/branches/SI_XPT/components/dotnet-plugin/src/main/java/org/apache/maven/dotnet/plugin/DotNetMojo.java
    incubator/nmaven/branches/SI_XPT/components/dotnet-plugin/src/main/resources/META-INF/plexus/components.xml
    incubator/nmaven/branches/SI_XPT/plugins/maven-compile-plugin/src/main/resources/META-INF/plexus/components.xml
    incubator/nmaven/branches/SI_XPT/plugins/maven-solution-plugin/src/main/java/org/apache/maven/dotnet/plugin/solution/SolutionMojo.java

Modified: incubator/nmaven/branches/SI_XPT/assemblies/NMaven.Plugin/src/main/csharp/NMaven.Plugin.csproj
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_XPT/assemblies/NMaven.Plugin/src/main/csharp/NMaven.Plugin.csproj?view=diff&rev=532576&r1=532575&r2=532576
==============================================================================
--- incubator/nmaven/branches/SI_XPT/assemblies/NMaven.Plugin/src/main/csharp/NMaven.Plugin.csproj (original)
+++ incubator/nmaven/branches/SI_XPT/assemblies/NMaven.Plugin/src/main/csharp/NMaven.Plugin.csproj Wed Apr 25 19:27:42 2007
@@ -37,10 +37,10 @@
       <Link>PluginLoader.cs</Link>
     </Compile>
     <Compile Include="NMaven\Plugin\Injector\IFieldInjector.cs" />
-    <Compile Include="NMaven\Plugin\Injector\MavenProjectInjector.cs" />
-    <Compile Include="NMaven\Plugin\Injector\StringInjector.cs" />
     <Compile Include="NMaven\Plugin\Injector\Impl\FieldInjectorRepository.cs" />
     <Compile Include="NMaven\Plugin\FieldInjectorAttribute.cs" />
+    <Compile Include="NMaven\Plugin\Injector\Impl\MavenProjectInjector.cs" />
+    <Compile Include="NMaven\Plugin\Injector\Impl\StringInjector.cs" />
   </ItemGroup>
   <ItemGroup>
     <Folder Include="NMaven" />

Modified: incubator/nmaven/branches/SI_XPT/assemblies/NMaven.Plugin/src/main/csharp/NMaven/Plugin/AbstractMojo.cs
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_XPT/assemblies/NMaven.Plugin/src/main/csharp/NMaven/Plugin/AbstractMojo.cs?view=diff&rev=532576&r1=532575&r2=532576
==============================================================================
--- incubator/nmaven/branches/SI_XPT/assemblies/NMaven.Plugin/src/main/csharp/NMaven/Plugin/AbstractMojo.cs (original)
+++ incubator/nmaven/branches/SI_XPT/assemblies/NMaven.Plugin/src/main/csharp/NMaven/Plugin/AbstractMojo.cs Wed Apr 25 19:27:42 2007
@@ -29,17 +29,20 @@
 
 namespace NMaven.Plugin
 {
+	/// <summary>
+	/// Base class for Mojos.
+	/// </summary>
 	public abstract class AbstractMojo : MarshalByRefObject 
     {
         public abstract void Execute();
         
         public abstract Type getT();
-        
-        public void init()
-        {
-			        	
-        }
-                     
+               
+        /// <summary>
+        /// Injects values into fields of the child class using information from the specified 
+        /// configuration file. 
+        /// </summary>
+        /// <param name="configurationFile">The file that contains the values used to populate the fields</param>
         public void injectFields(String configurationFile)
         {
 			XmlTextReader reader = 
@@ -53,8 +56,7 @@
 				{
 					IFieldInjector fieldInjector = fieldInjectorRepository.getFieldInjectorFor(fieldInfo);
 					fieldInjector.Inject(this, fieldInfo, reader.ReadString() );									
-				}	
-				
+				}					
 			}        	
         }
         

Modified: incubator/nmaven/branches/SI_XPT/assemblies/NMaven.Plugin/src/main/csharp/NMaven/Plugin/ClassAttribute.cs
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_XPT/assemblies/NMaven.Plugin/src/main/csharp/NMaven/Plugin/ClassAttribute.cs?view=diff&rev=532576&r1=532575&r2=532576
==============================================================================
--- incubator/nmaven/branches/SI_XPT/assemblies/NMaven.Plugin/src/main/csharp/NMaven/Plugin/ClassAttribute.cs (original)
+++ incubator/nmaven/branches/SI_XPT/assemblies/NMaven.Plugin/src/main/csharp/NMaven/Plugin/ClassAttribute.cs Wed Apr 25 19:27:42 2007
@@ -25,7 +25,7 @@
 	/// <summary>
 	/// Description of ClassAttribute.
 	/// </summary>
-	public class ClassAttribute : Attribute
+	public sealed class ClassAttribute : Attribute
 	{
 		private string phase;
 		

Modified: incubator/nmaven/branches/SI_XPT/assemblies/NMaven.Plugin/src/main/csharp/NMaven/Plugin/FieldAttribute.cs
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_XPT/assemblies/NMaven.Plugin/src/main/csharp/NMaven/Plugin/FieldAttribute.cs?view=diff&rev=532576&r1=532575&r2=532576
==============================================================================
--- incubator/nmaven/branches/SI_XPT/assemblies/NMaven.Plugin/src/main/csharp/NMaven/Plugin/FieldAttribute.cs (original)
+++ incubator/nmaven/branches/SI_XPT/assemblies/NMaven.Plugin/src/main/csharp/NMaven/Plugin/FieldAttribute.cs Wed Apr 25 19:27:42 2007
@@ -25,7 +25,7 @@
 	/// <summary>
 	/// Description of StringAttribute.
 	/// </summary>
-	public class FieldAttribute : Attribute
+	public sealed class FieldAttribute : Attribute
 	{
 		private string name;
 		

Modified: incubator/nmaven/branches/SI_XPT/assemblies/NMaven.Plugin/src/main/csharp/NMaven/Plugin/Generator/JavaClass.cs
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_XPT/assemblies/NMaven.Plugin/src/main/csharp/NMaven/Plugin/Generator/JavaClass.cs?view=diff&rev=532576&r1=532575&r2=532576
==============================================================================
--- incubator/nmaven/branches/SI_XPT/assemblies/NMaven.Plugin/src/main/csharp/NMaven/Plugin/Generator/JavaClass.cs (original)
+++ incubator/nmaven/branches/SI_XPT/assemblies/NMaven.Plugin/src/main/csharp/NMaven/Plugin/Generator/JavaClass.cs Wed Apr 25 19:27:42 2007
@@ -96,7 +96,6 @@
 			{
 				this.packageName = value;
 			}
-		}
-		
+		}		
 	}
 }

Modified: incubator/nmaven/branches/SI_XPT/assemblies/NMaven.Plugin/src/main/csharp/NMaven/Plugin/Injector/IFieldInjector.cs
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_XPT/assemblies/NMaven.Plugin/src/main/csharp/NMaven/Plugin/Injector/IFieldInjector.cs?view=diff&rev=532576&r1=532575&r2=532576
==============================================================================
--- incubator/nmaven/branches/SI_XPT/assemblies/NMaven.Plugin/src/main/csharp/NMaven/Plugin/Injector/IFieldInjector.cs (original)
+++ incubator/nmaven/branches/SI_XPT/assemblies/NMaven.Plugin/src/main/csharp/NMaven/Plugin/Injector/IFieldInjector.cs Wed Apr 25 19:27:42 2007
@@ -24,12 +24,22 @@
 namespace NMaven.Plugin.Injector
 {
 	/// <summary>
-	/// Description of FieldInjector.
+	/// Provides services for injecting information into fields.
 	/// </summary>
 	public interface IFieldInjector
 	{
+		/// <summary>
+		/// Injects the specified field object into the field info of the specified target object.
+		/// </summary>
+		/// <param name="targetObject">the target object containing the fields that are to be injected</param>
+		/// <param name="fieldInfo">the field to inject</param>
+		/// <param name="fieldObject">the value to set on the field</param>
 		void Inject(object targetObject, FieldInfo fieldInfo, object fieldObject);
 		
+		/// <summary>
+		/// Returns the java class name of field within the Java Mojo equivalent.
+		/// </summary>
+		/// <returns>the java class name of field within the Java Mojo equivalent</returns>
 		string GetJavaClassName();
 	}
 }

Modified: incubator/nmaven/branches/SI_XPT/assemblies/NMaven.Plugin/src/main/csharp/NMaven/Plugin/Injector/Impl/FieldInjectorRepository.cs
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_XPT/assemblies/NMaven.Plugin/src/main/csharp/NMaven/Plugin/Injector/Impl/FieldInjectorRepository.cs?view=diff&rev=532576&r1=532575&r2=532576
==============================================================================
--- incubator/nmaven/branches/SI_XPT/assemblies/NMaven.Plugin/src/main/csharp/NMaven/Plugin/Injector/Impl/FieldInjectorRepository.cs (original)
+++ incubator/nmaven/branches/SI_XPT/assemblies/NMaven.Plugin/src/main/csharp/NMaven/Plugin/Injector/Impl/FieldInjectorRepository.cs Wed Apr 25 19:27:42 2007
@@ -26,17 +26,16 @@
 namespace NMaven.Plugin.Injector.Impl
 {
 	/// <summary>
-	/// Description of FieldInjectorRepository.
+	/// Provides methods for getting field injectors.
 	/// </summary>
-	public class FieldInjectorRepository
+	internal sealed class FieldInjectorRepository
 	{		
-		public FieldInjectorRepository()
+		internal FieldInjectorRepository()
 		{
 		}
 		
-		public IFieldInjector getFieldInjectorFor(FieldInfo fieldInfo)
+		internal IFieldInjector getFieldInjectorFor(FieldInfo fieldInfo)
 		{
-			//String fieldTypeName = fieldInfo.FieldType.FullName;
 			Type[] types = this.GetType().Assembly.GetTypes();
 			foreach(Type type in types)
 			{
@@ -66,7 +65,7 @@
 		}
 		
 
-       public String GetFieldTypeFor(FieldInfo fieldInfo)
+       internal String GetFieldTypeFor(FieldInfo fieldInfo)
        {
 	    	foreach (Attribute attribute in fieldInfo.GetCustomAttributes(true))
 	        {	            	

Modified: incubator/nmaven/branches/SI_XPT/assemblies/NMaven.Plugin/src/main/csharp/NMaven/Plugin/PluginDomainManager.cs
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_XPT/assemblies/NMaven.Plugin/src/main/csharp/NMaven/Plugin/PluginDomainManager.cs?view=diff&rev=532576&r1=532575&r2=532576
==============================================================================
--- incubator/nmaven/branches/SI_XPT/assemblies/NMaven.Plugin/src/main/csharp/NMaven/Plugin/PluginDomainManager.cs (original)
+++ incubator/nmaven/branches/SI_XPT/assemblies/NMaven.Plugin/src/main/csharp/NMaven/Plugin/PluginDomainManager.cs Wed Apr 25 19:27:42 2007
@@ -27,7 +27,7 @@
 	/// <summary>
 	/// Allows loading of .NET Maven Plugins (and its dependencies) into a separate application domain.
 	/// </summary>
-	public class PluginDomainManager : AppDomainManager
+	public sealed class PluginDomainManager : AppDomainManager
 	{
 		/// <summary>
 		/// Default constructor
@@ -40,7 +40,7 @@
 		/// <summary>
 		/// Loads the specified .NET Maven plugin into the plugin domain 
 		/// </summary>
-		/// <param name="assemblyFile">the .NET Maven plugin</param>
+		/// <param name="assemblyFile">The .NET Maven plugin</param>
 		public void LoadPlugin(FileInfo assemblyFile)
 		{
 			

Modified: incubator/nmaven/branches/SI_XPT/components/dotnet-core/src/main/resources/META-INF/nmaven/registry-config.xml
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_XPT/components/dotnet-core/src/main/resources/META-INF/nmaven/registry-config.xml?view=diff&rev=532576&r1=532575&r2=532576
==============================================================================
--- incubator/nmaven/branches/SI_XPT/components/dotnet-core/src/main/resources/META-INF/nmaven/registry-config.xml (original)
+++ incubator/nmaven/branches/SI_XPT/components/dotnet-core/src/main/resources/META-INF/nmaven/registry-config.xml Wed Apr 25 19:27:42 2007
@@ -39,5 +39,10 @@
       <repository-class>org.apache.maven.dotnet.artifact.impl.NetDependenciesRepositoryImpl</repository-class>
       <repository-config>/META-INF/nmaven/net-dependencies.xml</repository-config>
     </repository>
+    <repository>
+      <repository-name>configuration-appenders</repository-name>
+      <repository-class>org.apache.maven.dotnet.plugin.impl.ConfigurationAppendersRepository</repository-class>
+      <repository-config>/META-INF/nmaven/configuration-appenders.xml</repository-config>
+    </repository>
   </repositories>
 </registry-config>

Modified: incubator/nmaven/branches/SI_XPT/components/dotnet-model/pom.xml
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_XPT/components/dotnet-model/pom.xml?view=diff&rev=532576&r1=532575&r2=532576
==============================================================================
--- incubator/nmaven/branches/SI_XPT/components/dotnet-model/pom.xml (original)
+++ incubator/nmaven/branches/SI_XPT/components/dotnet-model/pom.xml Wed Apr 25 19:27:42 2007
@@ -35,6 +35,7 @@
     <module>compiler-plugins</module>
     <module>executable-plugins</module>
     <module>netdependency</module>
+    <module>configuration-appenders</module>    
     <module>settings</module>
     <module>entries</module>
   </modules>

Modified: incubator/nmaven/branches/SI_XPT/components/dotnet-plugin/pom.xml
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_XPT/components/dotnet-plugin/pom.xml?view=diff&rev=532576&r1=532575&r2=532576
==============================================================================
--- incubator/nmaven/branches/SI_XPT/components/dotnet-plugin/pom.xml (original)
+++ incubator/nmaven/branches/SI_XPT/components/dotnet-plugin/pom.xml Wed Apr 25 19:27:42 2007
@@ -52,5 +52,10 @@
       <artifactId>dotnet-vendor</artifactId>
       <version>0.14-SNAPSHOT</version>
     </dependency>
+    <dependency>
+      <groupId>org.apache.maven.dotnet</groupId>
+      <artifactId>dotnet-model-configuration-appenders</artifactId>
+      <version>0.14-SNAPSHOT</version>
+    </dependency>
   </dependencies>
 </project>

Modified: incubator/nmaven/branches/SI_XPT/components/dotnet-plugin/src/main/java/org/apache/maven/dotnet/plugin/AbstractMojo.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_XPT/components/dotnet-plugin/src/main/java/org/apache/maven/dotnet/plugin/AbstractMojo.java?view=diff&rev=532576&r1=532575&r2=532576
==============================================================================
--- incubator/nmaven/branches/SI_XPT/components/dotnet-plugin/src/main/java/org/apache/maven/dotnet/plugin/AbstractMojo.java (original)
+++ incubator/nmaven/branches/SI_XPT/components/dotnet-plugin/src/main/java/org/apache/maven/dotnet/plugin/AbstractMojo.java Wed Apr 25 19:27:42 2007
@@ -27,6 +27,7 @@
 import org.apache.maven.dotnet.PlatformUnsupportedException;
 import org.apache.maven.project.MavenProject;
 import org.w3c.dom.Document;
+import org.w3c.dom.Element;
 
 import javax.xml.parsers.DocumentBuilderFactory;
 import javax.xml.parsers.DocumentBuilder;
@@ -40,6 +41,9 @@
 import java.io.File;
 import java.io.FileOutputStream;
 import java.io.IOException;
+import java.lang.reflect.Field;
+import java.util.Set;
+import java.util.HashSet;
 
 /**
  * The base class for plugins that execute a .NET plugin. Classes that extend this class are only expected to provide
@@ -61,19 +65,19 @@
         throws MojoExecutionException, MojoFailureException
     {
         DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
-        DocumentBuilder builder = null;
+        DocumentBuilder builder;
         try
         {
             builder = factory.newDocumentBuilder();
         }
         catch ( ParserConfigurationException e )
         {
-            e.printStackTrace();
+            throw new MojoExecutionException( "NMAVEN-xxx-000", e );
         }
         Document document = builder.newDocument();
 
-        File paramFile = null;
-        FileOutputStream fos = null;
+        FileOutputStream fos;
+        File paramFile;
         try
         {
             paramFile = File.createTempFile( "Plugin", ".xml" );
@@ -81,53 +85,97 @@
         }
         catch ( IOException e )
         {
-            e.printStackTrace();
+            throw new MojoExecutionException( "NMAVEN-xxx-000", e );
         }
 
         StreamResult result = new StreamResult();
         result.setOutputStream( fos );
-        Transformer xformer = null;
         try
         {
-            xformer = TransformerFactory.newInstance().newTransformer();
+            Transformer transformer = TransformerFactory.newInstance().newTransformer();
+            transformer.transform( this.getDOMSourceFor( document ), result );
         }
         catch ( TransformerConfigurationException e )
         {
-            e.printStackTrace();
-        }
+            throw new MojoExecutionException( "NMAVEN-xxx-000", e );
 
-        try
-        {
-            xformer.transform( this.getDOMSourceFor( document ), result );
         }
         catch ( TransformerException e )
         {
-            e.printStackTrace();
+            throw new MojoExecutionException( "NMAVEN-xxx-000", e );
         }
-        try
+        finally
         {
-            fos.close();
-        }
-        catch ( IOException e )
-        {
-            e.printStackTrace();
+            try
+            {
+                fos.close();
+            }
+            catch ( IOException e )
+            {
+                throw new MojoExecutionException( "NMAVEN-xxx-000: Unable to write file", e );
+            }
         }
+
         try
         {
             VendorInfo vendorInfo = VendorInfo.Factory.createDefaultVendorInfo();
             vendorInfo.setVendor( VendorFactory.createVendorFromName( "MICROSOFT" ) );
             getNetExecutableFactory().getPluginLoaderFor( "NMaven.Plugin", "NMaven.Plugin.Solution", vendorInfo,
-                                                     getMavenProject(), getLocalRepository(), paramFile,
-                                                     "SolutionMojo" ).execute();
+                                                          getMavenProject(), getLocalRepository(), paramFile,
+                                                          "SolutionMojo" ).execute();
         }
         catch ( PlatformUnsupportedException e )
         {
-            throw new MojoExecutionException( "", e );
+            throw new MojoExecutionException( "NMAVEN-xxx-000", e );
         }
         catch ( ExecutionException e )
         {
-            throw new MojoExecutionException( "", e );
+            throw new MojoExecutionException( "NMAVEN-xxx-000", e );
+        }
+    }
+
+    private Set<Field> getAnnotatedFieldsFrom( Field[] fields )
+    {
+        Set<Field> fieldSet = new HashSet<Field>();
+        for ( Field field : fields )
+        {
+            if ( field.getAnnotation( FieldAnnotation.class ) != null )
+            {
+                fieldSet.add( field );
+            }
         }
+        return fieldSet;
+    }
+
+    public DOMSource getDOMSourceFor( Document document )
+    {
+        Element root = document.createElement( "configuration" );
+        document.appendChild( root );
+
+        Set<Field> fields = getAnnotatedFieldsFrom( this.getClass().getDeclaredFields() );
+       // Set<Class> appenderClasses = getConfigurationAppenderClasses();
+        for ( Field field : fields )
+        {
+            ConfigurationAppender configurationAppender = getNetPluginContext().getConfigurationAppenderFor( field );
+            try
+            {
+                try
+                {
+                    configurationAppender.append( document, root, FieldInfo.Factory.createFieldInfo( field.getName(),
+                                                                                                     field.get(
+                                                                                                         this ) ) );
+                }
+                catch ( IllegalAccessException e )
+                {
+                    e.printStackTrace();
+                }
+            }
+            catch ( MojoExecutionException e )
+            {
+                e.printStackTrace();
+            }
+        }
+        return new DOMSource( document );
     }
 
     /**
@@ -141,13 +189,10 @@
     public abstract MavenProject getMavenProject();
 
     /**
-     * @see DotNetMojo#getDOMSourceFor(org.w3c.dom.Document)
-     */
-    public abstract DOMSource getDOMSourceFor( Document document );
-
-    /**
-     * @see org.apache.maven.dotnet.plugin.DotNetMojo#getNetExecutableFactory() 
+     * @see DotNetMojo#getNetExecutableFactory()
      */
     public abstract NetExecutableFactory getNetExecutableFactory();
+
+    public abstract PluginContext getNetPluginContext();
 
 }

Added: incubator/nmaven/branches/SI_XPT/components/dotnet-plugin/src/main/java/org/apache/maven/dotnet/plugin/ConfigurationAppender.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_XPT/components/dotnet-plugin/src/main/java/org/apache/maven/dotnet/plugin/ConfigurationAppender.java?view=auto&rev=532576
==============================================================================
--- incubator/nmaven/branches/SI_XPT/components/dotnet-plugin/src/main/java/org/apache/maven/dotnet/plugin/ConfigurationAppender.java (added)
+++ incubator/nmaven/branches/SI_XPT/components/dotnet-plugin/src/main/java/org/apache/maven/dotnet/plugin/ConfigurationAppender.java Wed Apr 25 19:27:42 2007
@@ -0,0 +1,12 @@
+package org.apache.maven.dotnet.plugin;
+
+import org.apache.maven.plugin.MojoExecutionException;
+import org.w3c.dom.Element;
+import org.w3c.dom.Document;
+
+public interface ConfigurationAppender
+{
+
+    void append( Document document, Element element, FieldInfo fieldInfo) throws MojoExecutionException;
+
+}

Propchange: incubator/nmaven/branches/SI_XPT/components/dotnet-plugin/src/main/java/org/apache/maven/dotnet/plugin/ConfigurationAppender.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/nmaven/branches/SI_XPT/components/dotnet-plugin/src/main/java/org/apache/maven/dotnet/plugin/ConfigurationAppenderAnnotation.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_XPT/components/dotnet-plugin/src/main/java/org/apache/maven/dotnet/plugin/ConfigurationAppenderAnnotation.java?view=auto&rev=532576
==============================================================================
--- incubator/nmaven/branches/SI_XPT/components/dotnet-plugin/src/main/java/org/apache/maven/dotnet/plugin/ConfigurationAppenderAnnotation.java (added)
+++ incubator/nmaven/branches/SI_XPT/components/dotnet-plugin/src/main/java/org/apache/maven/dotnet/plugin/ConfigurationAppenderAnnotation.java Wed Apr 25 19:27:42 2007
@@ -0,0 +1,15 @@
+package org.apache.maven.dotnet.plugin;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Documented;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+@Documented
+@Retention(RetentionPolicy.RUNTIME)
+@Target({ElementType.TYPE})
+public @interface ConfigurationAppenderAnnotation
+{
+    String targetClassName();
+}

Propchange: incubator/nmaven/branches/SI_XPT/components/dotnet-plugin/src/main/java/org/apache/maven/dotnet/plugin/ConfigurationAppenderAnnotation.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/nmaven/branches/SI_XPT/components/dotnet-plugin/src/main/java/org/apache/maven/dotnet/plugin/DotNetMojo.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_XPT/components/dotnet-plugin/src/main/java/org/apache/maven/dotnet/plugin/DotNetMojo.java?view=diff&rev=532576&r1=532575&r2=532576
==============================================================================
--- incubator/nmaven/branches/SI_XPT/components/dotnet-plugin/src/main/java/org/apache/maven/dotnet/plugin/DotNetMojo.java (original)
+++ incubator/nmaven/branches/SI_XPT/components/dotnet-plugin/src/main/java/org/apache/maven/dotnet/plugin/DotNetMojo.java Wed Apr 25 19:27:42 2007
@@ -67,4 +67,6 @@
      * @return the net executable factory
      */
     NetExecutableFactory getNetExecutableFactory();
+
+   // PluginContext getPluginContext();
 }

Added: incubator/nmaven/branches/SI_XPT/components/dotnet-plugin/src/main/java/org/apache/maven/dotnet/plugin/FieldAnnotation.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_XPT/components/dotnet-plugin/src/main/java/org/apache/maven/dotnet/plugin/FieldAnnotation.java?view=auto&rev=532576
==============================================================================
--- incubator/nmaven/branches/SI_XPT/components/dotnet-plugin/src/main/java/org/apache/maven/dotnet/plugin/FieldAnnotation.java (added)
+++ incubator/nmaven/branches/SI_XPT/components/dotnet-plugin/src/main/java/org/apache/maven/dotnet/plugin/FieldAnnotation.java Wed Apr 25 19:27:42 2007
@@ -0,0 +1,10 @@
+package org.apache.maven.dotnet.plugin;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+
+@Retention(RetentionPolicy.RUNTIME)
+public @interface FieldAnnotation
+{
+
+}

Propchange: incubator/nmaven/branches/SI_XPT/components/dotnet-plugin/src/main/java/org/apache/maven/dotnet/plugin/FieldAnnotation.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/nmaven/branches/SI_XPT/components/dotnet-plugin/src/main/java/org/apache/maven/dotnet/plugin/FieldInfo.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_XPT/components/dotnet-plugin/src/main/java/org/apache/maven/dotnet/plugin/FieldInfo.java?view=auto&rev=532576
==============================================================================
--- incubator/nmaven/branches/SI_XPT/components/dotnet-plugin/src/main/java/org/apache/maven/dotnet/plugin/FieldInfo.java (added)
+++ incubator/nmaven/branches/SI_XPT/components/dotnet-plugin/src/main/java/org/apache/maven/dotnet/plugin/FieldInfo.java Wed Apr 25 19:27:42 2007
@@ -0,0 +1,41 @@
+package org.apache.maven.dotnet.plugin;
+
+public interface FieldInfo
+{
+
+    String getName();
+
+    Object getValue();
+
+    /**
+     * Provides factory methods for field infos.
+     */
+    public static class Factory
+    {
+        /**
+         * Default constructor
+         */
+        private Factory()
+        {
+        }
+
+        /**
+         * Creates a default implementation of field info.
+         */
+        public static FieldInfo createFieldInfo( final String name, final Object value )
+        {
+            return new FieldInfo()
+            {
+                public String getName()
+                {
+                    return name;
+                }
+
+                public Object getValue()
+                {
+                    return value;
+                }
+            };
+        }
+    }
+}

Propchange: incubator/nmaven/branches/SI_XPT/components/dotnet-plugin/src/main/java/org/apache/maven/dotnet/plugin/FieldInfo.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/nmaven/branches/SI_XPT/components/dotnet-plugin/src/main/java/org/apache/maven/dotnet/plugin/MavenProjectConfigurationAppender.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_XPT/components/dotnet-plugin/src/main/java/org/apache/maven/dotnet/plugin/MavenProjectConfigurationAppender.java?view=auto&rev=532576
==============================================================================
--- incubator/nmaven/branches/SI_XPT/components/dotnet-plugin/src/main/java/org/apache/maven/dotnet/plugin/MavenProjectConfigurationAppender.java (added)
+++ incubator/nmaven/branches/SI_XPT/components/dotnet-plugin/src/main/java/org/apache/maven/dotnet/plugin/MavenProjectConfigurationAppender.java Wed Apr 25 19:27:42 2007
@@ -0,0 +1,70 @@
+package org.apache.maven.dotnet.plugin;
+
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.Document;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.project.MavenProject;
+import org.apache.maven.model.io.xpp3.MavenXpp3Writer;
+import org.codehaus.plexus.util.IOUtil;
+
+import java.io.StringWriter;
+import java.io.IOException;
+import java.io.File;
+import java.io.FileOutputStream;
+
+@ConfigurationAppenderAnnotation( targetClassName = "org.apache.maven.project.MavenProject")
+public class MavenProjectConfigurationAppender
+    implements ConfigurationAppender
+{
+    public void append( Document document, Element element, FieldInfo fieldInfo )
+        throws MojoExecutionException
+    {
+        Object value = fieldInfo.getValue();
+        if ( ! ( value instanceof MavenProject ) )
+        {
+            throw new MojoExecutionException( "" );
+        }
+        File mavenProjectFile = writeMavenProjectToTempFile( (MavenProject) value );
+        Node mavenProjectFileNode = document.createElement( "mavenProject" );
+        mavenProjectFileNode.setTextContent( mavenProjectFile.getAbsolutePath() );
+        element.appendChild( mavenProjectFileNode );
+    }
+
+    private String ToString( MavenProject mavenProject )
+    {
+        StringWriter stringWriter = new StringWriter();
+        try
+        {
+            new MavenXpp3Writer().write( stringWriter, mavenProject.getModel() );
+        }
+        catch ( IOException e )
+        {
+            e.printStackTrace();
+        }
+        finally
+        {
+            IOUtil.close( stringWriter );
+        }
+        return stringWriter.getBuffer().toString().replaceFirst( "<project>",
+                                                                 "<project xmlns=\"http://maven.apache.org/POM/4.0.0\">" );
+    }
+
+    public File writeMavenProjectToTempFile( MavenProject project )
+    {
+        String p = ToString( project );
+        try
+        {
+            File tempFile = File.createTempFile( "MavenProject", ".xml" );
+            FileOutputStream fos = new FileOutputStream( tempFile );
+            fos.write( p.getBytes() );
+            fos.close();
+            return tempFile;
+        }
+        catch ( IOException e )
+        {
+            e.printStackTrace();
+        }
+        return null;
+    }
+}

Propchange: incubator/nmaven/branches/SI_XPT/components/dotnet-plugin/src/main/java/org/apache/maven/dotnet/plugin/MavenProjectConfigurationAppender.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/nmaven/branches/SI_XPT/components/dotnet-plugin/src/main/java/org/apache/maven/dotnet/plugin/PluginContext.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_XPT/components/dotnet-plugin/src/main/java/org/apache/maven/dotnet/plugin/PluginContext.java?view=auto&rev=532576
==============================================================================
--- incubator/nmaven/branches/SI_XPT/components/dotnet-plugin/src/main/java/org/apache/maven/dotnet/plugin/PluginContext.java (added)
+++ incubator/nmaven/branches/SI_XPT/components/dotnet-plugin/src/main/java/org/apache/maven/dotnet/plugin/PluginContext.java Wed Apr 25 19:27:42 2007
@@ -0,0 +1,13 @@
+package org.apache.maven.dotnet.plugin;
+
+import java.lang.reflect.Field;
+
+public interface PluginContext
+{
+    /**
+     * Role used to register component implementations with the container.
+     */
+    String ROLE = PluginContext.class.getName();
+
+    ConfigurationAppender getConfigurationAppenderFor( Field field );
+}

Propchange: incubator/nmaven/branches/SI_XPT/components/dotnet-plugin/src/main/java/org/apache/maven/dotnet/plugin/PluginContext.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/nmaven/branches/SI_XPT/components/dotnet-plugin/src/main/java/org/apache/maven/dotnet/plugin/PomFileConfigurationAppender.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_XPT/components/dotnet-plugin/src/main/java/org/apache/maven/dotnet/plugin/PomFileConfigurationAppender.java?view=auto&rev=532576
==============================================================================
--- incubator/nmaven/branches/SI_XPT/components/dotnet-plugin/src/main/java/org/apache/maven/dotnet/plugin/PomFileConfigurationAppender.java (added)
+++ incubator/nmaven/branches/SI_XPT/components/dotnet-plugin/src/main/java/org/apache/maven/dotnet/plugin/PomFileConfigurationAppender.java Wed Apr 25 19:27:42 2007
@@ -0,0 +1,25 @@
+package org.apache.maven.dotnet.plugin;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.project.MavenProject;
+
+public class PomFileConfigurationAppender
+    implements ConfigurationAppender
+{
+    public void append( Document document, Element element, FieldInfo fieldInfo )
+        throws MojoExecutionException
+    {
+        Object value = fieldInfo.getValue();
+        if ( ! ( value instanceof MavenProject ) )
+        {
+            throw new MojoExecutionException( "" );
+        }
+
+        Node n1 = document.createElement( "pomFile" );
+        n1.setTextContent( ((MavenProject) value).getFile().getAbsolutePath() );
+        document.appendChild( n1 );
+    }
+}

Propchange: incubator/nmaven/branches/SI_XPT/components/dotnet-plugin/src/main/java/org/apache/maven/dotnet/plugin/PomFileConfigurationAppender.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/nmaven/branches/SI_XPT/components/dotnet-plugin/src/main/java/org/apache/maven/dotnet/plugin/StringConfigurationAppender.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_XPT/components/dotnet-plugin/src/main/java/org/apache/maven/dotnet/plugin/StringConfigurationAppender.java?view=auto&rev=532576
==============================================================================
--- incubator/nmaven/branches/SI_XPT/components/dotnet-plugin/src/main/java/org/apache/maven/dotnet/plugin/StringConfigurationAppender.java (added)
+++ incubator/nmaven/branches/SI_XPT/components/dotnet-plugin/src/main/java/org/apache/maven/dotnet/plugin/StringConfigurationAppender.java Wed Apr 25 19:27:42 2007
@@ -0,0 +1,25 @@
+package org.apache.maven.dotnet.plugin;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.apache.maven.plugin.MojoExecutionException;
+
+@ConfigurationAppenderAnnotation( targetClassName = "java.lang.String")
+public class StringConfigurationAppender
+    implements ConfigurationAppender
+{
+    public void append( Document document, Element element, FieldInfo fieldInfo )
+        throws MojoExecutionException
+    {
+        Object value = fieldInfo.getValue();
+        if ( ! ( value instanceof String ) )
+        {
+            throw new MojoExecutionException( "" );
+        }
+
+        Node n1 = document.createElement( fieldInfo.getName());
+        n1.setTextContent( (String) fieldInfo.getValue() );
+        element.appendChild( n1 );
+    }
+}

Propchange: incubator/nmaven/branches/SI_XPT/components/dotnet-plugin/src/main/java/org/apache/maven/dotnet/plugin/StringConfigurationAppender.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/nmaven/branches/SI_XPT/components/dotnet-plugin/src/main/java/org/apache/maven/dotnet/plugin/impl/ConfigurationAppendersRepository.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_XPT/components/dotnet-plugin/src/main/java/org/apache/maven/dotnet/plugin/impl/ConfigurationAppendersRepository.java?view=auto&rev=532576
==============================================================================
--- incubator/nmaven/branches/SI_XPT/components/dotnet-plugin/src/main/java/org/apache/maven/dotnet/plugin/impl/ConfigurationAppendersRepository.java (added)
+++ incubator/nmaven/branches/SI_XPT/components/dotnet-plugin/src/main/java/org/apache/maven/dotnet/plugin/impl/ConfigurationAppendersRepository.java Wed Apr 25 19:27:42 2007
@@ -0,0 +1,65 @@
+package org.apache.maven.dotnet.plugin.impl;
+
+import org.apache.maven.dotnet.registry.Repository;
+import org.apache.maven.dotnet.registry.RepositoryRegistry;
+import org.apache.maven.dotnet.model.configurationappenders.io.xpp3.ConfigurationAppendersXpp3Reader;
+import org.apache.maven.dotnet.model.configurationappenders.ConfigurationAppenderModel;
+import org.apache.maven.dotnet.model.configurationappenders.ConfigurationAppender;
+import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
+
+import java.io.InputStream;
+import java.io.IOException;
+import java.io.Reader;
+import java.io.InputStreamReader;
+import java.util.Hashtable;
+import java.util.List;
+import java.util.Set;
+import java.util.HashSet;
+
+public class ConfigurationAppendersRepository implements Repository
+{
+
+    private Set<Class> appenderClasses;
+
+    public void load( InputStream inputStream, Hashtable properties )
+        throws IOException
+    {
+        ConfigurationAppendersXpp3Reader xpp3Reader = new ConfigurationAppendersXpp3Reader();
+        Reader reader = new InputStreamReader( inputStream );
+        ConfigurationAppenderModel model;
+        try
+        {
+            model = xpp3Reader.read( reader );
+        }
+        catch ( XmlPullParserException e )
+        {
+            e.printStackTrace();
+            throw new IOException( "NMAVEN-062-000: Could not read plugins-compiler.xml" );
+        }
+        List<ConfigurationAppender> appenders  = model.getConfigurationAppenders();
+        appenderClasses = new HashSet<Class>();
+        for(ConfigurationAppender appender : appenders)
+        {
+            try
+            {
+                appenderClasses.add(Class.forName( appender.getName() ));
+            }
+            catch ( ClassNotFoundException e )
+            {
+                e.printStackTrace();
+                throw new IOException("NMAVEN-xxx-000: Could not load class appender: Name = ");
+            }
+        }
+
+    }
+
+    public Set<Class> getAppenderClasses()
+    {
+        return appenderClasses;
+    }
+
+    public void setRepositoryRegistry( RepositoryRegistry repositoryRegistry )
+    {
+
+    }
+}

Propchange: incubator/nmaven/branches/SI_XPT/components/dotnet-plugin/src/main/java/org/apache/maven/dotnet/plugin/impl/ConfigurationAppendersRepository.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/nmaven/branches/SI_XPT/components/dotnet-plugin/src/main/java/org/apache/maven/dotnet/plugin/impl/PluginContextImpl.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_XPT/components/dotnet-plugin/src/main/java/org/apache/maven/dotnet/plugin/impl/PluginContextImpl.java?view=auto&rev=532576
==============================================================================
--- incubator/nmaven/branches/SI_XPT/components/dotnet-plugin/src/main/java/org/apache/maven/dotnet/plugin/impl/PluginContextImpl.java (added)
+++ incubator/nmaven/branches/SI_XPT/components/dotnet-plugin/src/main/java/org/apache/maven/dotnet/plugin/impl/PluginContextImpl.java Wed Apr 25 19:27:42 2007
@@ -0,0 +1,50 @@
+package org.apache.maven.dotnet.plugin.impl;
+
+import org.apache.maven.dotnet.plugin.PluginContext;
+import org.apache.maven.dotnet.plugin.ConfigurationAppender;
+import org.apache.maven.dotnet.plugin.ConfigurationAppenderAnnotation;
+import org.apache.maven.dotnet.registry.RepositoryRegistry;
+
+import java.util.Set;
+import java.lang.reflect.Field;
+
+public class PluginContextImpl
+    implements PluginContext
+{
+    private RepositoryRegistry repositoryRegistry;
+
+    public ConfigurationAppender getConfigurationAppenderFor( Field field )
+    {
+        ConfigurationAppendersRepository repository =
+            (ConfigurationAppendersRepository) repositoryRegistry.find( "configuration-appenders" );
+        Set<Class> appenderClasses = repository.getAppenderClasses();
+        System.out.println("AC CLASSES = " + appenderClasses.size());
+        for ( Class c : appenderClasses )
+        {
+            ConfigurationAppenderAnnotation annotation =
+                (ConfigurationAppenderAnnotation) c.getAnnotation( ConfigurationAppenderAnnotation.class );
+            System.out.println(field.getType().getName() + ":" + annotation.targetClassName());
+            if ( field.getType().getName().equals( annotation.targetClassName() ) )
+            {
+                Object o;
+                try
+                {
+                    o = c.newInstance();
+                }
+                catch ( InstantiationException e )
+                {
+                    e.printStackTrace();
+                    return null;
+                }
+                catch ( IllegalAccessException e )
+                {
+                    e.printStackTrace();
+                    return null;
+                }
+
+                return (ConfigurationAppender) o;
+            }
+        }
+        return null;
+    }
+}

Propchange: incubator/nmaven/branches/SI_XPT/components/dotnet-plugin/src/main/java/org/apache/maven/dotnet/plugin/impl/PluginContextImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/nmaven/branches/SI_XPT/components/dotnet-plugin/src/main/resources/META-INF/plexus/components.xml
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_XPT/components/dotnet-plugin/src/main/resources/META-INF/plexus/components.xml?view=diff&rev=532576&r1=532575&r2=532576
==============================================================================
--- incubator/nmaven/branches/SI_XPT/components/dotnet-plugin/src/main/resources/META-INF/plexus/components.xml (original)
+++ incubator/nmaven/branches/SI_XPT/components/dotnet-plugin/src/main/resources/META-INF/plexus/components.xml Wed Apr 25 19:27:42 2007
@@ -7,6 +7,18 @@
         <requirement>
           <role>org.apache.maven.dotnet.executable.NetExecutableFactory</role>
         </requirement>
+        <requirement>
+          <role>org.apache.maven.dotnet.plugin.PluginContext</role>
+        </requirement>
+      </requirements>
+    </component>
+    <component>
+      <role>org.apache.maven.dotnet.plugin.PluginContext</role>
+      <implementation>org.apache.maven.dotnet.plugin.impl.PluginContextImpl</implementation>
+      <requirements>
+        <requirement>
+          <role>org.apache.maven.dotnet.registry.RepositoryRegistry</role>
+        </requirement>
       </requirements>
     </component>
   </components>

Modified: incubator/nmaven/branches/SI_XPT/plugins/maven-compile-plugin/src/main/resources/META-INF/plexus/components.xml
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_XPT/plugins/maven-compile-plugin/src/main/resources/META-INF/plexus/components.xml?view=diff&rev=532576&r1=532575&r2=532576
==============================================================================
--- incubator/nmaven/branches/SI_XPT/plugins/maven-compile-plugin/src/main/resources/META-INF/plexus/components.xml (original)
+++ incubator/nmaven/branches/SI_XPT/plugins/maven-compile-plugin/src/main/resources/META-INF/plexus/components.xml Wed Apr 25 19:27:42 2007
@@ -322,6 +322,9 @@
         <requirement>
           <role>org.apache.maven.dotnet.executable.NetExecutableFactory</role>
         </requirement>
+        <requirement>
+          <role>org.apache.maven.dotnet.plugin.PluginContext</role>
+        </requirement>        
       </requirements>
     </component> 
   </components>

Modified: incubator/nmaven/branches/SI_XPT/plugins/maven-solution-plugin/src/main/java/org/apache/maven/dotnet/plugin/solution/SolutionMojo.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_XPT/plugins/maven-solution-plugin/src/main/java/org/apache/maven/dotnet/plugin/solution/SolutionMojo.java?view=diff&rev=532576&r1=532575&r2=532576
==============================================================================
--- incubator/nmaven/branches/SI_XPT/plugins/maven-solution-plugin/src/main/java/org/apache/maven/dotnet/plugin/solution/SolutionMojo.java (original)
+++ incubator/nmaven/branches/SI_XPT/plugins/maven-solution-plugin/src/main/java/org/apache/maven/dotnet/plugin/solution/SolutionMojo.java Wed Apr 25 19:27:42 2007
@@ -1,19 +1,10 @@
 package org.apache.maven.dotnet.plugin.solution;
 
 import org.apache.maven.dotnet.plugin.AbstractMojo;
+import org.apache.maven.dotnet.plugin.FieldAnnotation;
+import org.apache.maven.dotnet.plugin.PluginContext;
 import org.apache.maven.dotnet.executable.NetExecutableFactory;
 import org.apache.maven.project.MavenProject;
-import org.apache.maven.model.io.xpp3.MavenXpp3Writer;
-import org.w3c.dom.Node;
-import org.w3c.dom.Element;
-import org.w3c.dom.Document;
-import org.codehaus.plexus.util.IOUtil;
-
-import javax.xml.transform.dom.DOMSource;
-import java.io.File;
-import java.io.IOException;
-import java.io.StringWriter;
-import java.io.FileOutputStream;
 
 /**
  * Generates resources
@@ -37,7 +28,15 @@
      * @parameter expression="${project}"
      * @required
      */
-    private MavenProject project;
+    @FieldAnnotation()
+    public MavenProject project;
+
+    /**
+     * @parameter expression="${basedir}"
+     * @required
+     */
+    @FieldAnnotation()
+    public String basedir;
 
     /**
      * The Vendor for the executable. Supports MONO and MICROSOFT: the default value is <code>MICROSOFT</code>. Not
@@ -62,6 +61,11 @@
      */
     private org.apache.maven.dotnet.executable.NetExecutableFactory netExecutableFactory;
 
+    /**
+     * @component
+     */
+    private PluginContext pluginContext;
+
     public String getLocalRepository()
     {
         return localRepository;
@@ -72,59 +76,73 @@
         return project;
     }
 
-    public DOMSource getDOMSourceFor( Document document )
+    public NetExecutableFactory getNetExecutableFactory()
     {
-        Element root = document.createElement( "configuration" );
-        document.appendChild( root );
-        Node n1 = document.createElement( "pomFile" );
-        n1.setTextContent( project.getFile().getAbsolutePath() );
-        root.appendChild( n1 );
-        File mavenProjectFile = writeMavenProjectToTempFile(project);
-        Node mavenProjectFileNode = document.createElement( "mavenProject");
-        mavenProjectFileNode.setTextContent( mavenProjectFile.getAbsolutePath());
-        root.appendChild(mavenProjectFileNode);
-        return new DOMSource( document );
+        return netExecutableFactory;
     }
 
-    public File writeMavenProjectToTempFile(MavenProject project)
+    public PluginContext getNetPluginContext()
     {
-        String p = ToString( project );
-        try
-        {
-            File tempFile = File.createTempFile( "MavenProject", ".xml");
-            FileOutputStream fos  = new FileOutputStream(tempFile );
-            fos.write( p.getBytes() );
-            fos.close();
-            return tempFile;
-        }
-        catch ( IOException e )
-        {
-            e.printStackTrace();
-        }
-        return null;
+        return pluginContext;
     }
 
-    private String ToString( MavenProject mavenProject )
+/*
+    private Set<Field> getAnnotatedFieldsFrom( Field[] fields )
     {
-        StringWriter stringWriter = new StringWriter();
-        try
-        {
-            new MavenXpp3Writer().write( stringWriter, project.getModel() );
-        }
-        catch ( IOException e )
+        Set<Field> fieldSet = new HashSet<Field>();
+        for ( Field field : fields )
         {
-            e.printStackTrace();
+            if ( field.getAnnotation( FieldAnnotation.class ) != null )
+            {
+                fieldSet.add( field );
+            }
         }
-        finally
+        return fieldSet;
+    }
+
+    private Set<Class> getConfigurationAppenderClasses()
+    {
+        Set<Class> appenderClasses = new HashSet<Class>();
+        for ( Class c : ConfigurationAppender.class.getClasses() )
         {
-            IOUtil.close( stringWriter );
+            if ( c.getAnnotation( ConfigurationAppenderAnnotation.class ) != null )
+            {
+                appenderClasses.add( c );
+            }
         }
-        return stringWriter.getBuffer().toString().replaceFirst( "<project>",
-                                                                 "<project xmlns=\"http://maven.apache.org/POM/4.0.0\">" );
+        return appenderClasses;
     }
 
-    public NetExecutableFactory getNetExecutableFactory()
+    public DOMSource getDOMSourceFor( Document document )
     {
-        return netExecutableFactory;
+        Element root = document.createElement( "configuration" );
+        document.appendChild( root );
+
+        Set<Field> fields = getAnnotatedFieldsFrom( this.getClass().getDeclaredFields() );
+        Set<Class> appenderClasses = getConfigurationAppenderClasses();
+        for ( Field field : fields )
+        {
+            ConfigurationAppender configurationAppender = pluginContext.getConfigurationAppenderFor( field );
+            try
+            {
+                try
+                {
+                    configurationAppender.append( document, root, FieldInfo.Factory.createFieldInfo( field.getName(),
+                                                                                                     field.get(
+                                                                                                         this ) ) );
+                }
+                catch ( IllegalAccessException e )
+                {
+                    e.printStackTrace();
+                }
+            }
+            catch ( MojoExecutionException e )
+            {
+                e.printStackTrace();
+            }
+        }
+        return new DOMSource( document );
     }
+*/
+
 }



Mime
View raw message