geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r573409 - in /geronimo/server/trunk: configs/ configs/ca-helper-jetty/ configs/ca-helper-tomcat/ configs/dojo-jetty6/ configs/dojo-tomcat/ configs/jsp-examples-jetty/ configs/jsp-examples-tomcat/ configs/webconsole-jetty6/ maven-plugins/car...
Date Thu, 06 Sep 2007 23:32:31 GMT
Author: djencks
Date: Thu Sep  6 16:32:30 2007
New Revision: 573409

URL: http://svn.apache.org/viewvc?rev=573409&view=rev
Log:
GERONIMO-3330 GERONIMO-3453  More changes.  Car-maven-plugin now uses same format for the plugin bits as the geronimo-plugin.xml

Modified:
    geronimo/server/trunk/configs/ca-helper-jetty/pom.xml
    geronimo/server/trunk/configs/ca-helper-tomcat/pom.xml
    geronimo/server/trunk/configs/dojo-jetty6/pom.xml
    geronimo/server/trunk/configs/dojo-tomcat/pom.xml
    geronimo/server/trunk/configs/jsp-examples-jetty/pom.xml
    geronimo/server/trunk/configs/jsp-examples-tomcat/pom.xml
    geronimo/server/trunk/configs/pom.xml
    geronimo/server/trunk/configs/webconsole-jetty6/pom.xml
    geronimo/server/trunk/maven-plugins/car-maven-plugin/pom.xml
    geronimo/server/trunk/maven-plugins/car-maven-plugin/src/it/metadatageneration/pom.xml
    geronimo/server/trunk/maven-plugins/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/PluginMetadataGeneratorMojo.java
    geronimo/server/trunk/maven-plugins/car-maven-plugin/src/test/java/org/apache/geronimo/mavenplugins/car/PluginMetadataTest.java
    geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/plugin/PluginInstallerGBean.java

Modified: geronimo/server/trunk/configs/ca-helper-jetty/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/configs/ca-helper-jetty/pom.xml?rev=573409&r1=573408&r2=573409&view=diff
==============================================================================
--- geronimo/server/trunk/configs/ca-helper-jetty/pom.xml (original)
+++ geronimo/server/trunk/configs/ca-helper-jetty/pom.xml Thu Sep  6 16:32:30 2007
@@ -46,7 +46,7 @@
             <type>war</type>
             <scope>test</scope>
         </dependency>
-        
+
         <dependency>
             <groupId>org.apache.geronimo.configs</groupId>
             <artifactId>jetty6-deployer</artifactId>
@@ -69,7 +69,7 @@
         </dependency>
 
     </dependencies>
-    
+
     <build>
         <resources>
             <resource>
@@ -77,7 +77,7 @@
                 <filtering>true</filtering>
             </resource>
         </resources>
-        
+
         <plugins>
             <plugin>
                 <groupId>org.apache.geronimo.plugins</groupId>
@@ -103,27 +103,29 @@
                             <type>car</type>
                         </dependency>
                     </dependencies>
-                    <prerequisites>
-                        <prerequisite>
-                            <id>
-                                <groupId>org.apache.geronimo.configs</groupId>
-                                <artifactId>jetty6</artifactId>
-                            </id>
-                            <resource-type>Web Container</resource-type>
-                            <description>The Jetty web container</description>
-                        </prerequisite>
-                        <prerequisite>
-                            <id>
-                                <groupId>org.apache.geronimo.configs</groupId>
-                                <artifactId>jasper</artifactId>
-                            </id>
-                            <resource-type>Web Container</resource-type>
-                            <description>The Jasper subsystem</description>
-                        </prerequisite>
-                    </prerequisites>
+                    <instance>
+                        <plugin-artifact>
+                            <prerequisite>
+                                <id>
+                                    <groupId>org.apache.geronimo.configs</groupId>
+                                    <artifactId>jetty6</artifactId>
+                                </id>
+                                <resource-type>Web Container</resource-type>
+                                <description>The Jetty web container</description>
+                            </prerequisite>
+                            <prerequisite>
+                                <id>
+                                    <groupId>org.apache.geronimo.configs</groupId>
+                                    <artifactId>jasper</artifactId>
+                                </id>
+                                <resource-type>Web Container</resource-type>
+                                <description>The Jasper subsystem</description>
+                            </prerequisite>
+                        </plugin-artifact>
+                    </instance>
                 </configuration>
             </plugin>
         </plugins>
     </build>
-    
+
 </project>

Modified: geronimo/server/trunk/configs/ca-helper-tomcat/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/configs/ca-helper-tomcat/pom.xml?rev=573409&r1=573408&r2=573409&view=diff
==============================================================================
--- geronimo/server/trunk/configs/ca-helper-tomcat/pom.xml (original)
+++ geronimo/server/trunk/configs/ca-helper-tomcat/pom.xml Thu Sep  6 16:32:30 2007
@@ -46,7 +46,7 @@
             <type>war</type>
             <scope>test</scope>
         </dependency>
-        
+
         <dependency>
             <groupId>org.apache.geronimo.configs</groupId>
             <artifactId>tomcat6-deployer</artifactId>
@@ -69,7 +69,7 @@
         </dependency>
 
     </dependencies>
-    
+
     <build>
         <resources>
             <resource>
@@ -77,7 +77,7 @@
                 <filtering>true</filtering>
             </resource>
         </resources>
-        
+
         <plugins>
             <plugin>
                 <groupId>org.apache.geronimo.plugins</groupId>
@@ -103,27 +103,30 @@
                             <type>car</type>
                         </dependency>
                     </dependencies>
-                    <prerequisites>
-                        <prerequisite>
-                            <id>
-                                <groupId>org.apache.geronimo.configs</groupId>
-                                <artifactId>tomcat</artifactId>
-                            </id>
-                            <resource-type>Web Container</resource-type>
-                            <description>The Tomcat web container</description>
-                        </prerequisite>
-                        <prerequisite>
-                            <id>
-                                <groupId>org.apache.geronimo.configs</groupId>
-                                <artifactId>jasper</artifactId>
-                            </id>
-                            <resource-type>Web Container</resource-type>
-                            <description>The Jasper subsystem</description>
-                        </prerequisite>
-                    </prerequisites>
+                    <instance>
+                        <plugin-artifact>
+                            <prerequisite>
+                                <id>
+                                    <groupId>org.apache.geronimo.configs</groupId>
+                                    <artifactId>tomcat</artifactId>
+                                </id>
+                                <resource-type>Web Container</resource-type>
+                                <description>The Tomcat web container</description>
+                            </prerequisite>
+                            <prerequisite>
+                                <id>
+                                    <groupId>org.apache.geronimo.configs</groupId>
+                                    <artifactId>jasper</artifactId>
+                                </id>
+                                <resource-type>Web Container</resource-type>
+                                <description>The Jasper subsystem</description>
+                            </prerequisite>
+                        </plugin-artifact>
+
+                    </instance>
                 </configuration>
             </plugin>
         </plugins>
     </build>
-    
+
 </project>

