geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r573656 - in /geronimo/server/trunk/maven-plugins/car-maven-plugin/src: it/j2ee-system-2/ it/j2ee-system-2/src/test/resources/META-INF/ it/j2ee-system/ it/j2ee-system/src/test/resources/META-INF/ it/metadatageneration-2/ it/metadatagenerati...
Date Fri, 07 Sep 2007 18:25:20 GMT
Author: djencks
Date: Fri Sep  7 11:25:14 2007
New Revision: 573656

URL: http://svn.apache.org/viewvc?rev=573656&view=rev
Log:
GERONIMO-3453 Add ability to derive dependencies from maven dependencies in the actual pom (original model)

Added:
    geronimo/server/trunk/maven-plugins/car-maven-plugin/src/it/j2ee-system-2/
      - copied from r573486, geronimo/server/trunk/maven-plugins/car-maven-plugin/src/it/j2ee-system/
    geronimo/server/trunk/maven-plugins/car-maven-plugin/src/it/j2ee-system-2/src/test/resources/META-INF/plan.xml   (with props)
    geronimo/server/trunk/maven-plugins/car-maven-plugin/src/it/j2ee-system/src/test/resources/META-INF/plan.xml   (with props)
    geronimo/server/trunk/maven-plugins/car-maven-plugin/src/it/metadatageneration-2/
      - copied from r573486, geronimo/server/trunk/maven-plugins/car-maven-plugin/src/it/metadatageneration/
    geronimo/server/trunk/maven-plugins/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/UseMavenDependencies.java   (with props)
Modified:
    geronimo/server/trunk/maven-plugins/car-maven-plugin/src/it/j2ee-system-2/pom.xml
    geronimo/server/trunk/maven-plugins/car-maven-plugin/src/it/j2ee-system-2/src/test/resources/META-INF/geronimo-plugin.xml
    geronimo/server/trunk/maven-plugins/car-maven-plugin/src/it/j2ee-system-2/validate.groovy
    geronimo/server/trunk/maven-plugins/car-maven-plugin/src/it/j2ee-system/validate.groovy
    geronimo/server/trunk/maven-plugins/car-maven-plugin/src/it/metadatageneration-2/pom.xml
    geronimo/server/trunk/maven-plugins/car-maven-plugin/src/it/metadatageneration-2/src/test/resources/META-INF/geronimo-plugin.xml
    geronimo/server/trunk/maven-plugins/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/AbstractCarMojo.java
    geronimo/server/trunk/maven-plugins/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/PlanProcessorMojo.java
    geronimo/server/trunk/maven-plugins/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/PluginMetadataGeneratorMojo.java

Modified: geronimo/server/trunk/maven-plugins/car-maven-plugin/src/it/j2ee-system-2/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/maven-plugins/car-maven-plugin/src/it/j2ee-system-2/pom.xml?rev=573656&r1=573486&r2=573656&view=diff
==============================================================================
--- geronimo/server/trunk/maven-plugins/car-maven-plugin/src/it/j2ee-system-2/pom.xml (original)
+++ geronimo/server/trunk/maven-plugins/car-maven-plugin/src/it/j2ee-system-2/pom.xml Fri Sep  7 11:25:14 2007
@@ -214,106 +214,10 @@
                     <category>Geronimo Core</category>
                     <osiApproved>true</osiApproved>
                     <geronimoVersion>2.1-SNAPSHOT</geronimoVersion>
-                    <dependencies>
-                        <dependency>
-                          <groupId>com.sun.xml.bind</groupId>
-                          <artifactId>jaxb-impl</artifactId>
-                          <version>2.0.5</version>
-                          <type>jar</type>
-                          <import>classes</import>
-                        </dependency>
-                        <dependency>
-                          <groupId>org.apache.geronimo.specs</groupId>
-                          <artifactId>geronimo-stax-api_1.0_spec</artifactId>
-                          <version>1.0</version>
-                          <type>jar</type>
-                          <import>classes</import>
-                        </dependency>
-                        <dependency>
-                          <groupId>org.apache.geronimo.modules</groupId>
-                          <artifactId>geronimo-common</artifactId>
-                          <version>2.1-SNAPSHOT</version>
-                          <type>jar</type>
-                          <import>classes</import>
-                        </dependency>
-                        <dependency>
-                          <groupId>jline</groupId>
-                          <artifactId>jline</artifactId>
-                          <version>0.9.91</version>
-                          <type>jar</type>
-                          <import>classes</import>
-                        </dependency>
-                        <dependency>
-                          <groupId>org.apache.geronimo.modules</groupId>
-                          <artifactId>geronimo-util</artifactId>
-                          <version>2.1-SNAPSHOT</version>
-                          <type>jar</type>
-                          <import>classes</import>
-                        </dependency>
-                        <dependency>
-                          <groupId>ognl</groupId>
-                          <artifactId>ognl</artifactId>
-                          <version>2.6.9</version>
-                          <type>jar</type>
-                          <import>classes</import>
-                        </dependency>
-                        <dependency>
-                          <groupId>asm</groupId>
-                          <artifactId>asm</artifactId>
-                          <version>2.2.3</version>
-                          <type>jar</type>
-                          <import>classes</import>
-                        </dependency>
-                        <dependency>
-                          <groupId>commons-jexl</groupId>
-                          <artifactId>commons-jexl</artifactId>
-                          <version>1.1</version>
-                          <type>jar</type>
-                          <import>classes</import>
-                        </dependency>
-                        <dependency>
-                          <groupId>asm</groupId>
-                          <artifactId>asm-commons</artifactId>
-                          <version>2.2.3</version>
-                          <type>jar</type>
-                          <import>classes</import>
-                        </dependency>
-                        <dependency>
-                          <groupId>commons-cli</groupId>
-                          <artifactId>commons-cli</artifactId>
-                          <version>1.0</version>
-                          <type>jar</type>
-                          <import>classes</import>
-                        </dependency>
-                        <dependency>
-                          <groupId>woodstox</groupId>
-                          <artifactId>wstx-asl</artifactId>
-                          <version>3.2.1</version>
-                          <type>jar</type>
-                          <import>classes</import>
-                        </dependency>
-                        <dependency>
-                          <groupId>javax.xml.bind</groupId>
-                          <artifactId>jaxb-api</artifactId>
-                          <version>2.0</version>
-                          <type>jar</type>
-                          <import>classes</import>
-                        </dependency>
-                        <dependency>
-                          <groupId>org.apache.geronimo.specs</groupId>
-                          <artifactId>geronimo-activation_1.1_spec</artifactId>
-                          <version>1.0</version>
-                          <type>jar</type>
-                          <import>classes</import>
-                        </dependency>
-                        <dependency>
-                          <groupId>org.apache.geronimo.modules</groupId>
-                          <artifactId>geronimo-system</artifactId>
-                          <version>2.1-SNAPSHOT</version>
-                          <type>jar</type>
-                          <import>classes</import>
-                        </dependency>
-                    </dependencies>
+                    <useMavenDependencies>
+                        <value>true</value>
+                        <includeVersion>false</includeVersion>
+                    </useMavenDependencies>
 
                 </configuration>
             </plugin>

