You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@archiva.apache.org by br...@apache.org on 2007/08/03 16:17:01 UTC

svn commit: r562474 [1/2] - in /maven/archiva/trunk: archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/ archiva-base/archiva-configuration/src/main/mdo/ archiva-base/archiva-configuration/src/test/conf/ archiva-bas...

Author: brett
Date: Fri Aug  3 07:16:58 2007
New Revision: 562474

URL: http://svn.apache.org/viewvc?view=rev&rev=562474
Log:
[MRM-430] configuration adjustments and tests

Added:
    maven/archiva/trunk/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/ConfigurationRuntimeException.java   (with props)
    maven/archiva/trunk/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/IndeterminateConfigurationException.java   (with props)
    maven/archiva/trunk/archiva-base/archiva-configuration/src/test/conf/archiva-0.9.xml   (with props)
    maven/archiva/trunk/archiva-base/archiva-configuration/src/test/conf/autodetect-v1.xml   (with props)
    maven/archiva/trunk/archiva-base/archiva-configuration/src/test/conf/conf-base.xml   (with props)
    maven/archiva/trunk/archiva-base/archiva-configuration/src/test/conf/conf-user.xml   (with props)
Removed:
    maven/archiva/trunk/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/ConfigurationUpgrade.java
    maven/archiva/trunk/archiva-base/archiva-configuration/src/test/conf/with-proxied-repos.xml
Modified:
    maven/archiva/trunk/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/ArchivaConfiguration.java
    maven/archiva/trunk/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/DefaultArchivaConfiguration.java
    maven/archiva/trunk/archiva-base/archiva-configuration/src/main/mdo/configuration.mdo
    maven/archiva/trunk/archiva-base/archiva-configuration/src/test/conf/repository-manager.xml
    maven/archiva/trunk/archiva-base/archiva-configuration/src/test/java/org/apache/maven/archiva/configuration/ArchivaConfigurationTest.java
    maven/archiva/trunk/archiva-base/archiva-configuration/src/test/resources/org/apache/maven/archiva/configuration/ArchivaConfigurationTest.xml
    maven/archiva/trunk/archiva-base/archiva-repository-layer/src/test/resources/org/apache/maven/archiva/repository/scanner/RepositoryContentConsumerUtilTest.xml
    maven/archiva/trunk/archiva-database/src/test/resources/org/apache/maven/archiva/database/updater/DatabaseConsumersTest.xml
    maven/archiva/trunk/archiva-database/src/test/resources/org/apache/maven/archiva/database/updater/DatabaseUpdaterTest.xml
    maven/archiva/trunk/archiva-reporting/archiva-artifact-reports/src/test/resources/META-INF/plexus/components.xml
    maven/archiva/trunk/archiva-scheduled/src/test/resources/org/apache/maven/archiva/scheduled/executors/ArchivaDatabaseUpdateTaskExecutorTest.xml
    maven/archiva/trunk/archiva-scheduled/src/test/resources/org/apache/maven/archiva/scheduled/executors/ArchivaRepositoryScanningTaskExecutorTest.xml
    maven/archiva/trunk/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/ConfigureAction.java
    maven/archiva/trunk/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/ConfigureProxyConnectorAction.java
    maven/archiva/trunk/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/database/DatabaseAction.java
    maven/archiva/trunk/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/networkproxies/ConfigureNetworkProxyAction.java
    maven/archiva/trunk/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/ConfigureRepositoryAction.java
    maven/archiva/trunk/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/scanning/RepositoryScanningAction.java
    maven/archiva/trunk/archiva-web/archiva-webapp/src/main/resources/META-INF/plexus/application.xml

Modified: maven/archiva/trunk/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/ArchivaConfiguration.java
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/ArchivaConfiguration.java?view=diff&rev=562474&r1=562473&r2=562474
==============================================================================
--- maven/archiva/trunk/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/ArchivaConfiguration.java (original)
+++ maven/archiva/trunk/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/ArchivaConfiguration.java Fri Aug  3 07:16:58 2007
@@ -27,8 +27,8 @@
  */
 public interface ArchivaConfiguration
 {
-    public static final String ROLE = ArchivaConfiguration.class.getName();
-    
+    String ROLE = ArchivaConfiguration.class.getName();
+
     /**
      * Get the configuration.
      *
@@ -42,9 +42,11 @@
      * @param configuration the configuration to save
      * @throws org.codehaus.plexus.registry.RegistryException
      *          if there is a problem saving the registry data
+     * @throws IndeterminateConfigurationException
+     *          if the configuration cannot be saved because it was read from two sources
      */
     void save( Configuration configuration )
-        throws RegistryException;
+        throws RegistryException, IndeterminateConfigurationException;
 
     /**
      * Add a change listener so that registry changes are propogated.
@@ -52,6 +54,5 @@
      * @param listener the listener
      */
     void addChangeListener( RegistryListener listener );
-    
 }
 

Added: maven/archiva/trunk/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/ConfigurationRuntimeException.java
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/ConfigurationRuntimeException.java?view=auto&rev=562474
==============================================================================
--- maven/archiva/trunk/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/ConfigurationRuntimeException.java (added)
+++ maven/archiva/trunk/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/ConfigurationRuntimeException.java Fri Aug  3 07:16:58 2007
@@ -0,0 +1,32 @@
+package org.apache.maven.archiva.configuration;
+
+/*
+ * 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.
+ */
+
+/**
+ * Unrecoverable exception in the configuration mechanism that is the result of a programming error.
+ */
+public class ConfigurationRuntimeException
+    extends RuntimeException
+{
+    public ConfigurationRuntimeException( String msg, Throwable cause )
+    {
+        super( msg, cause );
+    }
+}

Propchange: maven/archiva/trunk/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/ConfigurationRuntimeException.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: maven/archiva/trunk/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/DefaultArchivaConfiguration.java
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/DefaultArchivaConfiguration.java?view=diff&rev=562474&r1=562473&r2=562474
==============================================================================
--- maven/archiva/trunk/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/DefaultArchivaConfiguration.java (original)
+++ maven/archiva/trunk/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/DefaultArchivaConfiguration.java Fri Aug  3 07:16:58 2007
@@ -19,6 +19,7 @@
  * under the License.
  */
 
+import org.apache.commons.io.FileUtils;
 import org.apache.maven.archiva.configuration.io.registry.ConfigurationRegistryReader;
 import org.apache.maven.archiva.configuration.io.registry.ConfigurationRegistryWriter;
 import org.codehaus.plexus.logging.AbstractLogEnabled;
@@ -30,10 +31,27 @@
 import org.codehaus.plexus.registry.commons.CommonsConfigurationRegistry;
 import org.codehaus.plexus.util.StringUtils;
 
+import java.io.File;
+import java.io.IOException;
 import java.util.Iterator;
 
 /**
  * Implementation of configuration holder that retrieves it from the registry.
+ * <p/>
+ * The registry layers and merges the 2 configuration files: user, and application server.
+ * <p/>
+ * Instead of relying on the model defaults, if the registry is empty a default configuration file is loaded and
+ * applied from a resource. The defaults are not loaded into the registry as the lists (eg repositories) could no longer
+ * be removed if that was the case.
+ * <p/>
+ * When saving the configuration, it is saved to the location it was read from. If it was read from the defaults, it
+ * will be saved to the user location.
+ * However, if the configuration contains information from both sources, an exception is raised as this is currently
+ * unsupported. The reason for this is that it is not possible to identify where to re-save elements, and can result
+ * in list configurations (eg repositories) becoming inconsistent.
+ * <p/>
+ * If the configuration is outdated, it will be upgraded when it is loaded. This is done by checking the version flag
+ * before reading it from the registry.
  *
  * @plexus.component role="org.apache.maven.archiva.configuration.ArchivaConfiguration"
  */
