You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by am...@apache.org on 2006/05/25 05:08:06 UTC

svn commit: r409293 - in /geronimo/trunk/modules/system/src/java/org/apache/geronimo/system: plugin/PluginInstallerGBean.java repository/Maven1Repository.java

Author: ammulder
Date: Wed May 24 20:08:06 2006
New Revision: 409293

URL: http://svn.apache.org/viewvc?rev=409293&view=rev
Log:
Merge GERONIMO-1900 fix to trunk

Modified:
    geronimo/trunk/modules/system/src/java/org/apache/geronimo/system/plugin/PluginInstallerGBean.java
    geronimo/trunk/modules/system/src/java/org/apache/geronimo/system/repository/Maven1Repository.java

Modified: geronimo/trunk/modules/system/src/java/org/apache/geronimo/system/plugin/PluginInstallerGBean.java
URL: http://svn.apache.org/viewvc/geronimo/trunk/modules/system/src/java/org/apache/geronimo/system/plugin/PluginInstallerGBean.java?rev=409293&r1=409292&r2=409293&view=diff
==============================================================================
--- geronimo/trunk/modules/system/src/java/org/apache/geronimo/system/plugin/PluginInstallerGBean.java (original)
+++ geronimo/trunk/modules/system/src/java/org/apache/geronimo/system/plugin/PluginInstallerGBean.java Wed May 24 20:08:06 2006
@@ -513,6 +513,9 @@
                 ResultsFileWriteMonitor monitor = new ResultsFileWriteMonitor(poller);
                 writeableRepo.copyToRepository(carFile, data.getModuleId(), monitor);
                 installConfigXMLData(data.getModuleId(), data);
+                if(data.getFilesToCopy() != null) {
+                    extractPluginFiles(data.getModuleId(), data, monitor);
+                }
             }
 
             // 4. Use the standard logic to remove obsoletes, install dependencies, etc.
@@ -588,7 +591,7 @@
             soFar.add(configID);
         }
         // Download and install the main artifact
-        //todo: check all repositories?
+        boolean pluginWasInstalled = false;
         Artifact[] matches = configManager.getArtifactResolver().queryArtifacts(configID);
         if(matches.length == 0) { // not present, needs to be downloaded
             OpenResult result = openStream(configID, repos, username, password, monitor);
@@ -627,6 +630,7 @@
                     configID = result.getConfigID();
                     monitor.getResults().addInstalledConfigID(configID);
                 }
+                pluginWasInstalled = true;
             } finally {
                 result.getStream().close();
             }
@@ -671,6 +675,12 @@
         }
         // Copy any files out of the artifact
         PluginMetadata currentPlugin = configManager.isConfiguration(configID) ? getPluginMetadata(configID) : null;
+        if(pluginWasInstalled && currentPlugin != null && currentPlugin.getFilesToCopy() != null) {
+            extractPluginFiles(configID, currentPlugin, monitor);
+        }
+    }
+
+    private void extractPluginFiles(Artifact configID, PluginMetadata currentPlugin, ResultsFileWriteMonitor monitor) throws IOException {
         for (int i = 0; i < currentPlugin.getFilesToCopy().length; i++) {
             PluginMetadata.CopyFile data = currentPlugin.getFilesToCopy()[i];
             monitor.getResults().setCurrentFilePercent(-1);

Modified: geronimo/trunk/modules/system/src/java/org/apache/geronimo/system/repository/Maven1Repository.java
URL: http://svn.apache.org/viewvc/geronimo/trunk/modules/system/src/java/org/apache/geronimo/system/repository/Maven1Repository.java?rev=409293&r1=409292&r2=409293&view=diff
==============================================================================
--- geronimo/trunk/modules/system/src/java/org/apache/geronimo/system/repository/Maven1Repository.java (original)
+++ geronimo/trunk/modules/system/src/java/org/apache/geronimo/system/repository/Maven1Repository.java Wed May 24 20:08:06 2006
@@ -119,7 +119,14 @@
                 String artifactId = matcher.group(3);
                 String version = matcher.group(4);
                 String type = matcher.group(2);
-                artifacts.add(new Artifact(groupId, artifactId, version, type));
+                if(groupId.indexOf('/') > -1 || artifactId.indexOf('/') > -1 || type.indexOf('/') > -1 ||
+                    version.indexOf('/') > -1) {
+                    log.warn("could not resolve URI for malformed repository entry: " + names[i] +
+                    " - the filename should look like: <groupId>/<type>s/<artifactId>-<version>.<type>   "+
+                    "Perhaps you put in a file without a version number in the name?");
+                } else {
+                    artifacts.add(new Artifact(groupId, artifactId, version, type));
+                }
             } else {
             	log.warn("could not resolve URI for malformed repository entry: " + names[i] +
             	" - the filename should look like: <groupId>/<type>s/<artifactId>-<version>.<type>   "+