Modified: geronimo/server/trunk/maven-plugins/car-maven-plugin/src/it/j2ee-system-2/src/test/resources/META-INF/geronimo-plugin.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/maven-plugins/car-maven-plugin/src/it/j2ee-system-2/src/test/resources/META-INF/geronimo-plugin.xml?rev=573656&r1=573486&r2=573656&view=diff
==============================================================================
--- geronimo/server/trunk/maven-plugins/car-maven-plugin/src/it/j2ee-system-2/src/test/resources/META-INF/geronimo-plugin.xml (original)
+++ geronimo/server/trunk/maven-plugins/car-maven-plugin/src/it/j2ee-system-2/src/test/resources/META-INF/geronimo-plugin.xml Fri Sep  7 11:25:14 2007
@@ -13,88 +13,74 @@
             <version>2.1-SNAPSHOT</version>
             <type>car</type>
         </module-id>
-        <dependency start="false">
-            <groupId>com.sun.xml.bind</groupId>
-            <artifactId>jaxb-impl</artifactId>
-            <version>2.0.5</version>
-            <type>jar</type>
-        </dependency>
-        <dependency start="false">
-            <groupId>org.apache.geronimo.specs</groupId>
-            <artifactId>geronimo-stax-api_1.0_spec</artifactId>
-            <version>1.0</version>
-            <type>jar</type>
-        </dependency>
-        <dependency start="false">
+        <dependency start="true">
             <groupId>org.apache.geronimo.modules</groupId>
             <artifactId>geronimo-common</artifactId>
-            <version>2.1-SNAPSHOT</version>
             <type>jar</type>
         </dependency>
-        <dependency start="false">
-            <groupId>jline</groupId>
-            <artifactId>jline</artifactId>
-            <version>0.9.91</version>
+        <dependency start="true">
+            <groupId>org.apache.geronimo.modules</groupId>
+            <artifactId>geronimo-system</artifactId>
             <type>jar</type>
         </dependency>
-        <dependency start="false">
+        <dependency start="true">
             <groupId>org.apache.geronimo.modules</groupId>
             <artifactId>geronimo-util</artifactId>
-            <version>2.1-SNAPSHOT</version>
             <type>jar</type>
         </dependency>
-        <dependency start="false">
-            <groupId>ognl</groupId>
-            <artifactId>ognl</artifactId>
-            <version>2.6.9</version>
-            <type>jar</type>
-        </dependency>
-        <dependency start="false">
+        <dependency start="true">
             <groupId>asm</groupId>
             <artifactId>asm</artifactId>
-            <version>2.2.3</version>
             <type>jar</type>
         </dependency>
-        <dependency start="false">
-            <groupId>commons-jexl</groupId>
-            <artifactId>commons-jexl</artifactId>
-            <version>1.1</version>
-            <type>jar</type>
-        </dependency>
-        <dependency start="false">
+        <dependency start="true">
             <groupId>asm</groupId>
             <artifactId>asm-commons</artifactId>
-            <version>2.2.3</version>
             <type>jar</type>
         </dependency>
-        <dependency start="false">
+        <dependency start="true">
             <groupId>commons-cli</groupId>
             <artifactId>commons-cli</artifactId>
-            <version>1.0</version>
             <type>jar</type>
         </dependency>
-        <dependency start="false">
-            <groupId>woodstox</groupId>
-            <artifactId>wstx-asl</artifactId>
-            <version>3.2.1</version>
+        <dependency start="true">
+            <groupId>jline</groupId>
+            <artifactId>jline</artifactId>
+            <type>jar</type>
+        </dependency>
+        <dependency start="true">
+            <groupId>commons-jexl</groupId>
+            <artifactId>commons-jexl</artifactId>
+            <type>jar</type>
+        </dependency>
+        <dependency start="true">
+            <groupId>ognl</groupId>
+            <artifactId>ognl</artifactId>
             <type>jar</type>
         </dependency>
-        <dependency start="false">
+        <dependency start="true">
             <groupId>javax.xml.bind</groupId>
             <artifactId>jaxb-api</artifactId>
-            <version>2.0</version>
             <type>jar</type>
         </dependency>
-        <dependency start="false">
+        <dependency start="true">
+            <groupId>com.sun.xml.bind</groupId>
+            <artifactId>jaxb-impl</artifactId>
+            <type>jar</type>
+        </dependency>
+        <dependency start="true">
             <groupId>org.apache.geronimo.specs</groupId>
-            <artifactId>geronimo-activation_1.1_spec</artifactId>
-            <version>1.0</version>
+            <artifactId>geronimo-stax-api_1.0_spec</artifactId>
             <type>jar</type>
         </dependency>
