geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r598819 - in /geronimo/server/trunk: assemblies/geronimo-boilerplate-minimal/src/main/underlay/META-INF/ assemblies/geronimo-framework/ assemblies/geronimo-framework/src/main/assembly/ framework/modules/geronimo-kernel/src/main/java/org/apa...
Date Tue, 27 Nov 2007 23:28:48 GMT
Author: djencks
Date: Tue Nov 27 15:28:45 2007
New Revision: 598819

URL: http://svn.apache.org/viewvc?rev=598819&view=rev
Log:
GERONIMO-3607 baby step.  Make boilerplate into a plugin, and make plugin infrastructure deal
with packed jar plugins (at least a bit)

Added:
    geronimo/server/trunk/assemblies/geronimo-boilerplate-minimal/src/main/underlay/META-INF/
    geronimo/server/trunk/assemblies/geronimo-boilerplate-minimal/src/main/underlay/META-INF/geronimo-plugin.xml
  (with props)
Modified:
    geronimo/server/trunk/assemblies/geronimo-framework/pom.xml
    geronimo/server/trunk/assemblies/geronimo-framework/src/main/assembly/bin.xml
    geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/IOUtil.java
    geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/RepositoryConfigurationStore.java
    geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/plugin/PluginInstallerGBean.java

Added: geronimo/server/trunk/assemblies/geronimo-boilerplate-minimal/src/main/underlay/META-INF/geronimo-plugin.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/assemblies/geronimo-boilerplate-minimal/src/main/underlay/META-INF/geronimo-plugin.xml?rev=598819&view=auto
==============================================================================
--- geronimo/server/trunk/assemblies/geronimo-boilerplate-minimal/src/main/underlay/META-INF/geronimo-plugin.xml
(added)
+++ geronimo/server/trunk/assemblies/geronimo-boilerplate-minimal/src/main/underlay/META-INF/geronimo-plugin.xml
Tue Nov 27 15:28:45 2007
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<!--
+ 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.
+-->
+<geronimo-plugin xmlns="http://geronimo.apache.org/xml/ns/plugins-1.3" xmlns:ns2="http://geronimo.apache.org/xml/ns/attributes-1.2">
+    <name>Geronimo Configs :: Boilerplate</name>
+    <category>Geronimo Core</category>
+    <description>Base geronimo boilerplate</description>
+    <url>http://geronimo.apache.org/</url>
+    <author>The Apache Geronimo development community</author>
+    <license osi-approved="true">The Apache Software License, Version 2.0</license>
+    <plugin-artifact>
+        <module-id>
+            <groupId>org.apache.geronimo.assemblies</groupId>
+            <artifactId>geronimo-boilerplate-minimal</artifactId>
+            <version>2.1-SNAPSHOT</version>
+            <type>car</type>
+        </module-id>
+        <geronimo-version>2.1-SNAPSHOT</geronimo-version>
+        <jvm-version>1.5</jvm-version>
+        <copy-file relative-to="geronimo" dest-dir=""></copy-file>
+    </plugin-artifact>
+</geronimo-plugin>

Propchange: geronimo/server/trunk/assemblies/geronimo-boilerplate-minimal/src/main/underlay/META-INF/geronimo-plugin.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/assemblies/geronimo-boilerplate-minimal/src/main/underlay/META-INF/geronimo-plugin.xml
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/assemblies/geronimo-boilerplate-minimal/src/main/underlay/META-INF/geronimo-plugin.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Modified: geronimo/server/trunk/assemblies/geronimo-framework/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/assemblies/geronimo-framework/pom.xml?rev=598819&r1=598818&r2=598819&view=diff
==============================================================================
--- geronimo/server/trunk/assemblies/geronimo-framework/pom.xml (original)
+++ geronimo/server/trunk/assemblies/geronimo-framework/pom.xml Tue Nov 27 15:28:45 2007
@@ -42,7 +42,7 @@
             <groupId>org.apache.geronimo.assemblies</groupId>
             <artifactId>geronimo-boilerplate-minimal</artifactId>
             <version>${version}</version>
