You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@archiva.apache.org by jo...@apache.org on 2007/02/17 18:04:45 UTC

svn commit: r508779 [4/4] - in /maven/archiva/branches/archiva-MRM-239: ./ archiva-cli/ archiva-cli/src/main/java/org/apache/maven/archiva/cli/ archiva-common/ archiva-common/src/main/java/org/apache/maven/archiva/common/ archiva-common/src/main/java/o...

Modified: maven/archiva/branches/archiva-MRM-239/archiva-core/src/main/java/org/apache/maven/archiva/scheduler/DefaultRepositoryTaskScheduler.java
URL: http://svn.apache.org/viewvc/maven/archiva/branches/archiva-MRM-239/archiva-core/src/main/java/org/apache/maven/archiva/scheduler/DefaultRepositoryTaskScheduler.java?view=diff&rev=508779&r1=508778&r2=508779
==============================================================================
--- maven/archiva/branches/archiva-MRM-239/archiva-core/src/main/java/org/apache/maven/archiva/scheduler/DefaultRepositoryTaskScheduler.java (original)
+++ maven/archiva/branches/archiva-MRM-239/archiva-core/src/main/java/org/apache/maven/archiva/scheduler/DefaultRepositoryTaskScheduler.java Sat Feb 17 09:04:40 2007
@@ -21,9 +21,7 @@
 
 import org.apache.maven.archiva.configuration.ArchivaConfiguration;
 import org.apache.maven.archiva.configuration.Configuration;
-import org.apache.maven.archiva.indexer.RepositoryArtifactIndex;
-import org.apache.maven.archiva.indexer.RepositoryArtifactIndexFactory;
-import org.apache.maven.archiva.indexer.RepositoryIndexException;
+import org.apache.maven.archiva.repositories.ActiveManagedRepositories;
 import org.apache.maven.archiva.scheduler.task.DataRefreshTask;
 import org.apache.maven.archiva.scheduler.task.RepositoryTask;
 import org.codehaus.plexus.logging.AbstractLogEnabled;
@@ -41,7 +39,6 @@
 import org.quartz.JobDetail;
 import org.quartz.SchedulerException;
 
-import java.io.File;
 import java.text.ParseException;
 
 /**
@@ -68,15 +65,15 @@
      * @plexus.requirement
      */
     private ArchivaConfiguration archivaConfiguration;
-
+    
     /**
      * @plexus.requirement
      */
-    private RepositoryArtifactIndexFactory indexFactory;
+    private ActiveManagedRepositories activeRepositories;
 
     private static final String DISCOVERER_GROUP = "DISCOVERER";
 
-    private static final String INDEXER_JOB = "indexerTask";
+    private static final String DATA_REFRESH_JOB = "dataRefreshTask";
 
     public void start()
         throws StartingException
@@ -86,11 +83,11 @@
 
         try
         {
-            scheduleJobs( configuration.getIndexPath(), configuration.getIndexerCronExpression() );
+            scheduleJobs( configuration.getDataRefreshCronExpression() );
         }
         catch ( ParseException e )
         {
-            throw new StartingException( "Invalid configuration: " + configuration.getIndexerCronExpression(), e );
+            throw new StartingException( "Invalid configuration: " + configuration.getDataRefreshCronExpression(), e );
         }
         catch ( SchedulerException e )
         {
@@ -98,29 +95,22 @@
         }
     }
 
-    private void scheduleJobs( String indexPath, String indexerCronExpression )
+    private void scheduleJobs( String indexerCronExpression )
         throws ParseException, SchedulerException
     {
-        if ( indexPath != null )
-        {
-            JobDetail jobDetail = createJobDetail( INDEXER_JOB );
+        JobDetail jobDetail = createJobDetail( DATA_REFRESH_JOB );
 
-            getLogger().info( "Scheduling indexer: " + indexerCronExpression );
-            CronTrigger trigger = new CronTrigger( INDEXER_JOB + "Trigger", DISCOVERER_GROUP, indexerCronExpression );
-            scheduler.scheduleJob( jobDetail, trigger );
+        getLogger().info( "Scheduling data-refresh: " + indexerCronExpression );
+        CronTrigger trigger = new CronTrigger( DATA_REFRESH_JOB + "Trigger", DISCOVERER_GROUP, indexerCronExpression );
+        scheduler.scheduleJob( jobDetail, trigger );
 
-            try
-            {
-                queueNowIfNeeded();
-            }
-            catch ( org.codehaus.plexus.taskqueue.execution.TaskExecutionException e )
-            {
-                getLogger().error( "Error executing task first time, continuing anyway: " + e.getMessage(), e );
-            }
+        try
+        {
+            queueNowIfNeeded();
         }
-        else
+        catch ( org.codehaus.plexus.taskqueue.execution.TaskExecutionException e )
         {
-            getLogger().info( "Not scheduling indexer - index path is not configured" );
+            getLogger().error( "Error executing task first time, continuing anyway: " + e.getMessage(), e );
         }
     }
 
@@ -141,7 +131,7 @@
     {
         try
         {
-            scheduler.unscheduleJob( INDEXER_JOB, DISCOVERER_GROUP );
+            scheduler.unscheduleJob( DATA_REFRESH_JOB, DISCOVERER_GROUP );
         }
         catch ( SchedulerException e )
         {
@@ -157,7 +147,7 @@
 
     public void afterConfigurationChange( Registry registry, String propertyName, Object propertyValue )
     {
-        if ( "indexPath".equals( propertyName ) || "indexerCronExpression".equals( propertyName ) )
+        if ( "dataRefreshCronExpression".equals( propertyName ) )
         {
             getLogger().debug( "Restarting task scheduler with new configuration after property change: " +
                 propertyName + " to " + propertyValue );
@@ -173,7 +163,7 @@
             try
             {
                 Configuration configuration = archivaConfiguration.getConfiguration();
-                scheduleJobs( configuration.getIndexPath(), configuration.getIndexerCronExpression() );
+                scheduleJobs( configuration.getDataRefreshCronExpression() );
             }
             catch ( ParseException e )
             {
@@ -194,7 +184,7 @@
     }
 
     public void runDataRefresh()
-        throws org.apache.maven.archiva.scheduler.TaskExecutionException
+        throws TaskExecutionException
     {
         DataRefreshTask task = new DataRefreshTask();
         task.setJobName( "DATA_REFRESH_INIT" );
@@ -204,32 +194,16 @@
         }
         catch ( TaskQueueException e )
         {
-            throw new org.apache.maven.archiva.scheduler.TaskExecutionException( e.getMessage(), e );
+            throw new TaskExecutionException( e.getMessage(), e );
         }
     }
 
     public void queueNowIfNeeded()
-        throws org.codehaus.plexus.taskqueue.execution.TaskExecutionException
+        throws TaskExecutionException
     {
-        Configuration configuration = archivaConfiguration.getConfiguration();
-
-        File indexPath = new File( configuration.getIndexPath() );
-
-        try
+        if ( activeRepositories.needsDataRefresh() )
         {
-            RepositoryArtifactIndex artifactIndex = indexFactory.createStandardIndex( indexPath );
-            if ( !artifactIndex.exists() )
-            {
-                runDataRefresh();
-            }
-        }
-        catch ( RepositoryIndexException e )
-        {
-            throw new TaskExecutionException( e.getMessage(), e );
-        }
-        catch ( org.apache.maven.archiva.scheduler.TaskExecutionException e )
-        {
-            throw new TaskExecutionException( e.getMessage(), e );
+            runDataRefresh();
         }
     }
 

Modified: maven/archiva/branches/archiva-MRM-239/archiva-core/src/main/java/org/apache/maven/archiva/scheduler/RepositoryTaskJob.java
URL: http://svn.apache.org/viewvc/maven/archiva/branches/archiva-MRM-239/archiva-core/src/main/java/org/apache/maven/archiva/scheduler/RepositoryTaskJob.java?view=diff&rev=508779&r1=508778&r2=508779
==============================================================================
--- maven/archiva/branches/archiva-MRM-239/archiva-core/src/main/java/org/apache/maven/archiva/scheduler/RepositoryTaskJob.java (original)
+++ maven/archiva/branches/archiva-MRM-239/archiva-core/src/main/java/org/apache/maven/archiva/scheduler/RepositoryTaskJob.java Sat Feb 17 09:04:40 2007
@@ -73,7 +73,7 @@
                 }
                 else if ( RepositoryTask.QUEUE_POLICY_SKIP.equals( queuePolicy ) )
                 {
-                    //do not queue anymore, policy is to skip
+                    // do not queue anymore, policy is to skip
                 }
             }
         }

Modified: maven/archiva/branches/archiva-MRM-239/archiva-core/src/main/java/org/apache/maven/archiva/scheduler/RepositoryTaskScheduler.java
URL: http://svn.apache.org/viewvc/maven/archiva/branches/archiva-MRM-239/archiva-core/src/main/java/org/apache/maven/archiva/scheduler/RepositoryTaskScheduler.java?view=diff&rev=508779&r1=508778&r2=508779
==============================================================================
--- maven/archiva/branches/archiva-MRM-239/archiva-core/src/main/java/org/apache/maven/archiva/scheduler/RepositoryTaskScheduler.java (original)
+++ maven/archiva/branches/archiva-MRM-239/archiva-core/src/main/java/org/apache/maven/archiva/scheduler/RepositoryTaskScheduler.java Sat Feb 17 09:04:40 2007
@@ -19,6 +19,8 @@
  * under the License.
  */
 
+import org.codehaus.plexus.taskqueue.execution.TaskExecutionException;
+
 /**
  * The component that takes care of scheduling in the application.
  *
@@ -34,4 +36,4 @@
     void runDataRefresh()
         throws TaskExecutionException;
 
-}
+} 

Added: maven/archiva/branches/archiva-MRM-239/archiva-core/src/main/java/org/apache/maven/archiva/scheduler/executors/DataRefreshConsumers.java
URL: http://svn.apache.org/viewvc/maven/archiva/branches/archiva-MRM-239/archiva-core/src/main/java/org/apache/maven/archiva/scheduler/executors/DataRefreshConsumers.java?view=auto&rev=508779
==============================================================================
--- maven/archiva/branches/archiva-MRM-239/archiva-core/src/main/java/org/apache/maven/archiva/scheduler/executors/DataRefreshConsumers.java (added)
+++ maven/archiva/branches/archiva-MRM-239/archiva-core/src/main/java/org/apache/maven/archiva/scheduler/executors/DataRefreshConsumers.java Sat Feb 17 09:04:40 2007
@@ -0,0 +1,61 @@
+package org.apache.maven.archiva.scheduler.executors;
+
+/*
+ * 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.
+ */
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+/**
+ * Mutable list of consumer for the Data Refresh.
+ * 
+ * NOTE: This class only exists to minimize the requirements of manual component management.
+ *       This approach allows for a small and simple component definition in the application.xml
+ *
+ * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a>
+ * @version $Id$
+ * 
+ * @plexus.component role="org.apache.maven.archiva.scheduler.executors.DataRefreshConsumers"
+ */
+public class DataRefreshConsumers
+{
+    /**
+     * @plexus.configuration
+     */
+    private List consumerNames;
+
+    public List getConsumerNames()
+    {
+        if ( consumerNames == null )
+        {
+            consumerNames = new ArrayList();
+            consumerNames.add( "index-artifact" );
+            consumerNames.add( "artifact-health" );
+            consumerNames.add( "metadata-health" );
+        }
+
+        return consumerNames;
+    }
+
+    public Iterator iterator()
+    {
+        return getConsumerNames().iterator();
+    }
+}

Propchange: maven/archiva/branches/archiva-MRM-239/archiva-core/src/main/java/org/apache/maven/archiva/scheduler/executors/DataRefreshConsumers.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/archiva/branches/archiva-MRM-239/archiva-core/src/main/java/org/apache/maven/archiva/scheduler/executors/DataRefreshConsumers.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Propchange: maven/archiva/branches/archiva-MRM-239/archiva-core/src/main/java/org/apache/maven/archiva/scheduler/executors/DataRefreshConsumers.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: maven/archiva/branches/archiva-MRM-239/archiva-core/src/main/java/org/apache/maven/archiva/scheduler/executors/DataRefreshExecutor.java
URL: http://svn.apache.org/viewvc/maven/archiva/branches/archiva-MRM-239/archiva-core/src/main/java/org/apache/maven/archiva/scheduler/executors/DataRefreshExecutor.java?view=diff&rev=508779&r1=508778&r2=508779
==============================================================================
--- maven/archiva/branches/archiva-MRM-239/archiva-core/src/main/java/org/apache/maven/archiva/scheduler/executors/DataRefreshExecutor.java (original)
+++ maven/archiva/branches/archiva-MRM-239/archiva-core/src/main/java/org/apache/maven/archiva/scheduler/executors/DataRefreshExecutor.java Sat Feb 17 09:04:40 2007
@@ -19,27 +19,25 @@
  * under the License.
  */
 
+import org.apache.maven.archiva.common.consumers.Consumer;
+import org.apache.maven.archiva.common.consumers.ConsumerException;
+import org.apache.maven.archiva.common.consumers.ConsumerFactory;
 import org.apache.maven.archiva.configuration.ArchivaConfiguration;
 import org.apache.maven.archiva.configuration.Configuration;
 import org.apache.maven.archiva.configuration.ConfiguredRepositoryFactory;
 import org.apache.maven.archiva.configuration.RepositoryConfiguration;
 import org.apache.maven.archiva.discoverer.Discoverer;
-import org.apache.maven.archiva.discoverer.DiscovererConsumer;
-import org.apache.maven.archiva.discoverer.DiscovererConsumerFactory;
 import org.apache.maven.archiva.discoverer.DiscovererException;
 import org.apache.maven.archiva.discoverer.DiscovererStatistics;
 import org.apache.maven.archiva.scheduler.task.DataRefreshTask;
 import org.apache.maven.artifact.repository.ArtifactRepository;
 import org.codehaus.plexus.logging.AbstractLogEnabled;
-import org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable;
-import org.codehaus.plexus.personality.plexus.lifecycle.phase.InitializationException;
 import org.codehaus.plexus.taskqueue.Task;
 import org.codehaus.plexus.taskqueue.execution.TaskExecutionException;
 import org.codehaus.plexus.taskqueue.execution.TaskExecutor;
 
-import java.text.SimpleDateFormat;
+import java.io.IOException;
 import java.util.ArrayList;
-import java.util.Date;
 import java.util.Iterator;
 import java.util.List;
 
@@ -54,7 +52,7 @@
  */
 public class DataRefreshExecutor
     extends AbstractLogEnabled
-    implements TaskExecutor, Initializable
+    implements TaskExecutor
 {
     /**
      * Configuration store.
@@ -69,9 +67,9 @@
     private ConfiguredRepositoryFactory repoFactory;
 
     /**
-     * @plexus.configuration
+     * @plexus.requirement
      */
-    private List consumerNames;
+    private DataRefreshConsumers consumerNames;
 
     /**
      * @plexus.requirement
@@ -81,9 +79,7 @@
     /**
      * @plexus.requirement
      */
-    private DiscovererConsumerFactory consumerFactory;
-
-    private long lastRunTime = 0;
+    private ConsumerFactory consumerFactory;
 
     public void executeTask( Task task )
         throws TaskExecutionException
@@ -95,12 +91,6 @@
         execute();
     }
 
-    private String toHumanTimestamp( long timestamp )
-    {
-        SimpleDateFormat dateFormat = new SimpleDateFormat();
-        return dateFormat.format( new Date( timestamp ) );
-    }
-
     public void execute()
         throws TaskExecutionException
     {
@@ -113,11 +103,12 @@
             String name = (String) it.next();
             try
             {
-                DiscovererConsumer consumer = consumerFactory.createConsumer( name );
+                Consumer consumer = consumerFactory.createConsumer( name );
                 consumers.add( consumer );
             }
-            catch ( DiscovererException e )
+            catch ( ConsumerException e )
             {
+                getLogger().warn( e.getMessage(), e );
                 throw new TaskExecutionException( e.getMessage(), e );
             }
         }
@@ -137,23 +128,31 @@
 
             List filteredConsumers = filterConsumers( consumers, repository );
 
-            DiscovererStatistics stats = discoverer.scanRepository( repository, filteredConsumers,
-                                                                    repositoryConfiguration.isIncludeSnapshots() );
+            DiscovererStatistics lastRunStats = new DiscovererStatistics( repository );
+            try
+            {
+                lastRunStats.load( ".datarefresh" );
+            }
+            catch ( IOException e )
+            {
+                getLogger().info(
+                                  "Unable to load last run statistics for repository [" + repository.getId() + "]: "
+                                      + e.getMessage() );
+            }
 
-            getLogger().info( "----------------------------------------------------" );
-            getLogger().info( "Scan of Repository: " + repository.getId() );
-            getLogger().info( "   Started : " + toHumanTimestamp( stats.getTimestampStarted() ) );
-            getLogger().info( "   Finished: " + toHumanTimestamp( stats.getTimestampFinished() ) );
-            // TODO: pretty print ellapsed time.
-            getLogger().info( "   Duration: " + stats.getElapsedMilliseconds() + "ms" );
-            getLogger().info( "   Files   : " + stats.getFilesIncluded() );
-            getLogger().info( "   Consumed: " + stats.getFilesConsumed() );
-            getLogger().info( "   Skipped : " + stats.getFilesSkipped() );
-            
-            // TODO: Do we really need to check first?
-            if ( stats.getTimestampFinished() > lastRunTime )
+            try
             {
-                lastRunTime = stats.getTimestampFinished();
+                DiscovererStatistics stats = discoverer
+                    .walkRepository( repository, filteredConsumers, repositoryConfiguration.isIncludeSnapshots(),
+                                     lastRunStats.getTimestampFinished(), null, null );
+
+                stats.dump( getLogger() );
+            }
+            catch ( DiscovererException e )
+            {
+                getLogger().error(
+                                   "Unable to run data refresh against repository [" + repository.getId() + "]: "
+                                       + e.getMessage(), e );
             }
         }
 