-        <dependency start="false">
-            <groupId>org.apache.geronimo.modules</groupId>
-            <artifactId>geronimo-system</artifactId>
-            <version>2.1-SNAPSHOT</version>
+        <dependency start="true">
+            <groupId>woodstox</groupId>
+            <artifactId>wstx-asl</artifactId>
+            <type>jar</type>
+        </dependency>
+        <dependency start="true">
+            <groupId>org.apache.geronimo.specs</groupId>
+            <artifactId>geronimo-activation_1.1_spec</artifactId>
             <type>jar</type>
         </dependency>
     </plugin-artifact>

Added: geronimo/server/trunk/maven-plugins/car-maven-plugin/src/it/j2ee-system-2/src/test/resources/META-INF/plan.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/maven-plugins/car-maven-plugin/src/it/j2ee-system-2/src/test/resources/META-INF/plan.xml?rev=573656&view=auto
==============================================================================
--- geronimo/server/trunk/maven-plugins/car-maven-plugin/src/it/j2ee-system-2/src/test/resources/META-INF/plan.xml (added)
+++ geronimo/server/trunk/maven-plugins/car-maven-plugin/src/it/j2ee-system-2/src/test/resources/META-INF/plan.xml Fri Sep  7 11:25:14 2007
@@ -0,0 +1,175 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You 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.-->
+<!--Configuration for the innermost ring of a Geronimo server.
+This module should only contain critical services needed to
+run other Configurations - for example, the ServerInfo, Logging
+and Repository services used to load them.
+
+This module should *NOT* be used to provide server or application
+specific services - those should be provided by children.-->
+<module xmlns="http://geronimo.apache.org/xml/ns/deployment-1.2">
+  <environment>
+    <moduleId>
+      <groupId>org.apache.geronimo.plugins</groupId>
+      <artifactId>j2ee-system</artifactId>
+      <version>2.1-SNAPSHOT</version>
+      <type>car</type>
+    </moduleId>
+    <dependencies>
+      <dependency>
+        <groupId>org.apache.geronimo.modules</groupId>
+        <artifactId>geronimo-common</artifactId>
+        <type>jar</type>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.geronimo.modules</groupId>
+        <artifactId>geronimo-system</artifactId>
+        <type>jar</type>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.geronimo.modules</groupId>
+        <artifactId>geronimo-util</artifactId>
+        <type>jar</type>
+      </dependency>
+      <dependency>
+        <groupId>asm</groupId>
+        <artifactId>asm</artifactId>
+        <type>jar</type>
+      </dependency>
+      <dependency>
+        <groupId>asm</groupId>
+        <artifactId>asm-commons</artifactId>
+        <type>jar</type>
+      </dependency>
+      <dependency>
+        <groupId>commons-cli</groupId>
+        <artifactId>commons-cli</artifactId>
+        <type>jar</type>
+      </dependency>
+      <dependency>
+        <groupId>jline</groupId>
+        <artifactId>jline</artifactId>
+        <type>jar</type>
+      </dependency>
+      <dependency>
+        <groupId>commons-jexl</groupId>
+        <artifactId>commons-jexl</artifactId>
+        <type>jar</type>
+      </dependency>
+      <dependency>
+        <groupId>ognl</groupId>
+        <artifactId>ognl</artifactId>
+        <type>jar</type>
+      </dependency>
+      <dependency>
+        <groupId>javax.xml.bind</groupId>
+        <artifactId>jaxb-api</artifactId>
+        <type>jar</type>
+      </dependency>
+      <dependency>
+        <groupId>com.sun.xml.bind</groupId>
+        <artifactId>jaxb-impl</artifactId>
+        <type>jar</type>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.geronimo.specs</groupId>
+        <artifactId>geronimo-stax-api_1.0_spec</artifactId>
+        <type>jar</type>
+      </dependency>
+      <dependency>
+        <groupId>woodstox</groupId>
+        <artifactId>wstx-asl</artifactId>
+        <type>jar</type>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.geronimo.specs</groupId>
+        <artifactId>geronimo-activation_1.1_spec</artifactId>
+        <type>jar</type>
+      </dependency>
+    </dependencies>
+    <hidden-classes/>
+    <non-overridable-classes/>
+  </environment>
+  <gbean name="EmbeddedDaemon" class="org.apache.geronimo.system.main.EmbeddedDaemon"/>
+  <!--ServerInfo service-->
+  <gbean name="ServerInfo" class="org.apache.geronimo.system.serverinfo.BasicServerInfo"/>
+  <!--Repository-->
+  <gbean name="Repository" class="org.apache.geronimo.system.repository.Maven2Repository">
+    <attribute name="root">repository/</attribute>
+    <reference name="ServerInfo">
+      <name>ServerInfo</name>
+    </reference>
+  </gbean>
+  <!--Pinged and changed when the server completes loading when all the persistent configuration is loaded-->
+  <gbean name="ServerStatus" class="org.apache.geronimo.system.main.ServerStatusGBean">
+    <attribute name="serverStarted">false</attribute>
+  </gbean>
+  <!--Configuration Store service-->
+  <gbean name="Local" class="org.apache.geronimo.system.configuration.RepositoryConfigurationStore">
+    <reference name="Repository">
+      <name>Repository</name>
+    </reference>
+  </gbean>
+  <!--User-editable attribute service-->
+  <gbean name="AttributeManager" class="org.apache.geronimo.system.configuration.LocalAttributeManager">
+    <reference name="ServerInfo">
+      <name>ServerInfo</name>
+    </reference>
+    <attribute name="configFile">var/config/config.xml</attribute>
+    <attribute name="substitutionsFile">var/config/config-substitutions.properties</attribute>
+    <attribute name="substitutionPrefix">org.apache.geronimo.config.substitution.</attribute>
+  </gbean>
+  <!--ArtifactManager-->
+  <gbean name="ArtifactManager" class="org.apache.geronimo.kernel.repository.DefaultArtifactManager"/>
+  <!--ArtifactResolver-->
+  <gbean name="ArtifactResolver" class="org.apache.geronimo.system.resolver.ExplicitDefaultArtifactResolver">
+    <reference name="ArtifactManager">
+      <name>ArtifactManager</name>
+    </reference>
+    <reference name="Repositories"/>
+    <attribute name="versionMapLocation">var/config/artifact_aliases.properties</attribute>
+    <reference name="ServerInfo">
+      <name>ServerInfo</name>
+    </reference>
+  </gbean>
+  <!--Configuration Manager service-->
+  <gbean name="ConfigurationManager" class="org.apache.geronimo.kernel.config.EditableKernelConfigurationManager">
+    <reference name="Repositories"/>
+    <reference name="Stores"/>
+    <reference name="Watchers"/>
+    <reference name="AttributeStore">
+      <name>AttributeManager</name>
+    </reference>
+    <reference name="PersistentConfigurationList">
+      <type>AttributeStore</type>
+      <name>AttributeManager</name>
+    </reference>
+    <reference name="ArtifactManager">
+      <name>ArtifactManager</name>
+    </reference>
+    <reference name="ArtifactResolver">
+      <name>ArtifactResolver</name>
+    </reference>
+  </gbean>
+  <!--Logging service-->
+  <gbean name="Logger" class="org.apache.geronimo.system.logging.log4j.Log4jService">
+    <attribute name="configFileName">var/log/server-log4j.properties</attribute>
+    <attribute name="refreshPeriodSeconds">60</attribute>
+    <reference name="ServerInfo">
+      <name>ServerInfo</name>
+    </reference>
+  </gbean>
+</module>
\ No newline at end of file