@@ -49,17 +67,22 @@
     private Registry registry;
 
     /**
-     * @plexus.requirement
-     */
-    private ConfigurationUpgrade upgrader;
-
-    /**
      * The configuration that has been converted.
      */
     private Configuration configuration;
 
     private static final String KEY = "org.apache.maven.archiva";
 
+    /**
+     * @plexus.configuration default-value="${user.home}/.m2/archiva.xml"
+     */
+    private String userConfigFilename;
+
+    public String getFilteredUserConfigFilename()
+    {
+        return StringUtils.replace( userConfigFilename, "${user.home}", System.getProperty( "user.home" + "" ) );
+    }
+
     public synchronized Configuration getConfiguration()
     {
         if ( configuration == null )
@@ -71,26 +94,19 @@
 
     private Configuration load()
     {
-        if ( !upgrader.hasPerformed() )
+        // TODO: should this be the same as section? make sure unnamed sections still work (eg, sys properties)
+        Registry subset = registry.getSubset( KEY );
+        if ( subset.getString( "version" ) == null )
         {
-            upgrader.performUpgrade();
-            
-            // HACK: This would be so much easier with a registry.reload() method.
-            if ( registry instanceof CommonsConfigurationRegistry )
+            // a little autodetection of v1, even if version is omitted (this was previously allowed)
+            if ( subset.getSubset( "repositoryScanning" ).isEmpty() )
             {
-                try
-                {
-                    ( (CommonsConfigurationRegistry) registry ).initialize();
-                }
-                catch ( InitializationException e )
-                {
-                    getLogger().error( "Unable to reinitialize the registry: " + e.getMessage(), e );
-                }
+                // only for empty, or v < 1
+                subset = readDefaultConfiguration();
             }
         }
 
-        // TODO: should this be the same as section? make sure unnamed sections still work (eg, sys properties)
-        Configuration config = new ConfigurationRegistryReader().read( registry.getSubset( KEY ) );
+        Configuration config = new ConfigurationRegistryReader().read( subset );
 
         // TODO: for commons-configuration 1.3 only
         for ( Iterator i = config.getRepositories().iterator(); i.hasNext(); )
@@ -98,24 +114,76 @@
             RepositoryConfiguration c = (RepositoryConfiguration) i.next();
             c.setUrl( removeExpressions( c.getUrl() ) );
         }
-
         return config;
     }
 
+    private Registry readDefaultConfiguration()
+    {
+        // if it contains some old configuration, remove it (Archiva 0.9)
+        registry.removeSubset( KEY );
+
+        try
+        {
+            registry.addConfigurationFromResource( "org/apache/maven/archiva/configuration/default-archiva.xml", KEY );
+        }
+        catch ( RegistryException e )
+        {
+            throw new ConfigurationRuntimeException(
+                "Fatal error: Unable to find the built-in default configuration and load it into the registry", e );
+        }
+        return registry.getSubset( KEY );
+    }
+
     public void save( Configuration configuration )
-        throws RegistryException
+        throws RegistryException, IndeterminateConfigurationException
     {
         Registry section = registry.getSection( KEY + ".user" );
         if ( section == null )
         {
             section = registry.getSection( KEY + ".base" );
+            if ( section == null )
+            {
+                section = createDefaultConfigurationFile();
+            }
+        }
+        else if ( registry.getSection( KEY + ".base" ) != null )
+        {
+            throw new IndeterminateConfigurationException(
+                "Configuration can not be saved when it is loaded from two sources" );
         }
+
         new ConfigurationRegistryWriter().write( configuration, section );
         section.save();
 
         this.configuration = configuration;
     }
 