-            <scope>provided</scope>
+            <type>jar</type>
         </dependency>
 
         <dependency>
@@ -136,24 +136,7 @@
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-dependency-plugin</artifactId>
                 <executions>
-                    <execution>
-                        <id>unpack-boilerplate</id>
-                        <phase>generate-resources</phase>
-                        <goals>
-                            <goal>unpack</goal>
-                        </goals>
-                        <configuration>
-                            <artifactItems>
-                                <artifactItem>
-                                    <groupId>org.apache.geronimo.assemblies</groupId>
-                                    <artifactId>geronimo-boilerplate-minimal</artifactId>
-                                    <version>${version}</version>
-                                </artifactItem>
-                            </artifactItems>
-                            <outputDirectory>${project.build.directory}/boilerplate</outputDirectory>
-                        </configuration>
-                    </execution>
-                    
+
                     <execution>
                         <id>unpack-schemas</id>
                         <phase>generate-resources</phase>
@@ -204,7 +187,7 @@
                     </execution>
                 </executions>
             </plugin>
-            
+
             <plugin>
                 <groupId>org.apache.geronimo.plugins</groupId>
                 <artifactId>car-maven-plugin</artifactId>

Modified: geronimo/server/trunk/assemblies/geronimo-framework/src/main/assembly/bin.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/assemblies/geronimo-framework/src/main/assembly/bin.xml?rev=598819&r1=598818&r2=598819&view=diff
==============================================================================
--- geronimo/server/trunk/assemblies/geronimo-framework/src/main/assembly/bin.xml (original)
+++ geronimo/server/trunk/assemblies/geronimo-framework/src/main/assembly/bin.xml Tue Nov
27 15:28:45 2007
@@ -87,6 +87,7 @@
     </dependencySets>
 
     <fileSets>
+<!--
         <fileSet>
             <directory>target/boilerplate</directory>
             <outputDirectory>/</outputDirectory>