Propchange: geronimo/server/trunk/maven-plugins/car-maven-plugin/src/it/j2ee-system-2/src/test/resources/META-INF/plan.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/maven-plugins/car-maven-plugin/src/it/j2ee-system-2/src/test/resources/META-INF/plan.xml
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/maven-plugins/car-maven-plugin/src/it/j2ee-system-2/src/test/resources/META-INF/plan.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Modified: geronimo/server/trunk/maven-plugins/car-maven-plugin/src/it/j2ee-system-2/validate.groovy
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/maven-plugins/car-maven-plugin/src/it/j2ee-system-2/validate.groovy?rev=573656&r1=573486&r2=573656&view=diff
==============================================================================
--- geronimo/server/trunk/maven-plugins/car-maven-plugin/src/it/j2ee-system-2/validate.groovy (original)
+++ geronimo/server/trunk/maven-plugins/car-maven-plugin/src/it/j2ee-system-2/validate.groovy Fri Sep  7 11:25:14 2007
@@ -18,7 +18,12 @@
  */
 
 
-def expected = new File(basedir, "src/test/resources/META-INF/geronimo-plugin.xml").text
-def found = new File(basedir, "target/resources/META-INF/geronimo-plugin.xml").text
+def expected1 = new File(basedir, "src/test/resources/META-INF/geronimo-plugin.xml").text
+def found1 = new File(basedir, "target/resources/META-INF/geronimo-plugin.xml").text
 
-assert expected == found
\ No newline at end of file
+assert expected1 == found1
+
+def expected2 = new File(basedir, "src/test/resources/META-INF/plan.xml").text
+def found2 = new File(basedir, "target/resources/META-INF/plan.xml").text
+
+assert expected2 == found2
\ No newline at end of file