Modified: geronimo/server/trunk/configs/dojo-jetty6/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/configs/dojo-jetty6/pom.xml?rev=573409&r1=573408&r2=573409&view=diff
==============================================================================
--- geronimo/server/trunk/configs/dojo-jetty6/pom.xml (original)
+++ geronimo/server/trunk/configs/dojo-jetty6/pom.xml Thu Sep  6 16:32:30 2007
@@ -97,24 +97,26 @@
                             <type>car</type>
                         </dependency>
                     </dependencies>
-                    <prerequisites>
-                        <prerequisite>
-                            <id>
-                                <groupId>org.apache.geronimo.configs</groupId>
-                                <artifactId>jetty6</artifactId>
-                            </id>
-                            <resource-type>Web Container</resource-type>
-                            <description>The Jetty web container</description>
-                        </prerequisite>
-                        <prerequisite>
-                            <id>
-                                <groupId>org.apache.geronimo.configs</groupId>
-                                <artifactId>jasper</artifactId>
-                            </id>
-                            <resource-type>Web Container</resource-type>
-                            <description>The Jasper subsystem</description>
-                        </prerequisite>
-                    </prerequisites>
+                    <instance>
+                        <plugin-artifact>
+                            <prerequisite>
+                                <id>
+                                    <groupId>org.apache.geronimo.configs</groupId>
+                                    <artifactId>jetty6</artifactId>
+                                </id>
+                                <resource-type>Web Container</resource-type>
+                                <description>The Jetty web container</description>
+                            </prerequisite>
+                            <prerequisite>
+                                <id>
+                                    <groupId>org.apache.geronimo.configs</groupId>
+                                    <artifactId>jasper</artifactId>
+                                </id>
+                                <resource-type>Web Container</resource-type>
+                                <description>The Jasper subsystem</description>
+                            </prerequisite>
+                        </plugin-artifact>
+                    </instance>
                 </configuration>
             </plugin>
         </plugins>

Modified: geronimo/server/trunk/configs/dojo-tomcat/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/configs/dojo-tomcat/pom.xml?rev=573409&r1=573408&r2=573409&view=diff
==============================================================================
--- geronimo/server/trunk/configs/dojo-tomcat/pom.xml (original)
+++ geronimo/server/trunk/configs/dojo-tomcat/pom.xml Thu Sep  6 16:32:30 2007
@@ -46,7 +46,7 @@
             <version>${version}</version>
             <type>war</type>
         </dependency>
-        
+
         <dependency>
             <groupId>org.apache.geronimo.configs</groupId>
             <artifactId>jasper</artifactId>
@@ -62,7 +62,7 @@
             <scope>provided</scope>
         </dependency>
     </dependencies>
-    
+
     <build>
         <resources>
             <resource>
@@ -70,7 +70,7 @@
                 <filtering>true</filtering>
             </resource>
         </resources>
-        
+
         <plugins>
             <plugin>
                 <groupId>org.apache.geronimo.plugins</groupId>
@@ -96,27 +96,29 @@
                             <type>car</type>
                         </dependency>
                     </dependencies>
-                    <prerequisites>
-                        <prerequisite>
-                            <id>
-                                <groupId>org.apache.geronimo.configs</groupId>
-                                <artifactId>tomcat6</artifactId>
-                            </id>
-                            <resource-type>Web Container</resource-type>
-                            <description>The Tomcat web container</description>
-                        </prerequisite>
-                        <prerequisite>
-                            <id>
-                                <groupId>org.apache.geronimo.configs</groupId>
-                                <artifactId>jasper</artifactId>
-                            </id>
-                            <resource-type>Web Container</resource-type>
-                            <description>The Jasper subsystem</description>
-                        </prerequisite>
-                    </prerequisites>
+                    <instance>
+                        <plugin-artifact>
+                            <prerequisite>
+                                <id>
+                                    <groupId>org.apache.geronimo.configs</groupId>
+                                    <artifactId>tomcat6</artifactId>
+                                </id>
+                                <resource-type>Web Container</resource-type>
+                                <description>The Tomcat web container</description>
+                            </prerequisite>
+                            <prerequisite>
+                                <id>
+                                    <groupId>org.apache.geronimo.configs</groupId>
+                                    <artifactId>jasper</artifactId>
+                                </id>
+                                <resource-type>Web Container</resource-type>
+                                <description>The Jasper subsystem</description>
+                            </prerequisite>
+                        </plugin-artifact>
+                    </instance>
                 </configuration>
             </plugin>
         </plugins>
     </build>
-    
+
 </project>

Modified: geronimo/server/trunk/configs/jsp-examples-jetty/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/configs/jsp-examples-jetty/pom.xml?rev=573409&r1=573408&r2=573409&view=diff
==============================================================================
--- geronimo/server/trunk/configs/jsp-examples-jetty/pom.xml (original)
+++ geronimo/server/trunk/configs/jsp-examples-jetty/pom.xml Thu Sep  6 16:32:30 2007
@@ -33,19 +33,19 @@
     <name>Geronimo Configs :: JSP Examples Jetty</name>
     <packaging>car</packaging>
     <description>
-        The JSP examples originally developed for Tomcat.  Can be found
-        via HTTP at /jsp-examples/ after installation.  These examples give
+        The JSP examples originally developed for Tomcat. Can be found
+        via HTTP at /jsp-examples/ after installation. These examples give
         a basic introduction to JSP development along with sample code.
     </description>
 
     <dependencies>
-        
+
         <!--<dependency>-->
-            <!--<groupId>org.apache.geronimo.configs</groupId>-->
-            <!--<artifactId>jetty-deployer</artifactId>-->
-            <!--<version>${version}</version>-->
-            <!--<type>car</type>-->
-            <!--<scope>test</scope>-->
+        <!--<groupId>org.apache.geronimo.configs</groupId>-->
+        <!--<artifactId>jetty-deployer</artifactId>-->
+        <!--<version>${version}</version>-->
+        <!--<type>car</type>-->
+        <!--<scope>test</scope>-->
         <!--</dependency>-->
 
         <dependency>
@@ -54,7 +54,7 @@
             <version>${version}</version>
             <type>war</type>
         </dependency>
-        
+
         <dependency>
             <groupId>org.apache.geronimo.configs</groupId>
             <artifactId>jetty6-deployer</artifactId>
@@ -76,7 +76,7 @@
             <type>car</type>
         </dependency>
     </dependencies>
-    
+
     <build>
         <resources>
             <resource>
@@ -84,7 +84,7 @@
                 <filtering>true</filtering>
             </resource>
         </resources>
-        
+
         <plugins>
             <plugin>
                 <groupId>org.apache.geronimo.plugins</groupId>
@@ -102,7 +102,7 @@
                         <version>${version}</version>
                         <type>war</type>
                     </module>
-                    
+
                     <category>Example</category>
                     <dependencies>
                         <dependency>
@@ -111,27 +111,29 @@
                             <type>car</type>
                         </dependency>
                     </dependencies>