+    private Registry createDefaultConfigurationFile()
+        throws RegistryException
+    {
+        // TODO: may not be needed under commons-configuration 1.4 - check
+        File file = new File( getFilteredUserConfigFilename() );
+        try
+        {
+            FileUtils.writeStringToFile( file, "<configuration/>", "UTF-8" );
+        }
+        catch ( IOException e )
+        {
+            throw new RegistryException( "Unable to create configuration file: " + e.getMessage(), e );
+        }
+
+        try
+        {
+            ( (CommonsConfigurationRegistry) registry ).initialize();
+        }
+        catch ( InitializationException e )
+        {
+            throw new RegistryException( "Unable to reinitialize configuration: " + e.getMessage(), e );
+        }
+
+        return registry.getSection( KEY + ".user" );
+    }
+
     public void addChangeListener( RegistryListener listener )
     {
         Registry section = registry.getSection( KEY + ".user" );
@@ -148,10 +216,10 @@
 
     private String removeExpressions( String directory )
     {
-        String value = StringUtils.replace( directory, "${appserver.base}", registry.getString( "appserver.base",
-                                                                                                "${appserver.base}" ) );
-        value = StringUtils.replace( value, "${appserver.home}", registry.getString( "appserver.home",
-                                                                                     "${appserver.home}" ) );
+        String value = StringUtils.replace( directory, "${appserver.base}",
+                                            registry.getString( "appserver.base", "${appserver.base}" ) );
+        value = StringUtils.replace( value, "${appserver.home}",
+                                     registry.getString( "appserver.home", "${appserver.home}" ) );
         return value;
     }
 

Added: maven/archiva/trunk/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/IndeterminateConfigurationException.java
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/IndeterminateConfigurationException.java?view=auto&rev=562474
==============================================================================
--- maven/archiva/trunk/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/IndeterminateConfigurationException.java (added)
+++ maven/archiva/trunk/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/IndeterminateConfigurationException.java Fri Aug  3 07:16:58 2007
@@ -0,0 +1,32 @@
+package org.apache.maven.archiva.configuration;
+
+/*
+ * 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.
+ */
+
+/**
+ * Occurs when the configuration is stored in two locations and the save location can not be determined.
+ */
+public class IndeterminateConfigurationException
+    extends Exception
+{
+    public IndeterminateConfigurationException( String message )
+    {
+        super( message );
+    }
+}

Propchange: maven/archiva/trunk/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/IndeterminateConfigurationException.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: maven/archiva/trunk/archiva-base/archiva-configuration/src/main/mdo/configuration.mdo
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-base/archiva-configuration/src/main/mdo/configuration.mdo?view=diff&rev=562474&r1=562473&r2=562474
==============================================================================
--- maven/archiva/trunk/archiva-base/archiva-configuration/src/main/mdo/configuration.mdo (original)
+++ maven/archiva/trunk/archiva-base/archiva-configuration/src/main/mdo/configuration.mdo Fri Aug  3 07:16:58 2007
@@ -33,75 +33,75 @@
     <class rootElement="true" xml.tagName="configuration">
       <name>Configuration</name>
       <version>1.0.0+</version>
-      <fields>
-        <field>
-          <name>version</name>
-          <version>1.0.0+</version>
-          <type>String</type>
-          <required>true</required>
-          <description>This is the version of the configuration format.</description>
+      <fields>
+        <field>
+          <name>version</name>
+          <version>1.0.0+</version>
+          <type>String</type>
+          <required>true</required>
+          <description>This is the version of the configuration format.</description>
         </field>
         <field>
           <name>repositories</name>
           <version>1.0.0+</version>
           <association>
             <type>RepositoryConfiguration</type>
-            <multiplicity>*</multiplicity>
-          </association>
+            <multiplicity>*</multiplicity>
+          </association>
           <description>The list of repositories that this archiva instance uses.</description>
-        </field>
-        <field>
-          <name>proxyConnectors</name>
-          <version>1.0.0+</version>
-          <association>
-            <type>ProxyConnectorConfiguration</type>
-            <multiplicity>*</multiplicity>
-          </association>
-          <description>The list of proxy connectors for this archiva instance.</description>
-        </field>
+        </field>
+        <field>
+          <name>proxyConnectors</name>
+          <version>1.0.0+</version>
+          <association>
+            <type>ProxyConnectorConfiguration</type>
+            <multiplicity>*</multiplicity>
+          </association>
+          <description>The list of proxy connectors for this archiva instance.</description>
+        </field>
         <!-- To be introduced later.
-        <field>
-          <name>syncConnectors</name>
-          <version>1.0.0+</version>
-          <association>
-            <type>SyncConnectorConfiguration</type>
-            <multiplicity>*</multiplicity>
-          </association>
-          <description>The list of sync connectors for this archiva instance.</description>
-        </field>
-           -->
+        <field>
+          <name>syncConnectors</name>
+          <version>1.0.0+</version>
+          <association>
+            <type>SyncConnectorConfiguration</type>
+            <multiplicity>*</multiplicity>
+          </association>
+          <description>The list of sync connectors for this archiva instance.</description>
+        </field>
+           -->
         <field>
           <name>networkProxies</name>
           <version>1.0.0+</version>
           <association>
-            <type>NetworkProxyConfiguration</type>
+            <type>NetworkProxyConfiguration</type>
             <multiplicity>*</multiplicity>
           </association>
-          <description>
-          	The list of network proxies to use for outgoing requests.
+          <description>
+            The list of network proxies to use for outgoing requests.
+          </description>
+        </field>
+        <field>
+          <name>repositoryScanning</name>
+          <version>1.0.0+</version>
+          <association>
+            <type>RepositoryScanningConfiguration</type>
+            <multiplicity>1</multiplicity>
+          </association>
+          <description>
+            The repository scanning configuration.
+          </description>
+        </field>
+        <field>
+          <name>databaseScanning</name>
+          <version>1.0.0+</version>
+          <association>
+            <type>DatabaseScanningConfiguration</type>
+            <multiplicity>1</multiplicity>
+          </association>
+          <description>
+            The database scanning configuration.
           </description>
-        </field>
-        <field>
-          <name>repositoryScanning</name>
-          <version>1.0.0+</version>
-          <association>
-            <type>RepositoryScanningConfiguration</type>
-            <multiplicity>1</multiplicity>
-          </association>
-          <description>
-            The repository scanning configuration.
-          </description>
-        </field>
-        <field>
-          <name>databaseScanning</name>
-          <version>1.0.0+</version>
-          <association>
-            <type>DatabaseScanningConfiguration</type>
-            <multiplicity>1</multiplicity>
-          </association>
-          <description>
-            The database scanning configuration.
-          </description>
         </field>
         <field>
           <name>webapp</name>
@@ -113,129 +113,129 @@
           <description>
             The webapp configuration.
           </description>
-        </field>
-      </fields>
-      <codeSegments>
-        <codeSegment>
-          <version>1.0.0+</version>
-          <code><![CDATA[
-    /**
-     * Find {@link RepositoryConfiguration} with specified Id.
-     *  
-     * @param id the id of the repository to find.
-     * @return the repository configuration.
-     */
-    public RepositoryConfiguration findRepositoryById( String id )
-    {
-        // null id = null repo config.
-        if ( id == null )
-        {
-            return null;
-        }
-
-        // empty id = null repo config.
-        if ( id.trim().length() <= 0 )
-        {
-            return null;
-        }
-        
-        return (RepositoryConfiguration) createRepositoryMap().get( id );
-    }
-
-    /**
-     * Create a RepositoryMap of the current repositories.
-     * 
-     * @return the map of repository id's, to repository configurations.
-     */
-    public java.util.Map createRepositoryMap()
-    {
-        java.util.Map ret = new java.util.HashMap();
-        
-        // null repository list = null repo config.
-        if ( getRepositories() == null )
-        {
-            return ret;
-        }
-
-        // empty repository list == null repo config.
-        if ( getRepositories().isEmpty() )
-        {
-            return ret;
-        }
-        
-        java.util.Iterator it = getRepositories().iterator();
-        while ( it.hasNext() )
-        {
-            RepositoryConfiguration repoConfig = (RepositoryConfiguration) it.next();
-            ret.put( repoConfig.getId(), repoConfig );
-        }
-        
-        return ret;
-    }
-          ]]></code>
-        </codeSegment>
+        </field>
+      </fields>
+      <codeSegments>
+        <codeSegment>
+          <version>1.0.0+</version>
+          <code><![CDATA[
+    /**
+     * Find {@link RepositoryConfiguration} with specified Id.
+     *  
+     * @param id the id of the repository to find.
+     * @return the repository configuration.
+     */
+    public RepositoryConfiguration findRepositoryById( String id )
+    {
+        // null id = null repo config.
+        if ( id == null )
+        {
+            return null;
+        }
+
+        // empty id = null repo config.
+        if ( id.trim().length() <= 0 )
+        {
+            return null;
+        }
+        
+        return (RepositoryConfiguration) createRepositoryMap().get( id );
+    }
+
+    /**
+     * Create a RepositoryMap of the current repositories.
+     * 
+     * @return the map of repository id's, to repository configurations.
+     */
+    public java.util.Map createRepositoryMap()
+    {
+        java.util.Map ret = new java.util.HashMap();
+        
+        // null repository list = null repo config.
+        if ( getRepositories() == null )
+        {
+            return ret;
+        }
+
+        // empty repository list == null repo config.
+        if ( getRepositories().isEmpty() )
+        {
+            return ret;
+        }
+        
+        java.util.Iterator it = getRepositories().iterator();
+        while ( it.hasNext() )
+        {
+            RepositoryConfiguration repoConfig = (RepositoryConfiguration) it.next();
+            ret.put( repoConfig.getId(), repoConfig );
+        }
+        
+        return ret;
+    }
+          ]]></code>
+        </codeSegment>
       </codeSegments>
-    </class>
-    
-    <!-- 
-       ____                      _ _
-      |  _ \ ___ _ __   ___  ___(_) |_ ___  _ __ _   _
-      | |_) / _ \ '_ \ / _ \/ __| | __/ _ \| '__| | | |
-      |  _ <  __/ |_) | (_) \__ \ | || (_) | |  | |_| |
-      |_| \_\___| .__/ \___/|___/_|\__\___/|_|   \__, |
-                |_|                              |___/
-    
-      -->
-    
+    </class>
+
+    <!-- 
+     ____                      _ _
+    |  _ \ ___ _ __   ___  ___(_) |_ ___  _ __ _   _
+    | |_) / _ \ '_ \ / _ \/ __| | __/ _ \| '__| | | |
+    |  _ <  __/ |_) | (_) \__ \ | || (_) | |  | |_| |
+    |_| \_\___| .__/ \___/|___/_|\__\___/|_|   \__, |
+              |_|                              |___/
+
+    -->
+
     <class>
       <name>RepositoryConfiguration</name>
       <version>1.0.0+</version>
       <fields>
