maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r527159 - in /maven/plugins/trunk/maven-remote-resources-plugin: ./ pom.xml src/main/java/org/apache/maven/plugin/resources/remote/ProcessRemoteResourcesMojo.java src/main/mdo/supplemental-model.mdo
Date Tue, 10 Apr 2007 15:42:29 GMT
Author: dkulp
Date: Tue Apr 10 08:42:28 2007
New Revision: 527159

URL: http://svn.apache.org/viewvc?view=rev&rev=527159
Log:
Update to use DOM in the mdo so the supplements can be pure XML and not CDATA sections

Modified:
    maven/plugins/trunk/maven-remote-resources-plugin/   (props changed)
    maven/plugins/trunk/maven-remote-resources-plugin/pom.xml
    maven/plugins/trunk/maven-remote-resources-plugin/src/main/java/org/apache/maven/plugin/resources/remote/ProcessRemoteResourcesMojo.java
    maven/plugins/trunk/maven-remote-resources-plugin/src/main/mdo/supplemental-model.mdo

Propchange: maven/plugins/trunk/maven-remote-resources-plugin/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Tue Apr 10 08:42:28 2007
@@ -5,3 +5,7 @@
 .settings
 .classpath
 .project
+.checkstyle
+.pmd
+.ruleset
+

Modified: maven/plugins/trunk/maven-remote-resources-plugin/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-remote-resources-plugin/pom.xml?view=diff&rev=527159&r1=527158&r2=527159
==============================================================================
--- maven/plugins/trunk/maven-remote-resources-plugin/pom.xml (original)
+++ maven/plugins/trunk/maven-remote-resources-plugin/pom.xml Tue Apr 10 08:42:28 2007
@@ -106,7 +106,7 @@
       <plugin>
         <groupId>org.codehaus.modello</groupId>
         <artifactId>modello-maven-plugin</artifactId>
-        <version>1.0-alpha-7</version>
+        <version>1.0-alpha-15</version>
         <executions>
           <execution>
             <id>site-docs</id>

Modified: maven/plugins/trunk/maven-remote-resources-plugin/src/main/java/org/apache/maven/plugin/resources/remote/ProcessRemoteResourcesMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-remote-resources-plugin/src/main/java/org/apache/maven/plugin/resources/remote/ProcessRemoteResourcesMojo.java?view=diff&rev=527159&r1=527158&r2=527159
==============================================================================
--- maven/plugins/trunk/maven-remote-resources-plugin/src/main/java/org/apache/maven/plugin/resources/remote/ProcessRemoteResourcesMojo.java
(original)
+++ maven/plugins/trunk/maven-remote-resources-plugin/src/main/java/org/apache/maven/plugin/resources/remote/ProcessRemoteResourcesMojo.java
Tue Apr 10 08:42:28 2007
@@ -52,8 +52,8 @@
 import org.apache.maven.model.io.xpp3.MavenXpp3Reader;
 import org.apache.maven.plugin.AbstractMojo;
 import org.apache.maven.plugin.MojoExecutionException;
-import org.apache.maven.plugin.resources.SupplementalDataModel;
-import org.apache.maven.plugin.resources.io.xpp3.SupplementalDataModelXpp3Reader;
+import org.apache.maven.plugin.resources.remote.SupplementalDataModel;
+import org.apache.maven.plugin.resources.remote.io.xpp3.SupplementalDataModelXpp3Reader;
 import org.apache.maven.plugin.resources.remote.io.xpp3.RemoteResourcesBundleXpp3Reader;
 import org.apache.maven.project.InvalidProjectModelException;
 import org.apache.maven.project.MavenProject;
@@ -70,6 +70,7 @@
 import org.codehaus.plexus.resource.loader.FileResourceLoader;
 import org.codehaus.plexus.util.FileUtils;
 import org.codehaus.plexus.util.StringUtils;
+import org.codehaus.plexus.util.xml.Xpp3Dom;
 import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
 import org.codehaus.plexus.velocity.VelocityComponent;
 
@@ -655,7 +656,7 @@
         }
     }
 
-    protected Model getSupplement( String supplementModelXml )
+    protected Model getSupplement( Xpp3Dom supplementModelXml )
         throws MojoExecutionException
     {
         MavenXpp3Reader modelReader = new MavenXpp3Reader();
@@ -663,7 +664,7 @@
         
         try
         {
-            model = modelReader.read( new StringReader( supplementModelXml ) );
+            model = modelReader.read( new StringReader( supplementModelXml.toString() ) );
             String groupId = model.getGroupId();
             String artifactId = model.getArtifactId();
     
@@ -753,7 +754,11 @@
         
         for ( Iterator i = supplements.iterator(); i.hasNext(); )
         {
-            Model m = getSupplement( (String) i.next() );
+            SupplementalData sd = (SupplementalData) i.next();
+            
+            Xpp3Dom dom = (Xpp3Dom)sd.getProject();
+            
+            Model m = getSupplement( dom );
             supplementMap.put( generateSupplementMapKey( m.getGroupId(), m.getArtifactId()
), m );
         }
         

Modified: maven/plugins/trunk/maven-remote-resources-plugin/src/main/mdo/supplemental-model.mdo
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-remote-resources-plugin/src/main/mdo/supplemental-model.mdo?view=diff&rev=527159&r1=527158&r2=527159
==============================================================================
--- maven/plugins/trunk/maven-remote-resources-plugin/src/main/mdo/supplemental-model.mdo
(original)
+++ maven/plugins/trunk/maven-remote-resources-plugin/src/main/mdo/supplemental-model.mdo
Tue Apr 10 08:42:28 2007
@@ -24,7 +24,7 @@
   <defaults>
     <default>
       <key>package</key>
-      <value>org.apache.maven.plugin.resources</value>
+      <value>org.apache.maven.plugin.resources.remote</value>
     </default>
   </defaults>
   <classes>
@@ -38,11 +38,24 @@
           <version>1.0.0</version>
           <description>Snippits of POM xml files used to supplement the data model.</description>
           <association>
-            <type>String</type>
+            <type>SupplementalData</type>
             <multiplicity>*</multiplicity>
           </association>
         </field>
       </fields>
+    </class>
+    <class>
+      <name>SupplementalData</name>
+      <version>1.0.0</version>
+      <description>A single supplement</description>
+      <fields>
+        <field>
+          <name>project</name>
+          <version>1.0.0</version>
+          <description>Snippits of POM xml files used to supplement the data model.</description>
+          <type>DOM</type>
+        </field>
+	  </fields>    	
     </class>
   </classes>
 </model>



Mime
View raw message