@@ -94,7 +95,8 @@
                 <exclude>META-INF/**</exclude>
             </excludes>
         </fileSet>
-        
+-->
+
         <fileSet>
             <directory>target/assembly</directory>
             <outputDirectory>/</outputDirectory>
@@ -111,7 +113,7 @@
         </fileSet>
         
         <fileSet>
-            <directory>target/boilerplate/bin</directory>
+            <directory>target/assembly/bin</directory>
             <outputDirectory>bin</outputDirectory>
             <includes>
                 <include>*</include>
@@ -126,7 +128,7 @@
         </fileSet>
         
         <fileSet>
-            <directory>target/boilerplate/bin</directory>
+            <directory>target/assembly/bin</directory>
             <outputDirectory>bin</outputDirectory>
             <includes>
                 <include>*.bat</include>

Modified: geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/IOUtil.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/IOUtil.java?rev=598819&r1=598818&r2=598819&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/IOUtil.java
(original)
+++ geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/IOUtil.java
Tue Nov 27 15:28:45 2007
@@ -28,7 +28,6 @@
 import java.net.URL;
 import java.util.Collections;
 import java.util.Enumeration;
-import java.util.Iterator;
 import java.util.LinkedHashMap;
 import java.util.LinkedHashSet;
 import java.util.Map;
@@ -44,10 +43,11 @@
  */
 public class IOUtil {
     private final static Log log = LogFactory.getLog(IOUtil.class);
+
     public static void recursiveCopy(File srcDir, File destDir) throws IOException {
-        if (srcDir == null)  throw new NullPointerException("sourceDir is null");
-        if (destDir == null)  throw new NullPointerException("destDir is null");
-        if (!srcDir.isDirectory() || ! srcDir.canRead()) {
+        if (srcDir == null) throw new NullPointerException("sourceDir is null");
+        if (destDir == null) throw new NullPointerException("destDir is null");
+        if (!srcDir.isDirectory() || !srcDir.canRead()) {
             throw new IllegalArgumentException("Source directory must be a readable directory
" + srcDir);
         }
         if (destDir.exists()) {
@@ -103,7 +103,7 @@
         }
         out.flush();
     }
-    
+
     private static void listFiles(File directory) {
         if (!log.isDebugEnabled() || !directory.isDirectory()) {
             return;
@@ -146,7 +146,7 @@
         if (fileDeleted) {
             if (log.isDebugEnabled()) {
                 log.debug(file.getPath() + " deleted after " + retries
-                         + " retries, with " + interruptions + " interruptions.");
+                        + " retries, with " + interruptions + " interruptions.");
             }
         } else {
             log.warn(file.getPath() + " not deleted after " + retryLimit
@@ -180,7 +180,7 @@
         if (thing != null) {
             try {
                 thing.flush();
-            } catch(Exception ignored) {
+            } catch (Exception ignored) {
             }
         }
     }
@@ -189,7 +189,7 @@
         if (thing != null) {
             try {
                 thing.flush();
-            } catch(Exception ignored) {
+            } catch (Exception ignored) {
             }
         }
     }
@@ -198,7 +198,7 @@
         if (thing != null) {
             try {
                 thing.close();
-            } catch(Exception ignored) {
+            } catch (Exception ignored) {
             }
         }
     }
@@ -207,7 +207,7 @@
         if (thing != null) {
             try {
                 thing.close();
-            } catch(Exception ignored) {
+            } catch (Exception ignored) {
             }
         }
     }
@@ -216,7 +216,7 @@
         if (thing != null) {
             try {
                 thing.close();
-            } catch(Exception ignored) {
+            } catch (Exception ignored) {
             }
         }
     }
@@ -225,7 +225,7 @@
         if (thing != null) {
             try {
                 thing.close();
-            } catch(Exception ignored) {
+            } catch (Exception ignored) {
             }
         }
     }
