geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ammul...@apache.org
Subject svn commit: r396191 [1/2] - in /geronimo/branches/1.1: applications/console-standard/src/java/org/apache/geronimo/console/car/ configs/client-deployer/src/plan/ configs/console-jetty/ configs/console-jetty/src/conf/ configs/console-tomcat/ configs/cons...
Date Sun, 23 Apr 2006 01:19:21 GMT
Author: ammulder
Date: Sat Apr 22 18:19:16 2006
New Revision: 396191

URL: http://svn.apache.org/viewcvs?rev=396191&view=rev
Log:
Plugins work again
 - handle dependencies with no versions
 - can force including a version for a particular dependency
 - plugin descriptors are included for several of our default CARs
 - Deployers don't add references with versions (GERONIMO-1897)
 - GeronimoAsMaven supports Maven metadata files
 - Safely duplicate download status to avoid serialization errors
   and a race condition
Include a tool to export a plugin repository for Geronimo from a standard
  Maven 1.1 repo after a Geronimo build
Set specific versions for JAR dependencies for:
 - console-jetty & console-tomcat
 - jsp-examples-jetty
 - geronimo-directory

Added:
    geronimo/branches/1.1/configs/console-jetty/src/conf/
    geronimo/branches/1.1/configs/console-jetty/src/conf/geronimo-plugin.xml
    geronimo/branches/1.1/configs/console-tomcat/src/conf/
    geronimo/branches/1.1/configs/console-tomcat/src/conf/geronimo-plugin.xml
    geronimo/branches/1.1/configs/directory/src/conf/
    geronimo/branches/1.1/configs/directory/src/conf/geronimo-plugin.xml
    geronimo/branches/1.1/configs/jsp-examples-jetty/src/conf/
    geronimo/branches/1.1/configs/jsp-examples-jetty/src/conf/geronimo-plugin.xml
    geronimo/branches/1.1/configs/jsp-examples-tomcat/src/conf/
    geronimo/branches/1.1/configs/jsp-examples-tomcat/src/conf/geronimo-plugin.xml
    geronimo/branches/1.1/configs/servlets-examples-jetty/src/conf/
    geronimo/branches/1.1/configs/servlets-examples-jetty/src/conf/geronimo-plugin.xml
    geronimo/branches/1.1/configs/servlets-examples-tomcat/src/conf/
    geronimo/branches/1.1/configs/servlets-examples-tomcat/src/conf/geronimo-plugin.xml
    geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/util/PluginRepositoryExporter.java
Modified:
    geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/car/GeronimoAsMavenServlet.java
    geronimo/branches/1.1/configs/client-deployer/src/plan/plan.xml
    geronimo/branches/1.1/configs/console-jetty/maven.xml
    geronimo/branches/1.1/configs/console-jetty/project.xml
    geronimo/branches/1.1/configs/console-tomcat/maven.xml
    geronimo/branches/1.1/configs/console-tomcat/project.xml
    geronimo/branches/1.1/configs/directory/maven.xml
    geronimo/branches/1.1/configs/j2ee-deployer/src/plan/plan.xml
    geronimo/branches/1.1/configs/jetty-deployer/src/plan/plan.xml
    geronimo/branches/1.1/configs/jsp-examples-jetty/maven.xml
    geronimo/branches/1.1/configs/jsp-examples-jetty/project.xml
    geronimo/branches/1.1/configs/jsp-examples-tomcat/maven.xml
    geronimo/branches/1.1/configs/openejb-deployer/src/plan/plan.xml
    geronimo/branches/1.1/configs/servlets-examples-jetty/maven.xml
    geronimo/branches/1.1/configs/servlets-examples-tomcat/maven.xml
    geronimo/branches/1.1/configs/tomcat-deployer/src/plan/plan.xml
    geronimo/branches/1.1/configs/welcome-jetty/src/conf/geronimo-plugin.xml
    geronimo/branches/1.1/configs/welcome-tomcat/src/conf/geronimo-plugin.xml
    geronimo/branches/1.1/etc/project.properties
    geronimo/branches/1.1/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/CommandInstallCAR.java
    geronimo/branches/1.1/modules/directory/project.xml
    geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/configuration/ConfigInstallerGBean.java
    geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/configuration/DownloadResults.java
    geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/repository/AbstractRepository.java
    geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/repository/Maven1Repository.java
    geronimo/branches/1.1/plugins/geronimo-dependency-plugin/project.xml
    geronimo/branches/1.1/plugins/geronimo-dependency-plugin/src/java/org/apache/geronimo/plugin/dependency/GenerateServiceXml.java
    geronimo/branches/1.1/plugins/geronimo-packaging-plugin/project.xml
    geronimo/branches/1.1/plugins/geronimo-packaging-plugin/src/java/org/apache/geronimo/plugin/packaging/PlanProcessor.java

Modified: geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/car/GeronimoAsMavenServlet.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/car/GeronimoAsMavenServlet.java?rev=396191&r1=396190&r2=396191&view=diff
==============================================================================
--- geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/car/GeronimoAsMavenServlet.java (original)
+++ geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/car/GeronimoAsMavenServlet.java Sat Apr 22 18:19:16 2006
@@ -38,6 +38,7 @@
 import javax.xml.transform.TransformerException;
 import javax.xml.transform.TransformerFactory;
 import javax.xml.transform.OutputKeys;
+import javax.xml.transform.TransformerConfigurationException;
 import javax.xml.transform.dom.DOMSource;
 import javax.xml.transform.stream.StreamResult;
 import org.apache.commons.logging.Log;
@@ -59,6 +60,7 @@
 import org.apache.geronimo.kernel.repository.Artifact;
 import org.apache.geronimo.kernel.repository.Repository;
 import org.apache.geronimo.kernel.repository.Dependency;
+import org.apache.geronimo.kernel.repository.Version;
 import org.apache.geronimo.system.serverinfo.ServerInfo;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
@@ -71,15 +73,48 @@
  */
 public class GeronimoAsMavenServlet extends HttpServlet {
     private final static Log log = LogFactory.getLog(GeronimoAsMavenServlet.class);
+
+    protected void doHead(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) throws ServletException, IOException {
+        handleRequest(httpServletRequest, httpServletResponse, false);
+    }
+
     protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
+        handleRequest(request, response, true);
+    }
+    protected void handleRequest(HttpServletRequest request, HttpServletResponse response, boolean reply) throws ServletException, IOException {
         String path = request.getPathInfo();
         if(path == null) {
             throw new ServletException("No configId specified for CAR download");
         }
         Kernel kernel = KernelRegistry.getSingleKernel();
         if(path.equals("/geronimo-plugins.xml")) {
+            response.setContentType("text/xml");
+            if(reply) {
+                try {
+                    generateConfigFile(kernel, response.getWriter());
+                } catch (Exception e) {
+                    throw new ServletException("Unable to generate Geronimo configuration list", e);
+                }
+            }
+        } else if(path.endsWith("/maven-metadata.xml")) {
+            response.setContentType("text/xml");
             try {
-                generateConfigFile(kernel, response.getWriter());
+                String start = path.substring(0, path.lastIndexOf('/'));
+                if(start.charAt(0) == '/') {
+                    start = start.substring(1);
+                }
+                String[] parts = start.split("/");
+                if(parts.length > 2) {
+                    StringBuffer buf = new StringBuffer();
+                    for (int i = 0; i < parts.length-1; i++) {
+                        String part = parts[i];
+                        if(i > 0) buf.append('.');
+                        buf.append(part);
+                    }
+                    generateMavenFile(kernel, response.getWriter(), buf.toString(), parts[parts.length-1], reply);
+                } else {
+                    generateMavenFile(kernel, response.getWriter(), parts[0], parts[1], reply);
+                }
             } catch (Exception e) {
                 throw new ServletException("Unable to generate Geronimo configuration list", e);
             }
@@ -106,13 +141,13 @@
             }
             String artifactId = parts[2].substring(0, pos);
             String configId = groupId+"/"+artifactId+"/"+version+"/"+type;
-            if(!produceDownloadFile(kernel, Artifact.create(configId), response)) {
+            if(!produceDownloadFile(kernel, Artifact.create(configId), response, reply)) {
                 response.sendError(404, "Cannot locate download file "+path);
             }
         }
     }
 