-                    <prerequisites>
-                        <prerequisite>
-                            <id>
-                                <groupId>org.apache.geronimo.configs</groupId>
-                                <artifactId>jetty6</artifactId>
-                            </id>
-                            <resource-type>Web Container</resource-type>
-                            <description>The Jetty web container</description>
-                        </prerequisite>
-                        <prerequisite>
-                            <id>
-                                <groupId>org.apache.geronimo.configs</groupId>
-                                <artifactId>jasper</artifactId>
-                            </id>
-                            <resource-type>Web Container</resource-type>
-                            <description>The Jasper subsystem</description>
-                        </prerequisite>
-                    </prerequisites>
+                    <instance>
+                        <plugin-artifact>
+                            <prerequisite>
+                                <id>
+                                    <groupId>org.apache.geronimo.configs</groupId>
+                                    <artifactId>jetty6</artifactId>
+                                </id>
+                                <resource-type>Web Container</resource-type>
+                                <description>The Jetty web container</description>
+                            </prerequisite>
+                            <prerequisite>
+                                <id>
+                                    <groupId>org.apache.geronimo.configs</groupId>
+                                    <artifactId>jasper</artifactId>
+                                </id>
+                                <resource-type>Web Container</resource-type>
+                                <description>The Jasper subsystem</description>
+                            </prerequisite>
+                        </plugin-artifact>
+                    </instance>
                 </configuration>
             </plugin>
         </plugins>
     </build>
-    
+
 </project>

Modified: geronimo/server/trunk/configs/jsp-examples-tomcat/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/configs/jsp-examples-tomcat/pom.xml?rev=573409&r1=573408&r2=573409&view=diff
==============================================================================
--- geronimo/server/trunk/configs/jsp-examples-tomcat/pom.xml (original)
+++ geronimo/server/trunk/configs/jsp-examples-tomcat/pom.xml Thu Sep  6 16:32:30 2007
@@ -33,20 +33,20 @@
     <name>Geronimo Configs :: JSP Examples Tomcat</name>
     <packaging>car</packaging>
     <description>
-        The JSP examples originally developed for Tomcat.  Can be found
-        via HTTP at /jsp-examples/ after installation.  These examples give
+        The JSP examples originally developed for Tomcat. Can be found
+        via HTTP at /jsp-examples/ after installation. These examples give
         a basic introduction to JSP development along with sample code.
     </description>
-    
+
     <dependencies>
-        
+
         <dependency>
             <groupId>org.apache.geronimo.applications.examples</groupId>
             <artifactId>geronimo-jsp-examples</artifactId>
             <version>${version}</version>
             <type>war</type>
         </dependency>
-        
+
         <dependency>
             <groupId>org.apache.geronimo.configs</groupId>
             <artifactId>tomcat6-deployer</artifactId>
@@ -68,7 +68,7 @@
             <type>car</type>
         </dependency>
     </dependencies>
-    
+
     <build>
         <resources>
             <resource>
@@ -76,7 +76,7 @@
                 <filtering>true</filtering>
             </resource>
         </resources>
-        
+
         <plugins>
             <plugin>
                 <groupId>org.apache.geronimo.plugins</groupId>
@@ -102,27 +102,29 @@
                             <type>car</type>
                         </dependency>
                     </dependencies>
-                    <prerequisites>
-                        <prerequisite>
-                            <id>
-                                <groupId>org.apache.geronimo.configs</groupId>
-                                <artifactId>tomcat</artifactId>
-                            </id>
-                            <resource-type>Web Container</resource-type>
-                            <description>The Tomcat web container</description>
-                        </prerequisite>
-                        <prerequisite>
-                            <id>
-                                <groupId>org.apache.geronimo.configs</groupId>
-                                <artifactId>jasper</artifactId>
-                            </id>
-                            <resource-type>Web Container</resource-type>
-                            <description>The Jasper subsystem</description>
-                        </prerequisite>
-                    </prerequisites>
+                    <instance>
+                        <plugin-artifact>
+                            <prerequisite>
+                                <id>
+                                    <groupId>org.apache.geronimo.configs</groupId>
+                                    <artifactId>tomcat</artifactId>
+                                </id>
+                                <resource-type>Web Container</resource-type>
+                                <description>The Tomcat web container</description>
+                            </prerequisite>
+                            <prerequisite>
+                                <id>
+                                    <groupId>org.apache.geronimo.configs</groupId>
+                                    <artifactId>jasper</artifactId>
+                                </id>
+                                <resource-type>Web Container</resource-type>
+                                <description>The Jasper subsystem</description>
+                            </prerequisite>
+                        </plugin-artifact>
+                    </instance>
                 </configuration>
             </plugin>
         </plugins>
     </build>
-    
+
 </project>

Modified: geronimo/server/trunk/configs/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/configs/pom.xml?rev=573409&r1=573408&r2=573409&view=diff
==============================================================================
--- geronimo/server/trunk/configs/pom.xml (original)
+++ geronimo/server/trunk/configs/pom.xml Thu Sep  6 16:32:30 2007
@@ -103,16 +103,14 @@
                         <addMavenDescriptor>false</addMavenDescriptor>
                     </archive>
                     <osiApproved>true</osiApproved>
-                    <geronimoVersions>
-                        <value>${geronimoVersion}</value>
-                    </geronimoVersions>
-                    <jvmVersions>
-                        <value>1.5</value>
-                    </jvmVersions>
-                    <sourceRepositories>
-                        <value>http://www.geronimoplugins.com/repository/geronimo-1.1</value>
-                        <value>http://repo1.maven.org/maven2/</value>
-                    </sourceRepositories>
+                    <commonInstance>
+                        <plugin-artifact>
+                            <geronimo-version>${geronimoVersion}</geronimo-version>
+                            <jvm-version>1.5</jvm-version>
+                            <source-repository>http://www.geronimoplugins.com/repository/geronimo-1.1</source-repository>
+                            <source-repository>http://repo1.maven.org/maven2/</source-repository>
+                        </plugin-artifact>
+                    </commonInstance>
                 </configuration>
             </plugin>
         </plugins>

Modified: geronimo/server/trunk/configs/webconsole-jetty6/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/configs/webconsole-jetty6/pom.xml?rev=573409&r1=573408&r2=573409&view=diff
==============================================================================
--- geronimo/server/trunk/configs/webconsole-jetty6/pom.xml (original)
+++ geronimo/server/trunk/configs/webconsole-jetty6/pom.xml Thu Sep  6 16:32:30 2007
@@ -33,10 +33,10 @@
     <name>Geronimo Admin Console (Jetty)</name>
     <packaging>car</packaging>
     <description>
-        The web-based administration console for Geronimo.  You can
+        The web-based administration console for Geronimo. You can
         reach it via HTTP at /console and use it to configure the Geronimo
         installation as well as services like JDBC connection pools, JMS resources,
-        security realms, keystores, etc.  It provides simple statistics on the
+        security realms, keystores, etc. It provides simple statistics on the
         running Geronimo server, as well as letting you review and deploy applications
         and plugins.
     </description>
@@ -63,7 +63,7 @@
             <version>${version}</version>
             <type>car</type>
         </dependency>