-        <field>
-          <name>id</name>
-          <version>1.0.0+</version>
-          <type>String</type>
-          <required>true</required>
-          <description>
-            The repository identifier.
-          </description>
-        </field>
-        <field>
-          <name>name</name>
-          <version>1.0.0+</version>
-          <type>String</type>
-          <required>true</required>
-          <description>
-            The descriptive name of the repository.
-          </description>
-        </field>
-        <field>
-          <name>url</name>
-          <version>1.0.0+</version>
-          <type>String</type>
-          <required>true</required>
-          <description>
-            The URL for this repository.
-          </description>
-        </field>
-        <field>
-          <name>layout</name>
-          <version>1.0.0+</version>
-          <type>String</type>
-          <required>true</required>
-          <description>
-            The layout of the repository. Valid values are "default" and "legacy".
-          </description>
-          <!-- TODO: should be able to detect this from the repository (perhaps by metadata at the root) -->
-          <defaultValue>default</defaultValue>
-        </field>
-        <field>
-          <name>releases</name>
-          <version>1.0.0+</version>
-          <type>boolean</type>
-          <description>True if this repository contains release versioned artifacts.</description>
-          <defaultValue>true</defaultValue>
-        </field>
+        <field>
+          <name>id</name>
+          <version>1.0.0+</version>
+          <type>String</type>
+          <required>true</required>
+          <description>
+            The repository identifier.
+          </description>
+        </field>
+        <field>
+          <name>name</name>
+          <version>1.0.0+</version>
+          <type>String</type>
+          <required>true</required>
+          <description>
+            The descriptive name of the repository.
+          </description>
+        </field>
+        <field>
+          <name>url</name>
+          <version>1.0.0+</version>
+          <type>String</type>
+          <required>true</required>
+          <description>
+            The URL for this repository.
+          </description>
+        </field>
+        <field>
+          <name>layout</name>
+          <version>1.0.0+</version>
+          <type>String</type>
+          <required>true</required>
+          <description>
+            The layout of the repository. Valid values are "default" and "legacy".
+          </description>
+          <!-- TODO: should be able to detect this from the repository (perhaps by metadata at the root) -->
+          <defaultValue>default</defaultValue>
+        </field>
+        <field>
+          <name>releases</name>
+          <version>1.0.0+</version>
+          <type>boolean</type>
+          <description>True if this repository contains release versioned artifacts.</description>
+          <defaultValue>true</defaultValue>
+        </field>
         <field>
           <name>snapshots</name>
           <version>1.0.0+</version>
@@ -249,225 +249,225 @@
           <type>boolean</type>
           <description>True if this repository should be indexed.</description>
           <defaultValue>true</defaultValue>
