You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by jd...@apache.org on 2006/08/04 21:44:34 UTC

svn commit: r428856 [7/12] - in /geronimo/sandbox/svkmerge/trunk: ./ applications/ applications/console/ applications/console/console-core/ applications/console/console-ear/ applications/console/console-framework/ applications/console/console-framework...

Added: geronimo/sandbox/svkmerge/trunk/m2-assemblies/geronimo-tomcat-minimal/src/main/assembly/bin.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/svkmerge/trunk/m2-assemblies/geronimo-tomcat-minimal/src/main/assembly/bin.xml?rev=428856&view=auto
==============================================================================
--- geronimo/sandbox/svkmerge/trunk/m2-assemblies/geronimo-tomcat-minimal/src/main/assembly/bin.xml (added)
+++ geronimo/sandbox/svkmerge/trunk/m2-assemblies/geronimo-tomcat-minimal/src/main/assembly/bin.xml Fri Aug  4 12:44:18 2006
@@ -0,0 +1,180 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    Copyright 2006 The Apache Software Foundation
+    
+    Licensed under the Apache License, Version 2.0 (the "License");
+    you may not use this file except in compliance with the License.
+    You may obtain a copy of the License at
+    
+       http://www.apache.org/licenses/LICENSE-2.0
+    
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+-->
+
+<!-- $Rev$ $Date$ -->
+
+<assembly>
+    <id>bin</id>
+    
+    <formats>
+        <format>zip</format>
+        <format>tar.gz</format>
+        
+        <!--
+        
+        HACK: Turn off bz2 for now, it takes too long to generate.
+        
+        <format>tar.bz2</format>
+        -->
+    </formats>
+
+    <includeBaseDirectory>true</includeBaseDirectory>
+
+    <dependencySets>
+        <dependencySet>
+            <outputDirectory>lib</outputDirectory>
+            <includes>
+                <include>cglib:cglib-nodep</include>
+                <include>commons-cli:commons-cli</include>
+                <include>commons-logging:commons-logging</include>
+                <include>concurrent:concurrent</include>
+                <include>org.apache.geronimo.modules:geronimo-common</include>
+                <include>org.apache.geronimo.modules:geronimo-deploy-jsr88</include>
+                <include>org.apache.geronimo.modules:geronimo-deploy-tool</include>
+                <include>org.apache.geronimo.modules:geronimo-deployment</include>
+                <include>org.apache.geronimo.modules:geronimo-kernel</include>
+                <include>org.apache.geronimo.modules:geronimo-system</include>
+                <include>org.apache.geronimo.modules:geronimo-util</include>
+                <include>org.apache.geronimo.specs:geronimo-qname_1.1_spec</include>
+                <include>org.apache.geronimo.specs:geronimo-j2ee-deployment_1.1_spec</include>
+                <include>log4j:log4j</include>
+                <include>mx4j:mx4j</include>
+                <include>mx4j:mx4j-remote</include>
+                <include>xpp3:xpp3</include>
+                <include>xstream:xstream</include>
+            </includes>
+        </dependencySet>
+        
+        <dependencySet>
+            <outputDirectory>lib/endorsed</outputDirectory>
+            <includes>
+                <include>xerces:xercesImpl</include>
+                <include>xerces:xmlParserAPIs</include>
+            </includes>
+        </dependencySet>
+        
+        <dependencySet>
+            <outputDirectory>bin</outputDirectory>
+            <outputFileNameMapping>server.jar</outputFileNameMapping>
+            <includes>
+                <include>org.apache.geronimo.configs:j2ee-system</include>
+            </includes>
+        </dependencySet>
+        
+        <dependencySet>
+            <outputDirectory>bin</outputDirectory>
+            <outputFileNameMapping>client.jar</outputFileNameMapping>
+            <includes>
+                <include>org.apache.geronimo.configs:client-system</include>
+            </includes>
+        </dependencySet>
+        
+        <dependencySet>
+            <outputDirectory>bin</outputDirectory>
+            <outputFileNameMapping>deployer.jar</outputFileNameMapping>
+            <includes>
+                <include>org.apache.geronimo.configs:online-deployer</include>
+            </includes>
+        </dependencySet>
+        
+        <dependencySet>
+            <outputDirectory>bin</outputDirectory>
+            <outputFileNameMapping>shutdown.jar</outputFileNameMapping>
+            <includes>
+                <include>org.apache.geronimo.configs:shutdown</include>
+            </includes>
+        </dependencySet>
+        
+        <dependencySet>
+            <outputDirectory>bin</outputDirectory>
+            <outputFileNameMapping>upgrade.jar</outputFileNameMapping>
+            <includes>
+                <include>org.apache.geronimo.configs:upgrade-cli</include>
+            </includes>
+        </dependencySet>
+    </dependencySets>
+
+    <fileSets>
+        <fileSet>
+            <directory>target/boilerplate</directory>
+            <outputDirectory>/</outputDirectory>
+            <excludes>
+                <exclude>META-INF/**</exclude>
+            </excludes>
+        </fileSet>
+        
+        <!-- Include previously installed CAR files -->
+        <fileSet>
+            <directory>target/archive-tmp/repository</directory>
+            <outputDirectory>repository</outputDirectory>
+            <excludes>
+                <exclude>**/META-INF/maven/**</exclude>
+                <exclude>**/*.pom</exclude>
+                <exclude>**/*.sha1</exclude>
+                <exclude>**/*.md5</exclude>
+            </excludes>
+        </fileSet>
+        
+        <fileSet>
+            <directory>target/schema</directory>
+            <outputDirectory>schema</outputDirectory>
+            <includes>
+                <include>**/*.xsd</include>
+                <include>**/*.dtd</include>
+            </includes>
+            <lineEnding>dos</lineEnding>
+        </fileSet>
+        
+        <fileSet>
+            <directory>target/scripts</directory>
+            <outputDirectory>/</outputDirectory>
+            <includes>
+                <include>**/*.sh</include>
+            </includes>
+            <lineEnding>unix</lineEnding>
+            <fileMode>0755</fileMode>
+        </fileSet>
+        
+        <fileSet>
+            <directory>target/scripts</directory>
+            <outputDirectory>/</outputDirectory>
+            <includes>
+                <include>**/*.bat</include>
+                <include>*.txt</include>
+            </includes>
+            <lineEnding>dos</lineEnding>
+        </fileSet>
+        
+        <fileSet>
+            <directory>target/scratch</directory>
+            <outputDirectory>var/config</outputDirectory>
+            <includes>
+                <include>offline-deployer-list</include>
+            </includes>
+        </fileSet>
+        
+        <fileSet>
+            <directory>target/scratch</directory>
+            <outputDirectory>var/config</outputDirectory>
+            <fileMode>0644</fileMode>
+            <includes>
+                <include>config.xml</include>
+            </includes>
+        </fileSet>
+    </fileSets>
+
+</assembly>

Propchange: geronimo/sandbox/svkmerge/trunk/m2-assemblies/geronimo-tomcat-minimal/src/main/assembly/bin.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/svkmerge/trunk/m2-assemblies/geronimo-tomcat-minimal/src/main/assembly/bin.xml
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/sandbox/svkmerge/trunk/m2-assemblies/geronimo-tomcat-minimal/src/main/assembly/bin.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: geronimo/sandbox/svkmerge/trunk/m2-assemblies/geronimo-tomcat-minimal/src/main/var/config/config.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/svkmerge/trunk/m2-assemblies/geronimo-tomcat-minimal/src/main/var/config/config.xml?rev=428856&view=auto
==============================================================================
--- geronimo/sandbox/svkmerge/trunk/m2-assemblies/geronimo-tomcat-minimal/src/main/var/config/config.xml (added)
+++ geronimo/sandbox/svkmerge/trunk/m2-assemblies/geronimo-tomcat-minimal/src/main/var/config/config.xml Fri Aug  4 12:44:18 2006
@@ -0,0 +1,87 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- ======================================================== -->
+<!-- Warning - This XML file is re-generated by Geronimo when -->
+<!-- changes are made to Geronimo's configuration, therefore  -->
+<!-- any comments added to this file will be lost.            -->
+<!-- ======================================================== -->
+
+<attributes xmlns="http://geronimo.apache.org/xml/ns/attributes-1.1">
+    
+    <module name="org.apache.geronimo.configs/rmi-naming/${pom.version}/car">
+        <gbean name="RMIRegistry">
+            <attribute name="port">${PlanNamingPort}</attribute>
+        </gbean>
+        <gbean name="NamingProperties">
+            <!-- Check whether this really works if host name is 0.0.0.0 -->
+            <attribute name="namingProviderUrl">rmi://${PlanServerHostname}:${PlanNamingPort}</attribute>
+        </gbean>
+        <gbean name="DownloadedPluginRepos">
+          <attribute name="repositoryList">http://people.apache.org/~ammulder/plugin-repository-list-1.2.txt</attribute>
+          <attribute name="userRepositories">[]</attribute>
+        </gbean>
+    </module>
+    
+    <module name="org.apache.geronimo.configs/j2ee-server/${pom.version}/car"/>
+    
+    <module name="org.apache.geronimo.configs/j2ee-security/${pom.version}/car">
+        <gbean name="JaasLoginServiceRemotingServer">
+            <attribute name="host">${PlanServerHostname}</attribute>
+            <attribute name="port">${PlanRemoteLoginPort}</attribute>
+        </gbean>
+        <gbean name="JMXService">
+            <attribute name="protocol">rmi</attribute>
+            <attribute name="host">${PlanServerHostname}</attribute>
+            <attribute name="port">${PlanJMXPort}</attribute>
+            <attribute name="urlPath">/jndi/rmi://${PlanServerHostname}:${PlanNamingPort}/JMXConnector</attribute>
+        </gbean>
+    </module>
+
+    <module name="org.apache.geronimo.configs/tomcat/${pom.version}/car">
+        <gbean name="TomcatResources"/>
+        <gbean name="TomcatWebConnector">
+            <attribute name="host">${PlanServerHostname}</attribute>
+            <attribute name="port">${PlanHTTPPortPrimary}</attribute>
+            <attribute name="redirectPort">${PlanHTTPSPortPrimary}</attribute>
+        </gbean>
+        <gbean name="TomcatAJPConnector">
+            <attribute name="host">${PlanServerHostname}</attribute>
+            <attribute name="port">${PlanAJPPortPrimary}</attribute>
+            <attribute name="redirectPort">${PlanHTTPSPortPrimary}</attribute>
+        </gbean>
+        <gbean name="TomcatWebSSLConnector">
+            <attribute name="host">${PlanServerHostname}</attribute>
+            <attribute name="port">${PlanHTTPSPortPrimary}</attribute>
+        </gbean>
+    </module>
+    
+    <module name="org.apache.geronimo.configs/geronimo-gbean-deployer/${pom.version}/car"/>
+    
+    <module name="org.apache.geronimo.configs/j2ee-deployer/${pom.version}/car">
+        <gbean name="WebBuilder">
+            <attribute name="defaultNamespace">http://geronimo.apache.org/xml/ns/j2ee/web/tomcat-1.1</attribute>
+        </gbean>
+    </module>
+
+    <module name="org.apache.geronimo.configs/tomcat-deployer/${pom.version}/car"/>
+
+    <module name="org.apache.geronimo.configs/unavailable-ejb-deployer/${pom.version}/car"/>
+
+    <module name="org.apache.geronimo.configs/unavailable-webservices-deployer/${pom.version}/car"/>
+    
+    <module name="org.apache.geronimo.configs/unavailable-client-deployer/${pom.version}/car"/>
+
+    <module name="org.apache.geronimo.configs/sharedlib/${pom.version}/car">
+        <gbean name="SharedLib">
+            <attribute name="classesDirs">var/shared/classes</attribute>
+            <attribute name="libDirs">var/shared/lib</attribute>
+        </gbean>
+    </module>
+
+    <module name="org.apache.geronimo.configs/remote-deploy-tomcat/${pom.version}/car"/>
+    
+    <!--
+    <module name="org.apache.geronimo.configs/hot-deployer/${pom.version}/car"/>
+    -->
+    
+</attributes>