@@ -176,7 +175,7 @@
 
         for ( Iterator it = consumers.iterator(); it.hasNext(); )
         {
-            DiscovererConsumer consumer = (DiscovererConsumer) it.next();
+            Consumer consumer = (Consumer) it.next();
             if ( consumer.init( repository ) )
             {
                 // Approved!
@@ -189,34 +188,5 @@
         }
 
         return filtered;
-    }
-
-    public void initialize()
-        throws InitializationException
-    {
-        Configuration configuration = archivaConfiguration.getConfiguration();
-
-        for ( Iterator i = configuration.getRepositories().iterator(); i.hasNext(); )
-        {
-            RepositoryConfiguration repositoryConfiguration = (RepositoryConfiguration) i.next();
-
-            if ( !repositoryConfiguration.isIndexed() )
-            {
-                continue;
-            }
-
-            ArtifactRepository repository = repoFactory.createRepository( repositoryConfiguration );
-
-            DiscovererStatistics stats = new DiscovererStatistics( repository );
-            if ( stats.getTimestampFinished() > lastRunTime )
-            {
-                lastRunTime = stats.getTimestampFinished();
-            }
-        }
-    }
-
-    public long getLastRunTime()
-    {
-        return lastRunTime;
     }
 }

Modified: maven/archiva/branches/archiva-MRM-239/archiva-core/src/main/resources/META-INF/plexus/components.xml
URL: http://svn.apache.org/viewvc/maven/archiva/branches/archiva-MRM-239/archiva-core/src/main/resources/META-INF/plexus/components.xml?view=diff&rev=508779&r1=508778&r2=508779
==============================================================================
--- maven/archiva/branches/archiva-MRM-239/archiva-core/src/main/resources/META-INF/plexus/components.xml (original)
+++ maven/archiva/branches/archiva-MRM-239/archiva-core/src/main/resources/META-INF/plexus/components.xml Sat Feb 17 09:04:40 2007
@@ -21,9 +21,67 @@
 <component-set>
   <components>
 
+    <!-- TODO: Remove once CDC can handle correct cross-module descriptor creation. -->
+
+    <!-- SNIP:START -->
+
+    <component>
+      <role>org.apache.maven.archiva.common.consumers.Consumer</role>
+      <role-hint>index-artifact</role-hint>
+      <implementation>org.apache.maven.archiva.consumers.IndexArtifactConsumer</implementation>
+      <instantiation-strategy>per-lookup</instantiation-strategy>
+      <requirements>
+        <requirement>
+          <role>org.apache.maven.artifact.factory.ArtifactFactory</role>
+          <field-name>artifactFactory</field-name>
+        </requirement>
+      </requirements>
+    </component>
+
+    <component>
+      <role>org.apache.maven.archiva.common.consumers.Consumer</role>
+      <role-hint>artifact-health</role-hint>
+      <implementation>org.apache.maven.archiva.consumers.ArtifactHealthConsumer</implementation>
+      <instantiation-strategy>per-lookup</instantiation-strategy>
+      <requirements>
+        <requirement>
+          <role>org.apache.maven.artifact.factory.ArtifactFactory</role>
+          <field-name>artifactFactory</field-name>
+        </requirement>
+      </requirements>
+    </component>
+
+    <component>
+      <role>org.apache.maven.archiva.common.consumers.Consumer</role>
+      <role-hint>metadata-health</role-hint>
+      <implementation>org.apache.maven.archiva.consumers.RepositoryMetadataHealthConsumer</implementation>
+      <instantiation-strategy>per-lookup</instantiation-strategy>
+      <requirements>
+        <requirement>
+          <role>org.apache.maven.artifact.factory.ArtifactFactory</role>
+          <field-name>artifactFactory</field-name>
+        </requirement>
+      </requirements>
+    </component>
+
+    <!-- SNIP:END -->
+
+    <component>
+      <role>org.apache.maven.archiva.scheduler.executors.DataRefreshConsumers</role>
+      <implementation>org.apache.maven.archiva.scheduler.executors.DataRefreshConsumers</implementation>
+      <description>Mutable list of consumer for the Data Refresh.</description>
+      <configuration>
+        <consumer-names>
+          <consumer-name>index-artifact</consumer-name>
+          <consumer-name>artifact-health</consumer-name>
+          <consumer-name>metadata-health</consumer-name>
+        </consumer-names>
+      </configuration>
+    </component>
+
     <component>
       <role>org.codehaus.plexus.taskqueue.TaskQueue</role>
-      <role-hint>indexer</role-hint>
+      <role-hint>data-refresh</role-hint>
       <implementation>org.codehaus.plexus.taskqueue.DefaultTaskQueue</implementation>
       <lifecycle-handler>plexus-configurable</lifecycle-handler>
       <configuration>
@@ -38,20 +96,20 @@
 
     <component>
       <role>org.codehaus.plexus.taskqueue.execution.TaskQueueExecutor</role>
-      <role-hint>indexer</role-hint>
+      <role-hint>data-refresh</role-hint>
       <implementation>org.codehaus.plexus.taskqueue.execution.ThreadedTaskQueueExecutor</implementation>
       <requirements>
         <requirement>
           <role>org.codehaus.plexus.taskqueue.execution.TaskExecutor</role>