-    private boolean produceDownloadFile(Kernel kernel, Artifact configId, HttpServletResponse response) throws IOException {
+    private boolean produceDownloadFile(Kernel kernel, Artifact configId, HttpServletResponse response, boolean reply) throws IOException {
         //todo: replace kernel mumbo jumbo with JSR-77 navigation
         // Step 1: check if it's in a configuration store
         ConfigurationManager mgr = ConfigurationUtil.getConfigurationManager(kernel);
@@ -124,6 +159,9 @@
                 ConfigurationStore store = (ConfigurationStore) kernel.getProxyManager().createProxy(name, ConfigurationStore.class);
                 if(store.containsConfiguration(configId)) {
                     response.setContentType("application/zip");
+                    if(!reply) {
+                        return true;
+                    }
                     try {
                         kernel.invoke(name, "exportConfiguration", new Object[]{configId.toString(), response.getOutputStream()}, new String[]{String.class.getName(), OutputStream.class.getName()});
                         return true;
@@ -141,9 +179,12 @@
             Repository repo = (Repository) kernel.getProxyManager().createProxy(name, Repository.class);
             if(repo.contains(configId)) {
                 File path = repo.getLocation(configId);
-                if(!path.exists()) throw new IllegalStateException("Can't check length of file '"+path.getAbsolutePath()+"'");
-                InputStream in = new BufferedInputStream(new FileInputStream(path));
+                if(!path.exists()) throw new IllegalStateException("Can't find file '"+path.getAbsolutePath()+"'");
                 response.setContentType("application/zip");
+                if(!reply) {
+                    return true;
+                }
+                InputStream in = new BufferedInputStream(new FileInputStream(path));
                 response.setContentLength((int)path.length());
                 OutputStream out = response.getOutputStream();
                 byte[] buf = new byte[1024];
@@ -204,6 +245,37 @@
         Transformer xform = xfactory.newTransformer();
         xform.setOutputProperty(OutputKeys.INDENT, "yes");
         xform.transform(new DOMSource(doc), new StreamResult(out));
+    }
+
+    private void generateMavenFile(Kernel kernel, PrintWriter writer, String groupId, String artifactId, boolean reply) throws ParserConfigurationException, TransformerException {
+        ConfigurationManager mgr = ConfigurationUtil.getConfigurationManager(kernel);
+        Artifact[] artifacts = mgr.getArtifactResolver().queryArtifacts(new Artifact(groupId, artifactId, (Version)null, null));
+        if(!reply) {
+            return;
+        }
+
+        DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+        DocumentBuilder builder = factory.newDocumentBuilder();
+        Document doc = builder.newDocument();
+        Element root = doc.createElement("metadata");
+        doc.appendChild(root);
+        createText(doc, root, "groupId", groupId);
+        createText(doc, root, "artifactId", artifactId);
+        if(artifacts.length > 0) {
+            createText(doc, root, "version", artifacts[0].getVersion().toString());
+        }
+        Element versioning = doc.createElement("versioning");
+        root.appendChild(versioning);
+        Element versions = doc.createElement("versions");
+        versioning.appendChild(versions);
+        for (int i = 0; i < artifacts.length; i++) {
+            Artifact artifact = artifacts[i];
+            createText(doc, versions, "version", artifact.getVersion().toString());
+        }
+        TransformerFactory xfactory = TransformerFactory.newInstance();
+        Transformer xform = xfactory.newTransformer();
+        xform.setOutputProperty(OutputKeys.INDENT, "yes");
+        xform.transform(new DOMSource(doc), new StreamResult(writer));
     }
 
     private void writePrerequisite(Document doc, Element config, String configId, String server, String notServer) {

Modified: geronimo/branches/1.1/configs/client-deployer/src/plan/plan.xml
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/configs/client-deployer/src/plan/plan.xml?rev=396191&r1=396190&r2=396191&view=diff
==============================================================================
--- geronimo/branches/1.1/configs/client-deployer/src/plan/plan.xml (original)
+++ geronimo/branches/1.1/configs/client-deployer/src/plan/plan.xml Sat Apr 22 18:19:16 2006
@@ -52,7 +52,7 @@
                     <dependency>
                         <groupId>${pom.groupId}</groupId>
                         <artifactId>j2ee-server</artifactId>
-                        <version>${pom.currentVersion}</version>
+                        <!--<version>${pom.currentVersion}</version>-->
                         <type>car</type>
                     </dependency>
                 </dependencies>
@@ -64,7 +64,7 @@
                     <dependency>
                         <groupId>${pom.groupId}</groupId>
                         <artifactId>client</artifactId>
-                        <version>${pom.currentVersion}</version>
+                        <!--<version>${pom.currentVersion}</version>-->
                         <type>car</type>
                     </dependency>
                 </dependencies>

Modified: geronimo/branches/1.1/configs/console-jetty/maven.xml
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/configs/console-jetty/maven.xml?rev=396191&r1=396190&r2=396191&view=diff
==============================================================================
--- geronimo/branches/1.1/configs/console-jetty/maven.xml (original)
+++ geronimo/branches/1.1/configs/console-jetty/maven.xml Sat Apr 22 18:19:16 2006
@@ -18,9 +18,15 @@
 
 <!-- $Rev$ $Date$ -->
 
-<project default="default">
+<project default="default" xmlns:velocity="jelly:velocity">
 
     <goal name="default">
         <attainGoal name="car:install"/>
     </goal>
+
+    <preGoal name="car:install">
+        <velocity:merge basedir="${basedir}/src/conf"
+          template="geronimo-plugin.xml"
+          name="${geronimo.packaging.targetRepository}/${pom.groupId}/${pom.artifactId}/${pom.currentVersion}/${pom.artifactId}-${pom.currentVersion}.car/META-INF/geronimo-plugin.xml"/>
+    </preGoal>
 </project>

Modified: geronimo/branches/1.1/configs/console-jetty/project.xml
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/configs/console-jetty/project.xml?rev=396191&r1=396190&r2=396191&view=diff
==============================================================================
--- geronimo/branches/1.1/configs/console-jetty/project.xml (original)
+++ geronimo/branches/1.1/configs/console-jetty/project.xml Sat Apr 22 18:19:16 2006
@@ -120,6 +120,7 @@
             <version>${portlet_api_version}</version>
             <properties>
                 <geronimo.dependency>true</geronimo.dependency>
+                <geronimo.keep.version>true</geronimo.keep.version>
             </properties>
         </dependency>
         <dependency>
@@ -128,6 +129,7 @@
             <version>${pluto_version}</version>
             <properties>
                 <geronimo.dependency>true</geronimo.dependency>
+                <geronimo.keep.version>true</geronimo.keep.version>
             </properties>
         </dependency>
         <dependency>
@@ -216,6 +218,7 @@
             <version>${xmlbeans_version}</version>
             <properties>
                 <geronimo.dependency>true</geronimo.dependency>
+                <geronimo.keep.version>true</geronimo.keep.version>
             </properties>
         </dependency>
         <dependency>
@@ -224,6 +227,7 @@
             <version>${stax_api_version}</version>
             <properties>
                 <geronimo.dependency>true</geronimo.dependency>
+                <geronimo.keep.version>true</geronimo.keep.version>
             </properties>
         </dependency>
         <dependency>
@@ -232,6 +236,7 @@
             <version>${activemq_version}</version>
             <properties>
                 <geronimo.dependency>true</geronimo.dependency>
+                <geronimo.keep.version>true</geronimo.keep.version>
             </properties>
         </dependency>
         <dependency>
@@ -240,6 +245,7 @@
             <version>${activemq_version}</version>
             <properties>
                 <geronimo.dependency>true</geronimo.dependency>
+                <geronimo.keep.version>true</geronimo.keep.version>
             </properties>
         </dependency>
         <dependency>
@@ -248,6 +254,7 @@
             <version>${activemq_version}</version>
             <properties>
                 <geronimo.dependency>true</geronimo.dependency>
+                <geronimo.keep.version>true</geronimo.keep.version>
             </properties>
         </dependency>
         <dependency>

Added: geronimo/branches/1.1/configs/console-jetty/src/conf/geronimo-plugin.xml
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/configs/console-jetty/src/conf/geronimo-plugin.xml?rev=396191&view=auto
==============================================================================
--- geronimo/branches/1.1/configs/console-jetty/src/conf/geronimo-plugin.xml (added)
+++ geronimo/branches/1.1/configs/console-jetty/src/conf/geronimo-plugin.xml Sat Apr 22 18:19:16 2006
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<geronimo-plugin>
+<configuration>
+<name>Geronimo Admin Console (Jetty)</name>
+<config-id>${pom.groupId}/${pom.artifactId}/${pom.currentVersion}/car</config-id>
+<category>Core Geronimo</category>
+<description>The web-based administration console for Geronimo.  You can
+reach it via HTTP at /console and use it to configure the Geronimo
+installation as well as services like JDBC connection pools, JMS resources,
+security realms, keystores, etc.  It provides simple statistics on the
+running Geronimo server, as well as letting you review and deploy applications
+and plugins.</description>
+<license osi-approved="true">BSD -- Apache Software License (ASL) 2.0</license>
+<geronimo-version>${pom.currentVersion}</geronimo-version>
+<prerequisite>
+<id>geronimo/jetty//car</id>
+<resource-type>Web Container</resource-type>
+<description>This version of the admin console works with the Geronimo/Jetty distribution.
+It is not intended to run in the Geronimo/Tomcat distribution.  There is a separate version
+of the admin console that works with Tomcat.  Please install the version appropriate to
+your Geronimo distribution.</description>
+</prerequisite>
+<dependency>geronimo/j2ee-server//car</dependency>
+<dependency>geronimo/j2ee-security//car</dependency>
+<dependency>portlet-api/portlet-api/1.0/jar</dependency>
+<dependency>org.apache.pluto/pluto/1.0.1/jar</dependency>
+<dependency>geronimo/geronimo-console-core//jar</dependency>
+<dependency>geronimo/geronimo-management//jar</dependency>
+<dependency>geronimo/geronimo-test-ddbean//jar</dependency>
+<dependency>geronimo/geronimo-deploy-jsr88//jar</dependency>
+<dependency>geronimo/geronimo-deploy-config//jar</dependency>
+<dependency>geronimo/geronimo-service-builder//jar</dependency>
+<dependency>geronimo/geronimo-connector-builder//jar</dependency>
+<dependency>geronimo/geronimo-naming-builder//jar</dependency>
+<dependency>geronimo/geronimo-security-builder//jar</dependency>
+<dependency>geronimo/geronimo-j2ee-schema//jar</dependency>
+<dependency>xmlbeans/xbean/2.0.0/jar</dependency>
+<dependency>stax/stax-api/1.0/jar</dependency>
+<dependency>activemq/activemq-gbean-management/3.2.4-SNAPSHOT/jar</dependency>
+<dependency>activemq/activemq-gbean/3.2.4-SNAPSHOT/jar</dependency>
+<dependency>activemq/activemq-core/3.2.4-SNAPSHOT/jar</dependency>
+<dependency>geronimo/geronimo-converter//jar</dependency>
+<dependency>geronimo/geronimo-util//jar</dependency></configuration>
+<source-repository>http://www.geronimoplugins.com/repository/</source-repository>
+<backup-repository>http://www.ibiblio.org/maven2/</backup-repository>
+</geronimo-plugin>

Modified: geronimo/branches/1.1/configs/console-tomcat/maven.xml
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/configs/console-tomcat/maven.xml?rev=396191&r1=396190&r2=396191&view=diff
==============================================================================
--- geronimo/branches/1.1/configs/console-tomcat/maven.xml (original)
+++ geronimo/branches/1.1/configs/console-tomcat/maven.xml Sat Apr 22 18:19:16 2006
@@ -18,9 +18,15 @@
 
 <!-- $Rev$ $Date$ -->
 
-<project default="default">
+<project default="default" xmlns:velocity="jelly:velocity">
 
     <goal name="default">
         <attainGoal name="car:install"/>
     </goal>
+
+    <preGoal name="car:install">
+        <velocity:merge basedir="${basedir}/src/conf"
+          template="geronimo-plugin.xml"
+          name="${geronimo.packaging.targetRepository}/${pom.groupId}/${pom.artifactId}/${pom.currentVersion}/${pom.artifactId}-${pom.currentVersion}.car/META-INF/geronimo-plugin.xml"/>
+    </preGoal>
 </project>

Modified: geronimo/branches/1.1/configs/console-tomcat/project.xml
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/configs/console-tomcat/project.xml?rev=396191&r1=396190&r2=396191&view=diff
==============================================================================
--- geronimo/branches/1.1/configs/console-tomcat/project.xml (original)
+++ geronimo/branches/1.1/configs/console-tomcat/project.xml Sat Apr 22 18:19:16 2006
@@ -114,6 +114,7 @@
             <version>${portlet_api_version}</version>
             <properties>
                 <geronimo.dependency>true</geronimo.dependency>
+                <geronimo.keep.version>true</geronimo.keep.version>
             </properties>
         </dependency>
         <dependency>
@@ -122,6 +123,7 @@
             <version>${pluto_version}</version>
             <properties>
                 <geronimo.dependency>true</geronimo.dependency>
+                <geronimo.keep.version>true</geronimo.keep.version>
             </properties>
         </dependency>
         <dependency>
@@ -210,6 +212,7 @@
             <version>${xmlbeans_version}</version>
             <properties>
                 <geronimo.dependency>true</geronimo.dependency>
+                <geronimo.keep.version>true</geronimo.keep.version>
             </properties>
         </dependency>
         <dependency>
@@ -218,6 +221,7 @@
             <version>${stax_api_version}</version>
             <properties>
                 <geronimo.dependency>true</geronimo.dependency>
+                <geronimo.keep.version>true</geronimo.keep.version>
             </properties>
         </dependency>
         <dependency>
@@ -226,6 +230,7 @@
             <version>${activemq_version}</version>
             <properties>
                 <geronimo.dependency>true</geronimo.dependency>
+                <geronimo.keep.version>true</geronimo.keep.version>
             </properties>
         </dependency>
         <dependency>
@@ -234,6 +239,7 @@
             <version>${activemq_version}</version>
             <properties>
                 <geronimo.dependency>true</geronimo.dependency>
+                <geronimo.keep.version>true</geronimo.keep.version>
             </properties>
         </dependency>
         <dependency>
@@ -242,6 +248,7 @@
             <version>${activemq_version}</version>
             <properties>
                 <geronimo.dependency>true</geronimo.dependency>
+                <geronimo.keep.version>true</geronimo.keep.version>
             </properties>
         </dependency>
         <dependency>
@@ -395,12 +402,6 @@
             <groupId>activeio</groupId>
             <artifactId>activeio</artifactId>
             <version>${activeio_version}</version>
-        </dependency>
-
-        <dependency>
-            <groupId>jetty</groupId>
-            <artifactId>org.mortbay.jetty</artifactId>
-            <version>${jetty_version}</version>
         </dependency>
     </dependencies>
 </project>

Added: geronimo/branches/1.1/configs/console-tomcat/src/conf/geronimo-plugin.xml
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/configs/console-tomcat/src/conf/geronimo-plugin.xml?rev=396191&view=auto
==============================================================================
--- geronimo/branches/1.1/configs/console-tomcat/src/conf/geronimo-plugin.xml (added)
+++ geronimo/branches/1.1/configs/console-tomcat/src/conf/geronimo-plugin.xml Sat Apr 22 18:19:16 2006
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<geronimo-plugin>
+<configuration>
+<name>Geronimo Admin Console (Tomcat)</name>
+<config-id>${pom.groupId}/${pom.artifactId}/${pom.currentVersion}/car</config-id>
+<category>Core Geronimo</category>
+<description>The web-based administration console for Geronimo.  You can
+reach it via HTTP at /console and use it to configure the Geronimo
+installation as well as services like JDBC connection pools, JMS resources,
+security realms, keystores, etc.  It provides simple statistics on the
+running Geronimo server, as well as letting you review and deploy applications
+and plugins.</description>
+<license osi-approved="true">BSD -- Apache Software License (ASL) 2.0</license>
+<geronimo-version>${pom.currentVersion}</geronimo-version>
+<prerequisite>
+<id>geronimo/tomcat//car</id>
+<resource-type>Web Container</resource-type>
+<description>This version of the admin console works with the Geronimo/Tomcat distribution.
+It is not intended to run in the Geronimo/Jetty distribution.  There is a separate version
+of the admin console that works with Jetty.  Please install the version appropriate to
+your Geronimo distribution.</description>
+</prerequisite>
+<dependency>geronimo/j2ee-server//car</dependency>
+<dependency>geronimo/j2ee-security//car</dependency>
+<dependency>portlet-api/portlet-api/1.0/jar</dependency>
+<dependency>org.apache.pluto/pluto/1.0.1/jar</dependency>
+<dependency>geronimo/geronimo-console-core//jar</dependency>
+<dependency>geronimo/geronimo-management//jar</dependency>
+<dependency>geronimo/geronimo-test-ddbean//jar</dependency>
+<dependency>geronimo/geronimo-deploy-jsr88//jar</dependency>
+<dependency>geronimo/geronimo-deploy-config//jar</dependency>
+<dependency>geronimo/geronimo-service-builder//jar</dependency>
+<dependency>geronimo/geronimo-connector-builder//jar</dependency>
+<dependency>geronimo/geronimo-naming-builder//jar</dependency>
+<dependency>geronimo/geronimo-security-builder//jar</dependency>
+<dependency>geronimo/geronimo-j2ee-schema//jar</dependency>
+<dependency>xmlbeans/xbean/2.0.0/jar</dependency>
+<dependency>stax/stax-api/1.0/jar</dependency>
+<dependency>activemq/activemq-gbean-management/3.2.4-SNAPSHOT/jar</dependency>
+<dependency>activemq/activemq-gbean/3.2.4-SNAPSHOT/jar</dependency>
+<dependency>activemq/activemq-core/3.2.4-SNAPSHOT/jar</dependency>
+<dependency>geronimo/geronimo-converter//jar</dependency>
+<dependency>geronimo/geronimo-util//jar</dependency>
+</configuration>
+<source-repository>http://www.geronimoplugins.com/repository/</source-repository>
+<backup-repository>http://www.ibiblio.org/maven2/</backup-repository>
+</geronimo-plugin>

Modified: geronimo/branches/1.1/configs/directory/maven.xml
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/configs/directory/maven.xml?rev=396191&r1=396190&r2=396191&view=diff
==============================================================================
--- geronimo/branches/1.1/configs/directory/maven.xml (original)
+++ geronimo/branches/1.1/configs/directory/maven.xml Sat Apr 22 18:19:16 2006
@@ -18,9 +18,15 @@
 
 <!-- $Rev$ $Date$ -->
 
-<project default="default">
+<project default="default" xmlns:velocity="jelly:velocity">
 
     <goal name="default">
         <attainGoal name="car:install"/>
     </goal>
+
+    <preGoal name="car:install">
+        <velocity:merge basedir="${basedir}/src/conf"
+          template="geronimo-plugin.xml"
+          name="${geronimo.packaging.targetRepository}/${pom.groupId}/${pom.artifactId}/${pom.currentVersion}/${pom.artifactId}-${pom.currentVersion}.car/META-INF/geronimo-plugin.xml"/>
+    </preGoal>
 </project>

Added: geronimo/branches/1.1/configs/directory/src/conf/geronimo-plugin.xml
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/configs/directory/src/conf/geronimo-plugin.xml?rev=396191&view=auto
==============================================================================
--- geronimo/branches/1.1/configs/directory/src/conf/geronimo-plugin.xml (added)
+++ geronimo/branches/1.1/configs/directory/src/conf/geronimo-plugin.xml Sat Apr 22 18:19:16 2006
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<geronimo-plugin>
+<configuration>
+<name>Apache Directory 0.92 for Geronimo</name>
+<config-id>${pom.groupId}/${pom.artifactId}/${pom.currentVersion}/car</config-id>
+<category>Security</category>
+<description>
+  This plugin integrates the Apache Directory Server (ApacheDS)
+  LDAP server with Geronimo.  That means that Geronimo will run
+  an embedded LDAP server when it starts.  This LDAP server may
+  be used for LDAP security realms within Geronimo, as well as
+  for other purposes by Geronimo applications or by remote
+  applications.
+  
+  This plugin does not presently include any tools for managing
+  or inspecting the LDAP server, though Geronimo itself includes
+  a security realm that works with LDAP.
+  
+  For more information on the ApacheDS project, see
+  http://directory.apache.org/subprojects/apacheds/index.html
+</description>
+<license osi-approved="true">BSD -- Apache Software License (ASL) 2.0</license>
+<geronimo-version>${pom.currentVersion}</geronimo-version>
+<dependency>geronimo/j2ee-server//car</dependency>
+<dependency>geronimo/geronimo-directory//jar</dependency>
+</configuration>
+<source-repository>http://www.geronimoplugins.com/repository/</source-repository>
+<backup-repository>http://www.ibiblio.org/maven2/</backup-repository>
+</geronimo-plugin>
\ No newline at end of file

Modified: geronimo/branches/1.1/configs/j2ee-deployer/src/plan/plan.xml
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/configs/j2ee-deployer/src/plan/plan.xml?rev=396191&r1=396190&r2=396191&view=diff
==============================================================================
--- geronimo/branches/1.1/configs/j2ee-deployer/src/plan/plan.xml (original)
+++ geronimo/branches/1.1/configs/j2ee-deployer/src/plan/plan.xml Sat Apr 22 18:19:16 2006
@@ -78,7 +78,7 @@
                     <dependency>
                         <groupId>${pom.groupId}</groupId>
                         <artifactId>j2ee-server</artifactId>
-                        <version>${pom.currentVersion}</version>
+                        <!--<version>${pom.currentVersion}</version>-->
                         <type>car</type>
                     </dependency>
                 </dependencies>
@@ -112,7 +112,7 @@
                     <dependency>
                         <groupId>${pom.groupId}</groupId>
                         <artifactId>j2ee-server</artifactId>
-                        <version>${pom.currentVersion}</version>
+                        <!--<version>${pom.currentVersion}</version>-->
                         <type>car</type>
                     </dependency>
                 </dependencies>

Modified: geronimo/branches/1.1/configs/jetty-deployer/src/plan/plan.xml
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/configs/jetty-deployer/src/plan/plan.xml?rev=396191&r1=396190&r2=396191&view=diff
==============================================================================
--- geronimo/branches/1.1/configs/jetty-deployer/src/plan/plan.xml (original)
+++ geronimo/branches/1.1/configs/jetty-deployer/src/plan/plan.xml Sat Apr 22 18:19:16 2006
@@ -43,13 +43,13 @@
                     <dependency>
                         <groupId>${pom.groupId}</groupId>
                         <artifactId>j2ee-server</artifactId>
-                        <version>${pom.currentVersion}</version>
+                        <!--<version>${pom.currentVersion}</version>-->
                         <type>car</type>
                     </dependency>
                     <dependency>
                         <groupId>${pom.groupId}</groupId>
                         <artifactId>jetty</artifactId>
-                        <version>${pom.currentVersion}</version>
+                        <!--<version>${pom.currentVersion}</version>-->
                         <type>car</type>
                     </dependency>
                 </dependencies>

Modified: geronimo/branches/1.1/configs/jsp-examples-jetty/maven.xml
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/configs/jsp-examples-jetty/maven.xml?rev=396191&r1=396190&r2=396191&view=diff
==============================================================================
--- geronimo/branches/1.1/configs/jsp-examples-jetty/maven.xml (original)
+++ geronimo/branches/1.1/configs/jsp-examples-jetty/maven.xml Sat Apr 22 18:19:16 2006
@@ -18,9 +18,15 @@
 
 <!-- $Rev$ $Date$ -->
 
-<project default="default">
+<project default="default" xmlns:velocity="jelly:velocity">
 
     <goal name="default">
         <attainGoal name="car:install"/>
     </goal>
+
+    <preGoal name="car:install">
+        <velocity:merge basedir="${basedir}/src/conf"
+          template="geronimo-plugin.xml"
+          name="${geronimo.packaging.targetRepository}/${pom.groupId}/${pom.artifactId}/${pom.currentVersion}/${pom.artifactId}-${pom.currentVersion}.car/META-INF/geronimo-plugin.xml"/>
+    </preGoal>
 </project>

Modified: geronimo/branches/1.1/configs/jsp-examples-jetty/project.xml
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/configs/jsp-examples-jetty/project.xml?rev=396191&r1=396190&r2=396191&view=diff
==============================================================================
--- geronimo/branches/1.1/configs/jsp-examples-jetty/project.xml (original)
+++ geronimo/branches/1.1/configs/jsp-examples-jetty/project.xml Sat Apr 22 18:19:16 2006
@@ -101,6 +101,7 @@
             <version>${commons_collections_version}</version>
             <properties>
                 <geronimo.dependency>true</geronimo.dependency>
+                <geronimo.keep.version>true</geronimo.keep.version>
             </properties>
         </dependency>
 

Added: geronimo/branches/1.1/configs/jsp-examples-jetty/src/conf/geronimo-plugin.xml
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/configs/jsp-examples-jetty/src/conf/geronimo-plugin.xml?rev=396191&view=auto
==============================================================================
--- geronimo/branches/1.1/configs/jsp-examples-jetty/src/conf/geronimo-plugin.xml (added)
+++ geronimo/branches/1.1/configs/jsp-examples-jetty/src/conf/geronimo-plugin.xml Sat Apr 22 18:19:16 2006
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<geronimo-plugin>
+<configuration>
+<name>Jakarta JSP Examples (Jetty)</name>
+<config-id>${pom.groupId}/${pom.artifactId}/${pom.currentVersion}/car</config-id>
+<category>Examples</category>
+<description>The JSP examples originally developed for Tomcat.  Can be found
+via HTTP at /jsp-examples/ after installation.  These examples give
+a basic introduction to JSP development along with sample code.</description>
+<license osi-approved="true">BSD -- Apache Software License (ASL) 2.0</license>
+<geronimo-version>${pom.currentVersion}</geronimo-version>
+<prerequisite>
+<id>geronimo/jetty//car</id>
+<resource-type>Web Container</resource-type>
+<description>This version of the JSP Examples works with the Geronimo/Jetty distribution.  It is not intended to run in the Geronimo/Tomcat distribution.  There is a separate version of the Welcome application that works with Tomcat.  Please install the version appropriate to your Geronimo distribution.</description>
+</prerequisite>
+<dependency>commons-collections/commons-collections/3.1/jar</dependency>
+<dependency>geronimo/j2ee-server//car</dependency>
+</configuration>
+<source-repository>http://www.geronimoplugins.com/repository/</source-repository>
+<backup-repository>http://www.ibiblio.org/maven2/</backup-repository>
+</geronimo-plugin>

Modified: geronimo/branches/1.1/configs/jsp-examples-tomcat/maven.xml
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/configs/jsp-examples-tomcat/maven.xml?rev=396191&r1=396190&r2=396191&view=diff
==============================================================================
--- geronimo/branches/1.1/configs/jsp-examples-tomcat/maven.xml (original)
+++ geronimo/branches/1.1/configs/jsp-examples-tomcat/maven.xml Sat Apr 22 18:19:16 2006
@@ -18,9 +18,15 @@
 
 <!-- $Rev$ $Date$ -->
 
-<project default="default">
+<project default="default" xmlns:velocity="jelly:velocity">
 
     <goal name="default">
         <attainGoal name="car:install"/>
     </goal>
+
+    <preGoal name="car:install">
+        <velocity:merge basedir="${basedir}/src/conf"
+          template="geronimo-plugin.xml"
+          name="${geronimo.packaging.targetRepository}/${pom.groupId}/${pom.artifactId}/${pom.currentVersion}/${pom.artifactId}-${pom.currentVersion}.car/META-INF/geronimo-plugin.xml"/>
+    </preGoal>
 </project>

Added: geronimo/branches/1.1/configs/jsp-examples-tomcat/src/conf/geronimo-plugin.xml
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/configs/jsp-examples-tomcat/src/conf/geronimo-plugin.xml?rev=396191&view=auto
==============================================================================
--- geronimo/branches/1.1/configs/jsp-examples-tomcat/src/conf/geronimo-plugin.xml (added)
+++ geronimo/branches/1.1/configs/jsp-examples-tomcat/src/conf/geronimo-plugin.xml Sat Apr 22 18:19:16 2006
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<geronimo-plugin>
+<configuration>
+<name>Jakarta JSP Examples (Tomcat)</name>
+<config-id>${pom.groupId}/${pom.artifactId}/${pom.currentVersion}/car</config-id>
+<category>Examples</category>
+<description>The JSP examples originally developed for Tomcat.  Can be found
+via HTTP at /jsp-examples/ after installation.  These examples give
+a basic introduction to JSP development along with sample code.</description>
+<license osi-approved="true">BSD -- Apache Software License (ASL) 2.0</license>
+<geronimo-version>${pom.currentVersion}</geronimo-version>
+<prerequisite>
+<id>geronimo/tomcat//car</id>
+<resource-type>Web Container</resource-type>
+<description>This version of the JSP Examples works with the Geronimo/Tomcat distribution.  It is not intended to run in the Geronimo/Jetty distribution.  There is a separate version of the Welcome application that works with Jetty.  Please install the version appropriate to your Geronimo distribution.</description>
+</prerequisite>
+<dependency>geronimo/j2ee-server//car</dependency>
+</configuration>
+<source-repository>http://www.geronimoplugins.com/repository/</source-repository>
+<backup-repository>http://www.ibiblio.org/maven2/</backup-repository>
+</geronimo-plugin>

Modified: geronimo/branches/1.1/configs/openejb-deployer/src/plan/plan.xml
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/configs/openejb-deployer/src/plan/plan.xml?rev=396191&r1=396190&r2=396191&view=diff
==============================================================================
--- geronimo/branches/1.1/configs/openejb-deployer/src/plan/plan.xml (original)
+++ geronimo/branches/1.1/configs/openejb-deployer/src/plan/plan.xml Sat Apr 22 18:19:16 2006
@@ -40,7 +40,7 @@
                     <dependency>
                         <groupId>${pom.groupId}</groupId>
                         <artifactId>openejb</artifactId>
-                        <version>${pom.currentVersion}</version>
+                        <!--<version>${pom.currentVersion}</version>-->
                         <type>car</type>
                     </dependency>
                 </dependencies>

Modified: geronimo/branches/1.1/configs/servlets-examples-jetty/maven.xml
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/configs/servlets-examples-jetty/maven.xml?rev=396191&r1=396190&r2=396191&view=diff
==============================================================================
--- geronimo/branches/1.1/configs/servlets-examples-jetty/maven.xml (original)
+++ geronimo/branches/1.1/configs/servlets-examples-jetty/maven.xml Sat Apr 22 18:19:16 2006
@@ -18,9 +18,15 @@
 
 <!-- $Rev$ $Date$ -->
 
-<project default="default">
+<project default="default" xmlns:velocity="jelly:velocity">
 
     <goal name="default">
         <attainGoal name="car:install"/>
     </goal>
+
+    <preGoal name="car:install">
+        <velocity:merge basedir="${basedir}/src/conf"
+          template="geronimo-plugin.xml"
+          name="${geronimo.packaging.targetRepository}/${pom.groupId}/${pom.artifactId}/${pom.currentVersion}/${pom.artifactId}-${pom.currentVersion}.car/META-INF/geronimo-plugin.xml"/>
+    </preGoal>
 </project>

Added: geronimo/branches/1.1/configs/servlets-examples-jetty/src/conf/geronimo-plugin.xml
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/configs/servlets-examples-jetty/src/conf/geronimo-plugin.xml?rev=396191&view=auto
==============================================================================
--- geronimo/branches/1.1/configs/servlets-examples-jetty/src/conf/geronimo-plugin.xml (added)
+++ geronimo/branches/1.1/configs/servlets-examples-jetty/src/conf/geronimo-plugin.xml Sat Apr 22 18:19:16 2006
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<geronimo-plugin>
+<configuration>
+<name>Jakarta Servlet Examples (Jetty)</name>
+<config-id>${pom.groupId}/${pom.artifactId}/${pom.currentVersion}/car</config-id>
+<category>Examples</category>
+<description>The Servlet examples originally developed for Tomcat.  Can be found
+via HTTP at /servlets-examples/ after installation.  These examples give
+a basic introduction to Servlet development along with sample code.</description>
+<license osi-approved="true">BSD -- Apache Software License (ASL) 2.0</license>
+<geronimo-version>${pom.currentVersion}</geronimo-version>
+<prerequisite>
+<id>geronimo/jetty//car</id>
+<resource-type>Web Container</resource-type>
+<description>This version of the Servlet Examples works with the Geronimo/Jetty distribution.  It is not intended to run in the Geronimo/Tomcat distribution.  There is a separate version of the Welcome application that works with Tomcat.  Please install the version appropriate to your Geronimo distribution.</description>
+</prerequisite>
+<dependency>geronimo/j2ee-server//car</dependency>
+</configuration>
+<source-repository>http://www.geronimoplugins.com/repository/</source-repository>
+<backup-repository>http://www.ibiblio.org/maven2/</backup-repository>
+</geronimo-plugin>

Modified: geronimo/branches/1.1/configs/servlets-examples-tomcat/maven.xml
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/configs/servlets-examples-tomcat/maven.xml?rev=396191&r1=396190&r2=396191&view=diff
==============================================================================
--- geronimo/branches/1.1/configs/servlets-examples-tomcat/maven.xml (original)
+++ geronimo/branches/1.1/configs/servlets-examples-tomcat/maven.xml Sat Apr 22 18:19:16 2006
@@ -18,9 +18,15 @@
 
 <!-- $Rev$ $Date$ -->
 
-<project default="default">
+<project default="default" xmlns:velocity="jelly:velocity">
 
     <goal name="default">
         <attainGoal name="car:install"/>
     </goal>
+
+    <preGoal name="car:install">
+        <velocity:merge basedir="${basedir}/src/conf"
+          template="geronimo-plugin.xml"
+          name="${geronimo.packaging.targetRepository}/${pom.groupId}/${pom.artifactId}/${pom.currentVersion}/${pom.artifactId}-${pom.currentVersion}.car/META-INF/geronimo-plugin.xml"/>
+    </preGoal>
 </project>

Added: geronimo/branches/1.1/configs/servlets-examples-tomcat/src/conf/geronimo-plugin.xml
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/configs/servlets-examples-tomcat/src/conf/geronimo-plugin.xml?rev=396191&view=auto
==============================================================================
--- geronimo/branches/1.1/configs/servlets-examples-tomcat/src/conf/geronimo-plugin.xml (added)
+++ geronimo/branches/1.1/configs/servlets-examples-tomcat/src/conf/geronimo-plugin.xml Sat Apr 22 18:19:16 2006
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<geronimo-plugin>
+<configuration>
+<name>Jakarta Servlet Examples (Tomcat)</name>
+<config-id>${pom.groupId}/${pom.artifactId}/${pom.currentVersion}/car</config-id>
+<category>Examples</category>
+<description>The Servlet examples originally developed for Tomcat.  Can be found
+via HTTP at /servlets-examples/ after installation.  These examples give
+a basic introduction to Servlet development along with sample code.</description>
+<license osi-approved="true">BSD -- Apache Software License (ASL) 2.0</license>
+<geronimo-version>${pom.currentVersion}</geronimo-version>
+<prerequisite>
+<id>geronimo/tomcat//car</id>
+<resource-type>Web Container</resource-type>
+<description>This version of the Servlet Examples works with the Geronimo/Tomcat distribution.  It is not intended to run in the Geronimo/Jetty distribution.  There is a separate version of the Welcome application that works with Jetty.  Please install the version appropriate to your Geronimo distribution.</description>
+</prerequisite>
+<dependency>geronimo/j2ee-server//car</dependency>
+</configuration>
+<source-repository>http://www.geronimoplugins.com/repository/</source-repository>
+<backup-repository>http://www.ibiblio.org/maven2/</backup-repository>
+</geronimo-plugin>

Modified: geronimo/branches/1.1/configs/tomcat-deployer/src/plan/plan.xml
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/configs/tomcat-deployer/src/plan/plan.xml?rev=396191&r1=396190&r2=396191&view=diff
==============================================================================
--- geronimo/branches/1.1/configs/tomcat-deployer/src/plan/plan.xml (original)
+++ geronimo/branches/1.1/configs/tomcat-deployer/src/plan/plan.xml Sat Apr 22 18:19:16 2006
@@ -37,13 +37,13 @@
                     <dependency>
                         <groupId>${pom.groupId}</groupId>
                         <artifactId>j2ee-server</artifactId>
-                        <version>${pom.currentVersion}</version>
+                        <!--<version>${pom.currentVersion}</version>-->
                         <type>car</type>
                     </dependency>
                     <dependency>
                         <groupId>${pom.groupId}</groupId>
                         <artifactId>tomcat</artifactId>
-                        <version>${pom.currentVersion}</version>
+                        <!--<version>${pom.currentVersion}</version>-->
                         <type>car</type>
                     </dependency>
                 </dependencies>

Modified: geronimo/branches/1.1/configs/welcome-jetty/src/conf/geronimo-plugin.xml
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/configs/welcome-jetty/src/conf/geronimo-plugin.xml?rev=396191&r1=396190&r2=396191&view=diff
==============================================================================
--- geronimo/branches/1.1/configs/welcome-jetty/src/conf/geronimo-plugin.xml (original)
+++ geronimo/branches/1.1/configs/welcome-jetty/src/conf/geronimo-plugin.xml Sat Apr 22 18:19:16 2006
@@ -3,14 +3,14 @@
 <configuration>
 <name>Geronimo Welcome Web App (Jetty)</name>
 <config-id>${pom.groupId}/${pom.artifactId}/${pom.currentVersion}/car</config-id>
-<category>Examples</category>
+<category>Core Geronimo</category>
 <description>The welcome application for Geronimo.  This binds to / so it
 handles all requests that nothing else is bound to.  The main
 purpose is to greet users who are exploring Geronimo for the
 first time.  It should typically be removed or replaced for
 production applications.</description>
 <license osi-approved="true">BSD -- Apache Software License (ASL) 2.0</license>
-<geronimo-version>1.1-SNAPSHOT</geronimo-version>
+<geronimo-version>${pom.currentVersion}</geronimo-version>
 <prerequisite>
 <id>geronimo/jetty//car</id>
 <resource-type>Web Container</resource-type>

Modified: geronimo/branches/1.1/configs/welcome-tomcat/src/conf/geronimo-plugin.xml
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/configs/welcome-tomcat/src/conf/geronimo-plugin.xml?rev=396191&r1=396190&r2=396191&view=diff
==============================================================================
--- geronimo/branches/1.1/configs/welcome-tomcat/src/conf/geronimo-plugin.xml (original)
+++ geronimo/branches/1.1/configs/welcome-tomcat/src/conf/geronimo-plugin.xml Sat Apr 22 18:19:16 2006
@@ -3,16 +3,16 @@
 <configuration>
 <name>Geronimo Welcome Web App (Tomcat)</name>
 <config-id>${pom.groupId}/${pom.artifactId}/${pom.currentVersion}/car</config-id>
-<category>Examples</category>
+<category>Core Geronimo</category>
 <description>The welcome application for Geronimo.  This binds to / so it
 handles all requests that nothing else is bound to.  The main
 purpose is to greet users who are exploring Geronimo for the
 first time.  It should typically be removed or replaced for
 production applications.</description>
 <license osi-approved="true">BSD -- Apache Software License (ASL) 2.0</license>
-<geronimo-version>1.1-SNAPSHOT</geronimo-version>
+<geronimo-version>${pom.currentVersion}</geronimo-version>
 <prerequisite>
-<id>geronimo/jetty//car</id>
+<id>geronimo/tomcat//car</id>
 <resource-type>Web Container</resource-type>
 <description>This version of the Welcome application works with the Geronimo/Tomcat distribution.  It is not intended to run in the Geronimo/Jetty distribution.  There is a separate version of the Welcome application that works with Jetty.  Please install the version appropriate to your Geronimo distribution.</description>
 </prerequisite>

Modified: geronimo/branches/1.1/etc/project.properties
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/etc/project.properties?rev=396191&r1=396190&r2=396191&view=diff
==============================================================================
--- geronimo/branches/1.1/etc/project.properties (original)
+++ geronimo/branches/1.1/etc/project.properties Sat Apr 22 18:19:16 2006
@@ -95,10 +95,10 @@
 tranql_vendors_version=1.1
 release_notes_version=1.0
 
-geronimo_packaging_plugin_version=1.1.0-6
+geronimo_packaging_plugin_version=1.1.0-7
 geronimo_assembly_plugin_version=1.1.0-10
 geronimo_deployment_plugin_version=1.1.0-2
-geronimo_dependency_plugin_version=1.1.0-2
+geronimo_dependency_plugin_version=1.1.0-3
 
 geronimo_spec_activation_version=1.0
 

Modified: geronimo/branches/1.1/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/CommandInstallCAR.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/CommandInstallCAR.java?rev=396191&r1=396190&r2=396191&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/CommandInstallCAR.java (original)
+++ geronimo/branches/1.1/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/CommandInstallCAR.java Sat Apr 22 18:19:16 2006
@@ -89,13 +89,18 @@
 
     private DownloadResults showProgress(GeronimoDeploymentManager mgr, Object key) {
         System.out.println("Checking for status every 1000ms:");
+        String last = null, status;
         while(true) {
             DownloadResults results = mgr.checkOnInstall(key);
             if(results.getCurrentFile() != null) {
                 if(results.getCurrentFilePercent() > -1) {
-                    System.out.println(results.getCurrentMessage()+" ("+results.getCurrentFilePercent()+"%)");
+                    status = results.getCurrentMessage()+" ("+results.getCurrentFilePercent()+"%)";
                 } else {
-                    System.out.println(results.getCurrentMessage());
+                    status = results.getCurrentMessage();
+                }
+                if(last == null || !last.equals(status)) {
+                    last = status;
+                    System.out.println(status);
                 }
             }
             if(results.isFinished()) {

Modified: geronimo/branches/1.1/modules/directory/project.xml
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/directory/project.xml?rev=396191&r1=396190&r2=396191&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/directory/project.xml (original)
+++ geronimo/branches/1.1/modules/directory/project.xml Sat Apr 22 18:19:16 2006
@@ -67,7 +67,7 @@
             <version>${jelly_velocity_tags_version}</version>
         </dependency>
         <dependency>
-            <groupId> velocity</groupId>
+            <groupId>velocity</groupId>
             <artifactId>velocity</artifactId>
             <version>${velocity_version}</version>
         </dependency>
@@ -95,8 +95,9 @@
             <artifactId>apacheds-core</artifactId>
             <version>${apacheds_version}</version>
             <properties>
-                 <geronimo.dependency>true</geronimo.dependency>
-             </properties>
+                <geronimo.dependency>true</geronimo.dependency>
+                <geronimo.keep.version>true</geronimo.keep.version>
+            </properties>
         </dependency>
 
         <dependency>
@@ -104,8 +105,9 @@
             <artifactId>apacheds-shared</artifactId>
             <version>${apacheds_version}</version>
             <properties>
-                 <geronimo.dependency>true</geronimo.dependency>
-             </properties>
+                <geronimo.dependency>true</geronimo.dependency>
+                <geronimo.keep.version>true</geronimo.keep.version>
+            </properties>
         </dependency>
 
         <dependency>
@@ -113,8 +115,9 @@
             <artifactId>asn1-codec</artifactId>
             <version>${asn1_version}</version>
             <properties>
-                 <geronimo.dependency>true</geronimo.dependency>
-             </properties>
+                <geronimo.dependency>true</geronimo.dependency>
+                <geronimo.keep.version>true</geronimo.keep.version>
+            </properties>
         </dependency>
 
         <dependency>
@@ -122,8 +125,9 @@
             <artifactId>apache-ldapber-provider</artifactId>
             <version>${apacheds_version}</version>
             <properties>
-                 <geronimo.dependency>true</geronimo.dependency>
-             </properties>
+                <geronimo.dependency>true</geronimo.dependency>
+                <geronimo.keep.version>true</geronimo.keep.version>
+            </properties>
         </dependency>
 
         <dependency>
@@ -131,8 +135,9 @@
             <artifactId>asn1-ber</artifactId>
             <version>${asn1_version}</version>
             <properties>
-                 <geronimo.dependency>true</geronimo.dependency>
-             </properties>
+                <geronimo.dependency>true</geronimo.dependency>
+                <geronimo.keep.version>true</geronimo.keep.version>
+            </properties>
         </dependency>
 
         <dependency>
@@ -140,8 +145,9 @@
             <artifactId>asn1-der</artifactId>
             <version>${asn1_version}</version>
             <properties>
-                 <geronimo.dependency>true</geronimo.dependency>
-             </properties>
+                <geronimo.dependency>true</geronimo.dependency>
+                <geronimo.keep.version>true</geronimo.keep.version>
+            </properties>
         </dependency>
 
         <dependency>
@@ -150,8 +156,9 @@
             <version>${jdbm_version}</version>
             <url>http://jdbm.sourceforge.net</url>
             <properties>
-                 <geronimo.dependency>true</geronimo.dependency>
-             </properties>
+                <geronimo.dependency>true</geronimo.dependency>
+                <geronimo.keep.version>true</geronimo.keep.version>
+            </properties>
         </dependency>
 
         <dependency>
@@ -160,8 +167,9 @@
             <version>${regexp_version}</version>
             <url>http://jakarta.apache.org/regexp/index.html</url>
             <properties>
-                 <geronimo.dependency>true</geronimo.dependency>
-             </properties>
+                <geronimo.dependency>true</geronimo.dependency>
+                <geronimo.keep.version>true</geronimo.keep.version>
+            </properties>
         </dependency>
 
         <dependency>
@@ -170,8 +178,9 @@
             <version>${oro_version}</version>
             <url>http://jakarta.apache.org/oro</url>
             <properties>
-                 <geronimo.dependency>true</geronimo.dependency>
-             </properties>
+                <geronimo.dependency>true</geronimo.dependency>
+                <geronimo.keep.version>true</geronimo.keep.version>
+            </properties>
         </dependency>
 
         <dependency>
@@ -180,8 +189,9 @@
             <version>${commons_lang_version}</version>
             <url>http://jakarta.apache.org/commons/lang/api</url>
             <properties>
-                 <geronimo.dependency>true</geronimo.dependency>
-             </properties>
+                <geronimo.dependency>true</geronimo.dependency>
+                <geronimo.keep.version>true</geronimo.keep.version>
+            </properties>
         </dependency>
 
         <dependency>
@@ -190,8 +200,9 @@
             <version>${commons_collections_version}</version>
             <url>http://jakarta.apache.org/commons/collections</url>
             <properties>
-                 <geronimo.dependency>true</geronimo.dependency>
-             </properties>
+                <geronimo.dependency>true</geronimo.dependency>
+                <geronimo.keep.version>true</geronimo.keep.version>
+            </properties>
         </dependency>
 
         <dependency>
@@ -200,8 +211,9 @@
             <version>${commons_io_version}</version>
             <url>http://jakarta.apache.org/commons/io</url>
             <properties>
-                 <geronimo.dependency>true</geronimo.dependency>
-             </properties>
+                <geronimo.dependency>true</geronimo.dependency>
+                <geronimo.keep.version>true</geronimo.keep.version>
+            </properties>
         </dependency>
 
         <dependency>
@@ -210,8 +222,9 @@
             <version>${commons_primitives_version}</version>
             <url>http://jakarta.apache.org/commons/primitives</url>
             <properties>
-                 <geronimo.dependency>true</geronimo.dependency>
-             </properties>
+                <geronimo.dependency>true</geronimo.dependency>
+                <geronimo.keep.version>true</geronimo.keep.version>
+            </properties>
         </dependency>
 
         <dependency>
@@ -219,8 +232,9 @@
             <artifactId>ldap-common</artifactId>
             <version>${apacheds_version}</version>
             <properties>
-                 <geronimo.dependency>true</geronimo.dependency>
-             </properties>
+                <geronimo.dependency>true</geronimo.dependency>
+                <geronimo.keep.version>true</geronimo.keep.version>
+            </properties>
         </dependency>
 
         <dependency>
@@ -228,8 +242,9 @@
             <artifactId>kerberos-common</artifactId>
             <version>${kerberos_common_version}</version>
             <properties>
-                 <geronimo.dependency>true</geronimo.dependency>
-             </properties>
+                <geronimo.dependency>true</geronimo.dependency>
+                <geronimo.keep.version>true</geronimo.keep.version>
+            </properties>
         </dependency>
 
         <dependency>
@@ -237,8 +252,9 @@
             <artifactId>mina</artifactId>
             <version>${mina_version}</version>
             <properties>
-                 <geronimo.dependency>true</geronimo.dependency>
-             </properties>
+                <geronimo.dependency>true</geronimo.dependency>
+                <geronimo.keep.version>true</geronimo.keep.version>
+            </properties>
         </dependency>
 
         <dependency>
@@ -246,8 +262,9 @@
             <artifactId>kerberos-protocol</artifactId>
             <version>${kerberos_protocols_version}</version>
             <properties>
-                 <geronimo.dependency>true</geronimo.dependency>
-             </properties>
+                <geronimo.dependency>true</geronimo.dependency>
+                <geronimo.keep.version>true</geronimo.keep.version>
+            </properties>
         </dependency>
 
         <dependency>
@@ -255,8 +272,9 @@
             <artifactId>ldap-protocol</artifactId>
             <version>${ldap_protocols_version}</version>
             <properties>
-                 <geronimo.dependency>true</geronimo.dependency>
-             </properties>
+                <geronimo.dependency>true</geronimo.dependency>
+                <geronimo.keep.version>true</geronimo.keep.version>
+            </properties>
         </dependency>
 
         <dependency>
@@ -264,8 +282,9 @@
             <artifactId>antlr</artifactId>
             <version>${antlr_version}</version>
             <properties>
-                 <geronimo.dependency>true</geronimo.dependency>
-             </properties>
+                <geronimo.dependency>true</geronimo.dependency>
+                <geronimo.keep.version>true</geronimo.keep.version>
+            </properties>
         </dependency>
 
         <dependency>
@@ -273,8 +292,9 @@
             <artifactId>slf4j-simple</artifactId>
             <version>${slf4j_version}</version>
             <properties>
-                 <geronimo.dependency>true</geronimo.dependency>
-             </properties>
+                <geronimo.dependency>true</geronimo.dependency>
+                <geronimo.keep.version>true</geronimo.keep.version>
+            </properties>
         </dependency>
 
         <dependency>
@@ -293,7 +313,7 @@
             </properties>
         </dependency>
 
-       <dependency>
+        <dependency>
             <groupId>xmlbeans</groupId>
             <artifactId>xmlbeans-maven-plugin</artifactId>
             <version>${xmlbeans_maven_plugin_version}</version>

Modified: geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/configuration/ConfigInstallerGBean.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/configuration/ConfigInstallerGBean.java?rev=396191&r1=396190&r2=396191&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/configuration/ConfigInstallerGBean.java (original)
+++ geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/configuration/ConfigInstallerGBean.java Sat Apr 22 18:19:16 2006
@@ -67,6 +67,7 @@
 import org.apache.geronimo.kernel.repository.MissingDependencyException;
 import org.apache.geronimo.kernel.repository.Repository;
 import org.apache.geronimo.kernel.repository.WritableListableRepository;
+import org.apache.geronimo.kernel.repository.Version;
 import org.apache.geronimo.system.serverinfo.ServerInfo;
 import org.apache.geronimo.system.threads.ThreadPool;
 import org.apache.geronimo.util.encoders.Base64;
@@ -119,15 +120,19 @@
         for (Iterator i = artifacts.iterator(); i.hasNext();) {
             Artifact configId = (Artifact) i.next();
             File dir = writeableRepo.getLocation(configId);
-            File meta = new File(dir, "META-INF");
-            if(!meta.isDirectory() || !meta.canRead()) {
-                continue;
-            }
-            File xml = new File(meta, "geronimo-plugin.xml");
-            if(!xml.isFile() || !xml.canRead() || xml.length() == 0) {
-                continue;
+            if(dir.isDirectory()) {
+                File meta = new File(dir, "META-INF");
+                if(!meta.isDirectory() || !meta.canRead()) {
+                    continue;
+                }
+                File xml = new File(meta, "geronimo-plugin.xml");
+                if(!xml.isFile() || !xml.canRead() || xml.length() == 0) {
+                    continue;
+                }
+                readNameAndID(xml, plugins);
+            } else {
+                log.warn("Cannot extract plugin list from packed entries in repository yet ("+dir.getAbsolutePath()+")");
             }
-            readNameAndID(xml, plugins);
         }
         return plugins;
     }
@@ -140,13 +145,16 @@
         }
         File xml = new File(meta, "geronimo-plugin.xml");
         try {
+            ConfigurationData configData = configStore.loadConfiguration(configId);
             if(!xml.isFile() || !xml.canRead() || xml.length() == 0) {
-                return new ConfigurationArchiveData(null, new URL[0], createDefaultMetadata(configStore.loadConfiguration(configId)));
+                return new ConfigurationArchiveData(null, new URL[0], createDefaultMetadata(configData));
             }
             DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
             DocumentBuilder builder = factory.newDocumentBuilder();
             Document doc = builder.parse(xml);
-            return loadConfigurationMetadata(doc, xml);
+            ConfigurationArchiveData result = loadConfigurationMetadata(doc, xml);
+            overrideDependencies(configData, result.getConfiguration());
+            return result;
         } catch (InvalidConfigException e) {
             log.warn("Unable to generate metadata for "+configId, e);
         } catch (Exception e) {
@@ -190,7 +198,7 @@
         URL url = new URL(repository+"geronimo-plugins.xml");
         try {
             //todo: use a progress monitor
-            InputStream in = openStream(null, url, new URL[0], username, password, null);
+            InputStream in = openStream(null, url, new URL[0], username, password, null).getStream();
             return loadConfiguration(mavenRepository, in);
         } catch (MissingDependencyException e) {
             log.error("Cannot find plugin index at site "+url);
@@ -344,7 +352,8 @@
         boolean installed = false;
         if (configId != null) {
             artifact = Artifact.create(configId);
-            installed = configManager.isLoaded(artifact);
+            // Tests, etc. don't need to have a ConfigurationManager
+            installed = configManager != null && configManager.isLoaded(artifact);
         }
         log.trace("Checking "+configId+": installed="+installed+", eligible="+eligible);
         ConfigurationMetadata data = new ConfigurationMetadata(artifact, getChildText(config, "name"),
@@ -369,7 +378,7 @@
         return data;
     }
 
-    private String getChildText(Element root, String property) {
+    private static String getChildText(Element root, String property) {
         NodeList children = root.getChildNodes();
         for(int i=0; i<children.getLength(); i++) {
             Node check = children.item(i);
@@ -380,7 +389,7 @@
         return null;
     }
 
-    private String getText(Node target) {
+    private static String getText(Node target) {
         NodeList nodes = target.getChildNodes();
         StringBuffer buf = null;
         for(int j=0; j<nodes.getLength(); j++) {
@@ -395,7 +404,7 @@
         return buf == null ? null : buf.toString();
     }
 
-    private String[] getChildrenText(Element root, String property) {
+    private static String[] getChildrenText(Element root, String property) {
         NodeList children = root.getChildNodes();
         List results = new ArrayList();
         for(int i=0; i<children.getLength(); i++) {
@@ -455,7 +464,6 @@
                 if(metadata.getConfigId() != null) {
                     downloadArtifact(metadata.getConfigId(), list.getMainRepository(), list.getBackupRepositories(),
                             username, password, new ResultsFileWriteMonitor(poller), working);
-                    poller.addInstalledConfigID(metadata.getConfigId());
                 } else {
                     String[] deps = metadata.getDependencies();
                     for (int j = 0; j < deps.length; j++) {
@@ -466,6 +474,7 @@
                         }
                         downloadArtifact(entry, list.getMainRepository(), list.getBackupRepositories(),
                                 username, password, new ResultsFileWriteMonitor(poller), working);
+                        poller.addInstalledConfigID(metadata.getConfigId());
                     }
                 }
                 // 4. Uninstall obsolete configurations
@@ -592,11 +601,8 @@
 
     public DownloadResults checkOnInstall(Object key) {
         DownloadResults results = (DownloadResults) asyncKeys.get(key);
+        results = results.duplicate();
         if(results.isFinished()) {
-            //todo: subject to a race condition
-            // since this is not synchronized, it's possible that the download finishes after this
-            // passes but before the client reads it, so the client thinks it's done but we never removed the key
-            // fix if we care by copying the results before the if block and returning the copy?
             asyncKeys.remove(key);
         }
         return results;
@@ -627,13 +633,15 @@
             soFar.add(configID);
         }
         //todo: check all repositories?
-        if(!writeableRepo.contains(configID)) {
-            InputStream in = openStream(configID, repoURL, backups, username, password, monitor);
+        Artifact[] matches = configManager.getArtifactResolver().queryArtifacts(configID);
+        if(matches.length == 0) {
+            OpenResult result = openStream(configID, repoURL, backups, username, password, monitor);
             try {
-                writeableRepo.copyToRepository(in, configID, monitor); //todo: download SNAPSHOTS if previously available?
+                writeableRepo.copyToRepository(result.getStream(), result.getConfigID(), monitor); //todo: download SNAPSHOTS if previously available?
                 monitor.getResults().addDependencyInstalled(configID);
+                configID = result.getConfigID();
             } finally {
-                in.close();
+                result.getStream().close();
             }
         } else {
             monitor.getResults().addDependencyPresent(configID);
@@ -641,6 +649,17 @@
 
         try {
             ConfigurationData data = null;
+            if(!configID.isResolved()) {
+                // See if something's running
+                for (int i = matches.length-1; i >= 0; i--) {
+                    Artifact match = matches[i];
+                    if(configStore.containsConfiguration(match) && configManager.isRunning(match)) {
+                        return; // its dependencies must be OK
+                    }
+                }
+                // Go with something that's installed
+                configID = matches[matches.length-1];
+            }
             if(configStore.containsConfiguration(configID)) {
                 if(configManager.isRunning(configID)) {
                     return; // its dependencies must be OK
@@ -692,12 +711,15 @@
         return new URL(repository, configId.getGroupId().replace('.','/')+"/"+configId.getArtifactId()+"/"+configId.getVersion()+"/"+configId.getArtifactId()+"-"+configId.getVersion()+"."+configId.getType());
     }
 
-    private static InputStream openStream(Artifact artifact, URL repo, URL[] backups, String username, String password, ResultsFileWriteMonitor monitor) throws IOException, FailedLoginException, MissingDependencyException {
+    private static OpenResult openStream(Artifact artifact, URL repo, URL[] backups, String username, String password, ResultsFileWriteMonitor monitor) throws IOException, FailedLoginException, MissingDependencyException {
         if(monitor != null) {
             monitor.getResults().setCurrentFilePercent(-1);
             monitor.getResults().setCurrentMessage("Attempting to download "+artifact);
             monitor.setTotalBytes(-1); // In case the server doesn't say
         }
+        if(artifact != null && !artifact.isResolved()) {
+            artifact = findArtifact(artifact, repo, backups, username, password, monitor);
+        }
         InputStream in;
         LinkedList list = new LinkedList();
         list.add(repo);
@@ -712,62 +734,136 @@
             URL repository = (URL) list.removeFirst();
             URL url = artifact == null ? repository : getURL(artifact, repository);
             log.debug("Attempting to download "+artifact+" from "+url);
-            URLConnection con = url.openConnection();
-            if(con instanceof HttpURLConnection) {
-                HttpURLConnection http = (HttpURLConnection) url.openConnection();
+            in = connect(url, username, password, monitor);
+            if(in != null) {
+                return new OpenResult(artifact, in);
+            }
+        }
+    }
+
+    private static InputStream connect(URL url, String username, String password, ResultsFileWriteMonitor monitor) throws IOException, FailedLoginException {
+        return connect(url, username, password, monitor, null);
+    }
+    private static InputStream connect(URL url, String username, String password, ResultsFileWriteMonitor monitor, String method) throws IOException, FailedLoginException {
+        URLConnection con = url.openConnection();
+        if(con instanceof HttpURLConnection) {
+            HttpURLConnection http = (HttpURLConnection) url.openConnection();
+            if(method != null) {
+                http.setRequestMethod(method);
+            }
+            http.connect();
+            if(http.getResponseCode() == 401) { // need to authenticate
+                if(username == null || username.equals("")) {
+                    throw new FailedLoginException("Server returned 401 "+http.getResponseMessage());
+                }
+                http = (HttpURLConnection) url.openConnection();
+                http.setRequestProperty("Authorization", "Basic " + new String(Base64.encode((username + ":" + password).getBytes())));
+                if(method != null) {
+                    http.setRequestMethod(method);
+                }
                 http.connect();
-                if(http.getResponseCode() == 401) { // need to authenticate
-                    if(username == null || username.equals("")) {
-                        throw new FailedLoginException("Server returned 401 "+http.getResponseMessage());
-                    }
-                    http = (HttpURLConnection) url.openConnection();
-                    http.setRequestProperty("Authorization", "Basic " + new String(Base64.encode((username + ":" + password).getBytes())));
-                    http.connect();
-                    if(http.getResponseCode() == 401) {
-                        throw new FailedLoginException("Server returned 401 "+http.getResponseMessage());
-                    } else if(http.getResponseCode() == 404) {
-                        continue; // Not found at this repository
-                    }
-                    if(monitor != null && http.getContentLength() > 0) {
-                        monitor.setTotalBytes(http.getContentLength());
-                    }
-                    in = http.getInputStream();
+                if(http.getResponseCode() == 401) {
+                    throw new FailedLoginException("Server returned 401 "+http.getResponseMessage());
                 } else if(http.getResponseCode() == 404) {
-                    continue; // Not found at this repository
-                } else {
-                    if(monitor != null && http.getContentLength() > 0) {
-                        monitor.setTotalBytes(http.getContentLength());
-                    }
-                    in = http.getInputStream();
+                    return null; // Not found at this repository
+                }
+                if(monitor != null && http.getContentLength() > 0) {
+                    monitor.setTotalBytes(http.getContentLength());
                 }
+                return http.getInputStream();
+            } else if(http.getResponseCode() == 404) {
+                return null; // Not found at this repository
             } else {
-                if(username != null && !username.equals("")) {
-                    con.setRequestProperty("Authorization", "Basic " + new String(Base64.encode((username + ":" + password).getBytes())));
-                    try {
-                        con.connect();
-                        if(monitor != null && con.getContentLength() > 0) {
-                            monitor.setTotalBytes(con.getContentLength());
-                        }
-                        in = con.getInputStream();
-                    } catch (FileNotFoundException e) {
-                        continue;
+                if(monitor != null && http.getContentLength() > 0) {
+                    monitor.setTotalBytes(http.getContentLength());
+                }
+                return http.getInputStream();
+            }
+        } else {
+            if(username != null && !username.equals("")) {
+                con.setRequestProperty("Authorization", "Basic " + new String(Base64.encode((username + ":" + password).getBytes())));
+                try {
+                    con.connect();
+                    if(monitor != null && con.getContentLength() > 0) {
+                        monitor.setTotalBytes(con.getContentLength());
                     }
-                } else {
-                    try {
-                        con.connect();
-                        if(monitor != null && con.getContentLength() > 0) {
-                            monitor.setTotalBytes(con.getContentLength());
-                        }
-                        in = con.getInputStream();
-                    } catch (FileNotFoundException e) {
-                        continue;
+                    return con.getInputStream();
+                } catch (FileNotFoundException e) {
+                    return null;
+                }
+            } else {
+                try {
+                    con.connect();
+                    if(monitor != null && con.getContentLength() > 0) {
+                        monitor.setTotalBytes(con.getContentLength());
                     }
+                    return con.getInputStream();
+                } catch (FileNotFoundException e) {
+                    return null;
                 }
             }
-            if(in != null) {
-                return in;
+        }
+    }
+
+    private static Artifact findArtifact(Artifact query, URL repo, URL[] backups, String username, String password, ResultsFileWriteMonitor monitor) throws MissingDependencyException {
+        if(query.getGroupId() == null || query.getArtifactId() == null || query.getType() == null) {
+            throw new MissingDependencyException("No support yet for dependencies missing more than a version: "+query);
+        }
+        List list = new ArrayList();
+        list.add(repo);
+        for (int i = 0; i < backups.length; i++) {
+            list.add(backups[i]);
+        }
+        Artifact result = null;
+        for (int i = 0; i < list.size(); i++) {
+            URL url = (URL) list.get(i);
+            try {
+                result = findArtifact(query, url, username, password, monitor);
+            } catch (Exception e) {
+                log.warn("Unable to read from "+url, e);
+            }
+            if(result != null) {
+                return result;
             }
         }
+        throw new MissingDependencyException("No repository has a valid artifact for "+query);
+    }
+
+    private static Artifact findArtifact(Artifact query, URL url, String username, String password, ResultsFileWriteMonitor monitor) throws IOException, FailedLoginException, ParserConfigurationException, SAXException {
+        monitor.getResults().setCurrentMessage("Searching for "+query+" at "+url);
+        String base = query.getGroupId().replace('.', '/') + "/" + query.getArtifactId();
+        String path = base +"/maven-metadata.xml";
+        URL metaURL = new URL(url.toString()+path);
+        InputStream in = connect(metaURL, username, password, monitor);
+        if(in == null) {
+            return null;
+        }
+        DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+        DocumentBuilder builder = factory.newDocumentBuilder();
+        Document doc = builder.parse(in);
+        Element root = doc.getDocumentElement();
+        NodeList list = root.getElementsByTagName("versions");
+        if(list.getLength() == 0) {
+            return null;
+        }
+        list = ((Element)list.item(0)).getElementsByTagName("version");
+        Version[] available = new Version[list.getLength()];
+        for (int i = 0; i < available.length; i++) {
+            available[i] = new Version(getText(list.item(i)));
+        }
+        Arrays.sort(available);
+        for(int i=available.length-1; i>=0; i--) {
+            Version version = available[i];
+            URL test = new URL(url.toString()+base+"/"+version+"/"+query.getArtifactId()+"-"+version+"."+query.getType());
+            InputStream testStream = connect(test, username, password, monitor, "HEAD");
+            if(testStream == null) {
+                log.warn("Maven repository "+url+" listed artifact "+query+" version "+version+" but I couldn't find it at "+test);
+                continue;
+            }
+            testStream.close();
+            return new Artifact(query.getGroupId(), query.getArtifactId(), version, query.getType());
+        }
+        return null;
     }
 
     private static class ResultsFileWriteMonitor implements FileWriteMonitor {
@@ -816,7 +912,7 @@
             PluginNameIDHandler handler = new PluginNameIDHandler();
             parser.parse(xml, handler);
             if(handler.isComplete()) {
-                plugins.put(handler.getName(), handler.getID());
+                plugins.put(handler.getName(), Artifact.create(handler.getID()));
             }
         } catch (Exception e) {
             log.warn("Invalid XML at "+xml.getAbsolutePath(), e);
@@ -843,8 +939,8 @@
         }
 
         public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {
-            if(localName.equals("config-id") || localName.equals("name")) {
-                element = localName;
+            if(qName.equals("config-id") || qName.equals("name")) {
+                element = qName;
             }
         }
 
@@ -866,6 +962,12 @@
         }
     }
 
+    private void overrideDependencies(ConfigurationData data, ConfigurationMetadata metadata) {
+        //todo: this ends up doing a little more work than necessary
+        ConfigurationMetadata temp = createDefaultMetadata(data);
+        metadata.setDependencies(temp.getDependencies());
+    }
+
     private ConfigurationMetadata createDefaultMetadata(ConfigurationData data) {
         ConfigurationMetadata meta = new ConfigurationMetadata(data.getId(), data.getId().toString(),
                 "Please provide a description", "Unknown", true, false);
@@ -875,27 +977,38 @@
         meta.setObsoletes(new String[0]);
         List deps = new ArrayList();
         ConfigurationMetadata.Prerequisite prereq = null;
-        List real = data.getEnvironment().getDependencies();
+        prereq = processDependencyList(data.getEnvironment().getDependencies(), prereq, deps);
+        Map children = data.getChildConfigurations();
+        for (Iterator it = children.values().iterator(); it.hasNext();) {
+            ConfigurationData child = (ConfigurationData) it.next();
+            prereq = processDependencyList(child.getEnvironment().getDependencies(), prereq, deps);
+        }
+        meta.setDependencies((String[]) deps.toArray(new String[deps.size()]));
+        meta.setPrerequisites(prereq == null ? new ConfigurationMetadata.Prerequisite[0] : new ConfigurationMetadata.Prerequisite[]{prereq});
+        return meta;
+    }
+
+    private ConfigurationMetadata.Prerequisite processDependencyList(List real, ConfigurationMetadata.Prerequisite prereq, List deps) {
         for (int i = 0; i < real.size(); i++) {
             Dependency dep = (Dependency) real.get(i);
             if(dep.getArtifact().getGroupId().equals("geronimo")) {
-                if(dep.getArtifact().getArtifactId().equals("jetty")) {
+                if(dep.getArtifact().getArtifactId().indexOf("jetty") > -1) {
                     if(prereq == null) {
                         prereq = new ConfigurationMetadata.Prerequisite(dep.getArtifact(), true, "Web Container", "This plugin works with the Geronimo/Jetty distribution.  It is not intended to run in the Geronimo/Tomcat distribution.  There is a separate version of this plugin that works with Tomcat.");
                     }
                     continue;
-                } else if(dep.getArtifact().getArtifactId().equals("tomcay")) {
+                } else if(dep.getArtifact().getArtifactId().indexOf("tomcat") > -1) {
                     if(prereq == null) {
                         prereq = new ConfigurationMetadata.Prerequisite(dep.getArtifact(), true, "Web Container", "This plugin works with the Geronimo/Tomcat distribution.  It is not intended to run in the Geronimo/Jetty distribution.  There is a separate version of this plugin that works with Jetty.");
                     }
                     continue;
                 }
             }
-            deps.add(dep.getArtifact().toString());
+            if(!deps.contains(dep.getArtifact().toString())) {
+                deps.add(dep.getArtifact().toString());
+            }
         }
-        meta.setDependencies((String[]) deps.toArray(new String[deps.size()]));
-        meta.setPrerequisites(prereq == null ? new ConfigurationMetadata.Prerequisite[0] : new ConfigurationMetadata.Prerequisite[]{prereq});
-        return meta;
+        return prereq;
     }
 
     private static Document writeConfigurationMetadata(ConfigurationArchiveData metadata) throws ParserConfigurationException {
@@ -945,7 +1058,7 @@
         }
 
         Element repo = doc.createElement("source-repository");
-        repo.appendChild(doc.createTextNode(metadata.getRepository().toString()));
+        repo.appendChild(doc.createTextNode(metadata.getRepository() == null ? "" : metadata.getRepository().toString()));
         root.appendChild(repo);
         for (int i = 0; i < metadata.getBackups().length; i++) {
             URL url = metadata.getBackups()[i];
@@ -960,6 +1073,24 @@
         Element child = doc.createElement(name);
         child.appendChild(doc.createTextNode(text));
         parent.appendChild(child);
+    }
+
+    private static class OpenResult {
+        private final InputStream stream;
+        private final Artifact configID;
+
+        public OpenResult(Artifact configID, InputStream stream) {
+            this.configID = configID;
+            this.stream = stream;
+        }
+
+        public Artifact getConfigID() {
+            return configID;
+        }
+
+        public InputStream getStream() {
+            return stream;
+        }
     }
 
     public static final GBeanInfo GBEAN_INFO;



Mime
View raw message