-        
+
         <dependency>
             <groupId>org.apache.geronimo.configs</groupId>
             <artifactId>system-database</artifactId>
@@ -154,7 +154,7 @@
             <groupId>jdom</groupId>
             <artifactId>jdom</artifactId>
         </dependency>
-        
+
         <dependency>
             <groupId>org.apache.pluto</groupId>
             <artifactId>pluto</artifactId>
@@ -164,7 +164,7 @@
             <groupId>portlet-api</groupId>
             <artifactId>portlet-api</artifactId>
         </dependency>
-        
+
         <!-- Added to eliminate packaging of libraries in WEB-INF/lib in console-standard and console-framework applications -->
         <dependency>
             <groupId>org.apache.pluto</groupId>
@@ -208,7 +208,7 @@
         </dependency>
 
     </dependencies>
-    
+
     <build>
         <resources>
             <resource>
@@ -216,7 +216,7 @@
                 <filtering>true</filtering>
             </resource>
         </resources>
-        
+
         <plugins>
             <plugin>
                 <groupId>org.apache.geronimo.plugins</groupId>
@@ -237,190 +237,192 @@
 
                     <category>Core Geronimo</category>
                     <dependencies>
-                      <dependency>
-                        <groupId>org.apache.pluto</groupId>
-                        <artifactId>pluto-descriptors</artifactId>
-                        <version>1.0.1</version>
-                        <type>jar</type>
-                        <import>classes</import>
-                      </dependency>
-                      <dependency>
-                        <groupId>org.apache.geronimo.configs</groupId>
-                        <artifactId>connector-deployer</artifactId>
-                        <type>car</type>
-                      </dependency>
-                      <dependency>
-                        <groupId>commons-io</groupId>
-                        <artifactId>commons-io</artifactId>
-                        <version>1.1</version>
-                        <type>jar</type>
-                        <import>classes</import>
-                      </dependency>
-                      <dependency>
-                        <groupId>org.apache.geronimo.configs</groupId>
-                        <artifactId>j2ee-corba-yoko</artifactId>
-                        <type>car</type>
-                      </dependency>
-                      <dependency>
-                        <groupId>org.apache.geronimo.configs</groupId>
-                        <artifactId>jetty6-deployer</artifactId>
-                        <type>car</type>
-                      </dependency>
-                      <dependency>
-                        <groupId>org.apache.geronimo.modules</groupId>
-                        <artifactId>geronimo-upgrade</artifactId>
-                        <version>2.1-SNAPSHOT</version>
-                        <type>jar</type>
-                        <import>classes</import>
-                      </dependency>
-                      <dependency>
-                        <groupId>commons-digester</groupId>
-                        <artifactId>commons-digester</artifactId>
-                        <version>1.8</version>
-                        <type>jar</type>
-                        <import>classes</import>
-                      </dependency>
-                      <dependency>
-                        <groupId>portlet-api</groupId>
-                        <artifactId>portlet-api</artifactId>
-                        <version>1.0</version>
-                        <type>jar</type>
-                        <import>classes</import>
-                      </dependency>
-                      <dependency>
-                        <groupId>org.apache.geronimo.modules</groupId>
-                        <artifactId>geronimo-management</artifactId>
-                        <version>2.1-SNAPSHOT</version>
-                        <type>jar</type>
-                        <import>classes</import>
-                      </dependency>
-                      <dependency>
-                        <groupId>org.apache.geronimo.configs</groupId>
-                        <artifactId>jasper</artifactId>
-                        <type>car</type>
-                      </dependency>
-                      <dependency>
-                        <groupId>org.apache.geronimo.modules</groupId>
-                        <artifactId>geronimo-activemq-management</artifactId>
-                        <version>2.1-SNAPSHOT</version>
-                        <type>jar</type>
-                        <import>classes</import>
-                      </dependency>
-                      <dependency>
-                        <groupId>commons-fileupload</groupId>
-                        <artifactId>commons-fileupload</artifactId>
-                        <version>1.1.1</version>
-                        <type>jar</type>
-                        <import>classes</import>
-                      </dependency>
-                      <dependency>
-                        <groupId>jdom</groupId>
-                        <artifactId>jdom</artifactId>
-                        <version>1.0</version>
-                        <type>jar</type>
-                        <import>classes</import>
-                      </dependency>
-                      <dependency>
-                        <groupId>org.apache.geronimo.modules</groupId>
-                        <artifactId>geronimo-deploy-jsr88</artifactId>
-                        <version>2.1-SNAPSHOT</version>
-                        <type>jar</type>
-                        <import>classes</import>
-                      </dependency>
-                      <dependency>
-                        <groupId>org.apache.geronimo.modules</groupId>
-                        <artifactId>geronimo-converter</artifactId>
-                        <version>2.1-SNAPSHOT</version>
-                        <type>jar</type>
-                        <import>classes</import>
-                      </dependency>
-                      <dependency>
-                        <groupId>org.apache.geronimo.modules</groupId>
-                        <artifactId>geronimo-activemq</artifactId>
-                        <version>2.1-SNAPSHOT</version>
-                        <type>jar</type>
-                        <import>classes</import>
-                      </dependency>
-                      <dependency>
-                        <groupId>org.apache.pluto</groupId>
-                        <artifactId>pluto-portal</artifactId>
-                        <version>1.0.1</version>
-                        <type>jar</type>
-                        <import>classes</import>
-                      </dependency>
-                      <dependency>
-                        <groupId>org.apache.geronimo.configs</groupId>
-                        <artifactId>dojo-jetty6</artifactId>
-                        <type>car</type>
-                      </dependency>
-                      <dependency>
-                        <groupId>org.apache.geronimo.configs</groupId>
-                        <artifactId>j2ee-server</artifactId>
-                        <type>car</type>
-                      </dependency>
-                      <dependency>
-                        <groupId>org.apache.geronimo.configs</groupId>
-                        <artifactId>system-database</artifactId>
-                        <type>car</type>
-                      </dependency>
-                      <dependency>
-                        <groupId>org.codehaus.castor</groupId>
-                        <artifactId>castor</artifactId>
-                        <version>1.0.5</version>
-                        <type>jar</type>
-                        <import>classes</import>
-                      </dependency>
-                      <dependency>
-                        <groupId>org.apache.geronimo.applications.console</groupId>
-                        <artifactId>geronimo-console-core</artifactId>
-                        <version>2.1-SNAPSHOT</version>
-                        <type>jar</type>
-                        <import>classes</import>
-                      </dependency>
-                      <dependency>
-                        <groupId>xerces</groupId>
-                        <artifactId>xercesImpl</artifactId>
-                        <version>2.8.1</version>
-                        <type>jar</type>
-                        <import>classes</import>
-                      </dependency>
-                      <dependency>
-                        <groupId>dwr</groupId>
-                        <artifactId>dwr</artifactId>
-                        <version>1.1.3</version>
-                        <type>jar</type>
-                        <import>classes</import>
-                      </dependency>
-                      <dependency>
-                        <groupId>org.apache.pluto</groupId>
-                        <artifactId>pluto</artifactId>
-                        <version>1.0.1</version>
-                        <type>jar</type>
-                        <import>classes</import>
-                      </dependency>
+                        <dependency>
+                            <groupId>org.apache.pluto</groupId>
+                            <artifactId>pluto-descriptors</artifactId>
+                            <version>1.0.1</version>
+                            <type>jar</type>
+                            <import>classes</import>
+                        </dependency>
+                        <dependency>
+                            <groupId>org.apache.geronimo.configs</groupId>
+                            <artifactId>connector-deployer</artifactId>
+                            <type>car</type>
+                        </dependency>
+                        <dependency>
+                            <groupId>commons-io</groupId>
+                            <artifactId>commons-io</artifactId>
+                            <version>1.1</version>
+                            <type>jar</type>
+                            <import>classes</import>
+                        </dependency>
+                        <dependency>
+                            <groupId>org.apache.geronimo.configs</groupId>
+                            <artifactId>j2ee-corba-yoko</artifactId>
+                            <type>car</type>
+                        </dependency>
+                        <dependency>
+                            <groupId>org.apache.geronimo.configs</groupId>
+                            <artifactId>jetty6-deployer</artifactId>
+                            <type>car</type>
+                        </dependency>
+                        <dependency>
+                            <groupId>org.apache.geronimo.modules</groupId>
+                            <artifactId>geronimo-upgrade</artifactId>
+                            <version>2.1-SNAPSHOT</version>
+                            <type>jar</type>
+                            <import>classes</import>
+                        </dependency>
+                        <dependency>
+                            <groupId>commons-digester</groupId>
+                            <artifactId>commons-digester</artifactId>
+                            <version>1.8</version>
+                            <type>jar</type>
+                            <import>classes</import>
+                        </dependency>
+                        <dependency>
+                            <groupId>portlet-api</groupId>
+                            <artifactId>portlet-api</artifactId>
+                            <version>1.0</version>
+                            <type>jar</type>
+                            <import>classes</import>
+                        </dependency>
+                        <dependency>
+                            <groupId>org.apache.geronimo.modules</groupId>
+                            <artifactId>geronimo-management</artifactId>
+                            <version>2.1-SNAPSHOT</version>
+                            <type>jar</type>
+                            <import>classes</import>
+                        </dependency>
+                        <dependency>
+                            <groupId>org.apache.geronimo.configs</groupId>
+                            <artifactId>jasper</artifactId>
+                            <type>car</type>
+                        </dependency>
+                        <dependency>
+                            <groupId>org.apache.geronimo.modules</groupId>
+                            <artifactId>geronimo-activemq-management</artifactId>
+                            <version>2.1-SNAPSHOT</version>
+                            <type>jar</type>
+                            <import>classes</import>
+                        </dependency>
+                        <dependency>
+                            <groupId>commons-fileupload</groupId>
+                            <artifactId>commons-fileupload</artifactId>
+                            <version>1.1.1</version>
+                            <type>jar</type>
+                            <import>classes</import>
+                        </dependency>
+                        <dependency>
+                            <groupId>jdom</groupId>
+                            <artifactId>jdom</artifactId>
+                            <version>1.0</version>
+                            <type>jar</type>
+                            <import>classes</import>
+                        </dependency>
+                        <dependency>
+                            <groupId>org.apache.geronimo.modules</groupId>
+                            <artifactId>geronimo-deploy-jsr88</artifactId>
+                            <version>2.1-SNAPSHOT</version>
+                            <type>jar</type>
+                            <import>classes</import>
+                        </dependency>
+                        <dependency>
+                            <groupId>org.apache.geronimo.modules</groupId>
+                            <artifactId>geronimo-converter</artifactId>
+                            <version>2.1-SNAPSHOT</version>
+                            <type>jar</type>
+                            <import>classes</import>
+                        </dependency>
+                        <dependency>
+                            <groupId>org.apache.geronimo.modules</groupId>
+                            <artifactId>geronimo-activemq</artifactId>
+                            <version>2.1-SNAPSHOT</version>
+                            <type>jar</type>
+                            <import>classes</import>
+                        </dependency>
+                        <dependency>
+                            <groupId>org.apache.pluto</groupId>
+                            <artifactId>pluto-portal</artifactId>
+                            <version>1.0.1</version>
+                            <type>jar</type>
+                            <import>classes</import>
+                        </dependency>
+                        <dependency>
+                            <groupId>org.apache.geronimo.configs</groupId>
+                            <artifactId>dojo-jetty6</artifactId>
+                            <type>car</type>
+                        </dependency>
+                        <dependency>
+                            <groupId>org.apache.geronimo.configs</groupId>
+                            <artifactId>j2ee-server</artifactId>
+                            <type>car</type>
+                        </dependency>
+                        <dependency>
+                            <groupId>org.apache.geronimo.configs</groupId>
+                            <artifactId>system-database</artifactId>
+                            <type>car</type>
+                        </dependency>
+                        <dependency>
+                            <groupId>org.codehaus.castor</groupId>
+                            <artifactId>castor</artifactId>
+                            <version>1.0.5</version>
+                            <type>jar</type>
+                            <import>classes</import>
+                        </dependency>
+                        <dependency>
+                            <groupId>org.apache.geronimo.applications.console</groupId>
+                            <artifactId>geronimo-console-core</artifactId>
+                            <version>2.1-SNAPSHOT</version>
+                            <type>jar</type>
+                            <import>classes</import>
+                        </dependency>
+                        <dependency>
+                            <groupId>xerces</groupId>
+                            <artifactId>xercesImpl</artifactId>
+                            <version>2.8.1</version>
+                            <type>jar</type>
+                            <import>classes</import>
+                        </dependency>
+                        <dependency>
+                            <groupId>dwr</groupId>
+                            <artifactId>dwr</artifactId>
+                            <version>1.1.3</version>
+                            <type>jar</type>
+                            <import>classes</import>
+                        </dependency>
+                        <dependency>
+                            <groupId>org.apache.pluto</groupId>
+                            <artifactId>pluto</artifactId>
+                            <version>1.0.1</version>
+                            <type>jar</type>
+                            <import>classes</import>
+                        </dependency>
                     </dependencies>