-        </field>
-        <field>
-          <name>indexDir</name>
-          <version>1.0.0+</version>
-          <type>String</type>
-          <description>
-            The directory for the indexes of this repository.
-          </description>
-        </field>
-        <field>
-          <name>refreshCronExpression</name>
-          <version>1.0.0+</version>
-          <type>String</type>
-          <description>
-          	When to run the refresh task. 
-          	Default is every hour
-          </description>
-          <defaultValue>0 0 * * * ?</defaultValue>
-        </field>
-      </fields>
-      <codeSegments>
-        <codeSegment>
-          <version>1.0.0+</version>
-          <code><![CDATA[
-    /**
-     * Utility method to help determine if configuration refers to a remote repository.
-     * 
-     * @return true if configuration belongs to a remote repository. 
-     *      (note: false does not automatically mean this is a managed repository,
-     *      you must use {@link #isManaged()} to test for that.)
-     */
-    public boolean isRemote()
-    {
-        if ( this.url == null )
-        {
-            return false;
-        }
-
-        return !this.url.startsWith( "file" );
-    }
-
-    /**
-     * Utility method to help determine if configuration refers to a managed repository.
-     * 
-     * @return true if configuration belongs to a managed repository. 
-     *      (note: false does not automatically mean this is a remote repository,
-     *      you must use {@link #isRemote()} to test for that.)
-     */
-    public boolean isManaged()
-    {
-        if ( this.url == null )
-        {
-            return false;
-        }
-
-        return this.url.startsWith( "file" );
-    }          
-          ]]></code>
-        </codeSegment>
+        </field>
+        <field>
+          <name>indexDir</name>
+          <version>1.0.0+</version>
+          <type>String</type>
+          <description>
+            The directory for the indexes of this repository.
+          </description>
+        </field>
+        <field>
+          <name>refreshCronExpression</name>
+          <version>1.0.0+</version>
+          <type>String</type>
+          <description>
+            When to run the refresh task.
+            Default is every hour
+          </description>
+          <defaultValue>0 0 * * * ?</defaultValue>
+        </field>
+      </fields>
+      <codeSegments>
+        <codeSegment>
+          <version>1.0.0+</version>
+          <code><![CDATA[
+    /**
+     * Utility method to help determine if configuration refers to a remote repository.
+     * 
+     * @return true if configuration belongs to a remote repository. 
+     *      (note: false does not automatically mean this is a managed repository,
+     *      you must use {@link #isManaged()} to test for that.)
+     */
+    public boolean isRemote()
+    {
+        if ( this.url == null )
+        {
+            return false;
+        }
+
+        return !this.url.startsWith( "file" );
+    }
+
+    /**
+     * Utility method to help determine if configuration refers to a managed repository.
+     * 
+     * @return true if configuration belongs to a managed repository. 
+     *      (note: false does not automatically mean this is a remote repository,
+     *      you must use {@link #isRemote()} to test for that.)
+     */
+    public boolean isManaged()
+    {
+        if ( this.url == null )
+        {
+            return false;
+        }
+
+        return this.url.startsWith( "file" );
+    }          
+          ]]></code>
+        </codeSegment>
+      </codeSegments>
+    </class>
+
+    <!-- 
+      ____                            _
+     / ___|___  _ __  _ __   ___  ___| |_ ___  _ __ ___
+    | |   / _ \| '_ \| '_ \ / _ \/ __| __/ _ \| '__/ __|
+    | |__| (_) | | | | | | |  __/ (__| || (_) | |  \__ \
+     \____\___/|_| |_|_| |_|\___|\___|\__\___/|_|  |___/
+
+    -->
+
+    <class>
+      <name>AbstractRepositoryConnectorConfiguration</name>
+      <abstract>true</abstract>
+      <version>1.0.0+</version>
+      <fields>
+        <field>
+          <name>sourceRepoId</name>
+          <version>1.0.0+</version>
+          <type>String</type>
+          <required>true</required>
+          <description>
+            The Repository Source for this connector.
+          </description>
+        </field>
+        <field>
+          <name>targetRepoId</name>
+          <version>1.0.0+</version>
+          <type>String</type>
+          <required>true</required>
+          <description>
+            The Repository Target for this connector.
+          </description>
+        </field>
+        <field>
+          <name>proxyId</name>
+          <version>1.0.0+</version>
+          <type>String</type>
+          <description>
+            The network proxy ID to use for this connector.
+          </description>
+        </field>
+        <field>
+          <name>blackListPatterns</name>
+          <version>1.0.0+</version>
+          <association>
+            <type>String</type>
+            <multiplicity>*</multiplicity>
+          </association>
+          <description>
+            The list of blacklisted patterns for this connector.
+          </description>
+        </field>
+        <field>
+          <name>whiteListPatterns</name>
+          <version>1.0.0+</version>
+          <association>
+            <type>String</type>
+            <multiplicity>*</multiplicity>
+          </association>
+          <description>
+            The list of whitelisted patterns for this connector.
+          </description>
+        </field>
+        <field>
+          <name>policies</name>
+          <version>1.0.0+</version>
+          <type>Map</type>
+          <description>Policy configuration for the connector.</description>
+          <association xml.mapStyle="inline">
+            <type>String</type>
+            <multiplicity>*</multiplicity>
+          </association>
+        </field>
+        <field>
+          <name>properties</name>
+          <version>1.0.0+</version>
+          <type>Map</type>
+          <description>Configuration for the connector.</description>
+          <association xml.mapStyle="inline">
+            <type>String</type>
+            <multiplicity>*</multiplicity>
+          </association>
+        </field>
+      </fields>
+      <codeSegments>
+        <codeSegment>
+          <version>1.0.0+</version>
+          <code><![CDATA[
+    /**
+     * Obtain a specific policy from the underlying connector.
+     * 
+     * @param policyId the policy id to fetch.
+     * @param defaultValue the default value for the policy id.
+     * @return the configured policy value (or default value if not found).
+     */
+    public String getPolicy( String policyId, String defaultValue )
+    {
+        if ( this.getPolicies() == null )
+        {
+            return null;
+        }
+
+        Object value = this.getPolicies().get( policyId );
+
+        if ( value == null )
+        {
+            return defaultValue;
+        }
+
+        return (String) value;
+    }
+          ]]></code>
+        </codeSegment>
       </codeSegments>
-    </class>
-    
-    <!-- 
-        ____                            _
-       / ___|___  _ __  _ __   ___  ___| |_ ___  _ __ ___
-      | |   / _ \| '_ \| '_ \ / _ \/ __| __/ _ \| '__/ __|
-      | |__| (_) | | | | | | |  __/ (__| || (_) | |  \__ \
-       \____\___/|_| |_|_| |_|\___|\___|\__\___/|_|  |___/
-    
-      -->
-    
-    <class>
-      <name>AbstractRepositoryConnectorConfiguration</name>
-      <abstract>true</abstract>
-      <version>1.0.0+</version>
-      <fields>
-        <field>
-          <name>sourceRepoId</name>
-          <version>1.0.0+</version>
-          <type>String</type>
-          <required>true</required>
-          <description>
-            The Repository Source for this connector.
-          </description>
-        </field>
-        <field>
-          <name>targetRepoId</name>
-          <version>1.0.0+</version>
-          <type>String</type>
-          <required>true</required>
-          <description>
-            The Repository Target for this connector.
-          </description>
-        </field>
-        <field>
-          <name>proxyId</name>
-          <version>1.0.0+</version>
-          <type>String</type>
-          <description>
-            The network proxy ID to use for this connector.
-          </description>
-        </field>
-        <field>
-          <name>blackListPatterns</name>
-          <version>1.0.0+</version>
-          <association>
-            <type>String</type>
-            <multiplicity>*</multiplicity>
-          </association>
-          <description>
-            The list of blacklisted patterns for this connector.
-          </description>
-        </field>
-        <field>
-          <name>whiteListPatterns</name>
-          <version>1.0.0+</version>
-          <association>
-            <type>String</type>
-            <multiplicity>*</multiplicity>
-          </association>
-          <description>
-            The list of whitelisted patterns for this connector.
-          </description>
-        </field>
-        <field>
-          <name>policies</name>
-          <version>1.0.0+</version>
-          <type>Map</type>
-          <description>Policy configuration for the connector.</description>
-          <association xml.mapStyle="inline">
-            <type>String</type>
-            <multiplicity>*</multiplicity>
-          </association>
-        </field>        
-        <field>
-          <name>properties</name>
-          <version>1.0.0+</version>
-          <type>Map</type>
-          <description>Configuration for the connector.</description>
-          <association xml.mapStyle="inline">
-            <type>String</type>
-            <multiplicity>*</multiplicity>
-          </association>
-        </field>
-      </fields>
-      <codeSegments>
-        <codeSegment>
-          <version>1.0.0+</version>
-          <code><![CDATA[
-    /**
-     * Obtain a specific policy from the underlying connector.
-     * 
-     * @param policyId the policy id to fetch.
-     * @param defaultValue the default value for the policy id.
-     * @return the configured policy value (or default value if not found).
-     */
-    public String getPolicy( String policyId, String defaultValue )
-    {
-        if ( this.getPolicies() == null )
-        {
-            return null;
-        }
-
-        Object value = this.getPolicies().get( policyId );
-
-        if ( value == null )
-        {
-            return defaultValue;
-        }
-
-        return (String) value;
-    }
-          ]]></code>
-        </codeSegment>
-      </codeSegments>
-    </class>
-    
+    </class>
+
     <class>
       <superClass>AbstractRepositoryConnectorConfiguration</superClass>
       <name>ProxyConnectorConfiguration</name>
       <version>1.0.0+</version>
-      <fields>
-      </fields>
-      <codeSegments>
-        <codeSegment>
-          <version>1.0.0+</version>
-          <code><![CDATA[
-    /**
-     * The policy key {@link #getPolicies()} for snapshot handling.
-     * See {@link org.apache.maven.archiva.policies.SnapshotsPolicy} 
-     * for details on potential values to this policy key.
-     */
-    public static final String POLICY_SNAPSHOTS = "snapshots";
-
-    /**
-     * The policy key {@link #getPolicies()} for releases handling.
-     * See {@link org.apache.maven.archiva.policies.ReleasesPolicy}
-     * for details on potential values to this policy key.
-     */
-    public static final String POLICY_RELEASES = "releases";
-
-    /**
-     * The policy key {@link #getPolicies()} for checksum handling.
-     * See {@link org.apache.maven.archiva.policies.ChecksumPolicy}
-     * for details on potential values to this policy key.
-     */
-    public static final String POLICY_CHECKSUM = "checksum";
-
-    /**
-     * The policy key {@link #getPolicies()} for cache-failures handling.
-     * See {@link org.apache.maven.archiva.policies.CachedFailuresPolicy}
-     * for details on potential values to this policy key.
-     */
-    public static final String POLICY_CACHE_FAILURES = "cache-failures";
-          ]]></code>
-        </codeSegment>
-      </codeSegments>
-    </class>
-    
+      <fields>
+      </fields>
+      <codeSegments>
+        <codeSegment>
+          <version>1.0.0+</version>
+          <code><![CDATA[
+    /**
+     * The policy key {@link #getPolicies()} for snapshot handling.
+     * See {@link org.apache.maven.archiva.policies.SnapshotsPolicy} 
+     * for details on potential values to this policy key.
+     */
+    public static final String POLICY_SNAPSHOTS = "snapshots";
+
+    /**
+     * The policy key {@link #getPolicies()} for releases handling.
+     * See {@link org.apache.maven.archiva.policies.ReleasesPolicy}
+     * for details on potential values to this policy key.
+     */
+    public static final String POLICY_RELEASES = "releases";
+
+    /**
+     * The policy key {@link #getPolicies()} for checksum handling.
+     * See {@link org.apache.maven.archiva.policies.ChecksumPolicy}
+     * for details on potential values to this policy key.
+     */
+    public static final String POLICY_CHECKSUM = "checksum";
+
+    /**
+     * The policy key {@link #getPolicies()} for cache-failures handling.
+     * See {@link org.apache.maven.archiva.policies.CachedFailuresPolicy}
+     * for details on potential values to this policy key.
+     */
+    public static final String POLICY_CACHE_FAILURES = "cache-failures";
+          ]]></code>
+        </codeSegment>
+      </codeSegments>
+    </class>
+
     <class>
       <superClass>AbstractRepositoryConnectorConfiguration</superClass>
       <name>SyncConnectorConfiguration</name>
@@ -489,192 +489,193 @@
           <defaultValue>rsync</defaultValue>
         </field>
       </fields>
-    </class>
-    
-    <!-- 
-       ____                _
-      |  _ \ _ __ _____  _(_) ___  ___
-      | |_) | '__/ _ \ \/ / |/ _ \/ __|
-      |  __/| | | (_) >  <| |  __/\__ \
-      |_|   |_|  \___/_/\_\_|\___||___/
-    
-      -->
-    
+    </class>
+
+    <!-- 
+     ____                _
+    |  _ \ _ __ _____  _(_) ___  ___
+    | |_) | '__/ _ \ \/ / |/ _ \/ __|
+    |  __/| | | (_) >  <| |  __/\__ \
+    |_|   |_|  \___/_/\_\_|\___||___/
+
+    -->
+
     <class>
       <name>NetworkProxyConfiguration</name>
       <version>1.0.0+</version>