Added: geronimo/server/trunk/maven-plugins/car-maven-plugin/src/it/j2ee-system/src/test/resources/META-INF/plan.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/maven-plugins/car-maven-plugin/src/it/j2ee-system/src/test/resources/META-INF/plan.xml?rev=573656&view=auto
==============================================================================
--- geronimo/server/trunk/maven-plugins/car-maven-plugin/src/it/j2ee-system/src/test/resources/META-INF/plan.xml (added)
+++ geronimo/server/trunk/maven-plugins/car-maven-plugin/src/it/j2ee-system/src/test/resources/META-INF/plan.xml Fri Sep  7 11:25:14 2007
@@ -0,0 +1,203 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You 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.-->
+<!--Configuration for the innermost ring of a Geronimo server.
+This module should only contain critical services needed to
+run other Configurations - for example, the ServerInfo, Logging
+and Repository services used to load them.
+
+This module should *NOT* be used to provide server or application
+specific services - those should be provided by children.-->
+<module xmlns="http://geronimo.apache.org/xml/ns/deployment-1.2">
+  <environment>
+    <moduleId>
+      <groupId>org.apache.geronimo.plugins</groupId>
+      <artifactId>j2ee-system</artifactId>
+      <version>2.1-SNAPSHOT</version>
+      <type>car</type>
+    </moduleId>
+    <dependencies>
+      <dependency>
+        <groupId>com.sun.xml.bind</groupId>
+        <artifactId>jaxb-impl</artifactId>
+        <version>2.0.5</version>
+        <type>jar</type>
+        <import>classes</import>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.geronimo.specs</groupId>
+        <artifactId>geronimo-stax-api_1.0_spec</artifactId>
+        <version>1.0</version>
+        <type>jar</type>
+        <import>classes</import>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.geronimo.modules</groupId>
+        <artifactId>geronimo-common</artifactId>
+        <version>2.1-SNAPSHOT</version>
+        <type>jar</type>
+        <import>classes</import>
+      </dependency>
+      <dependency>
+        <groupId>jline</groupId>
+        <artifactId>jline</artifactId>
+        <version>0.9.91</version>
+        <type>jar</type>
+        <import>classes</import>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.geronimo.modules</groupId>
+        <artifactId>geronimo-util</artifactId>
+        <version>2.1-SNAPSHOT</version>
+        <type>jar</type>
+        <import>classes</import>
+      </dependency>
+      <dependency>
+        <groupId>ognl</groupId>
+        <artifactId>ognl</artifactId>
+        <version>2.6.9</version>
+        <type>jar</type>
+        <import>classes</import>
+      </dependency>
+      <dependency>
+        <groupId>asm</groupId>
+        <artifactId>asm</artifactId>
+        <version>2.2.3</version>
+        <type>jar</type>
+        <import>classes</import>
+      </dependency>
+      <dependency>
+        <groupId>commons-jexl</groupId>
+        <artifactId>commons-jexl</artifactId>
+        <version>1.1</version>
+        <type>jar</type>
+        <import>classes</import>
+      </dependency>
+      <dependency>
+        <groupId>asm</groupId>
+        <artifactId>asm-commons</artifactId>
+        <version>2.2.3</version>
+        <type>jar</type>
+        <import>classes</import>
+      </dependency>
+      <dependency>
+        <groupId>commons-cli</groupId>
+        <artifactId>commons-cli</artifactId>
+        <version>1.0</version>
+        <type>jar</type>
+        <import>classes</import>
+      </dependency>
+      <dependency>
+        <groupId>woodstox</groupId>
+        <artifactId>wstx-asl</artifactId>
+        <version>3.2.1</version>
+        <type>jar</type>
+        <import>classes</import>
+      </dependency>
+      <dependency>
+        <groupId>javax.xml.bind</groupId>
+        <artifactId>jaxb-api</artifactId>
+        <version>2.0</version>
+        <type>jar</type>
+        <import>classes</import>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.geronimo.specs</groupId>
+        <artifactId>geronimo-activation_1.1_spec</artifactId>
+        <version>1.0</version>
+        <type>jar</type>
+        <import>classes</import>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.geronimo.modules</groupId>
+        <artifactId>geronimo-system</artifactId>
+        <version>2.1-SNAPSHOT</version>
+        <type>jar</type>
+        <import>classes</import>
+      </dependency>
+    </dependencies>
+    <hidden-classes/>
+    <non-overridable-classes/>
+  </environment>
+  <gbean name="EmbeddedDaemon" class="org.apache.geronimo.system.main.EmbeddedDaemon"/>
+  <!--ServerInfo service-->
+  <gbean name="ServerInfo" class="org.apache.geronimo.system.serverinfo.BasicServerInfo"/>
+  <!--Repository-->
+  <gbean name="Repository" class="org.apache.geronimo.system.repository.Maven2Repository">
+    <attribute name="root">repository/</attribute>
+    <reference name="ServerInfo">
+      <name>ServerInfo</name>
+    </reference>
+  </gbean>
+  <!--Pinged and changed when the server completes loading when all the persistent configuration is loaded-->
+  <gbean name="ServerStatus" class="org.apache.geronimo.system.main.ServerStatusGBean">
+    <attribute name="serverStarted">false</attribute>
+  </gbean>
+  <!--Configuration Store service-->
+  <gbean name="Local" class="org.apache.geronimo.system.configuration.RepositoryConfigurationStore">
+    <reference name="Repository">
+      <name>Repository</name>
+    </reference>
+  </gbean>
+  <!--User-editable attribute service-->
+  <gbean name="AttributeManager" class="org.apache.geronimo.system.configuration.LocalAttributeManager">
+    <reference name="ServerInfo">
+      <name>ServerInfo</name>
+    </reference>
+    <attribute name="configFile">var/config/config.xml</attribute>
+    <attribute name="substitutionsFile">var/config/config-substitutions.properties</attribute>
+    <attribute name="substitutionPrefix">org.apache.geronimo.config.substitution.</attribute>
+  </gbean>
+  <!--ArtifactManager-->
+  <gbean name="ArtifactManager" class="org.apache.geronimo.kernel.repository.DefaultArtifactManager"/>
+  <!--ArtifactResolver-->
+  <gbean name="ArtifactResolver" class="org.apache.geronimo.system.resolver.ExplicitDefaultArtifactResolver">
+    <reference name="ArtifactManager">
+      <name>ArtifactManager</name>
+    </reference>
+    <reference name="Repositories"/>
+    <attribute name="versionMapLocation">var/config/artifact_aliases.properties</attribute>
+    <reference name="ServerInfo">
+      <name>ServerInfo</name>
+    </reference>
+  </gbean>
+  <!--Configuration Manager service-->
+  <gbean name="ConfigurationManager" class="org.apache.geronimo.kernel.config.EditableKernelConfigurationManager">
+    <reference name="Repositories"/>
+    <reference name="Stores"/>
+    <reference name="Watchers"/>
+    <reference name="AttributeStore">
+      <name>AttributeManager</name>
+    </reference>
+    <reference name="PersistentConfigurationList">
+      <type>AttributeStore</type>
+      <name>AttributeManager</name>
+    </reference>
+    <reference name="ArtifactManager">
+      <name>ArtifactManager</name>
+    </reference>
+    <reference name="ArtifactResolver">
+      <name>ArtifactResolver</name>
+    </reference>
+  </gbean>
+  <!--Logging service-->
+  <gbean name="Logger" class="org.apache.geronimo.system.logging.log4j.Log4jService">
+    <attribute name="configFileName">var/log/server-log4j.properties</attribute>
+    <attribute name="refreshPeriodSeconds">60</attribute>
+    <reference name="ServerInfo">
+      <name>ServerInfo</name>
+    </reference>
+  </gbean>
+</module>
\ No newline at end of file

Propchange: geronimo/server/trunk/maven-plugins/car-maven-plugin/src/it/j2ee-system/src/test/resources/META-INF/plan.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/maven-plugins/car-maven-plugin/src/it/j2ee-system/src/test/resources/META-INF/plan.xml
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/maven-plugins/car-maven-plugin/src/it/j2ee-system/src/test/resources/META-INF/plan.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Modified: geronimo/server/trunk/maven-plugins/car-maven-plugin/src/it/j2ee-system/validate.groovy
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/maven-plugins/car-maven-plugin/src/it/j2ee-system/validate.groovy?rev=573656&r1=573655&r2=573656&view=diff
==============================================================================
--- geronimo/server/trunk/maven-plugins/car-maven-plugin/src/it/j2ee-system/validate.groovy (original)
+++ geronimo/server/trunk/maven-plugins/car-maven-plugin/src/it/j2ee-system/validate.groovy Fri Sep  7 11:25:14 2007
@@ -18,7 +18,12 @@
  */
 
 