Propchange: geronimo/sandbox/svkmerge/trunk/m2-assemblies/geronimo-tomcat-minimal/src/main/var/config/config.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/svkmerge/trunk/m2-assemblies/geronimo-tomcat-minimal/src/main/var/config/config.xml
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/sandbox/svkmerge/trunk/m2-assemblies/geronimo-tomcat-minimal/src/main/var/config/config.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: geronimo/sandbox/svkmerge/trunk/m2-assemblies/geronimo-tomcat-minimal/src/main/var/config/offline-deployer-list
URL: http://svn.apache.org/viewvc/geronimo/sandbox/svkmerge/trunk/m2-assemblies/geronimo-tomcat-minimal/src/main/var/config/offline-deployer-list?rev=428856&view=auto
==============================================================================
--- geronimo/sandbox/svkmerge/trunk/m2-assemblies/geronimo-tomcat-minimal/src/main/var/config/offline-deployer-list (added)
+++ geronimo/sandbox/svkmerge/trunk/m2-assemblies/geronimo-tomcat-minimal/src/main/var/config/offline-deployer-list Fri Aug  4 12:44:18 2006
@@ -0,0 +1,9 @@
+##
+## List of deployers to be started for offline deployment
+##
+org.apache.geronimo.configs/geronimo-gbean-deployer/${pom.version}/car
+org.apache.geronimo.configs/j2ee-deployer/${pom.version}/car
+org.apache.geronimo.configs/unavailable-ejb-deployer/${pom.version}/car
+org.apache.geronimo.configs/unavailable-webservices-deployer/${pom.version}/car
+org.apache.geronimo.configs/unavailable-client-deployer/${pom.version}/car
+org.apache.geronimo.configs/tomcat-deployer/${pom.version}/car

Added: geronimo/sandbox/svkmerge/trunk/m2-assemblies/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/svkmerge/trunk/m2-assemblies/pom.xml?rev=428856&view=auto
==============================================================================
--- geronimo/sandbox/svkmerge/trunk/m2-assemblies/pom.xml (added)
+++ geronimo/sandbox/svkmerge/trunk/m2-assemblies/pom.xml Fri Aug  4 12:44:18 2006
@@ -0,0 +1,91 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    Copyright 2006 The Apache Software Foundation
+    
+    Licensed under the Apache License, Version 2.0 (the "License");
+    you may not use this file except in compliance with the License.
+    You may obtain a copy of the License at
+    
+       http://www.apache.org/licenses/LICENSE-2.0
+    
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+-->
+
+<!-- $Rev$ $Date$ -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+    
+    <modelVersion>4.0.0</modelVersion>
+    
+    <parent>
+        <groupId>org.apache.geronimo</groupId>
+        <artifactId>geronimo</artifactId>
+        <version>1.2-SNAPSHOT</version>
+        <relativePath>../pom.xml</relativePath>
+    </parent>
+
+    <groupId>org.apache.geronimo.assemblies</groupId>
+    <artifactId>assemblies</artifactId>
+    <name>Geronimo :: Assemblies</name>
+    <packaging>pom</packaging>
+    
+    <!--
+    
+    HACK: Need to explicitly configure SCM for this module since its artifactId
+          does not match the directory it lives in.
+    
+    FIXME: Rename module directory.
+    
+    -->
+    <scm>
+        <connection>scm:svn:https://svn.apache.org/repos/asf/geronimo/sandbox/svkmerge/m2migration/m2-assemblies</connection>
+        <developerConnection>scm:svn:https://${maven.username}@svn.apache.org/repos/asf/geronimo/sandbox/svkmerge/m2migration/m2-assemblies</developerConnection>
+        <url>http://svn.apache.org/repos/asf/geronimo/sandbox/svkmerge/m2migration/m2-assemblies</url>
+    </scm>
+
+    <properties>
+        <!--
+        
+        TODO: Move this where it can be shared with the configs/pom.xml values
+        
+        -->
+        <PlanServerHostname>0.0.0.0</PlanServerHostname>
+        <PlanNamingPort>1099</PlanNamingPort>
+        <PlanOpenEJBPort>4201</PlanOpenEJBPort>
+        <PlanClientAddresses>127.0.0.1</PlanClientAddresses>
+        <PlanIIOPPort>9000</PlanIIOPPort>
+        <PlanCOSNamingHost>localhost</PlanCOSNamingHost>
+        <PlanCOSNamingPort>1050</PlanCOSNamingPort>
+        <PlanORBSSLHost>localhost</PlanORBSSLHost>
+        <PlanORBSSLPort>2001</PlanORBSSLPort>
+        <PlanActiveMQPort>61616</PlanActiveMQPort>
+        <PlanDerbyPort>1527</PlanDerbyPort>
+        <PlanRemoteLoginPort>4242</PlanRemoteLoginPort>
+        <PlanLdapPort>1389</PlanLdapPort>
+        <PlanHTTPPortPrimary>8080</PlanHTTPPortPrimary>
+        <PlanHTTPSPortPrimary>8443</PlanHTTPSPortPrimary>
+        <PlanAJPPortPrimary>8009</PlanAJPPortPrimary>
+        <PlanHTTPPortSecondary>8090</PlanHTTPPortSecondary>
+        <PlanHTTPSPortSecondary>8453</PlanHTTPSPortSecondary>
+        <PlanAJPPortSecondary>8019</PlanAJPPortSecondary>
+        <PlanJMXPort>9999</PlanJMXPort>
+        
+        <PlanJettyWebBuilderDefaultNamespace>http://geronimo.apache.org/xml/ns/j2ee/web/jetty-1.0</PlanJettyWebBuilderDefaultNamespace>
+        <PlanTomcatWebBuilderDefaultNamespace>http://geronimo.apache.org/xml/ns/j2ee/web/tomcat-1.0</PlanTomcatWebBuilderDefaultNamespace>
+    </properties>
+    
+    <modules>
+        <module>geronimo-boilerplate-minimal</module>
+        <module>geronimo-boilerplate-j2ee</module>
+        <module>geronimo-jetty-j2ee</module>
+        <module>geronimo-jetty-minimal</module>
+        <module>geronimo-tomcat-j2ee</module>
+        <module>geronimo-tomcat-minimal</module>
+    </modules>
+    
+</project>
+