-      <fields>
-        <field>
-          <name>id</name>
-          <version>1.0.0+</version>
-          <type>String</type>
-          <description>
-            The ID for this proxy.
-          </description>
-        </field>
-        <field>
-          <name>protocol</name>
-          <version>1.0.0+</version>
-          <description>
-            The network protocol to use with this proxy: "http", "socks-4"
-          </description>
-          <type>String</type>
-          <required>true</required>
-          <defaultValue>http</defaultValue>
-        </field>
-        <field>
-          <name>host</name>
-          <version>1.0.0+</version>
-          <description>
-          	The proxy host.
-          </description>
-          <type>String</type>
-          <required>true</required>
-        </field>
-        <field>
-          <name>port</name>
-          <version>1.0.0+</version>
-          <description>
-          	The proxy port.
-          </description>
-          <type>int</type>
-          <defaultValue>8080</defaultValue>
-        </field>
+      <fields>
+        <field>
+          <name>id</name>
+          <version>1.0.0+</version>
+          <type>String</type>
+          <description>
+            The ID for this proxy.
+          </description>
+        </field>
+        <field>
+          <name>protocol</name>
+          <version>1.0.0+</version>
+          <description>
+            The network protocol to use with this proxy: "http", "socks-4"
+          </description>
+          <type>String</type>
+          <required>true</required>
+          <defaultValue>http</defaultValue>
+        </field>
+        <field>
+          <name>host</name>
+          <version>1.0.0+</version>
+          <description>
+            The proxy host.
+          </description>
+          <type>String</type>
+          <required>true</required>
+        </field>
+        <field>
+          <name>port</name>
+          <version>1.0.0+</version>
+          <description>
+            The proxy port.
+          </description>
+          <type>int</type>
+          <defaultValue>8080</defaultValue>
+        </field>
         <field>
           <name>username</name>
           <version>1.0.0+</version>
-          <description>
-          	The proxy user.
+          <description>
+            The proxy user.
           </description>
           <type>String</type>
         </field>
         <field>
           <name>password</name>
           <version>1.0.0+</version>
-          <description>
-          	The proxy password.
+          <description>
+            The proxy password.
           </description>
           <type>String</type>
-        </field>
+        </field>
       </fields>