-          <role-hint>indexer</role-hint>
+          <role-hint>data-refresh</role-hint>
         </requirement>
         <requirement>
           <role>org.codehaus.plexus.taskqueue.TaskQueue</role>
-          <role-hint>indexer</role-hint>
+          <role-hint>data-refresh</role-hint>
         </requirement>
       </requirements>
       <configuration>
-        <name>indexer</name>
+        <name>data-refresh</name>
       </configuration>
     </component>
     

Modified: maven/archiva/branches/archiva-MRM-239/archiva-core/src/test/java/org/apache/maven/archiva/repositories/DefaultActiveManagedRepositoriesTest.java
URL: http://svn.apache.org/viewvc/maven/archiva/branches/archiva-MRM-239/archiva-core/src/test/java/org/apache/maven/archiva/repositories/DefaultActiveManagedRepositoriesTest.java?view=diff&rev=508779&r1=508778&r2=508779
==============================================================================
--- maven/archiva/branches/archiva-MRM-239/archiva-core/src/test/java/org/apache/maven/archiva/repositories/DefaultActiveManagedRepositoriesTest.java (original)
+++ maven/archiva/branches/archiva-MRM-239/archiva-core/src/test/java/org/apache/maven/archiva/repositories/DefaultActiveManagedRepositoriesTest.java Sat Feb 17 09:04:40 2007
@@ -19,9 +19,9 @@
  * under the License.
  */
 
-import org.apache.maven.archiva.artifact.ManagedArtifact;
-import org.apache.maven.archiva.artifact.ManagedEjbArtifact;
-import org.apache.maven.archiva.artifact.ManagedJavaArtifact;
+import org.apache.maven.archiva.common.artifact.managed.ManagedArtifact;
+import org.apache.maven.archiva.common.artifact.managed.ManagedEjbArtifact;
+import org.apache.maven.archiva.common.artifact.managed.ManagedJavaArtifact;
 import org.codehaus.plexus.PlexusTestCase;
 
 /**

Modified: maven/archiva/branches/archiva-MRM-239/archiva-core/src/test/resources/org/apache/maven/archiva/scheduler/executors/DataRefreshExecutorTest.xml
URL: http://svn.apache.org/viewvc/maven/archiva/branches/archiva-MRM-239/archiva-core/src/test/resources/org/apache/maven/archiva/scheduler/executors/DataRefreshExecutorTest.xml?view=diff&rev=508779&r1=508778&r2=508779
==============================================================================
--- maven/archiva/branches/archiva-MRM-239/archiva-core/src/test/resources/org/apache/maven/archiva/scheduler/executors/DataRefreshExecutorTest.xml (original)
+++ maven/archiva/branches/archiva-MRM-239/archiva-core/src/test/resources/org/apache/maven/archiva/scheduler/executors/DataRefreshExecutorTest.xml Sat Feb 17 09:04:40 2007
@@ -33,38 +33,6 @@
     </component>
     
     <component>
-      <role>org.codehaus.plexus.taskqueue.execution.TaskExecutor</role>
-      <role-hint>data-refresh</role-hint>
-      <implementation>org.apache.maven.archiva.scheduler.executors.DataRefreshExecutor</implementation>
-      <description>DataRefreshExecutor</description>
-      <requirements>
-        <requirement>
-          <role>org.apache.maven.archiva.configuration.ArchivaConfiguration</role>
-          <field-name>archivaConfiguration</field-name>
-        </requirement>
-        <requirement>
-          <role>org.apache.maven.archiva.configuration.ConfiguredRepositoryFactory</role>
-          <field-name>repoFactory</field-name>
-        </requirement>
-        <requirement>
-          <role>org.apache.maven.archiva.discoverer.Discoverer</role>
-          <field-name>discoverer</field-name>
-        </requirement>
-        <requirement>
-          <role>org.apache.maven.archiva.discoverer.DiscovererConsumerFactory</role>
-          <field-name>consumerFactory</field-name>
-        </requirement>
-      </requirements>
-      <configuration>
-        <consumer-names>
-          <consumer-name>index-artifact</consumer-name>
-          <consumer-name>artifact-health</consumer-name>
-          <consumer-name>metadata-health</consumer-name>
-        </consumer-names>
-      </configuration>
-    </component>
-    
-    <component>
       <role>org.codehaus.plexus.jdo.JdoFactory</role>
       <role-hint>archiva</role-hint>
       <implementation>org.codehaus.plexus.jdo.DefaultConfigurableJdoFactory</implementation>

Modified: maven/archiva/branches/archiva-MRM-239/archiva-discoverer/pom.xml
URL: http://svn.apache.org/viewvc/maven/archiva/branches/archiva-MRM-239/archiva-discoverer/pom.xml?view=diff&rev=508779&r1=508778&r2=508779
==============================================================================
--- maven/archiva/branches/archiva-MRM-239/archiva-discoverer/pom.xml (original)
+++ maven/archiva/branches/archiva-MRM-239/archiva-discoverer/pom.xml Sat Feb 17 09:04:40 2007
@@ -27,8 +27,12 @@
   </parent>
   <modelVersion>4.0.0</modelVersion>
   <artifactId>archiva-discoverer</artifactId>
-  <name>Archiva Artifact Discoverer</name>
+  <name>Archiva Discoverer</name>
   <dependencies>
+    <dependency>
+      <groupId>org.apache.maven.archiva</groupId>
+      <artifactId>archiva-common</artifactId>
+    </dependency>
     <dependency>
       <groupId>org.codehaus.plexus</groupId>
       <artifactId>plexus-utils</artifactId>

Modified: maven/archiva/branches/archiva-MRM-239/archiva-discoverer/src/main/java/org/apache/maven/archiva/discoverer/DefaultDiscoverer.java
URL: http://svn.apache.org/viewvc/maven/archiva/branches/archiva-MRM-239/archiva-discoverer/src/main/java/org/apache/maven/archiva/discoverer/DefaultDiscoverer.java?view=diff&rev=508779&r1=508778&r2=508779
==============================================================================
--- maven/archiva/branches/archiva-MRM-239/archiva-discoverer/src/main/java/org/apache/maven/archiva/discoverer/DefaultDiscoverer.java (original)
+++ maven/archiva/branches/archiva-MRM-239/archiva-discoverer/src/main/java/org/apache/maven/archiva/discoverer/DefaultDiscoverer.java Sat Feb 17 09:04:40 2007
@@ -19,6 +19,7 @@
  * under the License.
  */
 
+import org.apache.maven.archiva.common.consumers.Consumer;
 import org.apache.maven.artifact.repository.ArtifactRepository;
 import org.codehaus.plexus.logging.AbstractLogEnabled;
 import org.codehaus.plexus.util.DirectoryWalker;
@@ -36,7 +37,6 @@
  * @author <a href="mailto:brett@apache.org">Brett Porter</a>
  * @author <a href="mailto:joakime@apache.org">Joakim Erdfelt</a>
  * @plexus.component role="org.apache.maven.archiva.discoverer.Discoverer"
- *    role-hint="default"
  */
 public class DefaultDiscoverer
     extends AbstractLogEnabled
@@ -65,18 +65,16 @@
     {
     }
 
-    public DiscovererStatistics scanRepository( ArtifactRepository repository, List consumers, boolean includeSnapshots )
-    {
-        return walkRepository( repository, consumers, includeSnapshots, true );
-    }
-
     public DiscovererStatistics walkRepository( ArtifactRepository repository, List consumers, boolean includeSnapshots )
+        throws DiscovererException
     {
-        return walkRepository( repository, consumers, includeSnapshots, false );
+        return walkRepository( repository, consumers, includeSnapshots, 0, null, null );
     }
 
-    private DiscovererStatistics walkRepository( ArtifactRepository repository, List consumers,
-                                                 boolean includeSnapshots, boolean checkLastModified )
+    public DiscovererStatistics walkRepository( ArtifactRepository repository, List consumers,
+                                                boolean includeSnapshots, long onlyModifiedAfterTimestamp,
+                                                List extraFileExclusions, List extraFileInclusions )
+        throws DiscovererException
     {
         // Sanity Check
 
@@ -120,16 +118,29 @@
             allExcludes.add( "**/*-SNAPSHOT*" );
         }
 
+        if ( extraFileExclusions != null )
+        {
+            allExcludes.addAll( extraFileExclusions );
+        }
+
         Iterator it = consumers.iterator();
         while ( it.hasNext() )
         {
-            DiscovererConsumer consumer = (DiscovererConsumer) it.next();
+            Consumer consumer = (Consumer) it.next();
 
-            // TODO Disabled, until I can find a better way to do this that doesn't clobber other consumers. - joakime
-            // addUniqueElements( consumer.getExcludePatterns(), allExcludes );
+            /* NOTE: Do not insert the consumer exclusion patterns here.
+             * Exclusion patterns are handled by RepositoryScanner.wantsFile(Consumer, String)
+             * 
+             * addUniqueElements( consumer.getExcludePatterns(), allExcludes );
+             */
             addUniqueElements( consumer.getIncludePatterns(), allIncludes );
         }
 
+        if ( extraFileInclusions != null )
+        {
+            allIncludes.addAll( extraFileInclusions );
+        }
+
         // Setup Directory Walker
 
         DirectoryWalker dirWalker = new DirectoryWalker();
@@ -140,9 +151,8 @@
         dirWalker.setExcludes( allExcludes );
 
         // Setup the Scan Instance
-
         RepositoryScanner repoScanner = new RepositoryScanner( repository, consumers );
-        repoScanner.setCheckLastModified( checkLastModified );
+        repoScanner.setOnlyModifiedAfterTimestamp( onlyModifiedAfterTimestamp );
 
         repoScanner.setLogger( getLogger() );
         dirWalker.addDirectoryWalkListener( repoScanner );

Modified: maven/archiva/branches/archiva-MRM-239/archiva-discoverer/src/main/java/org/apache/maven/archiva/discoverer/Discoverer.java
URL: http://svn.apache.org/viewvc/maven/archiva/branches/archiva-MRM-239/archiva-discoverer/src/main/java/org/apache/maven/archiva/discoverer/Discoverer.java?view=diff&rev=508779&r1=508778&r2=508779
==============================================================================
--- maven/archiva/branches/archiva-MRM-239/archiva-discoverer/src/main/java/org/apache/maven/archiva/discoverer/Discoverer.java (original)
+++ maven/archiva/branches/archiva-MRM-239/archiva-discoverer/src/main/java/org/apache/maven/archiva/discoverer/Discoverer.java Sat Feb 17 09:04:40 2007
@@ -21,6 +21,7 @@
 
 import org.apache.maven.artifact.repository.ArtifactRepository;
 
+import java.io.File;
 import java.util.List;
 
 /**
@@ -31,25 +32,42 @@
  */
 public interface Discoverer
 {
+    public static final String ROLE = Discoverer.class.getName();
+    
     /**
-     * Scan the repository for changes.
+     * Walk the repository, and report to the consumers the files found.
+     * 
      * Report changes to the appropriate Consumer.
      * 
+     * This is just a convenience method to {@link #walkRepository(ArtifactRepository, List, boolean, long, List, List)}
+     * equivalent to calling <code>walkRepository( repository, consumers, includeSnapshots, 0, null, null );</code>
+     * 
      * @param repository the repository to change.
      * @param consumers use the provided list of consumers.
-     * @param includeSnapshots true to include snapshots in the scanning of this repository.
+     * @param includeSnapshots true to include snapshots in the walking of this repository.
      * @return the statistics for this scan.
+     * @throws DiscovererException if there was a fundamental problem with getting the discoverer started.
      */
-    public DiscovererStatistics scanRepository( ArtifactRepository repository, List consumers, boolean includeSnapshots );
-    
+    public DiscovererStatistics walkRepository( ArtifactRepository repository, List consumers, boolean includeSnapshots )
+        throws DiscovererException;
+
     /**
-     * Walk the entire repository, regardless of change.
+     * Walk the repository, and report to the consumers the files found.
+     * 
      * Report changes to the appropriate Consumer.
      * 
      * @param repository the repository to change.
      * @param consumers use the provided list of consumers.
-     * @param includeSnapshots true to include snapshots in the walking of this repository.
+     * @param includeSnapshots true to include snapshots in the scanning of this repository.
+     * @param onlyModifiedAfterTimestamp Only report to the consumers, files that have a {@link File#lastModified()}) 
+     *          after the provided timestamp.
+     * @param extraFileExclusions an optional list of file exclusions on the walk.
+     * @param extraFileInclusions an optional list of file inclusions on the walk.
      * @return the statistics for this scan.
+     * @throws DiscovererException if there was a fundamental problem with getting the discoverer started. 
      */
-    public DiscovererStatistics walkRepository( ArtifactRepository repository, List consumers, boolean includeSnapshots );
+    public DiscovererStatistics walkRepository( ArtifactRepository repository, List consumers,
+                                                boolean includeSnapshots, long onlyModifiedAfterTimestamp,
+                                                List extraFileExclusions, List extraFileInclusions )
+        throws DiscovererException;
 }

Modified: maven/archiva/branches/archiva-MRM-239/archiva-discoverer/src/main/java/org/apache/maven/archiva/discoverer/DiscovererStatistics.java
URL: http://svn.apache.org/viewvc/maven/archiva/branches/archiva-MRM-239/archiva-discoverer/src/main/java/org/apache/maven/archiva/discoverer/DiscovererStatistics.java?view=diff&rev=508779&r1=508778&r2=508779
==============================================================================
--- maven/archiva/branches/archiva-MRM-239/archiva-discoverer/src/main/java/org/apache/maven/archiva/discoverer/DiscovererStatistics.java (original)
+++ maven/archiva/branches/archiva-MRM-239/archiva-discoverer/src/main/java/org/apache/maven/archiva/discoverer/DiscovererStatistics.java Sat Feb 17 09:04:40 2007
@@ -21,12 +21,15 @@
 
 import org.apache.commons.lang.math.NumberUtils;
 import org.apache.maven.artifact.repository.ArtifactRepository;
+import org.codehaus.plexus.logging.Logger;
 import org.codehaus.plexus.util.IOUtil;
 
 import java.io.File;
 import java.io.FileInputStream;
 import java.io.FileOutputStream;
 import java.io.IOException;