@@ -234,17 +234,20 @@
         if (thing != null) {
             try {
                 thing.close();
-            } catch(Exception ignored) {
+            } catch (Exception ignored) {
             }
         }
     }
 
     public static Set<URL> search(File root, String pattern) throws MalformedURLException
{
         if (root.isDirectory()) {
+            if (pattern == null || pattern.length() == 0) {
+                return Collections.singleton(new URL("file:" + root.toURI().normalize().getPath()));
+            }
             if (!SelectorUtils.hasWildcards(pattern)) {
                 File match = new File(root, pattern);
                 if (match.exists() && match.canRead()) {
-                    return Collections.singleton( new URL( "file:" + match.toURI().normalize().getPath()
) );
+                    return Collections.singleton(new URL("file:" + match.toURI().normalize().getPath()));
                 } else {
                     return Collections.emptySet();
                 }
@@ -265,6 +268,9 @@
             try {
                 jarFile = new JarFile(root);
                 URL baseURL = new URL("jar:" + root.toURL().toString() + "!/");
+                if (pattern == null || pattern.length() == 0) {
+                    return Collections.singleton(baseURL);
+                }
                 if (!SelectorUtils.hasWildcards(pattern)) {
                     ZipEntry entry = jarFile.getEntry(pattern);
                     if (entry != null) {

Modified: geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/RepositoryConfigurationStore.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/RepositoryConfigurationStore.java?rev=598819&r1=598818&r2=598819&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/RepositoryConfigurationStore.java
(original)
+++ geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/RepositoryConfigurationStore.java
Tue Nov 27 15:28:45 2007
@@ -223,8 +223,8 @@
             if (moduleName != null) {
                 location = new File(location, moduleName);
             }
-
-            if(path == null) {
+            return IOUtil.search(location, path);
+ /*           if(path == null) {
                 return Collections.singleton(location.toURL());
             } else {
                 if (location.isDirectory()) {
@@ -235,9 +235,11 @@
                     return matches;
                 }
             }
-        } else {
-            Set matches = IOUtil.search(location, moduleName + "/" +path);
-            return matches;
+*/        } else {
+            if (moduleName != null) {
+                path = moduleName + "/" +path;
+            }
+            return IOUtil.search(location, path);
         }
     }
 

Modified: geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/plugin/PluginInstallerGBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/plugin/PluginInstallerGBean.java?rev=598819&r1=598818&r2=598819&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/plugin/PluginInstallerGBean.java
(original)
+++ geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/plugin/PluginInstallerGBean.java
Tue Nov 27 15:28:45 2007
@@ -25,9 +25,9 @@
 import java.io.InputStream;
 import java.net.HttpURLConnection;
 import java.net.MalformedURLException;
+import java.net.URI;
 import java.net.URL;
 import java.net.URLConnection;
-import java.net.URI;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collection;
@@ -36,7 +36,6 @@
 import java.util.Enumeration;
 import java.util.HashMap;
 import java.util.HashSet;
-import java.util.Iterator;
 import java.util.LinkedList;
 import java.util.List;
 import java.util.Map;
@@ -215,19 +214,9 @@
      *                 The configId must be fully resolved (isResolved() == true)
      */
     public PluginType getPluginMetadata(Artifact moduleId) {
-        if (configManager != null) {
-            if (!configManager.isConfiguration(moduleId)) {
-                return null;
-            }
-        } else {
-            if (!configStore.containsConfiguration(moduleId)) {
-                return null;
-            }
-        }
         File dir = writeableRepo.getLocation(moduleId);
-        ConfigurationData configData;
+//        ConfigurationData configData;
         String source = dir.getAbsolutePath();
-        InputStream in;
         try {
             if (dir.isDirectory()) {
                 File meta = new File(dir, "META-INF");
@@ -235,37 +224,42 @@
                     return null;
                 }
                 File xml = new File(meta, "geronimo-plugin.xml");
-                configData = configStore.loadConfiguration(moduleId);
+//                configData = configStore.loadConfiguration(moduleId);
                 if (!xml.isFile() || !xml.canRead() || xml.length() == 0) {
-                    return createDefaultMetadata(configData);
+                    return createDefaultMetadata(moduleId);
+                }
+                InputStream in = new FileInputStream(xml);
+                try {
+                    return PluginXmlUtil.loadPluginMetadata(in);
+                } finally {
+                    in.close();
                 }
-                in = new FileInputStream(xml);
             } else {
                 if (!dir.isFile() || !dir.canRead()) {
                     log.error("Cannot read configuration " + dir.getAbsolutePath());
                     throw new IllegalStateException("Cannot read configuration " + dir.getAbsolutePath());
                 }
-                configData = configStore.loadConfiguration(moduleId);
+//                configData = configStore.loadConfiguration(moduleId);
                 JarFile jar = new JarFile(dir);
                 try {
                     ZipEntry entry = jar.getEntry("META-INF/geronimo-plugin.xml");
                     if (entry == null) {
-                        return createDefaultMetadata(configData);
+                        return createDefaultMetadata(moduleId);
                     }
                     source = dir.getAbsolutePath() + "#META-INF/geronimo-plugin.xml";
-                    in = jar.getInputStream(entry);
+                    InputStream in = jar.getInputStream(entry);
+                    try {
+                        return PluginXmlUtil.loadPluginMetadata(in);
+                    } finally {
+                        in.close();
+                    }
                 } finally {
                     jar.close();
                 }
             }
-            PluginType result;
-            try {
-                result = PluginXmlUtil.loadPluginMetadata(in);
-            } finally {
-                in.close();
-            }
-            overrideDependencies(configData, result);
-            return result;
+//            PluginType result;
+//            overrideDependencies(configData, result);
+//            return result;
         } catch (InvalidConfigException e) {
             e.printStackTrace();
             log.warn("Unable to generate metadata for " + moduleId, e);
@@ -724,19 +718,18 @@
     }
 
     public Artifact installLibrary(File libFile, String groupId) throws IOException {
-        String artifactId = null, version = null, type = null;
         Matcher matcher = MAVEN_1_PATTERN_PART.matcher("");
         matcher.reset(libFile.getName());
-        if(matcher.matches()) {
-            artifactId = matcher.group(1);
-            version = matcher.group(2);
-            type = matcher.group(3);
+        if (matcher.matches()) {
+            String artifactId = matcher.group(1);
+            String version = matcher.group(2);
+            String type = matcher.group(3);
+            Artifact artifact = new Artifact(groupId != null ? groupId : Artifact.DEFAULT_GROUP_ID,
artifactId, version, type);
+            writeableRepo.copyToRepository(libFile, artifact, null);
+            return artifact;
         } else {
-            throw new IllegalArgumentException("Filename "+libFile.getName()+" is not in
the form <artifact>-<version>.<type>, for e.g. mylib-1.0.jar.");
+            throw new IllegalArgumentException("Filename " + libFile.getName() + " is not
in the form <artifact>-<version>.<type>, for e.g. mylib-1.0.jar.");
         }
-        Artifact artifact = new Artifact(groupId != null ? groupId : Artifact.DEFAULT_GROUP_ID,
artifactId, version, type);
-        writeableRepo.copyToRepository(libFile, artifact, null);
-        return artifact;
     }
 
     /**
@@ -751,12 +744,14 @@
      * @param password    The password used for repositories secured with HTTP Basic authentication
      * @param monitor     The ongoing results of the download operations, with some monitoring
logic
      * @param soFar       The set of dependencies already downloaded.
-     * @param parentStack
+     * @param parentStack chain of modules that led to this dependency
      * @param dependency  Is this a dependency or the original artifact? @throws IOException
               When there's a problem reading or writing data
      * @throws FailedLoginException       When a repository requires authentication and either
no username
      *                                    and password are supplied or the username and password
supplied
      *                                    are not accepted
      * @throws MissingDependencyException When a dependency cannot be located in any of the
listed repositories
+     * @throws NoServerInstanceException  when no server descriptor is found for a specified
configuration bit
+     * @throws java.io.IOException        when a IO problem occurs
      */
     private void downloadArtifact(Artifact configID, Map<Artifact, PluginType> metadata,
List<String> repos, String username, String password, ResultsFileWriteMonitor monitor,
Set<Artifact> soFar, Stack<Artifact> parentStack, boolean dependency) throws IOException,
FailedLoginException, MissingDependencyException, NoServerInstanceException {
         if (soFar.contains(configID)) {
@@ -904,7 +899,7 @@
                     "Installed configuration into repository but ConfigStore cannot load
it: " + e.getMessage(), e);
         }
         // Copy any files out of the artifact
-        PluginType currentPlugin = configManager.isConfiguration(configID) ? getPluginMetadata(configID)
: null;
+        PluginType currentPlugin = getPluginMetadata(configID);
         if (pluginWasInstalled && currentPlugin != null) {
             extractPluginFiles(configID, currentPlugin, monitor);
         }
@@ -915,10 +910,8 @@
         for (CopyFileType data : instance.getCopyFile()) {
             monitor.getResults().setCurrentFilePercent(-1);
             monitor.getResults().setCurrentFile(data.getValue());
-            monitor.getResults().setCurrentMessage(
-                    "Copying " + data.getValue() + " from plugin to Geronimo installation");
+            monitor.getResults().setCurrentMessage("Copying " + data.getValue() + " from
plugin to Geronimo installation");
             copyFile(data, configID);
-            continue;
         }
     }
 
@@ -938,7 +931,7 @@
         if (set.iterator().next().getPath().endsWith("/")) {
             //directory, get all contents
             String pattern = sourceFile;
-            if (pattern.endsWith("/")) {
+            if (pattern.length() == 0 || pattern.endsWith("/")) {
                 pattern = pattern + "**";
             } else {
                 pattern = pattern + "/**";
@@ -978,10 +971,14 @@
         for (URL url : set) {
             String path = url.getPath();
             if (start == -1) {
-                if (sourceFile.endsWith("/")) {
-                    start = path.length();
-                    //this entry needs nothing done
-                    continue;
+                if (sourceFile.length() == 0 || sourceFile.endsWith("/")) {
+                    if ("jar".equals(url.getProtocol())) {
+                        start = path.lastIndexOf("!/") + 2;
+                    } else {
+                        start = path.length();
+                        //this entry needs nothing done
+                        continue;
+                    }
                 } else {
                     String remove = sourceFile;
                     int pos = sourceFile.lastIndexOf('/');
@@ -1005,6 +1002,9 @@
                     continue;
                 }
             }
+            if (target.isDirectory()) {
+                continue;
+            }
             if (!target.canWrite()) {
                 log.error("Plugin install cannot write to file " + target.getAbsolutePath());
                 continue;
@@ -1111,7 +1111,7 @@
         for (ConfigurationData child : children) {
             dependencies.addAll(child.getEnvironment().getDependencies());
         }
-        return (Dependency[]) dependencies.toArray(new Dependency[dependencies.size()]);
+        return dependencies.toArray(new Dependency[dependencies.size()]);
     }
 
     /**
@@ -1492,6 +1492,7 @@
      * Replaces all the dependency elements in the argument configuration data
      * with the dependencies from the actual data for that module.
      */
+/*
     private void overrideDependencies(ConfigurationData data, PluginType metadata) {
         //todo: this ends up doing a little more work than necessary
         PluginType temp = createDefaultMetadata(data);
@@ -1500,31 +1501,41 @@
         dependencyTypes.clear();
         dependencyTypes.addAll(instance.getDependency());
     }
+*/
 
     /**
      * Generates a default plugin metadata based on the data for this module
      * in the server.
      */
-    private PluginType createDefaultMetadata(ConfigurationData data) {
+    private PluginType createDefaultMetadata(Artifact moduleId) throws InvalidConfigException,
IOException, NoSuchConfigException {
+        if (configManager != null) {
+            if (!configManager.isConfiguration(moduleId)) {
+                return null;
+            }
+        } else {
+            if (!configStore.containsConfiguration(moduleId)) {
+                return null;
+            }
+        }
+        ConfigurationData data = configStore.loadConfiguration(moduleId);
+
         PluginType meta = new PluginType();
         PluginArtifactType instance = new PluginArtifactType();
         meta.getPluginArtifact().add(instance);
-        meta.setName(toArtifactType(data.getId()).toString());
-        instance.setModuleId(toArtifactType(data.getId()));
+        meta.setName(toArtifactType(moduleId).toString());
+        instance.setModuleId(toArtifactType(moduleId));
         meta.setCategory("Unknown");
-//        true, // installed
-//                false);
         instance.getGeronimoVersion().add(serverInfo.getVersion());
-        instance.getObsoletes().add(toArtifactType(new Artifact(data.getId().getGroupId(),
-                data.getId().getArtifactId(),
+        instance.getObsoletes().add(toArtifactType(new Artifact(moduleId.getGroupId(),
+                moduleId.getArtifactId(),
                 (Version) null,
-                data.getId().getType())));
+                moduleId.getType())));
         List<DependencyType> deps = instance.getDependency();
         PrerequisiteType prereq = null;
         prereq = processDependencyList(data.getEnvironment().getDependencies(), prereq, deps);
         Map children = data.getChildConfigurations();
-        for (Iterator it = children.values().iterator(); it.hasNext();) {
-            ConfigurationData child = (ConfigurationData) it.next();
+        for (Object o : children.values()) {
+            ConfigurationData child = (ConfigurationData) o;
             prereq = processDependencyList(child.getEnvironment().getDependencies(), prereq,
deps);
         }
         if (prereq != null) {



Mime
View raw message