-    </class>
-    
-    <!-- 
-       ____                        _
-      / ___|  ___ __ _ _ __  _ __ (_)_ __   __ _
-      \___ \ / __/ _` | '_ \| '_ \| | '_ \ / _` |
-       ___) | (_| (_| | | | | | | | | | | | (_| |
-      |____/ \___\__,_|_| |_|_| |_|_|_| |_|\__, |
-                                           |___/
-    
-      -->
-    <class>
-      <name>RepositoryScanningConfiguration</name>
-      <version>1.0.0+</version>
-      <fields>
-        <field>
-          <name>fileTypes</name>
-          <version>1.0.0+</version>
-          <required>true</required>
-          <association>
-            <type>FileType</type>
-            <multiplicity>*</multiplicity>
-          </association>
-          <description>
-            The FileTypes for the repository scanning configuration.
-          </description>
-        </field>
-        <field>
-          <name>knownContentConsumers</name>
-          <version>1.0.0+</version>
-          <required>true</required>
-          <association>
-            <type>String</type>
-            <multiplicity>*</multiplicity>
-          </association>
-          <description>
-            The list of active consumers IDs for known content.
-          </description>
-        </field>
-        <field>
-          <name>invalidContentConsumers</name>
-          <version>1.0.0+</version>
-          <required>true</required>
-          <association>
-            <type>String</type>
-            <multiplicity>*</multiplicity>
-          </association>
-          <description>
-            The list of active consumer IDs for invalid content.
-          </description>
-        </field>
-      </fields>
-    </class>
-    <class>
-      <name>FileType</name>
-      <version>1.0.0+</version>
-      <description>The FileType object</description>
-      <fields>
-        <field>
-          <name>id</name>
-          <version>1.0.0+</version>
-          <required>true</required>
-          <type>String</type>
-        </field>
-        <field>
-          <name>patterns</name>
-          <version>1.0.0+</version>
-          <required>true</required>
-          <association>
-            <type>String</type>
-            <multiplicity>*</multiplicity>
-          </association>
-        </field>
-      </fields>
-    </class>
-    <class>
-      <name>DatabaseScanningConfiguration</name>
-      <version>1.0.0+</version>
-      <description>
-        The scanning configuration for unprocessed ArchivaArtifact database objects.
-      </description>
-      <fields>
-        <field>
-          <name>cronExpression</name>
-          <version>1.0.0+</version>
-          <type>String</type>
-          <description>When to run the database scanning mechanism. Default is every two hours on the hour.</description>
-          <defaultValue>0 0 0/2 * * ?</defaultValue>
-        </field>
-        <field>
-          <name>unprocessedConsumers</name>
-          <version>1.0.0+</version>
-          <required>true</required>
-          <association>
-            <type>String</type>
-            <multiplicity>*</multiplicity>
-          </association>
-          <description>
-            The list of consumers for the unprocessed ArchivaArtifact database objects.
-          </description>
-        </field>
-        <field>
-          <name>cleanupConsumers</name>
-          <version>1.0.0+</version>
-          <required>true</required>
-          <association>
-            <type>String</type>
-            <multiplicity>*</multiplicity>
-          </association>
-          <description>
-            The list of consumers for previously processed ArchivaArtifact database 
-            objects that no longer exist on the filesystem, and might need to 
-            undergo a cleanup.
-          </description>
-        </field>
-      </fields>
-    </class>
-    
+    </class>
+
+    <!-- 
+     ____                        _
+    / ___|  ___ __ _ _ __  _ __ (_)_ __   __ _
+    \___ \ / __/ _` | '_ \| '_ \| | '_ \ / _` |
+     ___) | (_| (_| | | | | | | | | | | | (_| |
+    |____/ \___\__,_|_| |_|_| |_|_|_| |_|\__, |
+                                         |___/
+
+    -->
+    <class>
+      <name>RepositoryScanningConfiguration</name>
+      <version>1.0.0+</version>
+      <fields>
+        <field>
+          <name>fileTypes</name>
+          <version>1.0.0+</version>
+          <required>true</required>
+          <association>
+            <type>FileType</type>
+            <multiplicity>*</multiplicity>
+          </association>
+          <description>
+            The FileTypes for the repository scanning configuration.
+          </description>
+        </field>
+        <field>
+          <name>knownContentConsumers</name>
+          <version>1.0.0+</version>
+          <required>true</required>
+          <association>
+            <type>String</type>
+            <multiplicity>*</multiplicity>
+          </association>
+          <description>
+            The list of active consumers IDs for known content.
+          </description>
+        </field>
+        <field>
+          <name>invalidContentConsumers</name>
+          <version>1.0.0+</version>
+          <required>true</required>
+          <association>
+            <type>String</type>
+            <multiplicity>*</multiplicity>
+          </association>
+          <description>
+            The list of active consumer IDs for invalid content.
+          </description>
+        </field>
+      </fields>
+    </class>
+    <class>
+      <name>FileType</name>
+      <version>1.0.0+</version>
+      <description>The FileType object</description>
+      <fields>
+        <field>
+          <name>id</name>
+          <version>1.0.0+</version>
+          <required>true</required>
+          <type>String</type>
+        </field>
+        <field>
+          <name>patterns</name>
+          <version>1.0.0+</version>
+          <required>true</required>
+          <association>
+            <type>String</type>
+            <multiplicity>*</multiplicity>
+          </association>
+        </field>
+      </fields>
+    </class>
+    <class>
+      <name>DatabaseScanningConfiguration</name>
+      <version>1.0.0+</version>
+      <description>
+        The scanning configuration for unprocessed ArchivaArtifact database objects.
+      </description>
+      <fields>
+        <field>
+          <name>cronExpression</name>
+          <version>1.0.0+</version>
+          <type>String</type>
+          <description>When to run the database scanning mechanism. Default is every two hours on the hour.
+          </description>
+          <defaultValue>0 0 0/2 * * ?</defaultValue>
+        </field>
+        <field>
+          <name>unprocessedConsumers</name>
+          <version>1.0.0+</version>
+          <required>true</required>
+          <association>
+            <type>String</type>
+            <multiplicity>*</multiplicity>
+          </association>
+          <description>
+            The list of consumers for the unprocessed ArchivaArtifact database objects.
+          </description>
+        </field>
+        <field>
+          <name>cleanupConsumers</name>
+          <version>1.0.0+</version>
+          <required>true</required>
+          <association>
+            <type>String</type>
+            <multiplicity>*</multiplicity>
+          </association>
+          <description>
+            The list of consumers for previously processed ArchivaArtifact database
+            objects that no longer exist on the filesystem, and might need to
+            undergo a cleanup.
+          </description>
+        </field>
+      </fields>
+    </class>
+
     <!--    
     __        _______ ____    _    ____  ____  
     \ \      / / ____| __ )  / \  |  _ \|  _ \ 
@@ -683,7 +684,7 @@
        \_/\_/  |_____|____/_/   \_\_|   |_|    
                                                
     -->
-    
+
     <class>
       <name>WebappConfiguration</name>
       <version>1.0.0+</version>
@@ -697,11 +698,11 @@
           <version>1.0.0+</version>
           <association>
             <type>UserInterfaceOptions</type>
-          </association>          
+          </association>
         </field>
       </fields>
     </class>
-    
+
     <class>
       <name>UserInterfaceOptions</name>
       <version>1.0.0+</version>
@@ -712,20 +713,20 @@
         <field>
           <name>showFindArtifacts</name>
           <description>true if find artifacts should be enabled</description>
-          <version>1.0.0+</version>       
-          <type>boolean</type>  
+          <version>1.0.0+</version>
+          <type>boolean</type>
           <defaultValue>true</defaultValue>
         </field>
         <field>
           <name>appletFindEnabled</name>
           <description>true if applet behavior for find artifacts should be enabled</description>
-          <version>1.0.0+</version>       
-          <type>boolean</type>  
+          <version>1.0.0+</version>
+          <type>boolean</type>
           <defaultValue>true</defaultValue>
         </field>
       </fields>
     </class>
-    
+
   </classes>
 </model>
 

Added: maven/archiva/trunk/archiva-base/archiva-configuration/src/test/conf/archiva-0.9.xml
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-base/archiva-configuration/src/test/conf/archiva-0.9.xml?view=auto&rev=562474
==============================================================================
--- maven/archiva/trunk/archiva-base/archiva-configuration/src/test/conf/archiva-0.9.xml (added)
+++ maven/archiva/trunk/archiva-base/archiva-configuration/src/test/conf/archiva-0.9.xml Fri Aug  3 07:16:58 2007
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+  ~ 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.
+  -->
+
+<configuration>
+  <repositories>
+    <repository>
+      <directory>managed-repository</directory>
+      <id>local</id>
+      <name>local</name>
+    </repository>
+  </repositories>
+  <proxiedRepositories>
+    <proxiedRepository>
+      <url>http://www.ibiblio.org/maven2/</url>
+      <managedRepository>local</managedRepository>
+      <useNetworkProxy>true</useNetworkProxy>
+      <id>ibiblio</id>
+      <name>Ibiblio</name>
+    </proxiedRepository>
+    <proxiedRepository>
+      <url>http://repository.codehaus.org/</url>
+      <managedRepository>local</managedRepository>
+      <id>codehaus</id>
+      <name>Codehaus</name>
+    </proxiedRepository>
+  </proxiedRepositories>
+</configuration>

Propchange: maven/archiva/trunk/archiva-base/archiva-configuration/src/test/conf/archiva-0.9.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: maven/archiva/trunk/archiva-base/archiva-configuration/src/test/conf/autodetect-v1.xml
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-base/archiva-configuration/src/test/conf/autodetect-v1.xml?view=auto&rev=562474
==============================================================================
--- maven/archiva/trunk/archiva-base/archiva-configuration/src/test/conf/autodetect-v1.xml (added)
+++ maven/archiva/trunk/archiva-base/archiva-configuration/src/test/conf/autodetect-v1.xml Fri Aug  3 07:16:58 2007
@@ -0,0 +1,189 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+  ~ 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.
+  -->
+
+<configuration>
+  <repositories>
+    <repository>
+      <id>internal</id>
+      <name>Archiva Managed Internal Repository</name>
+      <url>file://${appserver.base}/repositories/internal</url>
+      <layout>default</layout>
+      <releases>true</releases>
+      <snapshots>false</snapshots>
+      <indexed>true</indexed>
+      <refreshCronExpression>0 0 * * ?</refreshCronExpression>
+    </repository>
+    <repository>
+      <id>snapshots</id>
+      <name>Archiva Managed Snapshot Repository</name>
+      <url>file://${appserver.base}/repositories/internal</url>
+      <layout>default</layout>
+      <releases>false</releases>
+      <snapshots>true</snapshots>
+      <indexed>true</indexed>
+      <refreshCronExpression>0 0,30 * * ?</refreshCronExpression>
+    </repository>
+    <repository>
+      <id>central</id>
+      <name>Central Repository</name>
+      <url>http://repo1.maven.org/maven2</url>
+      <layout>default</layout>
+      <releases>true</releases>
+      <snapshots>false</snapshots>
+      <indexed>false</indexed>
+    </repository>
+    <repository>
+      <id>maven2-repository.dev.java.net</id>
+      <name>Java.net Repository for Maven 2</name>
+      <url>https://maven2-repository.dev.java.net/nonav/repository</url>
+      <layout>default</layout>
+      <releases>true</releases>
+      <snapshots>false</snapshots>
+      <indexed>false</indexed>
+    </repository>
+  </repositories>
+
+  <proxyConnectors>
+    <proxyConnector>
+      <sourceRepoId>internal</sourceRepoId>
+      <targetRepoId>central</targetRepoId>
+      <proxyId/>
+      <snapshotsPolicy>disabled</snapshotsPolicy>
+      <releasePolicy>never</releasePolicy>
+      <failurePolicy>not-found</failurePolicy>
+    </proxyConnector>
+    <proxyConnector>
+      <sourceRepoId>internal</sourceRepoId>
+      <targetRepoId>maven2-repository.dev.java.net</targetRepoId>
+      <proxyId/>
+      <snapshotsPolicy>disabled</snapshotsPolicy>
+      <releasePolicy>never</releasePolicy>
+      <failurePolicy>not-found</failurePolicy>
+      <whiteListPatterns>
+        <whiteListPattern>javax/**</whiteListPattern>
+      </whiteListPatterns>
+    </proxyConnector>
+  </proxyConnectors>
+
+  <networkProxies>
+    <networkProxy>
+      <id>example</id>
+      <protocol>http</protocol>
+      <host>proxy.mycompany.com</host>
+      <port>8080</port>
+      <username>myself</username>
+      <password>mypass</password>
+    </networkProxy>
+  </networkProxies>
+
+  <repositoryScanning>
+    <fileTypes>
+      <fileType>
+        <id>artifacts</id>
+        <patterns>
+          <pattern>**/*.pom</pattern>
+          <pattern>**/*.jar</pattern>
+          <pattern>**/*.ear</pattern>
+          <pattern>**/*.war</pattern>
+          <pattern>**/*.car</pattern>
+          <pattern>**/*.sar</pattern>
+          <pattern>**/*.mar</pattern>
+          <pattern>**/*.rar</pattern>
+          <pattern>**/*.dtd</pattern>
+          <pattern>**/*.tld</pattern>
+          <pattern>**/*.tar.gz</pattern>
+          <pattern>**/*.tar.bz2</pattern>
+          <pattern>**/*.zip</pattern>
+        </patterns>
+      </fileType>
+      <fileType>
+        <id>indexable-content</id>
+        <patterns>
+          <pattern>**/*.txt</pattern>
+          <pattern>**/*.TXT</pattern>
+          <pattern>**/*.block</pattern>
+          <pattern>**/*.config</pattern>
+          <pattern>**/*.pom</pattern>
+          <pattern>**/*.xml</pattern>
+          <pattern>**/*.xsd</pattern>
+          <pattern>**/*.dtd</pattern>
+          <pattern>**/*.tld</pattern>
+        </patterns>
+      </fileType>
+      <fileType>
+        <id>auto-remove</id>
+        <patterns>
+          <pattern>**/*.bak</pattern>
+          <pattern>**/*~</pattern>
+          <pattern>**/*-</pattern>
+        </patterns>
+      </fileType>
+      <fileType>
+        <id>ignored</id>
+        <patterns>
+          <pattern>**/.htaccess</pattern>
+          <pattern>**/KEYS</pattern>
+          <pattern>**/*.rb</pattern>
+          <pattern>**/*.sh</pattern>
+          <pattern>**/.svn/**</pattern>
+          <pattern>**/.DAV/**</pattern>
+        </patterns>
+      </fileType>
+    </fileTypes>
+    <knownContentConsumers>
+      <knownContentConsumer>update-db-artifact</knownContentConsumer>
+      <knownContentConsumer>create-missing-checksums</knownContentConsumer>
+      <knownContentConsumer>update-db-repository-metadata</knownContentConsumer>
+      <knownContentConsumer>validate-checksum</knownContentConsumer>
+      <knownContentConsumer>validate-signature</knownContentConsumer>
+      <knownContentConsumer>index-content</knownContentConsumer>
+      <knownContentConsumer>auto-remove</knownContentConsumer>
+      <knownContentConsumer>auto-rename</knownContentConsumer>
+    </knownContentConsumers>
+    <invalidContentConsumers>
+      <invalidContentConsumer>update-db-bad-content</invalidContentConsumer>
+    </invalidContentConsumers>
+  </repositoryScanning>
+
+  <databaseScanning>
+    <cronExpression>0 0 * * ?</cronExpression>
+    <unprocessedConsumers>
+      <unprocessedConsumer>index-artifact</unprocessedConsumer>
+      <unprocessedConsumer>update-db-project</unprocessedConsumer>
+      <unprocessedConsumer>validate-repository-metadata</unprocessedConsumer>
+      <unprocessedConsumer>index-archive-toc</unprocessedConsumer>
+      <unprocessedConsumer>update-db-bytecode-stats</unprocessedConsumer>
+      <unprocessedConsumer>index-public-methods</unprocessedConsumer>
+    </unprocessedConsumers>
+    <cleanupConsumers>
+      <cleanupConsumer>not-present-remove-db-artifact</cleanupConsumer>
+      <cleanupConsumer>not-present-remove-db-project</cleanupConsumer>
+      <cleanupConsumer>not-present-remove-indexed</cleanupConsumer>
+    </cleanupConsumers>
+  </databaseScanning>
+
+  <webapp>
+    <ui>
+      <showFindArtifacts>true</showFindArtifacts>
+      <appletFindEnabled>true</appletFindEnabled>
+    </ui>
+  </webapp>
+
+</configuration>

Propchange: maven/archiva/trunk/archiva-base/archiva-configuration/src/test/conf/autodetect-v1.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: maven/archiva/trunk/archiva-base/archiva-configuration/src/test/conf/conf-base.xml
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-base/archiva-configuration/src/test/conf/conf-base.xml?view=auto&rev=562474
==============================================================================
--- maven/archiva/trunk/archiva-base/archiva-configuration/src/test/conf/conf-base.xml (added)
+++ maven/archiva/trunk/archiva-base/archiva-configuration/src/test/conf/conf-base.xml Fri Aug  3 07:16:58 2007
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+  ~ 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.
+  -->
+
+<configuration>
+  <version>1</version>
+  <repositories>
+    <repository>
+      <id>internal</id>
+      <name>Archiva Managed Internal Repository</name>
+      <url>file://${appserver.base}/repositories/internal</url>
+      <layout>default</layout>
+      <releases>true</releases>
+      <snapshots>false</snapshots>
+      <indexed>true</indexed>
+      <refreshCronExpression>0 0 * * ?</refreshCronExpression>
+    </repository>
+    <repository>
+      <id>snapshots</id>
+      <name>Archiva Managed Snapshot Repository</name>
+      <url>file://${appserver.base}/repositories/internal</url>
+      <layout>default</layout>
+      <releases>false</releases>
+      <snapshots>true</snapshots>
+      <indexed>true</indexed>
+      <refreshCronExpression>0 0,30 * * ?</refreshCronExpression>
+    </repository>
+    <repository>
+      <id>central</id>
+      <name>Central Repository</name>
+      <url>http://repo1.maven.org/maven2</url>
+      <layout>default</layout>
+      <releases>true</releases>
+      <snapshots>false</snapshots>
+      <indexed>false</indexed>
+    </repository>
+    <repository>
+      <id>maven2-repository.dev.java.net</id>
+      <name>Java.net Repository for Maven 2</name>
+      <url>https://maven2-repository.dev.java.net/nonav/repository</url>
+      <layout>default</layout>
+      <releases>true</releases>
+      <snapshots>false</snapshots>
+      <indexed>false</indexed>
+    </repository>
+  </repositories>
+
+  <webapp>
+    <ui>
+      <showFindArtifacts>false</showFindArtifacts>
+    </ui>
+  </webapp>
+</configuration>

Propchange: maven/archiva/trunk/archiva-base/archiva-configuration/src/test/conf/conf-base.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: maven/archiva/trunk/archiva-base/archiva-configuration/src/test/conf/conf-user.xml
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-base/archiva-configuration/src/test/conf/conf-user.xml?view=auto&rev=562474
==============================================================================
--- maven/archiva/trunk/archiva-base/archiva-configuration/src/test/conf/conf-user.xml (added)
+++ maven/archiva/trunk/archiva-base/archiva-configuration/src/test/conf/conf-user.xml Fri Aug  3 07:16:58 2007
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ 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.
+  -->
+<configuration>
+  <version>1</version>
+  <proxyConnectors>
+    <proxyConnector>
+      <sourceRepoId>internal</sourceRepoId>
+      <targetRepoId>central</targetRepoId>
+      <proxyId/>
+      <snapshotsPolicy>disabled</snapshotsPolicy>
+      <releasePolicy>never</releasePolicy>
+      <failurePolicy>not-found</failurePolicy>
+    </proxyConnector>
+    <proxyConnector>
+      <sourceRepoId>internal</sourceRepoId>
+      <targetRepoId>maven2-repository.dev.java.net</targetRepoId>
+      <proxyId/>
+      <snapshotsPolicy>disabled</snapshotsPolicy>
+      <releasePolicy>never</releasePolicy>
+      <failurePolicy>not-found</failurePolicy>
+      <whiteListPatterns>
+        <whiteListPattern>javax/**</whiteListPattern>
+      </whiteListPatterns>
+    </proxyConnector>
+  </proxyConnectors>
+
+  <webapp>
+    <ui>
+      <appletFindEnabled>false</appletFindEnabled>
+    </ui>
+  </webapp>
+</configuration>

Propchange: maven/archiva/trunk/archiva-base/archiva-configuration/src/test/conf/conf-user.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: maven/archiva/trunk/archiva-base/archiva-configuration/src/test/conf/repository-manager.xml
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-base/archiva-configuration/src/test/conf/repository-manager.xml?view=diff&rev=562474&r1=562473&r2=562474
==============================================================================
--- maven/archiva/trunk/archiva-base/archiva-configuration/src/test/conf/repository-manager.xml (original)
+++ maven/archiva/trunk/archiva-base/archiva-configuration/src/test/conf/repository-manager.xml Fri Aug  3 07:16:58 2007
@@ -19,6 +19,7 @@
   -->
 
 <configuration>
+  <version>1</version>
   <repositories>
     <repository>
       <id>internal</id>