Propchange: geronimo/sandbox/svkmerge/trunk/m2-assemblies/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/svkmerge/trunk/m2-assemblies/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/sandbox/svkmerge/trunk/m2-assemblies/pom.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: geronimo/sandbox/svkmerge/trunk/m2-plugins/car-maven-plugin/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/svkmerge/trunk/m2-plugins/car-maven-plugin/pom.xml?rev=428856&view=auto
==============================================================================
--- geronimo/sandbox/svkmerge/trunk/m2-plugins/car-maven-plugin/pom.xml (added)
+++ geronimo/sandbox/svkmerge/trunk/m2-plugins/car-maven-plugin/pom.xml Fri Aug  4 12:44:18 2006
@@ -0,0 +1,156 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    Copyright 2006 The Apache Software Foundation
+    
+    Licensed under the Apache License, Version 2.0 (the "License");
+    you may not use this file except in compliance with the License.
+    You may obtain a copy of the License at
+    
+       http://www.apache.org/licenses/LICENSE-2.0
+    
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+-->
+
+<!-- $Rev$ $Date$ -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+    
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <groupId>org.apache.geronimo.plugins</groupId>
+        <artifactId>plugins</artifactId>
+        <version>1.2-SNAPSHOT</version>
+        <relativePath>../pom.xml</relativePath>
+    </parent>
+
+    <artifactId>car-maven-plugin</artifactId>
+    <name>Geronimo Maven2 Plugins :: CAR</name>
+    <packaging>maven-plugin</packaging>
+    
+    <dependencies>
+        
+        <dependency>
+            <groupId>org.apache.geronimo.modules</groupId>
+            <artifactId>geronimo-kernel</artifactId>
+            <version>${pom.version}</version>
+        </dependency>
+        
+        <dependency>
+            <groupId>org.apache.geronimo.modules</groupId>
+            <artifactId>geronimo-system</artifactId>
+            <version>${pom.version}</version>
+        </dependency>
+        
+        <dependency>
+            <groupId>org.apache.geronimo.modules</groupId>
+            <artifactId>geronimo-service-builder</artifactId>
+            <version>${pom.version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.geronimo.modules</groupId>
+            <artifactId>geronimo-deploy-tool</artifactId>
+            <version>${pom.version}</version>
+            
+            <!-- exclude transitive deps -->
+            <exclusions>
+                <exclusion>
+                    <groupId>org.apache.geronimo.modules</groupId>
+                    <artifactId>geronimo-util</artifactId>
+                </exclusion>
+                <exclusion>
+                    <groupId>org.apache.geronimo.modules</groupId>
+                    <artifactId>geronimo-deploy-jsr88</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        
+        <dependency>
+            <groupId>xmlbeans</groupId>
+            <artifactId>xbean</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>stax</groupId>
+            <artifactId>stax-api</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>velocity</groupId>
+            <artifactId>velocity</artifactId>
+            <version>1.4</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.geronimo.modules</groupId>
+            <artifactId>geronimo-system</artifactId>
+            <version>${pom.version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>commons-cli</groupId>
+            <artifactId>commons-cli</artifactId>
+        </dependency>
+        
+        <dependency>
+            <groupId>org.apache.geronimo.specs</groupId>
+            <artifactId>geronimo-qname_1.1_spec</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>xerces</groupId>
+            <artifactId>xercesImpl</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>xerces</groupId>
+            <artifactId>xmlParserAPIs</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>xstream</groupId>
+            <artifactId>xstream</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>xpp3</groupId>
+            <artifactId>xpp3</artifactId>
+        </dependency> 
+    </dependencies>
+    
+    <build>
+        <!-- FIXME: Remove when the default is to use the m2 standard layout -->
+        <sourceDirectory>${pom.basedir}/src/main/java</sourceDirectory>
+        
+        <resources>
+            <resource>
+                <directory>${pom.basedir}</directory>
+                <targetPath>META-INF</targetPath>
+                <includes>
+                    <include>LICENSE.txt</include>
+                    <include>NOTICE.txt</include>
+                </includes>
+            </resource>
+            
+            <resource>
+                <directory>${pom.basedir}/src/main/resources</directory>
+            </resource>
+        </resources>
+        
+        <plugins>
+            <plugin>
+                <artifactId>maven-plugin-plugin</artifactId>
+                <configuration>
+                    <goalPrefix>car</goalPrefix>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+    
+</project>
+

Propchange: geronimo/sandbox/svkmerge/trunk/m2-plugins/car-maven-plugin/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/svkmerge/trunk/m2-plugins/car-maven-plugin/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/sandbox/svkmerge/trunk/m2-plugins/car-maven-plugin/pom.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: geronimo/sandbox/svkmerge/trunk/m2-plugins/car-maven-plugin/src/main/java/org/apache/geronimo/plugin/car/AbstractCarMojo.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/svkmerge/trunk/m2-plugins/car-maven-plugin/src/main/java/org/apache/geronimo/plugin/car/AbstractCarMojo.java?rev=428856&view=auto
==============================================================================
--- geronimo/sandbox/svkmerge/trunk/m2-plugins/car-maven-plugin/src/main/java/org/apache/geronimo/plugin/car/AbstractCarMojo.java (added)
+++ geronimo/sandbox/svkmerge/trunk/m2-plugins/car-maven-plugin/src/main/java/org/apache/geronimo/plugin/car/AbstractCarMojo.java Fri Aug  4 12:44:18 2006
@@ -0,0 +1,158 @@
+/*
+ *  Copyright 2006 The Apache Software Foundation
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+package org.apache.geronimo.plugin.car;
+
+import org.apache.geronimo.plugin.MojoSupport;
+
+import org.apache.maven.project.MavenProject;
+import org.apache.maven.project.MavenProjectHelper;
+import org.apache.maven.artifact.resolver.filter.ArtifactFilter;
+import org.apache.maven.artifact.resolver.filter.ExcludesArtifactFilter;
+import org.apache.maven.artifact.versioning.VersionRange;
+import org.apache.maven.artifact.Artifact;
+import org.apache.maven.artifact.factory.ArtifactFactory;
+import org.apache.maven.model.Dependency;
+import org.apache.maven.model.Exclusion;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.FileOutputStream;
+import java.io.BufferedOutputStream;
+
+import java.util.Set;
+import java.util.List;
+import java.util.Iterator;
+import java.util.HashSet;
+import java.util.ArrayList;
+import java.util.Properties;
+
+/**
+ * Support for <em>packaging</em> Mojos.
+ *
+ * @version $Id$
+ */
+public abstract class AbstractCarMojo
+    extends MojoSupport
+{
+    /**
+     * The maven project.
+     *
+     * @parameter expression="${project}"
+     * @required
+     * @readonly
+     */
+    protected MavenProject project;
+
+    /**
+     * The basedir of the project.
+     *
+     * @parameter expression="${basedir}"
+     * @required
+     * @readonly
+     */
+    protected File basedir;
+
+    /**
+     * The maven project's helper.
+     *
+     * @parameter expression="${component.org.apache.maven.project.MavenProjectHelper}"
+     * @required
+     * @readonly
+     */
+    protected MavenProjectHelper projectHelper;
+
+    /**
+     * @parameter expression="${component.org.apache.maven.artifact.factory.ArtifactFactory}"
+     * @required
+     * @readonly
+     */
+    protected ArtifactFactory artifactFactory;
+
+    protected Set getProjectArtifacts(final MavenProject project) {
+        Set artifacts = new HashSet();
+
+        Iterator dependencies = project.getDependencies().iterator();
+        while (dependencies.hasNext()) {
+            Dependency dep = (Dependency) dependencies.next();
+
+            String groupId = dep.getGroupId();
+            String artifactId = dep.getArtifactId();
+            VersionRange versionRange = VersionRange.createFromVersion(dep.getVersion());
+            String type = dep.getType();
+            if (type == null) {
+                type = "jar";
+            }
+
+            String classifier = dep.getClassifier();
+            boolean optional = dep.isOptional();
+            String scope = dep.getScope();
+            if (scope == null) {
+                scope = Artifact.SCOPE_COMPILE;
+            }
+
+            Artifact artifact = artifactFactory.createDependencyArtifact(
+                groupId,
+                artifactId,
+                versionRange,
+                type,
+                classifier,
+                scope,
+                optional);
+
+            if (scope.equalsIgnoreCase(Artifact.SCOPE_SYSTEM)) {
+                artifact.setFile(new File(dep.getSystemPath()));
+            }
+
+            List exclusions = new ArrayList();
+            for (Iterator j = dep.getExclusions().iterator(); j.hasNext();) {
+                Exclusion e = (Exclusion) j.next();
+                exclusions.add(e.getGroupId() + ":" + e.getArtifactId());
+            }
+
+            ArtifactFilter newFilter = new ExcludesArtifactFilter(exclusions);
+            artifact.setDependencyFilter(newFilter);
+            artifacts.add(artifact);
+        }
+
+        return artifacts;
+    }
+
+    protected Set getProjectArtifacts() {
+        return getProjectArtifacts(project);
+    }
+    
+    protected void generateExplicitVersionProperties(final File outputFile) throws IOException {
+        log.debug("Generating explicit version properties: " + outputFile);
+
+        // Generate explicit_versions for all our dependencies...
+        Properties props = new Properties();
+        Iterator iter = getProjectArtifacts().iterator();
+        while (iter.hasNext()) {
+            Artifact artifact = (Artifact)iter.next();
+            String name = artifact.getGroupId() + "/" + artifact.getArtifactId() + "//" + artifact.getType();
+            String value = artifact.getVersion();
+
+            log.debug("Setting " + name + "=" + value);
+            props.setProperty(name, value);
+        }
+
+        BufferedOutputStream output = new BufferedOutputStream(new FileOutputStream(outputFile));
+        props.store(output, null);
+        output.flush();
+        output.close();
+    }
+}

Propchange: geronimo/sandbox/svkmerge/trunk/m2-plugins/car-maven-plugin/src/main/java/org/apache/geronimo/plugin/car/AbstractCarMojo.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/svkmerge/trunk/m2-plugins/car-maven-plugin/src/main/java/org/apache/geronimo/plugin/car/AbstractCarMojo.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/sandbox/svkmerge/trunk/m2-plugins/car-maven-plugin/src/main/java/org/apache/geronimo/plugin/car/AbstractCarMojo.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/sandbox/svkmerge/trunk/m2-plugins/car-maven-plugin/src/main/java/org/apache/geronimo/plugin/car/InstallConfigMojo.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/svkmerge/trunk/m2-plugins/car-maven-plugin/src/main/java/org/apache/geronimo/plugin/car/InstallConfigMojo.java?rev=428856&view=auto
==============================================================================
--- geronimo/sandbox/svkmerge/trunk/m2-plugins/car-maven-plugin/src/main/java/org/apache/geronimo/plugin/car/InstallConfigMojo.java (added)
+++ geronimo/sandbox/svkmerge/trunk/m2-plugins/car-maven-plugin/src/main/java/org/apache/geronimo/plugin/car/InstallConfigMojo.java Fri Aug  4 12:44:18 2006
@@ -0,0 +1,261 @@
+/*
+ *  Copyright 2005 The Apache Software Foundation
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+package org.apache.geronimo.plugin.car;
+
+import org.apache.geronimo.kernel.config.InvalidConfigException;
+import org.apache.geronimo.kernel.config.NoSuchConfigException;
+import org.apache.geronimo.kernel.config.ConfigurationData;
+import org.apache.geronimo.kernel.repository.Artifact;
+import org.apache.geronimo.kernel.repository.ArtifactManager;
+import org.apache.geronimo.kernel.repository.ArtifactResolver;
+import org.apache.geronimo.kernel.repository.DefaultArtifactManager;
+import org.apache.geronimo.kernel.repository.Environment;
+import org.apache.geronimo.kernel.repository.FileWriteMonitor;
+import org.apache.geronimo.kernel.repository.MissingDependencyException;
+import org.apache.geronimo.kernel.repository.Dependency;
+import org.apache.geronimo.kernel.repository.WritableListableRepository;
+import org.apache.geronimo.system.repository.Maven2Repository;
+import org.apache.geronimo.system.configuration.RepositoryConfigurationStore;
+import org.apache.geronimo.system.resolver.ExplicitDefaultArtifactResolver;
+
+import org.apache.geronimo.plugin.MojoSupport;
+
+import org.apache.maven.artifact.repository.ArtifactRepository;
+import org.apache.maven.project.MavenProject;
+import org.apache.maven.plugin.MojoExecutionException;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+
+import java.util.Iterator;
+import java.util.HashSet;
+import java.util.LinkedHashSet;
+import java.util.Set;
+import java.util.Collections;
+
+/**
+ * Installs CAR files into a target repository to support assembly.
+ *
+ * @goal installConfig
+ * 
+ * @version $Rev$ $Date$
+ */
+public class InstallConfigMojo
+    extends AbstractCarMojo
+{
+    public static final FileWriteMonitor LOG_COPY_START = new StartFileWriteMonitor();
+
+    /**
+     * Root file of the TargetRepository.
+     *
+     * @parameter expression="${project.build.directory}"
+     */
+    private String targetRoot;
+
+    /**
+     * The location of the target repository relative to targetRoot.
+     * 
+     * @parameter default-value="archive-tmp/repository"
+     * @required
+     */
+    private String targetRepository;
+
+    /**
+     * Configuration to be installed specified as groupId/artifactId/version/type
+     * if none specified, plugin will install all dependencies of type "car"
+     *
+     * @parameter
+     * @optional
+     */
+    private String artifact;
+
+    /**
+     * Location of the source repository for the dependencies
+     *
+     * @parameter expression="${localRepository}"
+     * @required
+     */
+    private ArtifactRepository sourceRepository;
+    
+    /**
+     * The location where the properties mapping will be generated.
+     *
+     * @parameter expression="${project.build.directory}/explicit-versions.properties"
+     * @required
+     */
+    private File explicitResolutionProperties;
+
+    private ArtifactResolver artifactResolver;
+
+    private WritableListableRepository targetRepo;
+    private RepositoryConfigurationStore targetStore;
+
+    private WritableListableRepository sourceRepo;
+    private RepositoryConfigurationStore sourceStore;
+
+    protected void doExecute() throws Exception {
+        generateExplicitVersionProperties(explicitResolutionProperties);
+        
+        sourceRepo = new Maven2Repository(new File(sourceRepository.getBasedir()));
+        sourceStore = new RepositoryConfigurationStore(sourceRepo);
+
+        File targetRepoFile = new File(targetRoot, targetRepository);
+        if (!targetRepoFile.exists()) {
+            targetRepoFile.mkdirs();
+        }
+        
+        targetRepo = new Maven2Repository(targetRepoFile);
+        targetStore = new RepositoryConfigurationStore(targetRepo);
+
+        Artifact configId;
+        ArtifactManager artifactManager = new DefaultArtifactManager();
+        artifactResolver = new ExplicitDefaultArtifactResolver(
+            explicitResolutionProperties.getPath(),
+            artifactManager,
+            Collections.singleton(sourceRepo),
+            null);
+
+        if ( artifact != null ) {
+            configId = Artifact.create(artifact);
+            execute(configId);
+        }
+        else {
+            Iterator itr = getDependencies().iterator();
+            while (itr.hasNext()) {
+                org.apache.maven.artifact.Artifact mavenArtifact = (org.apache.maven.artifact.Artifact) itr.next();
+                if ("car".equals(mavenArtifact.getType())) {
+                    configId = new Artifact(mavenArtifact.getGroupId(), mavenArtifact.getArtifactId(), mavenArtifact.getVersion(), "car");
+                    execute(configId);
+                }
+            }
+        }
+    }
+
+    /**
+     * Retrieves all artifact dependencies.
+     *
+     * @return A HashSet of artifacts
+     */
+    protected Set getDependencies() {
+        Set dependenciesSet = new HashSet();
+
+        if (project.getArtifact() != null && project.getArtifact().getFile() != null) {
+            dependenciesSet.add( project.getArtifact() );
+        }
+
+        Set projectArtifacts = project.getArtifacts();
+        if (projectArtifacts != null) {
+            dependenciesSet.addAll(projectArtifacts);
+        }
+
+        return dependenciesSet;
+    }
+
+    private void execute(Artifact configId) throws Exception {
+        LinkedHashSet dependencies;
+
+        // does this configuration exist?
+        if (!sourceRepo.contains(configId)) {
+            throw new NoSuchConfigException(configId);
+        }
+
+        // is this config already installed?
+        if (targetStore.containsConfiguration(configId)) {
+            log.info("Configuration " + configId + " already present in configuration store");
+            return;
+        }
+
+        if (sourceStore.containsConfiguration(configId)) {
+            // Copy the configuration into the target configuration store
+            if (!targetStore.containsConfiguration(configId)) {
+                File sourceFile = sourceRepo.getLocation(configId);
+                InputStream in = new FileInputStream(sourceFile);
+                try {
+                    targetStore.install(in, (int)sourceFile.length(), configId, LOG_COPY_START);
+                }
+                finally {
+                    in.close();
+                }
+            }
+
+            // Determine the dependencies of this configuration
+            try {
+                ConfigurationData configurationData = targetStore.loadConfiguration(configId);
+                Environment environment = configurationData.getEnvironment();
+                dependencies = new LinkedHashSet();
+                for (Iterator iterator = environment.getDependencies().iterator(); iterator.hasNext();) {
+                    Dependency dependency = (Dependency) iterator.next();
+                    dependencies.add(dependency.getArtifact());
+                }
+
+                log.info("Installed configuration " + configId);
+            }
+            catch (IOException e) {
+                throw new InvalidConfigException("Unable to load configuration: " + configId, e);
+            }
+            catch (NoSuchConfigException e) {
+                throw new InvalidConfigException("Unable to load configuration: " + configId, e);
+            }
+        }
+        else {
+            if (!sourceRepo.contains(configId)) {
+                throw new RuntimeException("Dependency: " + configId + " not found in local maven repo: for configuration: " + artifact);
+            }
+
+            // Copy the artifact into the target repo
+            if (!targetRepo.contains(configId)) {
+                File sourceFile = sourceRepo.getLocation(configId);
+                InputStream in = new FileInputStream(sourceFile);
+                try {
+                    targetRepo.copyToRepository(in, (int)sourceFile.length(), configId, LOG_COPY_START);
+                }
+                finally {
+                    in.close();
+                }
+            }
+
+            // Determine the dependencies of this artifact
+            dependencies = sourceRepo.getDependencies(configId);
+        }
+        
+        dependencies = artifactResolver.resolveInClassLoader(dependencies);
+        for (Iterator iterator = dependencies.iterator(); iterator.hasNext();) {
+            Artifact artifact = (Artifact) iterator.next();
+            execute(artifact);
+        }
+    }
+
+    private static class StartFileWriteMonitor implements FileWriteMonitor {
+        public void writeStarted(String fileDescription, int fileSize) {
+            //
+            // FIXME: Using logging?
+            //
+            
+            System.out.println("Copying " + fileDescription);
+        }
+
+        public void writeProgress(int bytes) {
+            // ???
+        }
+
+        public void writeComplete(int bytes) {
+            // ???
+        }
+    }
+}

Propchange: geronimo/sandbox/svkmerge/trunk/m2-plugins/car-maven-plugin/src/main/java/org/apache/geronimo/plugin/car/InstallConfigMojo.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/svkmerge/trunk/m2-plugins/car-maven-plugin/src/main/java/org/apache/geronimo/plugin/car/InstallConfigMojo.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/sandbox/svkmerge/trunk/m2-plugins/car-maven-plugin/src/main/java/org/apache/geronimo/plugin/car/InstallConfigMojo.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/sandbox/svkmerge/trunk/m2-plugins/car-maven-plugin/src/main/java/org/apache/geronimo/plugin/car/InstallMojo.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/svkmerge/trunk/m2-plugins/car-maven-plugin/src/main/java/org/apache/geronimo/plugin/car/InstallMojo.java?rev=428856&view=auto
==============================================================================
--- geronimo/sandbox/svkmerge/trunk/m2-plugins/car-maven-plugin/src/main/java/org/apache/geronimo/plugin/car/InstallMojo.java (added)
+++ geronimo/sandbox/svkmerge/trunk/m2-plugins/car-maven-plugin/src/main/java/org/apache/geronimo/plugin/car/InstallMojo.java Fri Aug  4 12:44:18 2006
@@ -0,0 +1,114 @@
+/**
+ *
+ * Copyright 2006 The Apache Software Foundation
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+package org.apache.geronimo.plugin.car;
+
+import java.io.File;
+import java.util.Iterator;
+
+import org.apache.geronimo.kernel.config.ConfigurationData;
+import org.apache.geronimo.kernel.config.ConfigurationStore;
+import org.apache.geronimo.kernel.config.ConfigurationInfo;
+import org.apache.geronimo.kernel.repository.Artifact;
+import org.apache.geronimo.kernel.repository.WritableListableRepository;
+
+/**
+ * Copies all the configurations out of source config store into target config store.
+ *
+ * @goal install
+ *
+ * @version $Rev$ $Date$
+ */
+public class InstallMojo extends AbstractCarMojo {
+
+    private static final Class[] REPO_ARGS = { File.class };
+
+    private static final Class[] STORE_ARGS = { WritableListableRepository.class };
+
+    /**
+     * @parameter default-value="org.apache.geronimo.system.repository.Maven2Repository"
+     * @required
+     */
+    private String sourceRepositoryClass;
+
+    /**
+     * @parameter default-value="org.apache.geronimo.system.repository.Maven2Repository"
+     * @required
+     */
+    private String targetRepositoryClass;
+
+    /**
+     * @parameter default-value="org.apache.geronimo.system.configuration.RepositoryConfigurationStore"
+     * @required
+     */
+    private String sourceConfigurationStoreClass;
+
+    /**
+     * @parameter default-value="org.apache.geronimo.plugin.car.MavenConfigStore"
+     * @required
+     */
+    private String targetConfigurationStoreClass;
+
+    /**
+     * @parameter expression="${project.build.directory}/repository"
+     * @required
+     */
+    private File sourceRepositoryLocation;
+
+    /**
+     * @parameter expression="${settings.LocalRepository}"
+     * @required
+     */
+    private File targetRepositoryLocation;
+
+    protected void doExecute() throws Exception {
+        // copy artifact(s) to maven repository
+
+        ClassLoader cl = this.getClass().getClassLoader();
+
+        Class sourceRepoClass = cl.loadClass(sourceRepositoryClass);
+        WritableListableRepository sourceRepository = (WritableListableRepository)
+                sourceRepoClass.getDeclaredConstructor(REPO_ARGS).newInstance(new Object[]{ sourceRepositoryLocation });
+
+        Class sourceConfigStoreClass = cl.loadClass(sourceConfigurationStoreClass);
+        ConfigurationStore sourceConfigStore = (ConfigurationStore)
+                sourceConfigStoreClass.getDeclaredConstructor(STORE_ARGS).newInstance(new Object[]{ sourceRepository });
+
+        Class targetRepoClass = cl.loadClass(targetRepositoryClass);
+        WritableListableRepository targetRepository = (WritableListableRepository)
+                targetRepoClass.getDeclaredConstructor(REPO_ARGS).newInstance(new Object[]{ targetRepositoryLocation });
+        Class targetConfigStoreClass = cl.loadClass(targetConfigurationStoreClass);
+
+        ConfigurationStore targetConfigStore = (ConfigurationStore)
+                targetConfigStoreClass.getDeclaredConstructor(STORE_ARGS).newInstance(new Object[]{ targetRepository });
+
+        Iterator iterator = sourceConfigStore.listConfigurations().iterator();
+        while (iterator.hasNext()) {
+            ConfigurationInfo configInfo = (ConfigurationInfo) iterator.next();
+            Artifact configId = configInfo.getConfigID();
+            ConfigurationData configData = sourceConfigStore.loadConfiguration(configId);
+
+            log.info("Copying artifact: " + configId);
+
+            if (targetConfigStore.containsConfiguration(configId)) {
+                targetConfigStore.uninstall(configId);
+            }
+
+            targetConfigStore.install(configData);
+        }
+    }
+}

Propchange: geronimo/sandbox/svkmerge/trunk/m2-plugins/car-maven-plugin/src/main/java/org/apache/geronimo/plugin/car/InstallMojo.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/svkmerge/trunk/m2-plugins/car-maven-plugin/src/main/java/org/apache/geronimo/plugin/car/InstallMojo.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/sandbox/svkmerge/trunk/m2-plugins/car-maven-plugin/src/main/java/org/apache/geronimo/plugin/car/InstallMojo.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/sandbox/svkmerge/trunk/m2-plugins/car-maven-plugin/src/main/java/org/apache/geronimo/plugin/car/MavenAttributeStore.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/svkmerge/trunk/m2-plugins/car-maven-plugin/src/main/java/org/apache/geronimo/plugin/car/MavenAttributeStore.java?rev=428856&view=auto
==============================================================================
--- geronimo/sandbox/svkmerge/trunk/m2-plugins/car-maven-plugin/src/main/java/org/apache/geronimo/plugin/car/MavenAttributeStore.java (added)
+++ geronimo/sandbox/svkmerge/trunk/m2-plugins/car-maven-plugin/src/main/java/org/apache/geronimo/plugin/car/MavenAttributeStore.java Fri Aug  4 12:44:18 2006
@@ -0,0 +1,72 @@
+/**
+ *
+ * Copyright 2005 The Apache Software Foundation
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+package org.apache.geronimo.plugin.car;
+
+import org.apache.geronimo.gbean.GAttributeInfo;
+import org.apache.geronimo.gbean.GBeanData;
+import org.apache.geronimo.gbean.GBeanInfo;
+import org.apache.geronimo.gbean.GBeanInfoBuilder;
+import org.apache.geronimo.gbean.GReferenceInfo;
+import org.apache.geronimo.gbean.AbstractName;
+import org.apache.geronimo.gbean.ReferencePatterns;
+import org.apache.geronimo.kernel.config.ManageableAttributeStore;
+import org.apache.geronimo.kernel.repository.Artifact;
+
+import java.io.IOException;
+import java.util.Collection;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class MavenAttributeStore
+    implements ManageableAttributeStore
+{
+    public MavenAttributeStore() {
+    }
+
+    public Collection applyOverrides(Artifact configurationName, Collection datas, ClassLoader classLoader) {
+        return datas;
+    }
+
+    public void setValue(Artifact configurationName, AbstractName gbean, GAttributeInfo attribute, Object value) {
+    }
+
+    public void setReferencePatterns(Artifact configurationName, AbstractName gbean, GReferenceInfo reference, ReferencePatterns patterns) {
+    }
+
+    public void setShouldLoad(Artifact configurationName, AbstractName gbean, boolean load) {
+    }
+
+    public void addGBean(Artifact configurationName, GBeanData gbeanData) {
+    }
+
+    public void save() throws IOException {
+    }
+
+    public static final GBeanInfo GBEAN_INFO;
+
+    public static GBeanInfo getGBeanInfo() {
+        return GBEAN_INFO;
+    }
+
+    static {
+        GBeanInfoBuilder builder = GBeanInfoBuilder.createStatic(MavenAttributeStore.class);
+        builder.addInterface(ManageableAttributeStore.class);
+        GBEAN_INFO = builder.getBeanInfo();
+    }
+}

Propchange: geronimo/sandbox/svkmerge/trunk/m2-plugins/car-maven-plugin/src/main/java/org/apache/geronimo/plugin/car/MavenAttributeStore.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/svkmerge/trunk/m2-plugins/car-maven-plugin/src/main/java/org/apache/geronimo/plugin/car/MavenAttributeStore.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/sandbox/svkmerge/trunk/m2-plugins/car-maven-plugin/src/main/java/org/apache/geronimo/plugin/car/MavenAttributeStore.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/sandbox/svkmerge/trunk/m2-plugins/car-maven-plugin/src/main/java/org/apache/geronimo/plugin/car/MavenConfigStore.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/svkmerge/trunk/m2-plugins/car-maven-plugin/src/main/java/org/apache/geronimo/plugin/car/MavenConfigStore.java?rev=428856&view=auto
==============================================================================
--- geronimo/sandbox/svkmerge/trunk/m2-plugins/car-maven-plugin/src/main/java/org/apache/geronimo/plugin/car/MavenConfigStore.java (added)
+++ geronimo/sandbox/svkmerge/trunk/m2-plugins/car-maven-plugin/src/main/java/org/apache/geronimo/plugin/car/MavenConfigStore.java Fri Aug  4 12:44:18 2006
@@ -0,0 +1,105 @@
+/**
+ *
+ * Copyright 2005 The Apache Software Foundation
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+package org.apache.geronimo.plugin.car;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.List;
+
+import org.apache.geronimo.gbean.GBeanInfo;
+import org.apache.geronimo.gbean.GBeanInfoBuilder;
+import org.apache.geronimo.kernel.config.ConfigurationData;
+import org.apache.geronimo.kernel.config.InvalidConfigException;
+import org.apache.geronimo.kernel.config.NoSuchConfigException;
+import org.apache.geronimo.kernel.repository.Artifact;
+import org.apache.geronimo.kernel.repository.WritableListableRepository;
+import org.apache.geronimo.kernel.Kernel;
+import org.apache.geronimo.system.configuration.ExecutableConfigurationUtil;
+import org.apache.geronimo.system.configuration.RepositoryConfigurationStore;
+
+/**
+ * Implementation of ConfigurationStore that loads Configurations from a repository.
+ * This implementation is read-only on the assumption that a separate maven task will
+ * handle installation of a built package into the repository.
+ *
+ * @version $Rev$ $Date$
+ */
+public class MavenConfigStore
+    extends RepositoryConfigurationStore
+{
+    public MavenConfigStore(Kernel kernel, String objectName, WritableListableRepository repository) {
+        super(kernel, objectName, repository);
+    }
+
+    public MavenConfigStore(WritableListableRepository repository) {
+        super(repository);
+    }
+
+    public File createNewConfigurationDir(Artifact configId) {
+        try {
+            File tmpFile = File.createTempFile("package", ".tmpdir");
+            tmpFile.delete();
+            tmpFile.mkdir();
+            if (!tmpFile.isDirectory()) {
+                return null;
+            }
+            // create the meta-inf dir
+            File metaInf = new File(tmpFile, "META-INF");
+            metaInf.mkdirs();
+            return tmpFile;
+        }
+        catch (IOException e) {
+            // doh why can't I throw this?
+            return null;
+        }
+    }
+
+    public void install(ConfigurationData configurationData) throws IOException, InvalidConfigException {
+        File source = configurationData.getConfigurationDir();
+        if (!source.isDirectory()) {
+            throw new InvalidConfigException("Source must be a directory: source=" + source);
+        }
+        Artifact configId = configurationData.getId();
+        File targetFile = repository.getLocation(configId);
+        ExecutableConfigurationUtil.createExecutableConfiguration(configurationData, null, targetFile);
+    }
+
+    public void uninstall(Artifact configID) throws NoSuchConfigException, IOException {
+        File targetFile = repository.getLocation(configID);
+        targetFile.delete();
+    }
+
+    public List listConfigurations() {
+        throw new UnsupportedOperationException();
+    }
+
+    public static final GBeanInfo GBEAN_INFO;
+
+    public static GBeanInfo getGBeanInfo() {
+        return GBEAN_INFO;
+    }
+
+    static {
+        GBeanInfoBuilder builder = GBeanInfoBuilder.createStatic(MavenConfigStore.class, "ConfigurationStore");
+        builder.addAttribute("kernel", Kernel.class, false);
+        builder.addAttribute("objectName", String.class, false);
+        builder.addReference("Repository", WritableListableRepository.class, "Repository");
+        builder.setConstructor(new String[]{"kernel", "objectName", "Repository"});
+        GBEAN_INFO = builder.getBeanInfo();
+    }
+}

Propchange: geronimo/sandbox/svkmerge/trunk/m2-plugins/car-maven-plugin/src/main/java/org/apache/geronimo/plugin/car/MavenConfigStore.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/svkmerge/trunk/m2-plugins/car-maven-plugin/src/main/java/org/apache/geronimo/plugin/car/MavenConfigStore.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/sandbox/svkmerge/trunk/m2-plugins/car-maven-plugin/src/main/java/org/apache/geronimo/plugin/car/MavenConfigStore.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/sandbox/svkmerge/trunk/m2-plugins/car-maven-plugin/src/main/java/org/apache/geronimo/plugin/car/PackageBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/svkmerge/trunk/m2-plugins/car-maven-plugin/src/main/java/org/apache/geronimo/plugin/car/PackageBuilder.java?rev=428856&view=auto
==============================================================================
--- geronimo/sandbox/svkmerge/trunk/m2-plugins/car-maven-plugin/src/main/java/org/apache/geronimo/plugin/car/PackageBuilder.java (added)
+++ geronimo/sandbox/svkmerge/trunk/m2-plugins/car-maven-plugin/src/main/java/org/apache/geronimo/plugin/car/PackageBuilder.java Fri Aug  4 12:44:18 2006
@@ -0,0 +1,512 @@
+/**
+ *
+ * Copyright 2005 The Apache Software Foundation
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+package org.apache.geronimo.plugin.car;
+
+import java.io.File;
+import java.net.URI;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.geronimo.gbean.AbstractName;
+import org.apache.geronimo.gbean.AbstractNameQuery;
+import org.apache.geronimo.gbean.GBeanData;
+import org.apache.geronimo.gbean.GBeanInfo;
+import org.apache.geronimo.gbean.ReferencePatterns;
+import org.apache.geronimo.kernel.Kernel;
+import org.apache.geronimo.kernel.KernelFactory;
+import org.apache.geronimo.kernel.KernelRegistry;
+import org.apache.geronimo.kernel.Naming;
+import org.apache.geronimo.kernel.config.ConfigurationData;
+import org.apache.geronimo.kernel.config.ConfigurationManager;
+import org.apache.geronimo.kernel.config.ConfigurationUtil;
+import org.apache.geronimo.kernel.config.KernelConfigurationManager;
+import org.apache.geronimo.kernel.log.GeronimoLogging;
+import org.apache.geronimo.kernel.management.State;
+import org.apache.geronimo.kernel.repository.Artifact;
+import org.apache.geronimo.kernel.repository.DefaultArtifactManager;
+import org.apache.geronimo.system.resolver.ExplicitDefaultArtifactResolver;
+import org.apache.geronimo.plugin.car.MavenAttributeStore;
+
+/**
+ * Builds a Geronimo Configuration using the local Maven infrastructure.
+ *
+ * @version $Rev:385659 $ $Date$
+ */
+public class PackageBuilder
+{
+    private static Log log = LogFactory.getLog(PackageBuilder.class);
+
+    private static final String KERNEL_NAME = "geronimo.maven";
+
+    private static final String[] ARG_TYPES = {
+        boolean.class.getName(),
+        File.class.getName(),
+        File.class.getName(),
+        File.class.getName(),
+        Boolean.TYPE.getName(),
+        String.class.getName(),
+        String.class.getName(),
+        String.class.getName(),
+        String.class.getName(),
+        String.class.getName(),
+        String.class.getName(),
+        String.class.getName(),
+        String.class.getName(),
+    };
+
+    /**
+     * Reference to the kernel that will last the lifetime of this classloader.
+     * The KernelRegistry keeps soft references that may be garbage collected.
+     */
+    private static Kernel kernel;
+
+    private static AbstractName targetConfigStoreAName;
+
+    private static AbstractName targetRepositoryAName;
+
+    private String repositoryClass;
+
+    private String configurationStoreClass;
+
+    private String targetRepositoryClass;
+
+    private String targetConfigurationStoreClass;
+
+    private File repository;
+
+    private File targetRepository;
+
+    private Collection deploymentConfigs;
+
+    private AbstractName deployerName;
+
+    private File planFile;
+
+    private File moduleFile;
+
+    private File packageFile;
+
+    private String mainClass;
+
+    private String mainGBean;
+
+    private String mainMethod;
+
+    private String configurations;
+
+    private String classPath;
+
+    private String endorsedDirs;
+
+    private String extensionDirs;
+
+    private String explicitResolutionLocation;
+
+    private String logLevel;
+
+    private boolean targetSet;
+
+    private boolean singleArtifact = true;
+
+    public String getRepositoryClass() {
+        return repositoryClass;
+    }
+
+    public void setRepositoryClass(final String repositoryClass) {
+        this.repositoryClass = repositoryClass;
+    }
+
+    public String getConfigurationStoreClass() {
+        return configurationStoreClass;
+    }
+
+    public void setConfigurationStoreClass(final String configurationStoreClass) {
+        this.configurationStoreClass = configurationStoreClass;
+    }
+
+    public File getRepository() {
+        return repository;
+    }
+
+    public void setRepository(final File repository) {
+        this.repository = repository;
+    }
+
+    public String getTargetRepositoryClass() {
+        return targetRepositoryClass;
+    }
+
+    public void setTargetRepositoryClass(final String targetRepositoryClass) {
+        this.targetRepositoryClass = targetRepositoryClass;
+    }
+
+    public String getTargetConfigurationStoreClass() {
+        return targetConfigurationStoreClass;
+    }
+
+    public void setTargetConfigurationStoreClass(final String targetConfigurationStoreClass) {
+        this.targetConfigurationStoreClass = targetConfigurationStoreClass;
+    }
+
+    public File getTargetRepository() {
+        return targetRepository;
+    }
+
+    public void setTargetRepository(final File targetRepository) {
+        this.targetRepository = targetRepository;
+    }
+
+    public Collection getDeploymentConfig() {
+        return deploymentConfigs;
+    }
+
+    /**
+     * Set the id of the Configuration to use to perform the packaging.
+     *
+     * @param deploymentConfigString comma-separated list of the ids of the Configurations performing the deployment
+     */
+    public void setDeploymentConfig(final Collection deploymentConfigString) {
+        this.deploymentConfigs = deploymentConfigString;
+    }
+
+    public String getDeployerName() {
+        return deployerName.toString();
+    }
+
+    /**
+     * Set the name of the GBean that is the Deployer.
+     *
+     * @param deployerName the name of the Deployer GBean
+     */
+    public void setDeployerName(final String deployerName) {
+        this.deployerName = new AbstractName(URI.create(deployerName));
+    }
+
+    public File getPlanFile() {
+        return planFile;
+    }
+
+    /**
+     * Set the File that is the deployment plan.
+     *
+     * @param planFile the deployment plan
+     */
+    public void setPlanFile(final File planFile) {
+        this.planFile = planFile;
+    }
+
+    public File getModuleFile() {
+        return moduleFile;
+    }
+
+    /**
+     * Set the File that is the module being deployed.
+     *
+     * @param moduleFile the module to deploy
+     */
+    public void setModuleFile(final File moduleFile) {
+        this.moduleFile = moduleFile;
+    }
+
+    public File getPackageFile() {
+        return packageFile;
+    }
+
+    /**
+     * Set the File where the Configuration will be stored; normally the artifact being produced.
+     *
+     * @param packageFile the package file to produce
+     */
+    public void setPackageFile(final File packageFile) {
+        this.packageFile = packageFile;
+    }
+
+    public String getMainClass() {
+        return mainClass;
+    }
+
+    /**
+     * Set the name of the class containing the main method for a executable configuration.
+     *
+     * @param mainClass
+     */
+    public void setMainClass(final String mainClass) {
+        this.mainClass = mainClass;
+    }
+
+    public String getMainGBean() {
+        return mainGBean;
+    }
+
+    public void setMainGBean(final String mainGBean) {
+        this.mainGBean = mainGBean;
+    }
+
+    public String getMainMethod() {
+        return mainMethod;
+    }
+
+    public void setMainMethod(final String mainMethod) {
+        this.mainMethod = mainMethod;
+    }
+
+    public String getConfigurations() {
+        return configurations;
+    }
+
+    public void setConfigurations(final String configurations) {
+        this.configurations = configurations;
+    }
+
+    public String getClassPath() {
+        return classPath;
+    }
+
+    public void setClassPath(final String classPath) {
+        this.classPath = classPath;
+    }
+
+    public String getEndorsedDirs() {
+        return endorsedDirs;
+    }
+
+    public void setEndorsedDirs(final String endorsedDirs) {
+        this.endorsedDirs = endorsedDirs;
+    }
+
+    public String getExtensionDirs() {
+        return extensionDirs;
+    }
+
+    public void setExtensionDirs(final String extensionDirs) {
+        this.extensionDirs = extensionDirs;
+    }
+
+    public String getExplicitResolutionLocation() {
+        return explicitResolutionLocation;
+    }
+
+    public void setExplicitResolutionLocation(final String explicitResolutionLocation) {
+        this.explicitResolutionLocation = explicitResolutionLocation;
+    }
+
+    public String getLogLevel() {
+        return logLevel;
+    }
+
+    public void setLogLevel(String logLevel) {
+        this.logLevel = logLevel;
+    }
+
+    public void execute() throws Exception {
+        System.out.println("Packaging configuration " + planFile);
+
+        try {
+            Kernel kernel = createKernel();
+            if (!targetSet) {
+                setTargetConfigStore();
+            }
+
+            // start the Configuration we're going to use for this deployment
+            ConfigurationManager configurationManager = ConfigurationUtil.getConfigurationManager(kernel);
+            try {
+                for (Iterator iterator = deploymentConfigs.iterator(); iterator.hasNext();) {
+                    String artifactName = (String) iterator.next();
+                    Artifact configName = Artifact.create(artifactName);
+                    if (!configurationManager.isLoaded(configName)) {
+                        configurationManager.loadConfiguration(configName);
+                        configurationManager.startConfiguration(configName);
+                    }
+                }
+            } finally {
+                ConfigurationUtil.releaseConfigurationManager(kernel, configurationManager);
+            }
+
+            AbstractName deployer = locateDeployer(kernel);
+            invokeDeployer(kernel, deployer, targetConfigStoreAName.toString());
+
+            System.out.println("Generated package " + packageFile);
+        }
+        catch (Exception e) {
+            log.error(e.getClass().getName() + ": " + e.getMessage(), e);
+            throw e;
+        }
+    }
+
+    private void setTargetConfigStore() throws Exception {
+        try {
+            kernel.stopGBean(targetRepositoryAName);
+            kernel.setAttribute(targetRepositoryAName, "root", targetRepository.toURI());
+            kernel.startGBean(targetRepositoryAName);
+            if (kernel.getGBeanState(targetConfigStoreAName) != State.RUNNING_INDEX) {
+                throw new IllegalStateException("After restarted repository then config store is not running");
+            }
+            targetSet = true;
+        }
+        catch (Exception e) {
+            log.error(e.toString(), e);
+            throw e;
+        }
+    }
+
+    /**
+     * Create a Geronimo Kernel to contain the deployment configurations.
+     */
+    private synchronized Kernel createKernel() throws Exception {
+        // first return our cached version
+        if (kernel != null) {
+            return kernel;
+        }
+
+        // check the registry in case someone else created one
+        kernel = KernelRegistry.getKernel(KERNEL_NAME);
+        if (kernel != null) {
+            return kernel;
+        }
+
+        GeronimoLogging geronimoLogging = GeronimoLogging.getGeronimoLogging(logLevel);
+        if (geronimoLogging == null) {
+            geronimoLogging = GeronimoLogging.DEBUG;
+        }
+        GeronimoLogging.initialize(geronimoLogging);
+
+        // boot one ourselves
+        kernel = KernelFactory.newInstance().createKernel(KERNEL_NAME);
+        kernel.boot();
+
+        bootDeployerSystem();
+
+        return kernel;
+    }
+
+    /**
+     * Boot the in-Maven deployment system.
+     *
+     * This contains Repository and ConfigurationStore GBeans that map to
+     * the local maven installation.
+     */
+    private void bootDeployerSystem() throws Exception {
+        Artifact baseId = new Artifact("geronimo", "packaging", "fixed", "car");
+        Naming naming = kernel.getNaming();
+        ConfigurationData bootstrap = new ConfigurationData(baseId, naming);
+        ClassLoader cl = PackageBuilder.class.getClassLoader();
+        Set repoNames = new HashSet();
+
+        // Source repo
+        GBeanData repoGBean = bootstrap.addGBean("SourceRepository", GBeanInfo.getGBeanInfo(repositoryClass, cl));
+        URI repositoryURI = repository.toURI();
+        repoGBean.setAttribute("root", repositoryURI);
+        repoNames.add(repoGBean.getAbstractName());
+
+        // Target repo
+        GBeanData targetRepoGBean = bootstrap.addGBean("TargetRepository", GBeanInfo.getGBeanInfo(targetRepositoryClass, cl));
+        URI targetRepositoryURI = targetRepository.toURI();
+        targetRepoGBean.setAttribute("root", targetRepositoryURI);
+        repoNames.add(targetRepoGBean.getAbstractName());
+        targetRepositoryAName = targetRepoGBean.getAbstractName();
+
+        GBeanData artifactManagerGBean = bootstrap.addGBean("ArtifactManager", DefaultArtifactManager.GBEAN_INFO);
+
+        GBeanData artifactResolverGBean = bootstrap.addGBean("ArtifactResolver", ExplicitDefaultArtifactResolver.GBEAN_INFO);
+        artifactResolverGBean.setAttribute("versionMapLocation", explicitResolutionLocation);
+        ReferencePatterns repoPatterns = new ReferencePatterns(repoNames);
+        artifactResolverGBean.setReferencePatterns("Repositories", repoPatterns);
+        artifactResolverGBean.setReferencePattern("ArtifactManager", artifactManagerGBean.getAbstractName());
+
+        Set storeNames = new HashSet();
+
+        // Source config store
+        GBeanInfo configStoreInfo = GBeanInfo.getGBeanInfo(configurationStoreClass, cl);
+        GBeanData storeGBean = bootstrap.addGBean("ConfigStore", configStoreInfo);
+        if (configStoreInfo.getReference("Repository") != null) {
+            storeGBean.setReferencePattern("Repository", repoGBean.getAbstractName());
+        }
+        storeNames.add(storeGBean.getAbstractName());
+
+        // Target config store
+        GBeanInfo targetConfigStoreInfo = GBeanInfo.getGBeanInfo(targetConfigurationStoreClass, cl);
+        GBeanData targetStoreGBean = bootstrap.addGBean("TargetConfigStore", targetConfigStoreInfo);
+        if (targetConfigStoreInfo.getReference("Repository") != null) {
+            targetStoreGBean.setReferencePattern("Repository", targetRepoGBean.getAbstractName());
+        }
+        storeNames.add(targetStoreGBean.getAbstractName());
+
+        targetConfigStoreAName = targetStoreGBean.getAbstractName();
+        targetSet = true;
+
+        GBeanData attrManagerGBean = bootstrap.addGBean("AttributeStore", MavenAttributeStore.GBEAN_INFO);
+
+        GBeanData configManagerGBean = bootstrap.addGBean("ConfigManager", KernelConfigurationManager.GBEAN_INFO);
+        configManagerGBean.setReferencePatterns("Stores", new ReferencePatterns(storeNames));
+        configManagerGBean.setReferencePattern("AttributeStore", attrManagerGBean.getAbstractName());
+        configManagerGBean.setReferencePattern("ArtifactManager", artifactManagerGBean.getAbstractName());
+        configManagerGBean.setReferencePattern("ArtifactResolver", artifactResolverGBean.getAbstractName());
+        configManagerGBean.setReferencePatterns("Repositories", repoPatterns);
+
+        ConfigurationUtil.loadBootstrapConfiguration(kernel, bootstrap, cl);
+    }
+
+    /**
+     * Locate a Deployer GBean matching the deployerName pattern.
+     *
+     * @param kernel the kernel to search.
+     * @return the ObjectName of the Deployer GBean
+     *
+     * @throws IllegalStateException if there is not exactly one GBean matching the deployerName pattern
+     */
+    private AbstractName locateDeployer(Kernel kernel) {
+        Iterator i = kernel.listGBeans(new AbstractNameQuery(deployerName)).iterator();
+        if (!i.hasNext()) {
+            throw new IllegalStateException("No deployer found matching deployerName: " + deployerName);
+        }
+
+        AbstractName deployer = (AbstractName) i.next();
+        if (i.hasNext()) {
+            throw new IllegalStateException("Multiple deployers found matching deployerName: " + deployerName);
+        }
+
+        return deployer;
+    }
+
+    private List invokeDeployer(Kernel kernel, AbstractName deployer, String targetConfigStore) throws Exception {
+        boolean isExecutable = mainClass != null;
+
+        Object[] args = {
+            Boolean.FALSE,
+            planFile,
+            moduleFile,
+            singleArtifact ? packageFile : null,
+            Boolean.valueOf(!isExecutable),
+            mainClass,
+            mainGBean,
+            mainMethod,
+            configurations,
+            classPath,
+            endorsedDirs,
+            extensionDirs,
+            targetConfigStore
+        };
+
+        return (List) kernel.invoke(deployer, "deploy", args, ARG_TYPES);
+    }
+}

Propchange: geronimo/sandbox/svkmerge/trunk/m2-plugins/car-maven-plugin/src/main/java/org/apache/geronimo/plugin/car/PackageBuilder.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/svkmerge/trunk/m2-plugins/car-maven-plugin/src/main/java/org/apache/geronimo/plugin/car/PackageBuilder.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/sandbox/svkmerge/trunk/m2-plugins/car-maven-plugin/src/main/java/org/apache/geronimo/plugin/car/PackageBuilder.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/sandbox/svkmerge/trunk/m2-plugins/car-maven-plugin/src/main/java/org/apache/geronimo/plugin/car/PackageMojo.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/svkmerge/trunk/m2-plugins/car-maven-plugin/src/main/java/org/apache/geronimo/plugin/car/PackageMojo.java?rev=428856&view=auto
==============================================================================
--- geronimo/sandbox/svkmerge/trunk/m2-plugins/car-maven-plugin/src/main/java/org/apache/geronimo/plugin/car/PackageMojo.java (added)
+++ geronimo/sandbox/svkmerge/trunk/m2-plugins/car-maven-plugin/src/main/java/org/apache/geronimo/plugin/car/PackageMojo.java Fri Aug  4 12:44:18 2006
@@ -0,0 +1,255 @@
+/**
+ *
+ * Copyright 2005 The Apache Software Foundation
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+package org.apache.geronimo.plugin.car;
+
+import java.io.File;
+import java.io.BufferedOutputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Iterator;
+import java.util.Properties;
+
+import org.apache.geronimo.deployment.PluginBootstrap2;
+import org.apache.geronimo.system.configuration.RepositoryConfigurationStore;
+import org.apache.geronimo.system.repository.Maven2Repository;
+import org.apache.maven.artifact.Artifact;
+
+import org.codehaus.plexus.util.FileUtils;
+
+/**
+ * Build a Geronimo Configuration using the local Maven infrastructure.
+ *
+ * <p>
+ * <b>NOTE:</b> Calling pom.xml must have defined a ${geronimoVersion} property.
+ * </p>
+ *
+ * @goal package
+ * @requiresDependencyResolution runtime
+ *
+ * @version $Rev$ $Date$
+ */
+public class PackageMojo
+    extends AbstractCarMojo
+{
+    private List artifacts;
+
+    /**
+     * @parameter expression="${settings.localRepository}"
+     * @required
+     * @readonly
+     */
+    private File repository;
+
+    /**
+     * @parameter expression="${project.build.directory}/repository"
+     * @required
+     */
+    private File targetRepository;
+
+    /**
+     * @parameter expression="org.apache.geronimo.configs/geronimo-gbean-deployer/${geronimoVersion}/car"
+     * @required
+     * @readonly
+     */
+    private String deafultDeploymentConfig;
+
+    /**
+     * @parameter
+     */
+    private ArrayList deploymentConfigs;
+
+    /**
+     * @parameter expression="org.apache.geronimo.configs/geronimo-gbean-deployer/${geronimoVersion}/car?j2eeType=Deployer,name=Deployer"
+     * @required
+     */
+    private String deployerName;
+
+    /**
+     * @parameter expression="${project.build.directory}/plan/plan.xml"
+     * @required
+     */
+    private File planFile;
+
+    /**
+     * @parameter
+     */
+    private File moduleFile;
+
+    /**
+     * @parameter expression="${project.build.directory}/${project.artifactId}-${project.version}.car"
+     * @required
+     */
+    private File packageFile;
+
+    /**
+     * @parameter expression="${project.build.directory}"
+     * @required
+     */
+    private File buildDir;
+
+    /**
+     * @parameter
+     */
+    private String mainClass;
+
+    /**
+     * @parameter
+     */
+    private String mainMethod;
+
+    /**
+     * @parameter
+     */
+    private String mainGBean;
+
+    /**
+     * @parameter
+     */
+    private String configurations;
+
+    /**
+     * The classpath to be added to the generated manifest.
+     *
+     * @parameter
+     */
+    private ArrayList classPath;
+
+    /**
+     * @parameter default-value="lib/endorsed"
+     * @required
+     */
+    private String endorsedDirs;
+
+    /**
+     * @parameter default-value="lib/ext"
+     * @required
+     */
+    private String extensionDirs;
+
+    /**
+     * The location where the properties mapping will be generated.
+     *
+     * @parameter expression="${project.build.directory}/explicit-versions.properties"
+     */
+    private File explicitResolutionProperties;
+
+    /**
+     * @parameter default-value="WARN"
+     * @required
+     */
+    private String logLevel;
+
+    /**
+     * @parameter
+     */
+    private boolean boot = false;
+
+    protected void doExecute() throws Exception {
+        // We need to make sure to clean up any previous work first or this operation will fail
+        FileUtils.forceDelete(targetRepository);
+        FileUtils.forceMkdir(targetRepository);
+
+        // Use the default configs if none specified
+        if (deploymentConfigs == null) {
+            deploymentConfigs = new ArrayList();
+            deploymentConfigs.add(deafultDeploymentConfig);
+        }
+        log.debug("Deployment configs: " + deploymentConfigs);
+
+        generateExplicitVersionProperties(explicitResolutionProperties);
+
+        if (boot) {
+            executeBootShell();
+        }
+        else {
+            executePackageBuilderShell();
+        }
+
+        // copy configuration from target/repository to maven repo
+        project.getArtifact().setFile(packageFile);
+    }
+
+    public void executeBootShell() throws Exception {
+        PluginBootstrap2 boot = new PluginBootstrap2();
+
+        boot.setBuildDir(buildDir);
+        boot.setCarFile(packageFile);
+        boot.setLocalRepo(repository);
+        boot.setPlan(planFile);
+
+        boot.bootstrap();
+    }
+
+    private String getClassPath() {
+        if (classPath == null) {
+            return null;
+        }
+
+        log.debug("Creating classpath from: " + classPath);
+
+        StringBuffer buff = new StringBuffer();
+        Iterator iter = classPath.iterator();
+        while (iter.hasNext()) {
+            String element = (String)iter.next();
+            buff.append(element.trim());
+
+            if (iter.hasNext()) {
+                buff.append(" ");
+            }
+        }
+        
+        log.debug("Using classpath: " + buff);
+
+        return buff.toString();
+    }
+
+    public void executePackageBuilderShell() throws Exception {
+        PackageBuilder builder = new PackageBuilder();
+
+        //
+        // NOTE: May need to run this in a controlled classloader (w/reflection or a proxy)
+        //
+        //       http://www.nabble.com/PackageBuilderShellMojo-%28m2%29-and-classloaders-p5271991.html
+        //
+
+        builder.setClassPath(getClassPath());
+        builder.setDeployerName(deployerName);
+        builder.setDeploymentConfig(deploymentConfigs);
+        builder.setEndorsedDirs(endorsedDirs);
+        builder.setExtensionDirs(extensionDirs);
+        builder.setMainClass(mainClass);
+        builder.setMainMethod(mainMethod);
+        builder.setMainGBean(mainGBean);
+        builder.setConfigurations(configurations);
+        builder.setModuleFile(moduleFile);
+        builder.setPackageFile(packageFile);
+        builder.setPlanFile(planFile);
+        builder.setRepository(repository);
+        builder.setRepositoryClass(Maven2Repository.class.getName());
+        builder.setConfigurationStoreClass(MavenConfigStore.class.getName());
+        builder.setTargetRepository(targetRepository);
+        builder.setTargetRepositoryClass(Maven2Repository.class.getName());
+        builder.setTargetConfigurationStoreClass(RepositoryConfigurationStore.class.getName());
+        builder.setExplicitResolutionLocation(explicitResolutionProperties.getAbsolutePath());
+        builder.setLogLevel(logLevel);
+
+        builder.execute();
+    }
+}

Propchange: geronimo/sandbox/svkmerge/trunk/m2-plugins/car-maven-plugin/src/main/java/org/apache/geronimo/plugin/car/PackageMojo.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/svkmerge/trunk/m2-plugins/car-maven-plugin/src/main/java/org/apache/geronimo/plugin/car/PackageMojo.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/sandbox/svkmerge/trunk/m2-plugins/car-maven-plugin/src/main/java/org/apache/geronimo/plugin/car/PackageMojo.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain