geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r574377 - in /geronimo/server/trunk/maven-plugins/car-maven-plugin/src: it/metadatageneration-2/src/test/resources/META-INF/ it/metadatageneration/src/test/resources/META-INF/ main/java/org/apache/geronimo/mavenplugins/car/
Date Mon, 10 Sep 2007 21:22:41 GMT
Author: djencks
Date: Mon Sep 10 14:22:41 2007
New Revision: 574377

URL: http://svn.apache.org/viewvc?rev=574377&view=rev
Log:
GERONIMO-3453 workaround major maven problem where the gbean names were being dropped from
the stuff to go into config.xml

Modified:
    geronimo/server/trunk/maven-plugins/car-maven-plugin/src/it/metadatageneration-2/src/test/resources/META-INF/geronimo-plugin.xml
    geronimo/server/trunk/maven-plugins/car-maven-plugin/src/it/metadatageneration/src/test/resources/META-INF/geronimo-plugin.xml
    geronimo/server/trunk/maven-plugins/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/PluginMetadataGeneratorMojo.java

Modified: geronimo/server/trunk/maven-plugins/car-maven-plugin/src/it/metadatageneration-2/src/test/resources/META-INF/geronimo-plugin.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/maven-plugins/car-maven-plugin/src/it/metadatageneration-2/src/test/resources/META-INF/geronimo-plugin.xml?rev=574377&r1=574376&r2=574377&view=diff
==============================================================================
--- geronimo/server/trunk/maven-plugins/car-maven-plugin/src/it/metadatageneration-2/src/test/resources/META-INF/geronimo-plugin.xml
(original)
+++ geronimo/server/trunk/maven-plugins/car-maven-plugin/src/it/metadatageneration-2/src/test/resources/META-INF/geronimo-plugin.xml
Mon Sep 10 14:22:41 2007
@@ -43,7 +43,7 @@
         <source-repository>http://bar.com</source-repository>
         <copy-file relative-to="WEB-INF" dest-dir="bar">META-INF/foo.xml</copy-file>
         <config-xml-content>
-            <ns2:gbean>
+            <ns2:gbean name="DownloadedPluginRepos">
                 <ns2:attribute name="repositoryList">http://geronimo.apache.org/plugins/plugin-repository-list-2.1.txt</ns2:attribute>
                 <ns2:attribute name="userRepositories">~/.m2/repository,${key1}</ns2:attribute>
             </ns2:gbean>

Modified: geronimo/server/trunk/maven-plugins/car-maven-plugin/src/it/metadatageneration/src/test/resources/META-INF/geronimo-plugin.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/maven-plugins/car-maven-plugin/src/it/metadatageneration/src/test/resources/META-INF/geronimo-plugin.xml?rev=574377&r1=574376&r2=574377&view=diff
==============================================================================
--- geronimo/server/trunk/maven-plugins/car-maven-plugin/src/it/metadatageneration/src/test/resources/META-INF/geronimo-plugin.xml
(original)
+++ geronimo/server/trunk/maven-plugins/car-maven-plugin/src/it/metadatageneration/src/test/resources/META-INF/geronimo-plugin.xml
Mon Sep 10 14:22:41 2007
@@ -42,7 +42,7 @@
         <source-repository>http://bar.com</source-repository>
         <copy-file relative-to="WEB-INF" dest-dir="bar">META-INF/foo.xml</copy-file>
         <config-xml-content>
-            <ns2:gbean>
+            <ns2:gbean name="DownloadedPluginRepos">
                 <ns2:attribute name="repositoryList">http://geronimo.apache.org/plugins/plugin-repository-list-2.1.txt</ns2:attribute>
                 <ns2:attribute name="userRepositories">~/.m2/repository,${key1}</ns2:attribute>
             </ns2:gbean>

Modified: geronimo/server/trunk/maven-plugins/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/PluginMetadataGeneratorMojo.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/maven-plugins/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/PluginMetadataGeneratorMojo.java?rev=574377&r1=574376&r2=574377&view=diff
==============================================================================
--- geronimo/server/trunk/maven-plugins/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/PluginMetadataGeneratorMojo.java
(original)
+++ geronimo/server/trunk/maven-plugins/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/PluginMetadataGeneratorMojo.java
Mon Sep 10 14:22:41 2007
@@ -34,6 +34,7 @@
 import org.apache.geronimo.system.plugin.model.PluginType;
 import org.apache.maven.model.License;
 import org.codehaus.plexus.configuration.PlexusConfiguration;
+import org.codehaus.plexus.util.xml.Xpp3Dom;
 
 /**
  * Generate a geronimo-plugin.xml file based on configuration in the pom and car-maven-plugin
configuration.
@@ -109,11 +110,10 @@
 
     /**
      * Configuration for this instance itself.  This is a plugin-artifactType element without
moduleId or dependencies. Do not include more than one of these in the parent poms
-     * since maven will not merge them correctly.
+     * since maven will not merge them correctly.  Actually we have to fish this out of the
model since maven mangles the xml for us.
      *
-     * @parameter
      */
-    private PlexusConfiguration instance;
+//    private PlexusConfiguration instance;
 
     protected void doExecute() throws Exception {
 
@@ -133,10 +133,14 @@
         }
 
         PluginArtifactType instance;
-        if (this.instance == null || this.instance.getChild("plugin-artifact") == null) {
+        Xpp3Dom dom = (Xpp3Dom) ((org.apache.maven.model.Plugin)project.getModel().getBuild().getPluginsAsMap().get(
"org.apache.geronimo.plugins:car-maven-plugin")).getConfiguration();
+        Xpp3Dom instanceDom = dom.getChild("instance");
+
+        if (instanceDom == null || instanceDom.getChild("plugin-artifact") == null) {
             instance = new PluginArtifactType();
         } else {
-            instance = PluginInstallerGBean.loadPluginArtifactMetadata(new StringReader(this.instance.getChild("plugin-artifact").toString().replace("#{",
"${")));
+            String instanceString = instanceDom.getChild("plugin-artifact").toString();
+            instance = PluginInstallerGBean.loadPluginArtifactMetadata(new StringReader(instanceString.replace("#{",
"${")));
         }
         if (this.commonInstance != null && this.commonInstance.getChild("plugin-artifact")
!= null) {
             PluginArtifactType commonInstance = PluginInstallerGBean.loadPluginArtifactMetadata(new
StringReader(this.commonInstance.getChild("plugin-artifact").toString().replace("#{", "${")));



Mime
View raw message