-def expected = new File(basedir, "src/test/resources/META-INF/geronimo-plugin.xml").text
-def found = new File(basedir, "target/resources/META-INF/geronimo-plugin.xml").text
+def expected1 = new File(basedir, "src/test/resources/META-INF/geronimo-plugin.xml").text
+def found1 = new File(basedir, "target/resources/META-INF/geronimo-plugin.xml").text
 
-assert expected == found
\ No newline at end of file
+assert expected1 == found1
+
+def expected2 = new File(basedir, "src/test/resources/META-INF/plan.xml").text
+def found2 = new File(basedir, "target/resources/META-INF/plan.xml").text
+
+assert expected2 == found2
\ No newline at end of file

Modified: geronimo/server/trunk/maven-plugins/car-maven-plugin/src/it/metadatageneration-2/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/maven-plugins/car-maven-plugin/src/it/metadatageneration-2/pom.xml?rev=573656&r1=573486&r2=573656&view=diff
==============================================================================
--- geronimo/server/trunk/maven-plugins/car-maven-plugin/src/it/metadatageneration-2/pom.xml (original)
+++ geronimo/server/trunk/maven-plugins/car-maven-plugin/src/it/metadatageneration-2/pom.xml Fri Sep  7 11:25:14 2007
@@ -39,53 +39,12 @@
     <dependencies>
 
         <dependency>
