geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ga...@apache.org
Subject svn commit: r749701 - /geronimo/server/branches/2.1/framework/modules/geronimo-plugin/src/main/java/org/apache/geronimo/system/plugin/PluginInstallerGBean.java
Date Tue, 03 Mar 2009 19:02:57 GMT
Author: gawor
Date: Tue Mar  3 19:02:57 2009
New Revision: 749701

URL: http://svn.apache.org/viewvc?rev=749701&view=rev
Log:
Warn instead of failing on bad repos. Based on patch from Ivan (GERONIMO-4547)

Modified:
    geronimo/server/branches/2.1/framework/modules/geronimo-plugin/src/main/java/org/apache/geronimo/system/plugin/PluginInstallerGBean.java

Modified: geronimo/server/branches/2.1/framework/modules/geronimo-plugin/src/main/java/org/apache/geronimo/system/plugin/PluginInstallerGBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/framework/modules/geronimo-plugin/src/main/java/org/apache/geronimo/system/plugin/PluginInstallerGBean.java?rev=749701&r1=749700&r2=749701&view=diff
==============================================================================
--- geronimo/server/branches/2.1/framework/modules/geronimo-plugin/src/main/java/org/apache/geronimo/system/plugin/PluginInstallerGBean.java
(original)
+++ geronimo/server/branches/2.1/framework/modules/geronimo-plugin/src/main/java/org/apache/geronimo/system/plugin/PluginInstallerGBean.java
Tue Mar  3 19:02:57 2009
@@ -712,25 +712,25 @@
             repos.add(defaultRepository);
         }
         if (!restrictToDefaultRepository) {
-            List<String> repoLocations;
-            List<String> defaultRepoLocations;
-
             if (!instance.getSourceRepository().isEmpty()) {
-                repoLocations = instance.getSourceRepository();
-                for (String repoLocation : repoLocations) {
-                    SourceRepository repo = SourceRepositoryFactory.getSourceRepository(repoLocation);
-                    repos.add(repo);
-                }
+                addRepos(repos, instance.getSourceRepository());
             } 
             
             //always add the default repository location no matter if the plugin instance
contains source-repository.
-            defaultRepoLocations = pluginsToInstall.getDefaultRepository();
-            for (String defaultRepoLocation : defaultRepoLocations) {
-                SourceRepository repo = SourceRepositoryFactory.getSourceRepository(defaultRepoLocation);
+            addRepos(repos, pluginsToInstall.getDefaultRepository());
+        }
+        return repos;
+    }
+
+    private void addRepos(List<SourceRepository> repos, List<String> repoLocations)
{
+        for (String repoLocation : repoLocations) {
+            try {
+                SourceRepository repo = SourceRepositoryFactory.getSourceRepository(repoLocation);
                 repos.add(repo);
+            } catch (IllegalStateException e) {
+                log.warn("Invalid repository: " + repoLocation, e);
             }
         }
-        return repos;
     }
 
     /**



Mime
View raw message