-                    <prerequisites>
-                        <prerequisite>
-                            <id>
-                                <groupId>org.apache.geronimo.configs</groupId>
-                                <artifactId>jetty6</artifactId>
-                            </id>
-                            <resource-type>Web Container</resource-type>
-                            <description>The Jetty web container</description>
-                        </prerequisite>
-                        <prerequisite>
-                            <id>
-                                <groupId>org.apache.geronimo.configs</groupId>
-                                <artifactId>jasper</artifactId>
-                            </id>
-                            <resource-type>Web Container</resource-type>
-                            <description>The Jasper subsystem</description>
-                        </prerequisite>
-                    </prerequisites>
-                    
+                    <instance>
+                        <plugin-artifact>
+                            <prerequisite>
+                                <id>
+                                    <groupId>org.apache.geronimo.configs</groupId>
+                                    <artifactId>jetty6</artifactId>
+                                </id>
+                                <resource-type>Web Container</resource-type>
+                                <description>The Jetty web container</description>
+                            </prerequisite>
+                            <prerequisite>
+                                <id>
+                                    <groupId>org.apache.geronimo.configs</groupId>
+                                    <artifactId>jasper</artifactId>
+                                </id>
+                                <resource-type>Web Container</resource-type>
+                                <description>The Jasper subsystem</description>
+                            </prerequisite>
+                        </plugin-artifact>
+                    </instance>
+
                 </configuration>
             </plugin>
         </plugins>
     </build>