+import java.text.SimpleDateFormat;
+import java.util.Date;
 import java.util.Properties;
 
 /**
@@ -37,8 +40,6 @@
  */
 public class DiscovererStatistics
 {
-    public static final String STATS_FILENAME = ".stats";
-
     private static final String PROP_FILES_CONSUMED = "scan.consumed.files";
 
     private static final String PROP_FILES_INCLUDED = "scan.included.files";
@@ -64,14 +65,14 @@
     public DiscovererStatistics( ArtifactRepository repository )
     {
         this.repository = repository;
-        load();
     }
 
-    public void load()
+    public void load( String filename )
+        throws IOException
     {
         File repositoryBase = new File( this.repository.getBasedir() );
 
-        File scanProperties = new File( repositoryBase, STATS_FILENAME );
+        File scanProperties = new File( repositoryBase, filename );
         FileInputStream fis = null;
         try
         {
@@ -88,6 +89,7 @@
         catch ( IOException e )
         {
             reset();
+            throw e;
         }
         finally
         {
@@ -95,8 +97,8 @@
         }
     }
 
-    public void save()
-        throws DiscovererException
+    public void save( String filename )
+        throws IOException
     {
         Properties props = new Properties();
         props.setProperty( PROP_TIMESTAMP_FINISHED, String.valueOf( timestampFinished ) );
@@ -106,7 +108,7 @@
         props.setProperty( PROP_FILES_SKIPPED, String.valueOf( filesSkipped ) );
 
         File repositoryBase = new File( this.repository.getBasedir() );
-        File statsFile = new File( repositoryBase, STATS_FILENAME );
+        File statsFile = new File( repositoryBase, filename );
 
         FileOutputStream fos = null;
         try
@@ -115,11 +117,6 @@
             props.store( fos, "Last Scan Information, managed by Archiva. DO NOT EDIT" );
             fos.flush();
         }
-        catch ( IOException e )
-        {
-            throw new DiscovererException( "Unable to write scan stats to file " + statsFile.getAbsolutePath() + ": "
-                + e.getMessage(), e );
-        }
         finally
         {
             IOUtil.close( fos );
@@ -178,5 +175,24 @@
     public void setTimestampStarted( long timestampStarted )
     {
         this.timestampStarted = timestampStarted;
+    }
+
+    public void dump( Logger logger )
+    {
+        logger.info( "----------------------------------------------------" );
+        logger.info( "Scan of Repository: " + repository.getId() );
+        logger.info( "   Started : " + toHumanTimestamp( this.getTimestampStarted() ) );
+        logger.info( "   Finished: " + toHumanTimestamp( this.getTimestampFinished() ) );
+        // TODO: pretty print ellapsed time.
+        logger.info( "   Duration: " + this.getElapsedMilliseconds() + "ms" );
+        logger.info( "   Files   : " + this.getFilesIncluded() );
+        logger.info( "   Consumed: " + this.getFilesConsumed() );
+        logger.info( "   Skipped : " + this.getFilesSkipped() );
+    }
+    
+    private String toHumanTimestamp( long timestamp )
+    {
+        SimpleDateFormat dateFormat = new SimpleDateFormat();
+        return dateFormat.format( new Date( timestamp ) );
     }
 }

Modified: maven/archiva/branches/archiva-MRM-239/archiva-discoverer/src/main/java/org/apache/maven/archiva/discoverer/RepositoryScanner.java
URL: http://svn.apache.org/viewvc/maven/archiva/branches/archiva-MRM-239/archiva-discoverer/src/main/java/org/apache/maven/archiva/discoverer/RepositoryScanner.java?view=diff&rev=508779&r1=508778&r2=508779
==============================================================================
--- maven/archiva/branches/archiva-MRM-239/archiva-discoverer/src/main/java/org/apache/maven/archiva/discoverer/RepositoryScanner.java (original)
+++ maven/archiva/branches/archiva-MRM-239/archiva-discoverer/src/main/java/org/apache/maven/archiva/discoverer/RepositoryScanner.java Sat Feb 17 09:04:40 2007
@@ -20,6 +20,8 @@
  */
 
 import org.apache.commons.lang.SystemUtils;
+import org.apache.maven.archiva.common.consumers.Consumer;
+import org.apache.maven.archiva.common.utils.BaseFile;
 import org.apache.maven.artifact.repository.ArtifactRepository;
 import org.codehaus.plexus.logging.Logger;
 import org.codehaus.plexus.util.DirectoryWalkListener;
@@ -50,7 +52,7 @@
 
     private DiscovererStatistics stats;
 
-    private boolean checkLastModified = true;
+    private long onlyModifiedAfterTimestamp = 0;
 
     public RepositoryScanner( ArtifactRepository repository, List consumerList )
     {
@@ -61,7 +63,7 @@
         Iterator it = this.consumers.iterator();
         while ( it.hasNext() )
         {
-            DiscovererConsumer consumer = (DiscovererConsumer) it.next();
+            Consumer consumer = (Consumer) it.next();
 
             if ( !consumer.init( this.repository ) )
             {
@@ -81,29 +83,9 @@
         return stats;
     }
 
-    public void directoryWalkFinished()
-    {
-        getLogger().info( "Walk Finished." );
-        stats.timestampFinished = System.currentTimeMillis();
-        
-        if( isCheckLastModified() )
-        {
-            // Only save if dealing with 'last modified' concept.
-            
-            try
-            {
-                stats.save();
-            }
-            catch ( DiscovererException e )
-            {
-                getLogger().warn( "Unable to save Scan information.", e );
-            }
-        }
-    }
-
     public void directoryWalkStarting( File basedir )
     {
-        getLogger().info( "Walk Started." );
+        getLogger().info( "Walk Started: [" + this.repository.getId() + "] " + this.repository.getBasedir() );
         stats.reset();
         stats.timestampStarted = System.currentTimeMillis();
     }
@@ -113,7 +95,7 @@
         getLogger().debug( "Walk Step: " + percentage + ", " + file );
 
         // Timestamp finished points to the last successful scan, not this current one.
-        if ( isCheckLastModified() && ( file.lastModified() <= stats.timestampFinished ) )
+        if ( file.lastModified() < onlyModifiedAfterTimestamp )
         {
             // Skip file as no change has occured.
             getLogger().debug( "Skipping, No Change: " + file.getAbsolutePath() );
@@ -125,62 +107,87 @@
         {
             stats.filesIncluded++;
 
-            String relativePath = PathUtil.getRelative( repository.getBasedir(), file );
+            BaseFile basefile = new BaseFile( repository.getBasedir(), file );
 
             Iterator itConsumers = this.consumers.iterator();
             while ( itConsumers.hasNext() )
             {
-                DiscovererConsumer consumer = (DiscovererConsumer) itConsumers.next();
+                Consumer consumer = (Consumer) itConsumers.next();
 
-                if ( isConsumerOfFile( consumer, relativePath ) )
+                if ( wantsFile( consumer, basefile.getRelativePath() ) )
                 {
                     try
                     {
                         getLogger().debug( "Sending to consumer: " + consumer.getName() );
                         stats.filesConsumed++;
-                        consumer.processFile( file );
+                        consumer.processFile( basefile );
                     }
                     catch ( Exception e )
                     {
                         /* Intentionally Catch all exceptions.
                          * So that the discoverer processing can continue.
                          */
-                        getLogger()
-                            .error( "Unable to process file [" + file.getAbsolutePath() + "]: " + e.getMessage(), e );
+                        getLogger().error(
+                                           "Consumer [" + consumer.getName() + "] had an error when processing file ["
+                                               + basefile.getAbsolutePath() + "]: " + e.getMessage(), e );
                     }
                 }
                 else
                 {
-                    getLogger().debug( "Skipping consumer " + consumer.getName() + " for file " + relativePath );
+                    getLogger().debug(
+                                       "Skipping consumer " + consumer.getName() + " for file "
+                                           + basefile.getRelativePath() );
                 }
             }
         }
     }
 
-    private boolean isConsumerOfFile( DiscovererConsumer consumer, String relativePath )
+    public void directoryWalkFinished()
     {
-        Iterator it = consumer.getIncludePatterns().iterator();
-        // String name = file.getAbsolutePath();
+        getLogger().info( "Walk Finished: [" + this.repository.getId() + "] " + this.repository.getBasedir() );
+        stats.timestampFinished = System.currentTimeMillis();
+    }
+
+    private boolean wantsFile( Consumer consumer, String relativePath )
+    {
+        Iterator it;
+
+        // Test excludes first.
+        it = consumer.getExcludePatterns().iterator();
         while ( it.hasNext() )
         {
             String pattern = (String) it.next();
             if ( SelectorUtils.matchPath( pattern, relativePath, isCaseSensitive ) )
             {
+                // Definately does NOT WANT FILE.
+                return false;
+            }
+        }
+
+        // Now test includes.
+        it = consumer.getIncludePatterns().iterator();
+        while ( it.hasNext() )
+        {
+            String pattern = (String) it.next();
+            if ( SelectorUtils.matchPath( pattern, relativePath, isCaseSensitive ) )
+            {
+                // Specifically WANTS FILE.
                 return true;
             }
         }
 
+        // Not included, and Not excluded?  Default to EXCLUDE.
         return false;
     }
-
-    public boolean isCheckLastModified()
+    
+    public long getOnlyModifiedAfterTimestamp()
     {
-        return checkLastModified;
+        return onlyModifiedAfterTimestamp;
     }
 
-    public void setCheckLastModified( boolean checkLastModified )
+    public void setOnlyModifiedAfterTimestamp( long onlyModifiedAfterTimestamp )
     {
-        this.checkLastModified = checkLastModified;
+        this.onlyModifiedAfterTimestamp = onlyModifiedAfterTimestamp;
     }
 
     /**
@@ -200,5 +207,4 @@
     {
         this.logger = logger;
     }
-
 }

Modified: maven/archiva/branches/archiva-MRM-239/archiva-discoverer/src/test/java/org/apache/maven/archiva/discoverer/AbstractDiscovererTestCase.java
URL: http://svn.apache.org/viewvc/maven/archiva/branches/archiva-MRM-239/archiva-discoverer/src/test/java/org/apache/maven/archiva/discoverer/AbstractDiscovererTestCase.java?view=diff&rev=508779&r1=508778&r2=508779
==============================================================================
--- maven/archiva/branches/archiva-MRM-239/archiva-discoverer/src/test/java/org/apache/maven/archiva/discoverer/AbstractDiscovererTestCase.java (original)
+++ maven/archiva/branches/archiva-MRM-239/archiva-discoverer/src/test/java/org/apache/maven/archiva/discoverer/AbstractDiscovererTestCase.java Sat Feb 17 09:04:40 2007
@@ -33,6 +33,23 @@
 public abstract class AbstractDiscovererTestCase
     extends PlexusTestCase
 {
+    protected Discoverer discoverer;
+
+    protected void setUp()
+        throws Exception
+    {
+        super.setUp();
+
+        discoverer = (Discoverer) lookup( Discoverer.ROLE );
+    }
+
+    protected void tearDown()
+        throws Exception
+    {
+        release( discoverer );
+        super.tearDown();
+    }
+
     protected ArtifactRepository getLegacyRepository()
         throws Exception
     {
@@ -51,19 +68,9 @@
         return repository;
     }
 
-    private void resetRepositoryState( ArtifactRepository repository )
+    protected void resetRepositoryState( ArtifactRepository repository )
     {
-        // Clean out any .stats file.
-        File repoBaseDir = new File( repository.getBasedir() );
-
-        File statFile = new File( repoBaseDir, DiscovererStatistics.STATS_FILENAME );
-        if ( statFile.exists() )
-        {
-            statFile.delete();
-        }
-
-        // TODO: Clean out any index.
-        // TODO: Clean out any report.
+        // Implement any kind of repository cleanup.
     }
 
     protected ArtifactRepository createRepository( File basedir, String layout )
@@ -73,6 +80,7 @@
 
         ArtifactRepositoryLayout repoLayout = (ArtifactRepositoryLayout) lookup( ArtifactRepositoryLayout.ROLE, layout );
 
-        return factory.createArtifactRepository( "discoveryRepo", "file://" + basedir, repoLayout, null, null );
+        return factory.createArtifactRepository( "discoveryRepo-" + getName(), "file://" + basedir, repoLayout, null,
+                                                 null );
     }
 }

Modified: maven/archiva/branches/archiva-MRM-239/archiva-discoverer/src/test/java/org/apache/maven/archiva/discoverer/AllTests.java
URL: http://svn.apache.org/viewvc/maven/archiva/branches/archiva-MRM-239/archiva-discoverer/src/test/java/org/apache/maven/archiva/discoverer/AllTests.java?view=diff&rev=508779&r1=508778&r2=508779
==============================================================================
--- maven/archiva/branches/archiva-MRM-239/archiva-discoverer/src/test/java/org/apache/maven/archiva/discoverer/AllTests.java (original)
+++ maven/archiva/branches/archiva-MRM-239/archiva-discoverer/src/test/java/org/apache/maven/archiva/discoverer/AllTests.java Sat Feb 17 09:04:40 2007
@@ -35,9 +35,7 @@
     {
         TestSuite suite = new TestSuite( "Test for org.apache.maven.archiva.discoverer" );
         //$JUnit-BEGIN$
-        suite.addTest( org.apache.maven.archiva.discoverer.builders.AllTests.suite() );
-        suite.addTest( org.apache.maven.archiva.discoverer.consumers.AllTests.suite() );
-        suite.addTestSuite( PathUtilTest.class );
+        suite.addTestSuite( DefaultDiscovererTest.class );
         //$JUnit-END$
         return suite;
     }

Added: maven/archiva/branches/archiva-MRM-239/archiva-discoverer/src/test/java/org/apache/maven/archiva/discoverer/DefaultDiscovererTest.java
URL: http://svn.apache.org/viewvc/maven/archiva/branches/archiva-MRM-239/archiva-discoverer/src/test/java/org/apache/maven/archiva/discoverer/DefaultDiscovererTest.java?view=auto&rev=508779
==============================================================================
--- maven/archiva/branches/archiva-MRM-239/archiva-discoverer/src/test/java/org/apache/maven/archiva/discoverer/DefaultDiscovererTest.java (added)
+++ maven/archiva/branches/archiva-MRM-239/archiva-discoverer/src/test/java/org/apache/maven/archiva/discoverer/DefaultDiscovererTest.java Sat Feb 17 09:04:40 2007
@@ -0,0 +1,167 @@
+package org.apache.maven.archiva.discoverer;
+
+/*
+ * 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.
+ */
+
+import org.apache.commons.lang.StringUtils;
+import org.apache.maven.archiva.common.utils.BaseFile;
+import org.apache.maven.artifact.repository.ArtifactRepository;
+import org.codehaus.plexus.logging.Logger;
+import org.codehaus.plexus.logging.console.ConsoleLogger;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+/**
+ * DefaultDiscovererTest 
+ *
+ * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a>
+ * @version $Id$
+ */
+public class DefaultDiscovererTest
+    extends AbstractDiscovererTestCase
+{
+    private MockConsumer createAndAddMockConsumer( List consumers, String includePattern, String excludePattern )
+    {
+        MockConsumer mockConsumer = new MockConsumer();
+        mockConsumer.getIncludePatterns().add( includePattern );
+        if ( StringUtils.isNotBlank( excludePattern ) )
+        {
+            mockConsumer.getExcludePatterns().add( excludePattern );
+        }
+        consumers.add( mockConsumer );
+        return mockConsumer;
+    }
+    
+    private void assertFilesProcessed( int expectedFileCount, DiscovererStatistics stats, MockConsumer mockConsumer )
+    {
+        assertNotNull( "Stats should not be null.", stats );
+        assertNotNull( "MockConsumer should not be null.", mockConsumer );
+        assertNotNull( "MockConsumer.filesProcessed should not be null.", mockConsumer.getFilesProcessed() );
+
+        if ( stats.getFilesConsumed() != mockConsumer.getFilesProcessed().size() )
+        {
+            fail( "Somehow, the stats count of files consumed, and the count of actual files "
+                + "processed by the consumer do not match." );
+        }
+
+        int actualFileCount = mockConsumer.getFilesProcessed().size();
+
+        if ( expectedFileCount != actualFileCount )
+        {
+            stats.dump( new ConsoleLogger( Logger.LEVEL_DEBUG, "test" ) );
+            System.out.println( "Base Dir:" + stats.getRepository().getBasedir() );
+            Iterator it = mockConsumer.getFilesProcessed().iterator();
+            while ( it.hasNext() )
+            {
+                BaseFile file = (BaseFile) it.next();
+                System.out.println( "  Processed File: " + file.getRelativePath() );
+            }
+
+            fail( "Files Processed mismatch: expected:<" + expectedFileCount + ">, actual:<" + actualFileCount + ">" );
+        }
+    }
+
+    public void testLegacyLayoutRepositoryAll()
+        throws Exception
+    {
+        ArtifactRepository repository = getLegacyRepository();
+        List consumers = new ArrayList();
+        MockConsumer mockConsumer = createAndAddMockConsumer( consumers, "**/*", null );
+
+        DiscovererStatistics stats = discoverer.walkRepository( repository, consumers, true );
+
+        assertNotNull( stats );
+
+        assertFilesProcessed( 16, stats, mockConsumer );
+    }
+
+    public void testDefaultLayoutRepositoryAll()
+        throws Exception
+    {
+        ArtifactRepository repository = getDefaultRepository();
+        List consumers = new ArrayList();
+        MockConsumer mockConsumer = createAndAddMockConsumer( consumers, "**/*", null );
+
+        DiscovererStatistics stats = discoverer.walkRepository( repository, consumers, true );
+
+        assertNotNull( stats );
+        
+        assertFilesProcessed( 43, stats, mockConsumer );
+    }
+
+    public void testDefaultLayoutRepositoryPomsOnly()
+        throws Exception
+    {
+        ArtifactRepository repository = getDefaultRepository();
+        List consumers = new ArrayList();
+        MockConsumer mockConsumer = createAndAddMockConsumer( consumers, "**/*.pom", null );
+
+        DiscovererStatistics stats = discoverer.walkRepository( repository, consumers, true );
+
+        assertNotNull( stats );
+
+        assertFilesProcessed( 10, stats, mockConsumer );
+    }
+
+    public void testDefaultLayoutRepositoryJarsOnly()
+        throws Exception
+    {
+        ArtifactRepository repository = getDefaultRepository();
+        List consumers = new ArrayList();
+        MockConsumer mockConsumer = createAndAddMockConsumer( consumers, "**/*.jar", null );
+
+        DiscovererStatistics stats = discoverer.walkRepository( repository, consumers, true );
+
+        assertNotNull( stats );
+
+        assertFilesProcessed( 17, stats, mockConsumer );
+    }
+
+    public void testDefaultLayoutRepositoryJarsNoSnapshots()
+        throws Exception
+    {
+        ArtifactRepository repository = getDefaultRepository();
+        List consumers = new ArrayList();
+        MockConsumer mockConsumer = createAndAddMockConsumer( consumers, "**/*.jar", null );
+
+        DiscovererStatistics stats = discoverer.walkRepository( repository, consumers, false );
+
+        assertNotNull( stats );
+
+        assertFilesProcessed( 13, stats, mockConsumer );
+    }
+
+    public void testDefaultLayoutRepositoryJarsNoSnapshotsWithExclusions()
+        throws Exception
+    {
+        ArtifactRepository repository = getDefaultRepository();
+        List consumers = new ArrayList();
+        MockConsumer mockConsumer = createAndAddMockConsumer( consumers, "**/*.jar", null );
+
+        List exclusions = new ArrayList();
+        exclusions.add( "**/*-client.jar" );
+        DiscovererStatistics stats = discoverer.walkRepository( repository, consumers, false, 0, exclusions, null );
+
+        assertNotNull( stats );
+
+        assertFilesProcessed( 12, stats, mockConsumer );
+    }
+}

Propchange: maven/archiva/branches/archiva-MRM-239/archiva-discoverer/src/test/java/org/apache/maven/archiva/discoverer/DefaultDiscovererTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/archiva/branches/archiva-MRM-239/archiva-discoverer/src/test/java/org/apache/maven/archiva/discoverer/DefaultDiscovererTest.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Propchange: maven/archiva/branches/archiva-MRM-239/archiva-discoverer/src/test/java/org/apache/maven/archiva/discoverer/DefaultDiscovererTest.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: maven/archiva/branches/archiva-MRM-239/archiva-discoverer/src/test/java/org/apache/maven/archiva/discoverer/MockConsumer.java
URL: http://svn.apache.org/viewvc/maven/archiva/branches/archiva-MRM-239/archiva-discoverer/src/test/java/org/apache/maven/archiva/discoverer/MockConsumer.java?view=auto&rev=508779
==============================================================================
--- maven/archiva/branches/archiva-MRM-239/archiva-discoverer/src/test/java/org/apache/maven/archiva/discoverer/MockConsumer.java (added)
+++ maven/archiva/branches/archiva-MRM-239/archiva-discoverer/src/test/java/org/apache/maven/archiva/discoverer/MockConsumer.java Sat Feb 17 09:04:40 2007
@@ -0,0 +1,75 @@
+/**
+ * 
+ */
+package org.apache.maven.archiva.discoverer;
+
+import org.apache.maven.archiva.common.consumers.Consumer;
+import org.apache.maven.archiva.common.consumers.ConsumerException;
+import org.apache.maven.archiva.common.utils.BaseFile;
+import org.apache.maven.artifact.repository.ArtifactRepository;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class MockConsumer
+    implements Consumer
+{
+    private List excludePatterns = new ArrayList();
+
+    private List includePatterns = new ArrayList();
+
+    private List filesProcessed = new ArrayList();
+
+    private int countFileProblems = 0;
+
+    public String getName()
+    {
+        return "MockConsumer (Testing Only)";
+    }
+
+    public boolean init( ArtifactRepository repository )
+    {
+        return true;
+    }
+
+    public void processFile( BaseFile file )
+        throws ConsumerException
+    {
+        filesProcessed.add( file );
+    }
+
+    public void processFileProblem( BaseFile file, String message )
+    {
+        countFileProblems++;
+    }
+
+    public List getExcludePatterns()
+    {
+        return excludePatterns;
+    }
+
+    public void setExcludePatterns( List excludePatterns )
+    {
+        this.excludePatterns = excludePatterns;
+    }
+
+    public List getIncludePatterns()
+    {
+        return includePatterns;
+    }
+
+    public void setIncludePatterns( List includePatterns )
+    {
+        this.includePatterns = includePatterns;
+    }
+
+    public int getCountFileProblems()
+    {
+        return countFileProblems;
+    }
+
+    public List getFilesProcessed()
+    {
+        return filesProcessed;
+    }
+}
\ No newline at end of file

Propchange: maven/archiva/branches/archiva-MRM-239/archiva-discoverer/src/test/java/org/apache/maven/archiva/discoverer/MockConsumer.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/archiva/branches/archiva-MRM-239/archiva-discoverer/src/test/java/org/apache/maven/archiva/discoverer/MockConsumer.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Propchange: maven/archiva/branches/archiva-MRM-239/archiva-discoverer/src/test/java/org/apache/maven/archiva/discoverer/MockConsumer.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: maven/archiva/branches/archiva-MRM-239/archiva-indexer/pom.xml
URL: http://svn.apache.org/viewvc/maven/archiva/branches/archiva-MRM-239/archiva-indexer/pom.xml?view=diff&rev=508779&r1=508778&r2=508779
==============================================================================
--- maven/archiva/branches/archiva-MRM-239/archiva-indexer/pom.xml (original)
+++ maven/archiva/branches/archiva-MRM-239/archiva-indexer/pom.xml Sat Feb 17 09:04:40 2007
@@ -27,7 +27,7 @@
   </parent>
   <modelVersion>4.0.0</modelVersion>
   <artifactId>archiva-indexer</artifactId>
-  <name>Archiva Repository Indexer</name>
+  <name>Archiva Indexer</name>
   <dependencies>
     <dependency>
       <groupId>org.apache.maven</groupId>

Modified: maven/archiva/branches/archiva-MRM-239/archiva-proxy/pom.xml
URL: http://svn.apache.org/viewvc/maven/archiva/branches/archiva-MRM-239/archiva-proxy/pom.xml?view=diff&rev=508779&r1=508778&r2=508779
==============================================================================
--- maven/archiva/branches/archiva-MRM-239/archiva-proxy/pom.xml (original)
+++ maven/archiva/branches/archiva-MRM-239/archiva-proxy/pom.xml Sat Feb 17 09:04:40 2007
@@ -31,11 +31,7 @@
   <dependencies>
     <dependency>
       <groupId>org.apache.maven.archiva</groupId>
-      <artifactId>archiva-discoverer</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.maven</groupId>
-      <artifactId>maven-artifact</artifactId>
+      <artifactId>archiva-common</artifactId>
     </dependency>
     <dependency>
       <groupId>org.apache.maven.wagon</groupId>

Modified: maven/archiva/branches/archiva-MRM-239/archiva-proxy/src/main/java/org/apache/maven/archiva/proxy/DefaultProxyRequestHandler.java
URL: http://svn.apache.org/viewvc/maven/archiva/branches/archiva-MRM-239/archiva-proxy/src/main/java/org/apache/maven/archiva/proxy/DefaultProxyRequestHandler.java?view=diff&rev=508779&r1=508778&r2=508779
==============================================================================
--- maven/archiva/branches/archiva-MRM-239/archiva-proxy/src/main/java/org/apache/maven/archiva/proxy/DefaultProxyRequestHandler.java (original)
+++ maven/archiva/branches/archiva-MRM-239/archiva-proxy/src/main/java/org/apache/maven/archiva/proxy/DefaultProxyRequestHandler.java Sat Feb 17 09:04:40 2007
@@ -21,8 +21,8 @@
 
 import org.apache.commons.io.FileUtils;
 import org.apache.commons.io.IOUtils;
-import org.apache.maven.archiva.discoverer.DiscovererException;
-import org.apache.maven.archiva.discoverer.builders.LayoutArtifactBuilder;
+import org.apache.maven.archiva.common.artifact.builder.BuilderException;
+import org.apache.maven.archiva.common.artifact.builder.LayoutArtifactBuilder;
 import org.apache.maven.artifact.Artifact;
 import org.apache.maven.artifact.factory.ArtifactFactory;
 import org.apache.maven.artifact.repository.ArtifactRepository;
@@ -162,7 +162,7 @@
                 artifact = defaultArtifactBuilder.build( artifactPath );
                 getLogger().debug( "Artifact requested is: " + artifact );
             }
-            catch ( DiscovererException e )
+            catch ( BuilderException e )
             {
                 msg = "Failed to build artifact from path:\n\tfrom default: " + e.getMessage();
             }
@@ -174,7 +174,7 @@
                     artifact = legacyArtifactBuilder.build( artifactPath );
                     getLogger().debug( "Artifact requested is: " + artifact );
                 }
-                catch ( DiscovererException e )
+                catch ( BuilderException e )
                 {
                     getLogger().debug( msg + "\n\tfrom legacy: " + e.getMessage() );
                 }

Added: maven/archiva/branches/archiva-MRM-239/archiva-site/src/site/resources/images/graph-multimodule.dot
URL: http://svn.apache.org/viewvc/maven/archiva/branches/archiva-MRM-239/archiva-site/src/site/resources/images/graph-multimodule.dot?view=auto&rev=508779
==============================================================================
--- maven/archiva/branches/archiva-MRM-239/archiva-site/src/site/resources/images/graph-multimodule.dot (added)
+++ maven/archiva/branches/archiva-MRM-239/archiva-site/src/site/resources/images/graph-multimodule.dot Sat Feb 17 09:04:40 2007
@@ -0,0 +1,239 @@
+// Auto generated dot file from plexus-graphing-graphviz.
+digraph gid {
+
+  // Graph Defaults
+  graph [
+    rankdir="TB"
+  ];
+
+  // Node Defaults.
+  node [
+    fontname="Helvetica",
+    fontsize="8",
+    shape="box"
+  ];
+
+  // Edge Defaults.
+  edge [
+    arrowsize="0.8"
+    fontsize="8",
+  ];
+
+  // Node
+  "ORGAPACHEMAVENARCHIVAARCHIVA_REPOSITORY_LAYER10_SNAPSHOTJAR" [
+    label="org.apache.maven.archiva\narchiva-repository-layer\n1.0-SNAPSHOT\njar",
+    fontsize="8",
+    shape=box
+  ];
+
+  // Node
+  "ORGAPACHEMAVENARCHIVAARCHIVA_WEBAPP10_SNAPSHOTWAR" [
+    label="org.apache.maven.archiva\narchiva-webapp\n1.0-SNAPSHOT\nwar",
+    fontsize="8",
+    shape=box
+  ];
+
+  // Node
+  "ORGAPACHEMAVENARCHIVAARCHIVA_PLEXUS_APPLICATION10_SNAPSHOTPLEXUS_APPLICATION" [
+    label="org.apache.maven.archiva\narchiva-plexus-application\n1.0-SNAPSHOT\nplexus-application",
+    fontsize="8",
+    shape=box
+  ];
+
+  // Node
+  "ORGAPACHEMAVENARCHIVAARCHIVA_CORE10_SNAPSHOTJAR" [
+    label="org.apache.maven.archiva\narchiva-core\n1.0-SNAPSHOT\njar",
+    fontsize="8",
+    shape=box
+  ];
+
+  // Node
+  "ORGAPACHEMAVENARCHIVAARCHIVA_CONFIGURATION10_SNAPSHOTJAR" [
+    label="org.apache.maven.archiva\narchiva-configuration\n1.0-SNAPSHOT\njar",
+    fontsize="8",
+    shape=box
+  ];
+
+  // Node
+  "ORGAPACHEMAVENARCHIVAARCHIVA_PROXY10_SNAPSHOTJAR" [
+    label="org.apache.maven.archiva\narchiva-proxy\n1.0-SNAPSHOT\njar",
+    fontsize="8",
+    shape=box
+  ];
+
+  // Node
+  "ORGAPACHEMAVENARCHIVAARCHIVA_REPORTS_STANDARD10_SNAPSHOTJAR" [
+    label="org.apache.maven.archiva\narchiva-reports-standard\n1.0-SNAPSHOT\njar",
+    fontsize="8",
+    shape=box
+  ];
+
+  // Node
+  "ORGAPACHEMAVENARCHIVAARCHIVA_CLI10_SNAPSHOTJAR" [
+    label="org.apache.maven.archiva\narchiva-cli\n1.0-SNAPSHOT\njar",
+    fontsize="8",
+    shape=box
+  ];
+
+  // Node
+  "ORGAPACHEMAVENARCHIVAARCHIVA_CONVERTER10_SNAPSHOTJAR" [
+    label="org.apache.maven.archiva\narchiva-converter\n1.0-SNAPSHOT\njar",
+    fontsize="8",
+    shape=box
+  ];
+
+  // Node
+  "ORGAPACHEMAVENARCHIVAARCHIVA_APPLET10_SNAPSHOTJAR" [
+    label="org.apache.maven.archiva\narchiva-applet\n1.0-SNAPSHOT\njar",
+    fontsize="8",
+    shape=box
+  ];
+
+  // Node
+  "ORGAPACHEMAVENARCHIVAARCHIVA_PLEXUS_RUNTIME10_SNAPSHOTJAR" [
+    label="org.apache.maven.archiva\narchiva-plexus-runtime\n1.0-SNAPSHOT\njar",
+    fontsize="8",
+    shape=box
+  ];
+
+  // Node
+  "ORGAPACHEMAVENARCHIVAARCHIVA_DISCOVERER10_SNAPSHOTJAR" [
+    label="org.apache.maven.archiva\narchiva-discoverer\n1.0-SNAPSHOT\njar",
+    fontsize="8",
+    shape=box
+  ];
+
+  // Node
+  "ORGAPACHEMAVENARCHIVAARCHIVA_SECURITY10_SNAPSHOTJAR" [
+    label="org.apache.maven.archiva\narchiva-security\n1.0-SNAPSHOT\njar",
+    fontsize="8",
+    shape=box
+  ];
+
+  // Node
+  "ORGAPACHEMAVENARCHIVAARCHIVA_INDEXER10_SNAPSHOTJAR" [
+    label="org.apache.maven.archiva\narchiva-indexer\n1.0-SNAPSHOT\njar",
+    fontsize="8",
+    shape=box
+  ];
+
+  // Edge
+  "ORGAPACHEMAVENARCHIVAARCHIVA_CORE10_SNAPSHOTJAR" -> "ORGAPACHEMAVENARCHIVAARCHIVA_CONVERTER10_SNAPSHOTJAR" [
+    arrowtail=none,
+    arrowhead=normal
+  ];
+
+  // Edge
+  "ORGAPACHEMAVENARCHIVAARCHIVA_WEBAPP10_SNAPSHOTWAR" -> "ORGAPACHEMAVENARCHIVAARCHIVA_APPLET10_SNAPSHOTJAR" [
+    arrowtail=none,
+    arrowhead=normal
+  ];
+
+  // Edge
+  "ORGAPACHEMAVENARCHIVAARCHIVA_PLEXUS_APPLICATION10_SNAPSHOTPLEXUS_APPLICATION" -> "ORGAPACHEMAVENARCHIVAARCHIVA_WEBAPP10_SNAPSHOTWAR" [
+    arrowtail=none,
+    arrowhead=normal
+  ];
+
+  // Edge
+  "ORGAPACHEMAVENARCHIVAARCHIVA_WEBAPP10_SNAPSHOTWAR" -> "ORGAPACHEMAVENARCHIVAARCHIVA_INDEXER10_SNAPSHOTJAR" [
+    arrowtail=none,
+    arrowhead=normal
+  ];
+
+  // Edge
+  "ORGAPACHEMAVENARCHIVAARCHIVA_CORE10_SNAPSHOTJAR" -> "ORGAPACHEMAVENARCHIVAARCHIVA_CONFIGURATION10_SNAPSHOTJAR" [
+    arrowtail=none,
+    arrowhead=normal
+  ];
+
+  // Edge
+  "ORGAPACHEMAVENARCHIVAARCHIVA_PLEXUS_RUNTIME10_SNAPSHOTJAR" -> "ORGAPACHEMAVENARCHIVAARCHIVA_PLEXUS_APPLICATION10_SNAPSHOTPLEXUS_APPLICATION" [
+    arrowtail=none,
+    arrowhead=normal
+  ];
+
+  // Edge
+  "ORGAPACHEMAVENARCHIVAARCHIVA_CLI10_SNAPSHOTJAR" -> "ORGAPACHEMAVENARCHIVAARCHIVA_CORE10_SNAPSHOTJAR" [
+    arrowtail=none,
+    arrowhead=normal
+  ];
+
+  // Edge
+  "ORGAPACHEMAVENARCHIVAARCHIVA_PROXY10_SNAPSHOTJAR" -> "ORGAPACHEMAVENARCHIVAARCHIVA_DISCOVERER10_SNAPSHOTJAR" [
+    arrowtail=none,
+    arrowhead=normal
+  ];
+
+  // Edge
+  "ORGAPACHEMAVENARCHIVAARCHIVA_REPORTS_STANDARD10_SNAPSHOTJAR" -> "ORGAPACHEMAVENARCHIVAARCHIVA_INDEXER10_SNAPSHOTJAR" [
+    arrowtail=none,
+    arrowhead=normal
+  ];
+
+  // Edge
+  "ORGAPACHEMAVENARCHIVAARCHIVA_CORE10_SNAPSHOTJAR" -> "ORGAPACHEMAVENARCHIVAARCHIVA_DISCOVERER10_SNAPSHOTJAR" [
+    arrowtail=none,
+    arrowhead=normal
+  ];
+
+  // Edge
+  "ORGAPACHEMAVENARCHIVAARCHIVA_REPORTS_STANDARD10_SNAPSHOTJAR" -> "ORGAPACHEMAVENARCHIVAARCHIVA_REPOSITORY_LAYER10_SNAPSHOTJAR" [
+    arrowtail=none,
+    arrowhead=normal
+  ];
+
+  // Edge
+  "ORGAPACHEMAVENARCHIVAARCHIVA_REPORTS_STANDARD10_SNAPSHOTJAR" -> "ORGAPACHEMAVENARCHIVAARCHIVA_DISCOVERER10_SNAPSHOTJAR" [
+    arrowtail=none,
+    arrowhead=normal
+  ];
+
+  // Edge
+  "ORGAPACHEMAVENARCHIVAARCHIVA_WEBAPP10_SNAPSHOTWAR" -> "ORGAPACHEMAVENARCHIVAARCHIVA_DISCOVERER10_SNAPSHOTJAR" [
+    arrowtail=none,
+    arrowhead=normal
+  ];
+
+  // Edge
+  "ORGAPACHEMAVENARCHIVAARCHIVA_WEBAPP10_SNAPSHOTWAR" -> "ORGAPACHEMAVENARCHIVAARCHIVA_PROXY10_SNAPSHOTJAR" [
+    arrowtail=none,
+    arrowhead=normal
+  ];
+
+  // Edge
+  "ORGAPACHEMAVENARCHIVAARCHIVA_CORE10_SNAPSHOTJAR" -> "ORGAPACHEMAVENARCHIVAARCHIVA_PROXY10_SNAPSHOTJAR" [
+    arrowtail=none,
+    arrowhead=normal
+  ];
+
+  // Edge
+  "ORGAPACHEMAVENARCHIVAARCHIVA_WEBAPP10_SNAPSHOTWAR" -> "ORGAPACHEMAVENARCHIVAARCHIVA_CONFIGURATION10_SNAPSHOTJAR" [
+    arrowtail=none,
+    arrowhead=normal
+  ];
+
+  // Edge
+  "ORGAPACHEMAVENARCHIVAARCHIVA_CONVERTER10_SNAPSHOTJAR" -> "ORGAPACHEMAVENARCHIVAARCHIVA_REPORTS_STANDARD10_SNAPSHOTJAR" [
+    arrowtail=none,
+    arrowhead=normal
+  ];
+
+  // Edge
+  "ORGAPACHEMAVENARCHIVAARCHIVA_CORE10_SNAPSHOTJAR" -> "ORGAPACHEMAVENARCHIVAARCHIVA_REPORTS_STANDARD10_SNAPSHOTJAR" [
+    arrowtail=none,
+    arrowhead=normal
+  ];
+
+  // Edge
+  "ORGAPACHEMAVENARCHIVAARCHIVA_WEBAPP10_SNAPSHOTWAR" -> "ORGAPACHEMAVENARCHIVAARCHIVA_CORE10_SNAPSHOTJAR" [
+    arrowtail=none,
+    arrowhead=normal
+  ];
+
+  // Edge
+  "ORGAPACHEMAVENARCHIVAARCHIVA_WEBAPP10_SNAPSHOTWAR" -> "ORGAPACHEMAVENARCHIVAARCHIVA_SECURITY10_SNAPSHOTJAR" [
+    arrowtail=none,
+    arrowhead=normal
+  ];
+}

Added: maven/archiva/branches/archiva-MRM-239/archiva-site/src/site/resources/images/graph-multimodule.png
URL: http://svn.apache.org/viewvc/maven/archiva/branches/archiva-MRM-239/archiva-site/src/site/resources/images/graph-multimodule.png?view=auto&rev=508779
==============================================================================
Binary file - no diff available.

Propchange: maven/archiva/branches/archiva-MRM-239/archiva-site/src/site/resources/images/graph-multimodule.png
------------------------------------------------------------------------------
    svn:mime-type = image/png

Modified: maven/archiva/branches/archiva-MRM-239/archiva-webapp/pom.xml
URL: http://svn.apache.org/viewvc/maven/archiva/branches/archiva-MRM-239/archiva-webapp/pom.xml?view=diff&rev=508779&r1=508778&r2=508779
==============================================================================
--- maven/archiva/branches/archiva-MRM-239/archiva-webapp/pom.xml (original)
+++ maven/archiva/branches/archiva-MRM-239/archiva-webapp/pom.xml Sat Feb 17 09:04:40 2007
@@ -107,23 +107,15 @@
     </dependency>
     <dependency>
       <groupId>org.apache.maven.archiva</groupId>
-      <artifactId>archiva-indexer</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.maven.archiva</groupId>
-      <artifactId>archiva-discoverer</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.maven.archiva</groupId>
-      <artifactId>archiva-configuration</artifactId>
+      <artifactId>archiva-proxy</artifactId>
     </dependency>
     <dependency>
       <groupId>org.apache.maven.archiva</groupId>
-      <artifactId>archiva-proxy</artifactId>
+      <artifactId>archiva-core</artifactId>
     </dependency>
     <dependency>
       <groupId>org.apache.maven.archiva</groupId>
-      <artifactId>archiva-core</artifactId>
+      <artifactId>archiva-common</artifactId>
     </dependency>
     <dependency>
       <groupId>org.apache.maven.archiva</groupId>

Modified: maven/archiva/branches/archiva-MRM-239/archiva-webapp/src/jetty-env.xml
URL: http://svn.apache.org/viewvc/maven/archiva/branches/archiva-MRM-239/archiva-webapp/src/jetty-env.xml?view=diff&rev=508779&r1=508778&r2=508779
==============================================================================
--- maven/archiva/branches/archiva-MRM-239/archiva-webapp/src/jetty-env.xml (original)
+++ maven/archiva/branches/archiva-MRM-239/archiva-webapp/src/jetty-env.xml Sat Feb 17 09:04:40 2007
@@ -37,21 +37,46 @@
   </Arg>
 </New>
 
+  <!-- Archiva database -->
+  <New id="archiva" class="org.mortbay.jetty.plus.naming.Resource">
+    <Arg>jdbc/archiva</Arg>
+    <Arg>
+      <New class="org.apache.derby.jdbc.EmbeddedDataSource">
+        <Set name="DatabaseName">target/databases/archiva</Set>
+        <Set name="user">sa</Set>
+        <Set name="createDatabase">create</Set>
+      </New>
+    </Arg>
+  </New>
+
+  <New id="archivaShutdown" class="org.mortbay.jetty.plus.naming.Resource">
+    <Arg>jdbc/archivaShutdown</Arg>
+    <Arg>
+      <New class="org.apache.derby.jdbc.EmbeddedDataSource">
+        <Set name="DatabaseName">target/databases/archiva</Set>
+        <Set name="user">sa</Set>
+        <Set name="shutdownDatabase">shutdown</Set>
+      </New>
+    </Arg>
+  </New>
+
+  <!-- Users / Security Database -->
   <New id="users" class="org.mortbay.jetty.plus.naming.Resource">
     <Arg>jdbc/users</Arg>
     <Arg>
       <New class="org.apache.derby.jdbc.EmbeddedDataSource">
-        <Set name="DatabaseName">target/database</Set>
+        <Set name="DatabaseName">target/databases/users</Set>
         <Set name="user">sa</Set>
         <Set name="createDatabase">create</Set>
       </New>
     </Arg>
   </New>
-  <New id="shutdown" class="org.mortbay.jetty.plus.naming.Resource">
-    <Arg>jdbc/shutdown</Arg>
+
+  <New id="usersShutdown" class="org.mortbay.jetty.plus.naming.Resource">
+    <Arg>jdbc/usersShutdown</Arg>
     <Arg>
       <New class="org.apache.derby.jdbc.EmbeddedDataSource">
-        <Set name="DatabaseName">target/database</Set>
+        <Set name="DatabaseName">target/databases/users</Set>
         <Set name="user">sa</Set>
         <Set name="shutdownDatabase">shutdown</Set>
       </New>

Modified: maven/archiva/branches/archiva-MRM-239/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/ConfigureAction.java
URL: http://svn.apache.org/viewvc/maven/archiva/branches/archiva-MRM-239/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/ConfigureAction.java?view=diff&rev=508779&r1=508778&r2=508779
==============================================================================
--- maven/archiva/branches/archiva-MRM-239/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/ConfigureAction.java (original)
+++ maven/archiva/branches/archiva-MRM-239/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/ConfigureAction.java Sat Feb 17 09:04:40 2007
@@ -28,7 +28,7 @@
 import org.apache.maven.archiva.configuration.InvalidConfigurationException;
 import org.apache.maven.archiva.indexer.RepositoryIndexException;
 import org.apache.maven.archiva.indexer.RepositoryIndexSearchException;
-import org.apache.maven.archiva.scheduler.executors.DataRefreshExecutor;
+import org.apache.maven.archiva.repositories.ActiveManagedRepositories;
 import org.apache.maven.archiva.security.ArchivaRoleConstants;
 import org.codehaus.plexus.registry.RegistryException;
 import org.codehaus.plexus.scheduler.CronExpressionValidator;
@@ -57,15 +57,15 @@
     private ArchivaConfiguration archivaConfiguration;
 
     /**
-     * @plexus.requirement role="org.codehaus.plexus.taskqueue.execution.TaskExecutor" role-hint="data-refresh"
+     * @plexus.requirement
      */
-    private DataRefreshExecutor dataRefresh;
+    private ActiveManagedRepositories activeRepositories;
 
     /**
      * The configuration.
      */
     private Configuration configuration;
-
+    
     private CronExpressionValidator cronValidator;
 
     private String second = "0";
@@ -101,7 +101,7 @@
     {
         // TODO: if this didn't come from the form, go to configure.action instead of going through with re-saving what was just loaded
         // TODO: if this is changed, do we move the index or recreate it?
-        configuration.setIndexerCronExpression( getCronExpression() );
+        configuration.setDataRefreshCronExpression( getCronExpression() );
 
         // Normalize the path
         File file = new File( configuration.getIndexPath() );
@@ -126,7 +126,7 @@
 
     public String input()
     {
-        String[] cronEx = configuration.getIndexerCronExpression().split( " " );
+        String[] cronEx = configuration.getDataRefreshCronExpression().split( " " );
         int i = 0;
 
         while ( i < cronEx.length )
@@ -158,9 +158,9 @@
             i++;
         }
 
-        if ( dataRefresh.getLastRunTime() != 0 )
+        if ( activeRepositories.getLastDataRefreshTime() != 0 )
         {
-            lastIndexingTime = new Date( dataRefresh.getLastRunTime() ).toString();
+            lastIndexingTime = new Date( activeRepositories.getLastDataRefreshTime() ).toString();
         }
         else
         {

Modified: maven/archiva/branches/archiva-MRM-239/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/RunRepositoryTaskAction.java
URL: http://svn.apache.org/viewvc/maven/archiva/branches/archiva-MRM-239/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/RunRepositoryTaskAction.java?view=diff&rev=508779&r1=508778&r2=508779
==============================================================================
--- maven/archiva/branches/archiva-MRM-239/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/RunRepositoryTaskAction.java (original)
+++ maven/archiva/branches/archiva-MRM-239/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/RunRepositoryTaskAction.java Sat Feb 17 09:04:40 2007
@@ -20,12 +20,12 @@
  */
 
 import org.apache.maven.archiva.scheduler.RepositoryTaskScheduler;
-import org.apache.maven.archiva.scheduler.TaskExecutionException;
 import org.apache.maven.archiva.security.ArchivaRoleConstants;
 import org.codehaus.plexus.security.rbac.Resource;
 import org.codehaus.plexus.security.ui.web.interceptor.SecureAction;
 import org.codehaus.plexus.security.ui.web.interceptor.SecureActionBundle;
 import org.codehaus.plexus.security.ui.web.interceptor.SecureActionException;
+import org.codehaus.plexus.taskqueue.execution.TaskExecutionException;
 import org.codehaus.plexus.xwork.action.PlexusActionSupport;
 
 /**
@@ -42,7 +42,7 @@
      */
     private RepositoryTaskScheduler taskScheduler;
 
-    public String runIndexer()
+    public String runRefresh()
         throws TaskExecutionException
     {
         taskScheduler.runDataRefresh();

Modified: maven/archiva/branches/archiva-MRM-239/archiva-webapp/src/main/java/org/apache/maven/archiva/web/tags/DownloadArtifact.java
URL: http://svn.apache.org/viewvc/maven/archiva/branches/archiva-MRM-239/archiva-webapp/src/main/java/org/apache/maven/archiva/web/tags/DownloadArtifact.java?view=diff&rev=508779&r1=508778&r2=508779
==============================================================================
--- maven/archiva/branches/archiva-MRM-239/archiva-webapp/src/main/java/org/apache/maven/archiva/web/tags/DownloadArtifact.java (original)
+++ maven/archiva/branches/archiva-MRM-239/archiva-webapp/src/main/java/org/apache/maven/archiva/web/tags/DownloadArtifact.java Sat Feb 17 09:04:40 2007
@@ -25,7 +25,7 @@
 
 import org.apache.commons.lang.StringEscapeUtils;
 import org.apache.commons.lang.StringUtils;
-import org.apache.maven.archiva.artifact.ManagedArtifact;
+import org.apache.maven.archiva.common.artifact.managed.ManagedArtifact;
 import org.apache.maven.archiva.configuration.RepositoryConfiguration;
 import org.apache.maven.archiva.repositories.ActiveManagedRepositories;
 import org.apache.maven.project.ProjectBuildingException;

Modified: maven/archiva/branches/archiva-MRM-239/archiva-webapp/src/main/resources/META-INF/plexus/application.xml
URL: http://svn.apache.org/viewvc/maven/archiva/branches/archiva-MRM-239/archiva-webapp/src/main/resources/META-INF/plexus/application.xml?view=diff&rev=508779&r1=508778&r2=508779
==============================================================================
--- maven/archiva/branches/archiva-MRM-239/archiva-webapp/src/main/resources/META-INF/plexus/application.xml (original)
+++ maven/archiva/branches/archiva-MRM-239/archiva-webapp/src/main/resources/META-INF/plexus/application.xml Sat Feb 17 09:04:40 2007
@@ -73,6 +73,60 @@
 
     <component>
       <role>org.codehaus.plexus.jdo.JdoFactory</role>
+      <role-hint>archiva</role-hint>
+      <implementation>org.codehaus.plexus.jdo.DataSourceConfigurableJdoFactory</implementation>
+      <configuration>
+
+        <connectionFactoryName>java:comp/env/jdbc/archiva</connectionFactoryName>
+        <shutdownConnectionFactoryName>java:comp/env/jdbc/archivaShutdown</shutdownConnectionFactoryName>
+
+        <!-- JPOX and JDO configuration -->
+        <persistenceManagerFactoryClass>org.jpox.PersistenceManagerFactoryImpl</persistenceManagerFactoryClass>
+        <otherProperties>
+          <property>
+            <name>org.jpox.autoCreateSchema</name>
+            <value>true</value>
+          </property>
+          <property>
+            <name>org.jpox.validateTables</name>
+            <value>false</value>
+          </property>
+          <property>
+            <name>org.jpox.validateConstraints</name>
+            <value>false</value>
+          </property>
+          <property>
+            <name>org.jpox.validateColumns</name>
+            <value>false</value>
+          </property>
+          <property>
+            <name>org.jpox.autoStartMechanism</name>
+            <value>None</value>
+          </property>
+          <property>
+            <name>org.jpox.transactionIsolation</name>
+            <value>READ_UNCOMMITTED</value>
+          </property>
+          <property>
+            <name>org.jpox.poid.transactionIsolation</name>
+            <value>READ_UNCOMMITTED</value>
+          </property>
+          <property>
+            <name>org.jpox.rdbms.dateTimezone</name>
+            <value>JDK_DEFAULT_TIMEZONE</value>
+          </property>
+<!--
+          <property>
+            <name>org.jpox.identifier.case</name>
+            <value>PreserveCase</value>
+          </property>
+-->
+        </otherProperties>
+      </configuration>
+    </component>
+
+    <component>
+      <role>org.codehaus.plexus.jdo.JdoFactory</role>
       <role-hint>users</role-hint>
       <implementation>org.codehaus.plexus.jdo.DataSourceConfigurableJdoFactory</implementation>
       <configuration>

Modified: maven/archiva/branches/archiva-MRM-239/pom.xml
URL: http://svn.apache.org/viewvc/maven/archiva/branches/archiva-MRM-239/pom.xml?view=diff&rev=508779&r1=508778&r2=508779
==============================================================================
--- maven/archiva/branches/archiva-MRM-239/pom.xml (original)
+++ maven/archiva/branches/archiva-MRM-239/pom.xml Sat Feb 17 09:04:40 2007
@@ -24,6 +24,9 @@
     <version>4</version>
     <relativePath>../pom/maven/pom.xml</relativePath>
   </parent>
+  <prerequisites>
+    <maven>2.0.5</maven>
+  </prerequisites>
   <groupId>org.apache.maven.archiva</groupId>
   <artifactId>archiva</artifactId>
   <packaging>pom</packaging>
@@ -120,6 +123,7 @@
   <modules>
     <module>archiva-applet</module>
     <module>archiva-converter</module>
+    <module>archiva-common</module>
     <module>archiva-discoverer</module>
     <module>archiva-reports-standard</module>
     <module>archiva-indexer</module>
@@ -221,6 +225,20 @@
       </dependency>
       <dependency>
         <groupId>org.apache.maven.archiva</groupId>
+        <artifactId>archiva-common</artifactId>
+        <version>${pom.version}</version>
+      </dependency>
+      <!--
+      <dependency>
+        <groupId>org.apache.maven.archiva</groupId>
+        <artifactId>archiva-common</artifactId>
+        <version>${pom.version}</version>
+        <classifier>tests</classifier>
+        <scope>test</scope>
+      </dependency>
+       -->
+      <dependency>
+        <groupId>org.apache.maven.archiva</groupId>
         <artifactId>archiva-core</artifactId>
         <version>${pom.version}</version>
       </dependency>
@@ -495,9 +513,18 @@
       </build>
     </profile>
   </profiles>
-  <!-- TODO: remove once modello is released -->
-  <!-- TODO: remove once ehcache, p-sec, registry, webdav, xwork, naming released -->
   <repositories>
+    <repository>
+      <id>codehaus.org</id>
+      <url>http://repository.codehaus.org</url>
+      <releases>
+        <enabled>true</enabled>
+      </releases>
+      <snapshots>
+        <enabled>false</enabled>
+      </snapshots>
+    </repository>
+    <!-- TODO: remove once ehcache, p-sec, registry, webdav, xwork, naming released -->
     <repository>
       <id>codehaus.org</id>
       <url>http://snapshots.repository.codehaus.org</url>