-            <groupId>org.apache.geronimo.modules</groupId>
-            <artifactId>geronimo-system</artifactId>
-            <version>${version}</version>
-        </dependency>
-
-        <dependency>
-            <groupId>org.apache.geronimo.modules</groupId>
-            <artifactId>geronimo-service-builder</artifactId>
-            <version>${version}</version>
-        </dependency>
-
-        <dependency>
-            <groupId>org.apache.geronimo.modules</groupId>
-            <artifactId>geronimo-deploy-tool</artifactId>
-            <version>${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>org.apache.maven</groupId>
-            <artifactId>maven-archiver</artifactId>
-            <version>2.2</version>
-        </dependency>
-
-        <dependency>
             <groupId>velocity</groupId>
             <artifactId>velocity</artifactId>
             <version>1.4</version>
         </dependency>
 
         <dependency>
-            <groupId>commons-cli</groupId>
-            <artifactId>commons-cli</artifactId>
-        </dependency>
-
-        <dependency>
             <groupId>xstream</groupId>
             <artifactId>xstream</artifactId>
         </dependency>
@@ -93,11 +52,13 @@
         <dependency>
             <groupId>xpp3</groupId>
             <artifactId>xpp3</artifactId>
+            <scope>test</scope>
         </dependency>
 
         <dependency>
             <groupId>commons-logging</groupId>
             <artifactId>commons-logging</artifactId>
+            <scope>provided</scope>
         </dependency>
 
     </dependencies>
@@ -110,21 +71,10 @@
                 <configuration>
                     <category>Test</category>
                     <osiApproved>true</osiApproved>
-                    <dependencies>
-                        <dependency>
-                            <groupId>xstream</groupId>
-                            <artifactId>xstream</artifactId>
-                            <type>jar</type>
-                        </dependency>
-                        <dependency>
-                            <groupId>velocity</groupId>
-                            <artifactId>velocity</artifactId>
-                            <version>1.4</version>
-                            <type>jar</type>
-                            <start>true</start>
-                            <import>classes</import>
-                        </dependency>
-                    </dependencies>
+                    <useMavenDependencies>
+                        <value>true</value>
+                        <includeVersion>true</includeVersion>
+                    </useMavenDependencies>
                     <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>

Modified: geronimo/server/trunk/maven-plugins/car-maven-plugin/src/it/metadatageneration-2/src/test/resources/META-INF/geronimo-plugin.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/maven-plugins/car-maven-plugin/src/it/metadatageneration-2/src/test/resources/META-INF/geronimo-plugin.xml?rev=573656&r1=573486&r2=573656&view=diff
==============================================================================
--- geronimo/server/trunk/maven-plugins/car-maven-plugin/src/it/metadatageneration-2/src/test/resources/META-INF/geronimo-plugin.xml (original)
+++ geronimo/server/trunk/maven-plugins/car-maven-plugin/src/it/metadatageneration-2/src/test/resources/META-INF/geronimo-plugin.xml Fri Sep  7 11:25:14 2007
@@ -23,15 +23,16 @@
             <resource-type>joke</resource-type>
             <description>this is an explanation</description>
         </prerequisite>
-        <dependency start="false">
-            <groupId>xstream</groupId>
-            <artifactId>xstream</artifactId>
-            <type>jar</type>
-        </dependency>
         <dependency start="true">
             <groupId>velocity</groupId>
             <artifactId>velocity</artifactId>
             <version>1.4</version>
+            <type>jar</type>
+        </dependency>
+        <dependency start="true">
+            <groupId>xstream</groupId>
+            <artifactId>xstream</artifactId>
+            <version>1.1.3</version>
             <type>jar</type>
         </dependency>
         <obsoletes>

Modified: geronimo/server/trunk/maven-plugins/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/AbstractCarMojo.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/maven-plugins/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/AbstractCarMojo.java?rev=573656&r1=573655&r2=573656&view=diff
==============================================================================
--- geronimo/server/trunk/maven-plugins/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/AbstractCarMojo.java (original)
+++ geronimo/server/trunk/maven-plugins/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/AbstractCarMojo.java Fri Sep  7 11:25:14 2007
@@ -27,6 +27,7 @@
 import java.util.Iterator;
 import java.util.Properties;
 import java.util.Map;
+import java.util.List;
 
 import org.codehaus.mojo.pluginsupport.MojoSupport;
 import org.codehaus.mojo.pluginsupport.util.ArtifactItem;
@@ -40,6 +41,7 @@
 import org.apache.maven.project.MavenProjectHelper;
 import org.apache.maven.artifact.Artifact;
 import org.apache.maven.artifact.repository.ArtifactRepository;
+import org.apache.maven.model.*;
 
 /**
  * Support for <em>packaging</em> Mojos.
@@ -209,6 +211,36 @@
         assert artifact != null;
 
         return "car".equals(artifact.getType());
+    }
+
+    protected boolean includeDependency(org.apache.maven.model.Dependency dependency) {
+        if (dependency.getGroupId().startsWith("org.apache.geronimo.genesis")) {
+            return false;
+        }
+        String scope = dependency.getScope();
+        return scope == null || "runtime".equalsIgnoreCase(scope) || "compile".equalsIgnoreCase(scope);
+    }
+
+    protected org.apache.maven.model.Dependency resolveDependency(org.apache.maven.model.Dependency dependency, List<org.apache.maven.model.Dependency> artifacts) {
+        for (org.apache.maven.model.Dependency match: artifacts) {
+            if (matches(dependency, match)) {
+                return match;
+            }
+        }
+        throw new IllegalStateException("Dependency " + dependency + " is not resolved in project");
+    }
+
+    private boolean matches(org.apache.maven.model.Dependency dependency, org.apache.maven.model.Dependency match) {
+        if (dependency.getGroupId() != null && !dependency.getGroupId().equals(match.getGroupId())) {
+            return false;
+        }
+        if (dependency.getArtifactId() != null && !dependency.getArtifactId().equals(match.getArtifactId())) {
+            return false;
+        }
+        if (dependency.getType() != null && !dependency.getType().equals(match.getType())) {
+            return false;
+        }
+        return true;
     }
 
     protected class ArtifactLookupImpl

Modified: geronimo/server/trunk/maven-plugins/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/PlanProcessorMojo.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/maven-plugins/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/PlanProcessorMojo.java?rev=573656&r1=573655&r2=573656&view=diff
==============================================================================
--- geronimo/server/trunk/maven-plugins/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/PlanProcessorMojo.java (original)
+++ geronimo/server/trunk/maven-plugins/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/PlanProcessorMojo.java Fri Sep  7 11:25:14 2007
@@ -33,6 +33,7 @@
 import org.apache.geronimo.deployment.xbeans.EnvironmentType;
 import org.apache.geronimo.kernel.repository.Artifact;
 import org.apache.geronimo.kernel.repository.Environment;
+import org.apache.geronimo.kernel.repository.ImportType;
 import org.apache.velocity.Template;
 import org.apache.velocity.VelocityContext;
 import org.apache.velocity.app.Velocity;
@@ -47,14 +48,12 @@
 
 /**
  * Add dependencies to a plan and process with velocity
- * 
- * @goal prepare-plan
  *
  * @version $Rev$ $Date$
+ * @goal prepare-plan
  */
 public class PlanProcessorMojo
-    extends AbstractCarMojo
-{
+        extends AbstractCarMojo {
     private static final String ENVIRONMENT_LOCAL_NAME = "environment";
 
     private static final QName ENVIRONMENT_QNAME = new QName("http://geronimo.apache.org/xml/ns/deployment-1.2", "environment");
@@ -88,6 +87,11 @@
      */
     private List<Dependency> dependencies = Collections.emptyList();
 
+    /**
+     * @parameter
+     */
+    private UseMavenDependencies useMavenDependencies;
+
     private VelocityContext createContext() {
         VelocityContext context = new VelocityContext();
 
@@ -117,12 +121,12 @@
         //
         //        Might be better of just hand rolling something...
         //
-        
+
         VelocityContext context = createContext();
 
         VelocityEngine velocity = new VelocityEngine();
         velocity.setProperty(Velocity.FILE_RESOURCE_LOADER_PATH, sourceDir.getAbsolutePath());
-        
+
         // Don't spit out any logs
         velocity.setProperty(Velocity.RUNTIME_LOG_LOGSYSTEM_CLASS, "org.apache.velocity.runtime.log.NullLogSystem");
         velocity.init();
@@ -140,20 +144,19 @@
 
         try {
             mergeEnvironment(xmlCursor, configId, dependencies);
-            
+
             if (targetDir.exists()) {
                 if (!targetDir.isDirectory()) {
                     throw new RuntimeException("TargetDir: " + this.targetDir + " exists and is not a directory");
                 }
-            }
-            else {
+            } else {
                 targetDir.mkdirs();
             }
 
             XmlOptions xmlOptions = new XmlOptions();
             xmlOptions.setSavePrettyPrint();
             doc.save(targetFile, xmlOptions);
-            
+
             log.info("Generated: " + targetFile);
         }
         finally {
@@ -171,7 +174,7 @@
         }
         QName childName = xmlCursor.getName();
         Environment oldEnvironment;
-        
+
         if (childName != null && childName.getLocalPart().equals(ENVIRONMENT_LOCAL_NAME)) {
             convertElement(xmlCursor, ENVIRONMENT_QNAME.getNamespaceURI());
             XmlObject xmlObject = xmlCursor.getObject();
@@ -203,11 +206,11 @@
     private void moveToFirstStartElement(XmlCursor xmlCursor) throws AssertionError {
         xmlCursor.toStartDoc();
         xmlCursor.toFirstChild();
-        while (!xmlCursor.currentTokenType().isStart()) {            
+        while (!xmlCursor.currentTokenType().isStart()) {
             if (!xmlCursor.toNextSibling()) {
                 break;
             }
-        } 
+        }
         if (!xmlCursor.currentTokenType().isStart()) {
             throw new AssertionError("Cannot find first start element");
         }
@@ -241,13 +244,41 @@
     private LinkedHashSet<org.apache.geronimo.kernel.repository.Dependency> toDependencies() {
         LinkedHashSet<org.apache.geronimo.kernel.repository.Dependency> dependencies = new LinkedHashSet<org.apache.geronimo.kernel.repository.Dependency>();
 
-        for (Dependency dependency : this.dependencies) {
-            org.apache.geronimo.kernel.repository.Dependency gdep = dependency.toDependency();
+        if (useMavenDependencies == null || !useMavenDependencies.isValue()) {
+            for (Dependency dependency : this.dependencies) {
+                org.apache.geronimo.kernel.repository.Dependency gdep = dependency.toDependency();
                 dependencies.add(gdep);
+            }
+        } else {
+            List<org.apache.maven.model.Dependency> includedDependencies = project.getOriginalModel().getDependencies();
+            List<org.apache.maven.model.Dependency> artifacts = project.getDependencies();
+            for (org.apache.maven.model.Dependency dependency : includedDependencies) {
+                dependency = resolveDependency(dependency, artifacts);
+                if (includeDependency(dependency)) {
+                    org.apache.geronimo.kernel.repository.Dependency gdep = toGeronimoDependency(dependency, useMavenDependencies.isIncludeVersion());
+                    dependencies.add(gdep);
+                }
+            }
         }
 
         return dependencies;
     }
+
+
+    private static org.apache.geronimo.kernel.repository.Dependency toGeronimoDependency(final org.apache.maven.model.Dependency dependency, boolean includeVersion) {
+        Artifact artifact = toGeronimoArtifact(dependency, includeVersion);
+        return new org.apache.geronimo.kernel.repository.Dependency(artifact, ImportType.ALL);
+    }
+
+    private static Artifact toGeronimoArtifact(final org.apache.maven.model.Dependency dependency, boolean includeVersion) {
+        String groupId = dependency.getGroupId();
+        String artifactId = dependency.getArtifactId();
+        String version = includeVersion ? dependency.getVersion() : null;
+        String type = dependency.getType();
+
+        return new Artifact(groupId, artifactId, version, type);
+    }
+
 
     interface Inserter {
         ArtifactType insert(EnvironmentType environmentType);

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=573656&r1=573655&r2=573656&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 Fri Sep  7 11:25:14 2007
@@ -28,6 +28,7 @@
 
 import org.apache.geronimo.system.plugin.PluginInstallerGBean;
 import org.apache.geronimo.system.plugin.model.ArtifactType;
+import org.apache.geronimo.system.plugin.model.DependencyType;
 import org.apache.geronimo.system.plugin.model.LicenseType;
 import org.apache.geronimo.system.plugin.model.PluginArtifactType;
 import org.apache.geronimo.system.plugin.model.PluginType;
@@ -88,6 +89,11 @@
     private List<Dependency> dependencies = Collections.emptyList();
 
     /**
+     * @parameter
+     */
+    private UseMavenDependencies useMavenDependencies;
+
+    /**
      * shared configuration from parent that we merge since maven is incompetent at it.
      *
      * @parameter
@@ -168,9 +174,7 @@
         artifactType.setVersion(project.getVersion());
         artifactType.setType(project.getArtifact().getType());
         instance.setModuleId(artifactType);
-        for (Dependency dependency : dependencies) {
-            instance.getDependency().add(dependency.toDependencyType());
-        }
+        addDependencies(instance);
         targetDir.mkdirs();
         FileOutputStream out = new FileOutputStream(targetFile);
         try {
@@ -181,4 +185,34 @@
         getProject().getResources().add(targetFile);
     }
 
+    private void addDependencies(PluginArtifactType instance) {
+        if (useMavenDependencies == null || !useMavenDependencies.isValue()) {
+            for (Dependency dependency : dependencies) {
+                instance.getDependency().add(dependency.toDependencyType());
+            }
+        } else {
+            List<org.apache.maven.model.Dependency> includedDependencies = project.getOriginalModel().getDependencies();
+            List<org.apache.maven.model.Dependency> artifacts = project.getDependencies();
+            for (org.apache.maven.model.Dependency dependency : includedDependencies) {
+                dependency = resolveDependency(dependency, artifacts);
+                if (includeDependency(dependency)) {
+                    DependencyType gdep = toGeronimoDependency(dependency, useMavenDependencies.isIncludeVersion());
+                    instance.getDependency().add(gdep);
+                }
+            }
+
+        }
+    }
+
+    private static DependencyType toGeronimoDependency(final org.apache.maven.model.Dependency dependency, boolean includeVersion) {
+        DependencyType dependencyType = new DependencyType();
+        dependencyType.setGroupId(dependency.getGroupId());
+        dependencyType.setArtifactId(dependency.getArtifactId());
+        if (includeVersion) {
+            dependencyType.setVersion(dependency.getVersion());
+        }
+        dependencyType.setType(dependency.getType());
+        dependencyType.setStart(true);
+        return dependencyType;
+    }
 }

Added: geronimo/server/trunk/maven-plugins/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/UseMavenDependencies.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/maven-plugins/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/UseMavenDependencies.java?rev=573656&view=auto
==============================================================================
--- geronimo/server/trunk/maven-plugins/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/UseMavenDependencies.java (added)
+++ geronimo/server/trunk/maven-plugins/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/UseMavenDependencies.java Fri Sep  7 11:25:14 2007
@@ -0,0 +1,46 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.mavenplugins.car;
+
+/**
+ * @version $Rev:$ $Date:$
+ */
+public class UseMavenDependencies {
+
+    /**
+     * @parameter
+     */
+    private boolean value = true;
+
+    /**
+     * @parameter
+     */
+    private boolean includeVersion;
+
+
+    public boolean isValue() {
+        return value;
+    }
+
+    public boolean isIncludeVersion() {
+        return includeVersion;
+    }
+}

Propchange: geronimo/server/trunk/maven-plugins/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/UseMavenDependencies.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/maven-plugins/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/UseMavenDependencies.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/maven-plugins/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/UseMavenDependencies.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain



Mime
View raw message