summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoakim Erdfelt <joakime@apache.org>2007-10-10 22:15:51 +0000
committerJoakim Erdfelt <joakime@apache.org>2007-10-10 22:15:51 +0000
commit54207afb878a6f43871baa20907a4356242d065b (patch)
tree1b2db2326e7ccc50d8ef7740e90bf9aafa958dc5
parente799f29dc2144e2c8283458ef12b4b6fe0151175 (diff)
downloadarchiva-54207afb878a6f43871baa20907a4356242d065b.tar.gz
archiva-54207afb878a6f43871baa20907a4356242d065b.zip
Eliminating duplicate repositories from showing up after the conversion.
git-svn-id: https://svn.apache.org/repos/asf/maven/archiva/trunk@583630 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/DefaultArchivaConfiguration.java16
1 files changed, 9 insertions, 7 deletions
diff --git a/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/DefaultArchivaConfiguration.java b/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/DefaultArchivaConfiguration.java
index 95d85ad1d..a663dcdb5 100644
--- a/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/DefaultArchivaConfiguration.java
+++ b/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/DefaultArchivaConfiguration.java
@@ -88,7 +88,7 @@ public class DefaultArchivaConfiguration
* Configuration Listeners we've registered.
*/
private Set<ConfigurationListener> listeners = new HashSet<ConfigurationListener>();
-
+
/**
* Registry Listeners we've registered.
*/
@@ -153,6 +153,9 @@ public class DefaultArchivaConfiguration
config.addRemoteRepository( repo );
}
}
+
+ // Prevent duplicate repositories from showing up.
+ config.getRepositories().clear();
}
// Normalize the order fields in the proxy connectors.
@@ -255,7 +258,7 @@ public class DefaultArchivaConfiguration
new ConfigurationRegistryWriter().write( configuration, section );
section.save();
-
+
triggerEvent( ConfigurationEvent.SAVED );
this.configuration = processExpressions( configuration );
@@ -278,8 +281,8 @@ public class DefaultArchivaConfiguration
try
{
( (Initializable) registry ).initialize();
-
- for ( RegistryListener regListener: registryListeners )
+
+ for ( RegistryListener regListener : registryListeners )
{
addRegistryChangeListener( regListener );
}
@@ -288,7 +291,7 @@ public class DefaultArchivaConfiguration
{
throw new RegistryException( "Unable to reinitialize configuration: " + e.getMessage(), e );
}
-
+
triggerEvent( ConfigurationEvent.SAVED );
return registry.getSection( KEY + ".user" );
@@ -329,7 +332,7 @@ public class DefaultArchivaConfiguration
listeners.remove( listener );
}
-
+
public void addChangeListener( RegistryListener listener )
{
addRegistryChangeListener( listener );
@@ -352,7 +355,6 @@ public class DefaultArchivaConfiguration
}
}
-
public void initialize()
throws InitializationException
{