-    
+
 </project>

Modified: geronimo/server/trunk/maven-plugins/car-maven-plugin/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/maven-plugins/car-maven-plugin/pom.xml?rev=573409&r1=573408&r2=573409&view=diff
==============================================================================
--- geronimo/server/trunk/maven-plugins/car-maven-plugin/pom.xml (original)
+++ geronimo/server/trunk/maven-plugins/car-maven-plugin/pom.xml Thu Sep  6 16:32:30 2007
@@ -36,6 +36,23 @@
     <packaging>maven-plugin</packaging>
     
     <dependencies>
+        <dependency>
+            <groupId>javax.xml.bind</groupId>
+            <artifactId>jaxb-api</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>com.sun.xml.bind</groupId>
+            <artifactId>jaxb-impl</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.geronimo.specs</groupId>
+            <artifactId>geronimo-stax-api_1.0_spec</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>woodstox</groupId>
+            <artifactId>wstx-asl</artifactId>
+        </dependency>
         
         <dependency>
             <groupId>org.apache.geronimo.modules</groupId>
@@ -109,23 +126,6 @@
             <version>2.0.4</version>
         </dependency>
         
-        <dependency>
-            <groupId>javax.xml.bind</groupId>
-            <artifactId>jaxb-api</artifactId>
-        </dependency>
-
-        <dependency>
-            <groupId>com.sun.xml.bind</groupId>
-            <artifactId>jaxb-impl</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.geronimo.specs</groupId>
-            <artifactId>geronimo-stax-api_1.0_spec</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>woodstox</groupId>
-            <artifactId>wstx-asl</artifactId>
-        </dependency>
     </dependencies>
     
     <build>

Modified: geronimo/server/trunk/maven-plugins/car-maven-plugin/src/it/metadatageneration/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/maven-plugins/car-maven-plugin/src/it/metadatageneration/pom.xml?rev=573409&r1=573408&r2=573409&view=diff
==============================================================================
--- geronimo/server/trunk/maven-plugins/car-maven-plugin/src/it/metadatageneration/pom.xml (original)
+++ geronimo/server/trunk/maven-plugins/car-maven-plugin/src/it/metadatageneration/pom.xml Thu Sep  6 16:32:30 2007
@@ -110,14 +110,14 @@
                 <configuration>
                     <category>Test</category>
                     <osiApproved>true</osiApproved>
-                        <geronimoVersion>2.0.1</geronimoVersion>
-                        <geronimoVersion>2.1-SNAPSHOT</geronimoVersion>
-<!--
-                    <geronimoVersions>
-                        <value>2.0.1</value>
-                        <value>2.1-SNAPSHOT</value>
-                    </geronimoVersions>
--->
+                    <geronimoVersion>2.0.1</geronimoVersion>
+                    <geronimoVersion>2.1-SNAPSHOT</geronimoVersion>
+                    <!--
+                                        <geronimoVersions>
+                                            <value>2.0.1</value>
+                                            <value>2.1-SNAPSHOT</value>
+                                        </geronimoVersions>
+                    -->
                     <jvmVersions>
                         <value>1.5</value>
                         <value>1.5.2</value>
@@ -185,6 +185,30 @@
                     <artifactAliases>
                         org.apache.geronimo.test/foo//car=org.apache.geronimo.test/bar/1.0/car
                     </artifactAliases>
+                    <instance>
+                        <plugin-artifact xmlns="http://geronimo.apache.org/xml/ns/plugins-1.2" xmlns:ns2="http://geronimo.apache.org/xml/ns/attributes-1.2">
+                            <jvm-version>1.5</jvm-version>
+                            <jvm-version>1.5.2</jvm-version>
+                            <prerequisite>
+                                <id>
+                                    <groupId>commons-logging</groupId>
+                                    <artifactId>commons-logging</artifactId>
+                                </id>
+                                <resource-type>joke</resource-type>
+                                <description>this is an explanation</description>
+                            </prerequisite>
+                            <obsoletes>
+                                <groupId>commons-logging</groupId>
+                                <artifactId>commons-logging</artifactId>
+                            </obsoletes>
+                            <source-repository>http://foo.com</source-repository>
+                            <source-repository>http://bar.com</source-repository>
+                            <copy-file relative-to="WEB-INF" dest-dir="bar">META-INF/foo.xml</copy-file>
+                            <artifact-alias key="org.apache.geronimo.test/foo//car">org.apache.geronimo.test/bar/1.0/car</artifact-alias>
+                            <config-substitution key="key2">value2</config-substitution>
+                            <config-substitution key="key1">value1</config-substitution>
+                        </plugin-artifact>
+                    </instance>
                 </configuration>
             </plugin>
         </plugins>

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=573409&r1=573408&r2=573409&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 Thu Sep  6 16:32:30 2007
@@ -22,31 +22,27 @@
 
 import java.io.File;
 import java.io.FileOutputStream;
+import java.io.StringReader;
 import java.util.Collections;
 import java.util.List;
-import java.util.Properties;
-import java.util.Map;
-import java.util.HashMap;
 
 import org.apache.geronimo.system.plugin.PluginInstallerGBean;
 import org.apache.geronimo.system.plugin.model.ArtifactType;
 import org.apache.geronimo.system.plugin.model.LicenseType;
 import org.apache.geronimo.system.plugin.model.PluginArtifactType;
 import org.apache.geronimo.system.plugin.model.PluginType;
-import org.apache.geronimo.system.plugin.model.PropertyType;
-import org.apache.geronimo.common.propertyeditor.PropertiesEditor;
 import org.apache.maven.model.License;
+import org.codehaus.plexus.configuration.PlexusConfiguration;
 
 /**
  * Add dependencies to a plan and process with velocity
  *
- * @goal prepare-metadata
- *
  * @version $Rev$ $Date$
+ * @goal prepare-metadata
  */
 public class PluginMetadataGeneratorMojo
