geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ammul...@apache.org
Subject svn commit: r409290 - in /geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system: plugin/PluginInstallerGBean.java repository/Maven1Repository.java
Date Thu, 25 May 2006 02:53:54 GMT
Author: ammulder
Date: Wed May 24 19:53:53 2006
New Revision: 409290

URL: http://svn.apache.org/viewvc?rev=409290&view=rev
Log:
Fix plugin build and install (GERONIMO-1900)
 - rebuild plugins
 - accomodate M2-formatted content in the source M1 repo
 - Fix NPE for plugins with external dependencies

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

Modified: geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/plugin/PluginInstallerGBean.java
URL: http://svn.apache.org/viewvc/geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/plugin/PluginInstallerGBean.java?rev=409290&r1=409289&r2=409290&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/plugin/PluginInstallerGBean.java
(original)
+++ geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/plugin/PluginInstallerGBean.java
Wed May 24 19:53:53 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/branches/1.1/modules/system/src/java/org/apache/geronimo/system/repository/Maven1Repository.java
URL: http://svn.apache.org/viewvc/geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/repository/Maven1Repository.java?rev=409290&r1=409289&r2=409290&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/repository/Maven1Repository.java
(original)
+++ geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/repository/Maven1Repository.java
Wed May 24 19:53:53 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>
  "+



Mime
View raw message