-        extends AbstractCarMojo
-{
+        extends AbstractCarMojo {
+
 
     /**
      * @parameter expression="${project.build.directory}/resources/META-INF"
@@ -89,40 +85,21 @@
     /**
      * @parameter
      */
-    private List<Prerequisite> prerequisites = Collections.emptyList();
-
-    /**
-     * @parameter
-     */
     private List<Dependency> dependencies = Collections.emptyList();
 
     /**
+     * shared configuration from parent that we merge since maven is incompetent at it.
+     *
      * @parameter
      */
-    private List<ModuleId> obsoletes = Collections.emptyList();
+    private PlexusConfiguration commonInstance;
 
     /**
+     * configuration for this instance itself
+     *
      * @parameter
      */
-    private List<String> sourceRepositories = Collections.emptyList();
-
-    /**
-     * @parameter
-     */
-    private List<CopyFile> copyFiles = Collections.emptyList();
-    /**
-     * @parameter
-     */
-    private List<Gbean> gbeans;
-
-    /**
-     * @parameter
-     */
-    private String configSubstitutions;
-    /**
-     * @parameter
-     */
-    private String artifactAliases;
+    private PlexusConfiguration instance;
 
     protected void doExecute() throws Exception {
 
@@ -133,7 +110,7 @@
         metadata.setDescription(project.getDescription());
         metadata.setCategory(category);
 
-        for (Object licenseObj: project.getLicenses()) {
+        for (Object licenseObj : project.getLicenses()) {
             License license = (License) licenseObj;
             LicenseType licenseType = new LicenseType();
             licenseType.setValue(license.getName());
@@ -141,7 +118,48 @@
             metadata.getLicense().add(licenseType);
         }
 
-        PluginArtifactType instance = new PluginArtifactType();
+        PluginArtifactType instance;
+        if (this.instance == null || this.instance.getChild("plugin-artifact") == null) {
+            instance = new PluginArtifactType();
+        } else {
+            instance = PluginInstallerGBean.loadPluginArtifactMetadata(new StringReader(this.instance.getChild("plugin-artifact").toString()));
+        }
+        if (this.commonInstance != null && this.commonInstance.getChild("plugin-artifact") != null) {
+            PluginArtifactType commonInstance = PluginInstallerGBean.loadPluginArtifactMetadata(new StringReader(this.commonInstance.getChild("plugin-artifact").toString()));
+            //merge
+            if (instance.getArtifactAlias().isEmpty()) {
+                instance.getArtifactAlias().addAll(commonInstance.getArtifactAlias());
+            }
+            if (instance.getConfigSubstitution().isEmpty()) {
+                instance.getConfigSubstitution().addAll(commonInstance.getConfigSubstitution());
+            }
+            if ((instance.getConfigXmlContent() == null || instance.getConfigXmlContent().getGbean().isEmpty())
+                    && (commonInstance.getConfigXmlContent() != null && !commonInstance.getConfigXmlContent().getGbean().isEmpty())) {
+                instance.setConfigXmlContent(new PluginArtifactType.ConfigXmlContent());
+                instance.getConfigXmlContent().getGbean().addAll(commonInstance.getConfigXmlContent().getGbean());
+            }
+            if (instance.getCopyFile().isEmpty()) {
+                instance.getCopyFile().addAll(commonInstance.getCopyFile());
+            }
+            if (instance.getDependency().isEmpty()) {
+                instance.getDependency().addAll(commonInstance.getDependency());
+            }
+            if (instance.getGeronimoVersion().isEmpty()) {
+                instance.getGeronimoVersion().addAll(commonInstance.getGeronimoVersion());
+            }
+            if (instance.getJvmVersion().isEmpty()) {
+                instance.getJvmVersion().addAll(commonInstance.getJvmVersion());
+            }
+            if (instance.getObsoletes().isEmpty()) {
+                instance.getObsoletes().addAll(commonInstance.getObsoletes());
+            }
+            if (instance.getPrerequisite().isEmpty()) {
+                instance.getPrerequisite().addAll(commonInstance.getPrerequisite());
+            }
+            if (instance.getSourceRepository().isEmpty()) {
+                instance.getSourceRepository().addAll(commonInstance.getSourceRepository());
+            }
+        }
         metadata.getPluginArtifact().add(instance);
 
         ArtifactType artifactType = new ArtifactType();
@@ -150,44 +168,9 @@
         artifactType.setVersion(project.getVersion());
         artifactType.setType(project.getArtifact().getType());
         instance.setModuleId(artifactType);
-
-        instance.getGeronimoVersion().addAll(geronimoVersions);
-        instance.getJvmVersion().addAll(jvmVersions);
-        for (Prerequisite prerequisite: prerequisites) {
-            instance.getPrerequisite().add(prerequisite.toPrerequisiteType());
-        }
-        for (Dependency dependency: dependencies) {
+        for (Dependency dependency : dependencies) {
             instance.getDependency().add(dependency.toDependencyType());
         }
-        for (ModuleId obsolete: obsoletes) {
-            instance.getObsoletes().add(obsolete.toArtifactType());
-        }
-
-        instance.getSourceRepository().addAll(sourceRepositories);
-        for (CopyFile copyFile: copyFiles) {
-            instance.getCopyFile().add(copyFile.toCopyFileType());
-        }
-        if (gbeans != null && gbeans.size() > 0) {
-            PluginArtifactType.ConfigXmlContent configXmlContent = new PluginArtifactType.ConfigXmlContent();
-            for (Gbean gbean: gbeans) {
-                configXmlContent.getGbean().add(gbean.toGBeanType());
-            }
-            instance.setConfigXmlContent(configXmlContent);
-        }
-
-        for (Map.Entry<Object, Object> entry: toProperties(configSubstitutions).entrySet()) {
-            PropertyType property = new PropertyType();
-            property.setKey((String) entry.getKey());
-            property.setValue((String) entry.getValue());
-            instance.getConfigSubstitution().add(property);
-        }
-        for (Map.Entry<Object, Object> entry: toProperties(artifactAliases).entrySet()) {
-            PropertyType property = new PropertyType();
-            property.setKey((String) entry.getKey());
-            property.setValue((String) entry.getValue());
-            instance.getArtifactAlias().add(property);
-        }
-
         targetDir.mkdirs();
         FileOutputStream out = new FileOutputStream(targetFile);
         try {
@@ -196,15 +179,6 @@
             out.close();
         }
         getProject().getResources().add(targetFile);
-    }
-
-    private Properties toProperties(String text) {
-        if (text == null) {
-            return new Properties();
-        }
-        PropertiesEditor editor = new PropertiesEditor();
-        editor.setAsText(text);
-        return (Properties) editor.getValue();
     }
 
 }

Modified: geronimo/server/trunk/maven-plugins/car-maven-plugin/src/test/java/org/apache/geronimo/mavenplugins/car/PluginMetadataTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/maven-plugins/car-maven-plugin/src/test/java/org/apache/geronimo/mavenplugins/car/PluginMetadataTest.java?rev=573409&r1=573408&r2=573409&view=diff
==============================================================================
--- geronimo/server/trunk/maven-plugins/car-maven-plugin/src/test/java/org/apache/geronimo/mavenplugins/car/PluginMetadataTest.java (original)
+++ geronimo/server/trunk/maven-plugins/car-maven-plugin/src/test/java/org/apache/geronimo/mavenplugins/car/PluginMetadataTest.java Thu Sep  6 16:32:30 2007
@@ -20,7 +20,12 @@
 
 package org.apache.geronimo.mavenplugins.car;
 
+import java.io.StringReader;
+import java.io.ByteArrayInputStream;
+
 import junit.framework.TestCase;
+import org.apache.geronimo.system.plugin.PluginInstallerGBean;
+import org.apache.geronimo.system.plugin.model.PluginArtifactType;
 
 /**
  * @version $Rev$ $Date$
@@ -31,5 +36,34 @@
         Attribute attr = new Attribute("foo", "#{bar}");
         assertEquals("${bar}", attr.getValue());
         assertEquals("${bar}", "#{bar}".replace("#{", "${"));
+    }
+
+    private static final String PROLOGUE = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n";
+    private static final String INSTANCE1="<plugin-artifact>\n" +
+            " <jvm-version>1.5</jvm-version>\n" +
+            " <jvm-version>1.5.2</jvm-version>\n" +
+            " <prerequisite>\n" +
+            "  <id>\n" +
+            "   <groupId>commons-logging</groupId>\n" +
+            "   <artifactId>commons-logging</artifactId>\n" +
+            "  </id>\n" +
+            "  <resource-type>joke</resource-type>\n" +
+            "  <description>this is an explanation</description>\n" +
+            " </prerequisite>\n" +
+            " <obsoletes>\n" +
+            "  <groupId>commons-logging</groupId>\n" +
+            "  <artifactId>commons-logging</artifactId>\n" +
+            " </obsoletes>\n" +
+            " <source-repository>http://foo.com</source-repository>\n" +
+            " <source-repository>http://bar.com</source-repository>\n" +
+            " <copy-file dest-dir=\"bar\" relative-to=\"WEB-INF\">META-INF/foo.xml</copy-file>\n" +
+            " <artifact-alias key=\"org.apache.geronimo.test/foo//car\">org.apache.geronimo.test/bar/1.0/car</artifact-alias>\n" +
+            " <config-substitution key=\"key2\">value2</config-substitution>\n" +
+            " <config-substitution key=\"key1\">value1</config-substitution>\n" +
+            "</plugin-artifact>";
+
+    public void testReadInstance() throws Exception {
+        PluginArtifactType instance = PluginInstallerGBean.loadPluginArtifactMetadata(new StringReader(PROLOGUE + INSTANCE1));
+//        assertEquals(2, instance.getConfigSubstitution().size());
     }
 }

Modified: geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/plugin/PluginInstallerGBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/plugin/PluginInstallerGBean.java?rev=573409&r1=573408&r2=573409&view=diff
==============================================================================
--- geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/plugin/PluginInstallerGBean.java (original)
+++ geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/plugin/PluginInstallerGBean.java Thu Sep  6 16:32:30 2007
@@ -24,6 +24,7 @@
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
+import java.io.Reader;
 import java.io.Writer;
 import java.net.HttpURLConnection;
 import java.net.MalformedURLException;
@@ -62,6 +63,7 @@
 import javax.xml.stream.XMLInputFactory;
 import javax.xml.stream.XMLStreamException;
 import javax.xml.stream.XMLStreamReader;
+import javax.xml.transform.sax.SAXSource;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -106,8 +108,11 @@
 import org.w3c.dom.Node;
 import org.w3c.dom.NodeList;
 import org.xml.sax.Attributes;
+import org.xml.sax.InputSource;
 import org.xml.sax.SAXException;
+import org.xml.sax.XMLReader;
 import org.xml.sax.helpers.DefaultHandler;
+import org.xml.sax.helpers.XMLFilterImpl;
 
 /**
  * A GBean that knows how to download configurations from a Maven repository.
@@ -117,14 +122,16 @@
 public class PluginInstallerGBean implements PluginInstaller {
     private final static Log log = LogFactory.getLog(PluginInstallerGBean.class);
 
-    private static final XMLInputFactory XMLINPUT_FACTORY = XMLInputFactory.newInstance();
+    public static final XMLInputFactory XMLINPUT_FACTORY = XMLInputFactory.newInstance();
     private static final JAXBContext PLUGIN_CONTEXT;
     private static final JAXBContext PLUGIN_LIST_CONTEXT;
+    private static final JAXBContext PLUGIN_ARTIFACT_CONTEXT;
 
     static {
         try {
             PLUGIN_CONTEXT = JAXBContext.newInstance(PluginType.class);
             PLUGIN_LIST_CONTEXT = JAXBContext.newInstance(PluginListType.class);
+            PLUGIN_ARTIFACT_CONTEXT = JAXBContext.newInstance(PluginArtifactType.class);
         } catch (JAXBException e) {
             throw new RuntimeException("Could not create jaxb contexts for plugin types");
         }
@@ -1435,6 +1442,63 @@
         return plugin;
     }
 
+    public static PluginArtifactType loadPluginArtifactMetadata(Reader in) throws SAXException, MalformedURLException, JAXBException, XMLStreamException, ParserConfigurationException {
+        InputSource inputSource = new InputSource(in);
+
+        SAXParserFactory factory = SAXParserFactory.newInstance();
+        factory.setNamespaceAware(true);
+        factory.setValidating(false);
+        SAXParser parser = factory.newSAXParser();
+
+        Unmarshaller unmarshaller = PLUGIN_ARTIFACT_CONTEXT.createUnmarshaller();
+//        unmarshaller.setEventHandler(new ValidationEventHandler(){
+//            public boolean handleEvent(ValidationEvent validationEvent) {
+//                System.out.println(validationEvent);
+//                return false;
+//            }
+//        });
+
+
+        NamespaceFilter xmlFilter = new NamespaceFilter(parser.getXMLReader());
+        xmlFilter.setContentHandler(unmarshaller.getUnmarshallerHandler());
+
+        SAXSource source = new SAXSource(xmlFilter, inputSource);
+//        XMLStreamReader xmlStream = XMLINPUT_FACTORY.createXMLStreamReader(in);
+        JAXBElement<PluginArtifactType> element = unmarshaller.unmarshal(source, PluginArtifactType.class);
+        PluginArtifactType plugin = element.getValue();
+        return plugin;
+    }
+
+    public static class NamespaceFilter extends XMLFilterImpl {
+        private static String PLUGIN_NS = "http://geronimo.apache.org/xml/ns/plugins-1.2";
+        private static String GBEAN_NS = "http://geronimo.apache.org/xml/ns/attributes-1.2";
+
+        private String namespace;
+
+        public NamespaceFilter(XMLReader xmlReader) {
+            super(xmlReader);
+        }
+
+        @Override
+        public void startElement(String uri, String localName, String qname, Attributes atts) throws SAXException {
+            if ("plugin-artifact".equals(localName)) {
+                namespace = PLUGIN_NS;
+            } else if ("gbean".equals(localName)) {
+                namespace = GBEAN_NS;
+            }
+            super.startElement(namespace, localName, qname, atts);
+        }
+
+        @Override
+        public void endElement(String uri, String localName, String qName) throws SAXException {
+            super.endElement(namespace, localName, qName);
+            if ("plugin-artifact".equals(localName)) {
+                namespace = null;
+            } else if ("gbean".equals(localName)) {
+                namespace = PLUGIN_NS;
+            }
+        }
+    }
     /**
      * Loads the list of all available plugins from the specified stream
      * (representing geronimo-plugins.xml at the specified repository).



Mime
View raw message