]> source.dussan.org Git - archiva.git/commitdiff
Cleanup of scheduler dependencies
authorMartin Stockhammer <martin_s@apache.org>
Sun, 2 Feb 2020 21:02:26 +0000 (22:02 +0100)
committerMartin Stockhammer <martin_s@apache.org>
Sun, 2 Feb 2020 21:02:26 +0000 (22:02 +0100)
14 files changed:
archiva-modules/archiva-base/archiva-consumers/archiva-consumer-archetype/src/main/resourcesstatic/archetype-resources/pom.xml
archiva-modules/archiva-base/archiva-consumers/archiva-indexer-consumers/pom.xml
archiva-modules/archiva-base/archiva-repository-scanner/src/main/java/org/apache/archiva/repository/scanner/DefaultRepositoryScanner.java
archiva-modules/archiva-base/archiva-repository-scanner/src/main/java/org/apache/archiva/repository/scanner/RepositoryContentConsumers.java
archiva-modules/archiva-maven/archiva-maven-indexer/pom.xml
archiva-modules/archiva-scheduler/archiva-scheduler-api/pom.xml
archiva-modules/archiva-scheduler/archiva-scheduler-repository/pom.xml
archiva-modules/archiva-scheduler/archiva-scheduler-repository/src/main/java/org/apache/archiva/scheduler/repository/ArchivaRepositoryScanningTaskExecutor.java
archiva-modules/archiva-scheduler/archiva-scheduler-repository/src/test/java/org/apache/archiva/mock/MockManagedRepositoryAdmin.java [deleted file]
archiva-modules/archiva-scheduler/archiva-scheduler-repository/src/test/java/org/apache/archiva/scheduler/repository/AbstractArchivaRepositoryScanningTaskExecutorTest.java
archiva-modules/archiva-scheduler/archiva-scheduler-repository/src/test/java/org/apache/archiva/scheduler/repository/ArchivaRepositoryScanningTaskExecutorPhase2Test.java
archiva-modules/archiva-scheduler/archiva-scheduler-repository/src/test/resources/spring-context.xml
archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/archiva/webdav/StubRepositoryContentConsumers.java
status-dep.txt

index 2de571f08fac7b6b68f893f316e2c0f350d0f7d4..851d78914f505452333e01e756b36fc1d0ba067f 100644 (file)
     </dependency>
 
     <!-- Test scope -->
+    <dependency>
+      <groupId>org.apache.archiva</groupId>
+      <artifactId>repository-statistics</artifactId>
+      <version>${archiva.version}</version>
+    </dependency>
     <dependency>
       <groupId>org.apache.archiva.components.cache</groupId>
       <artifactId>archiva-components-spring-cache-ehcache</artifactId>
index 012e3f2936ab4a01e07c305f760440c7c6e24274..2a9678abee65c36371acd39e3e2d1f9a2debed8d 100644 (file)
     </dependency>
 
     <!-- Test scope -->
+    <dependency>
+      <groupId>org.apache.archiva</groupId>
+      <artifactId>repository-statistics</artifactId>
+      <scope>test</scope>
+    </dependency>
     <dependency>
       <groupId>org.springframework</groupId>
       <artifactId>spring-test</artifactId>
index 8d33daf95ce1c3f168469d3bed9175d3e839a63c..3b49e3a9b991b7e615992eee6d9d7eec132c9177 100644 (file)
@@ -19,8 +19,8 @@ package org.apache.archiva.repository.scanner;
  * under the License.
  */
 
-import org.apache.archiva.admin.model.RepositoryAdminException;
 import org.apache.archiva.configuration.FileTypes;
+import org.apache.archiva.consumers.ConsumerException;
 import org.apache.archiva.consumers.InvalidRepositoryContentConsumer;
 import org.apache.archiva.consumers.KnownRepositoryContentConsumer;
 import org.apache.archiva.consumers.RepositoryContentConsumer;
@@ -70,10 +70,11 @@ public class DefaultRepositoryScanner
 
             return scan( repository, knownContentConsumers, invalidContentConsumers, ignoredPatterns, changesSince );
         }
-        catch ( RepositoryAdminException e )
+        catch ( ConsumerException e )
         {
-            throw new RepositoryScannerException( e.getMessage(), e );
-        } finally
+            throw new RepositoryScannerException( e.getMessage( ), e );
+        }
+        finally
         {
             repositoryContentConsumers.releaseSelectedKnownConsumers( knownContentConsumers );
         }
index 828fd5c0bef08df0d98eaea1def97ad82cb32f1a..0795fa557767db6ee791a9b1d615fb1ee15de433 100644 (file)
@@ -24,6 +24,7 @@ import org.apache.archiva.admin.model.admin.ArchivaAdministration;
 import org.apache.archiva.common.utils.BaseFile;
 import org.apache.archiva.common.utils.PathUtil;
 import org.apache.archiva.configuration.ArchivaConfiguration;
+import org.apache.archiva.consumers.ConsumerException;
 import org.apache.archiva.consumers.InvalidRepositoryContentConsumer;
 import org.apache.archiva.consumers.KnownRepositoryContentConsumer;
 import org.apache.archiva.consumers.RepositoryContentConsumer;
@@ -34,7 +35,6 @@ import org.apache.archiva.repository.scanner.functors.ConsumerProcessFileClosure
 import org.apache.archiva.repository.scanner.functors.TriggerBeginScanClosure;
 import org.apache.archiva.repository.scanner.functors.TriggerScanCompletedClosure;
 import org.apache.commons.collections4.Closure;
-import org.apache.commons.collections4.CollectionUtils;
 import org.apache.commons.collections4.IterableUtils;
 import org.apache.commons.collections4.functors.IfClosure;
 import org.springframework.beans.BeansException;
@@ -96,9 +96,16 @@ public class RepositoryContentConsumers
      * @return the list of consumer ids that have been selected by the configuration.
      */
     public List<String> getSelectedKnownConsumerIds()
-        throws RepositoryAdminException
+        throws ConsumerException
     {
-        return archivaAdministration.getKnownContentConsumers();
+        try
+        {
+            return archivaAdministration.getKnownContentConsumers();
+        }
+        catch ( RepositoryAdminException e )
+        {
+            throw new ConsumerException( e.getMessage( ), e );
+        }
     }
 
     /**
@@ -114,9 +121,16 @@ public class RepositoryContentConsumers
      * @return the list of consumer ids that have been selected by the configuration.
      */
     public List<String> getSelectedInvalidConsumerIds()
-        throws RepositoryAdminException
+        throws ConsumerException
     {
-        return archivaAdministration.getInvalidContentConsumers();
+        try
+        {
+            return archivaAdministration.getInvalidContentConsumers();
+        }
+        catch ( RepositoryAdminException e )
+        {
+            throw new ConsumerException( e.getMessage( ), e );
+        }
     }
 
     /**
@@ -126,7 +140,7 @@ public class RepositoryContentConsumers
      * @return the map of String ids to {@link KnownRepositoryContentConsumer} objects.
      */
     public Map<String, KnownRepositoryContentConsumer> getSelectedKnownConsumersMap()
-        throws RepositoryAdminException
+        throws ConsumerException
     {
         Map<String, KnownRepositoryContentConsumer> consumerMap = new HashMap<>();
 
@@ -145,7 +159,7 @@ public class RepositoryContentConsumers
      * @return the map of String ids to {@link InvalidRepositoryContentConsumer} objects.
      */
     public Map<String, InvalidRepositoryContentConsumer> getSelectedInvalidConsumersMap()
-        throws RepositoryAdminException
+        throws ConsumerException
     {
         Map<String, InvalidRepositoryContentConsumer> consumerMap = new HashMap<>();
 
@@ -165,7 +179,7 @@ public class RepositoryContentConsumers
      * by the active configuration.
      */
     public List<KnownRepositoryContentConsumer> getSelectedKnownConsumers()
-        throws RepositoryAdminException
+        throws ConsumerException
     {
         // FIXME only for testing
         if ( selectedKnownConsumers != null )
@@ -210,7 +224,7 @@ public class RepositoryContentConsumers
      * by the active configuration.
      */
     public synchronized List<InvalidRepositoryContentConsumer> getSelectedInvalidConsumers()
-        throws RepositoryAdminException
+        throws ConsumerException
     {
 
         // FIXME only for testing
@@ -221,7 +235,15 @@ public class RepositoryContentConsumers
 
         List<InvalidRepositoryContentConsumer> ret = new ArrayList<>();
 
-        List<String> invalidSelected = getSelectedInvalidConsumerIds();
+        List<String> invalidSelected = null;
+        try
+        {
+            invalidSelected = getSelectedInvalidConsumerIds();
+        }
+        catch ( ConsumerException e )
+        {
+            e.printStackTrace( );
+        }
 
         for ( InvalidRepositoryContentConsumer consumer : getAvailableInvalidConsumers() )
         {
@@ -264,13 +286,12 @@ public class RepositoryContentConsumers
      * NOTE: Make sure that there is no repository scanning task executing before invoking this so as to prevent
      * the index writer/reader of the current index-content consumer executing from getting closed. For an example,
      * see ArchivaDavResource#executeConsumers( File ).
-     *
-     * @param repository             the repository configuration to use.
+     *  @param repository             the repository configuration to use.
      * @param localFile              the local file to execute the consumers against.
      * @param updateRelatedArtifacts TODO
      */
     public void executeConsumers( ManagedRepository repository, Path localFile, boolean updateRelatedArtifacts )
-        throws RepositoryAdminException
+        throws ConsumerException
     {
         List<KnownRepositoryContentConsumer> selectedKnownConsumers = null;
         // Run the repository consumers
index 11b0471b584951ee80db2a62e4b186eb0ae4cf26..8fcc724e0e21c9c403418fed506b6bbf612a68fa 100644 (file)
 
 
     <!-- TEST Scope -->
+    <dependency>
+      <groupId>org.apache.archiva</groupId>
+      <artifactId>repository-statistics</artifactId>
+      <scope>test</scope>
+    </dependency>
     <dependency>
       <groupId>org.easymock</groupId>
       <artifactId>easymock</artifactId>
index 0d54566d1e6a1d8f9fa4af2c856318f04534f055..10ebcc55f9f8dc900d1f6a55934a4a1446bd40a3 100644 (file)
   </properties>
 
   <dependencies>
-    <dependency>
-      <groupId>org.apache.archiva</groupId>
-      <artifactId>archiva-repository-admin-api</artifactId>
-    </dependency>
     <dependency>
       <groupId>org.apache.archiva.components</groupId>
       <artifactId>archiva-components-spring-taskqueue</artifactId>
index a312519e451adc62a1981c3e989cb50f78d4041f..5047b1800f4e944e5a86692f61ec926ed3532847 100644 (file)
   </properties>
 
   <dependencies>
+    <dependency>
+      <groupId>org.apache.archiva</groupId>
+      <artifactId>archiva-scheduler-repository-api</artifactId>
+    </dependency>
     <dependency>
       <groupId>org.apache.archiva</groupId>
       <artifactId>archiva-scheduler-api</artifactId>
     </dependency>
     <dependency>
       <groupId>org.apache.archiva</groupId>
-      <artifactId>archiva-scheduler-repository-api</artifactId>
-      <version>${project.version}</version>
+      <artifactId>archiva-storage-api</artifactId>
     </dependency>
     <dependency>
-      <groupId>commons-io</groupId>
-      <artifactId>commons-io</artifactId>
+      <groupId>org.apache.archiva</groupId>
+      <artifactId>archiva-storage-fs</artifactId>
     </dependency>
     <dependency>
-      <groupId>org.apache.archiva.components</groupId>
-      <artifactId>archiva-components-spring-quartz</artifactId>
+      <groupId>org.apache.archiva</groupId>
+      <artifactId>archiva-consumer-api</artifactId>
     </dependency>
     <dependency>
-      <groupId>org.quartz-scheduler</groupId>
-      <artifactId>quartz</artifactId>
+      <groupId>org.apache.archiva</groupId>
+      <artifactId>archiva-filelock</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.archiva</groupId>
+      <artifactId>archiva-proxy-api</artifactId>
     </dependency>
     <dependency>
       <groupId>org.apache.archiva</groupId>
-      <artifactId>repository-statistics</artifactId>
+      <artifactId>archiva-model</artifactId>
     </dependency>
     <dependency>
       <groupId>org.apache.archiva</groupId>
       <groupId>org.apache.archiva</groupId>
       <artifactId>archiva-repository-scanner</artifactId>
     </dependency>
-
     <dependency>
       <groupId>org.apache.archiva</groupId>
       <artifactId>archiva-repository-layer</artifactId>
-      <exclusions>
-        <exclusion>
-          <groupId>commons-logging</groupId>
-          <artifactId>commons-logging-api</artifactId>
-        </exclusion>
-        <exclusion>
-          <groupId>log4j</groupId>
-          <artifactId>log4j</artifactId>
-        </exclusion>
-      </exclusions>
     </dependency>
     <dependency>
-      <groupId>org.slf4j</groupId>
-      <artifactId>slf4j-api</artifactId>
+      <groupId>org.apache.archiva</groupId>
+      <artifactId>archiva-common</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.archiva</groupId>
+      <artifactId>archiva-repository-api</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.archiva</groupId>
+      <artifactId>metadata-repository-api</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.archiva</groupId>
+      <artifactId>metadata-statistics-api</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.archiva.components</groupId>
+      <artifactId>archiva-components-spring-taskqueue</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.archiva.components</groupId>
+      <artifactId>archiva-components-spring-quartz</artifactId>
+    </dependency>
+
+    <dependency>
+      <groupId>javax.annotation</groupId>
+      <artifactId>javax.annotation-api</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>javax.inject</groupId>
+      <artifactId>javax.inject</artifactId>
     </dependency>
 
+    <dependency>
+      <groupId>org.springframework</groupId>
+      <artifactId>spring-context</artifactId>
+    </dependency>
+
+    <dependency>
+      <groupId>org.apache.commons</groupId>
+      <artifactId>commons-lang3</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>commons-io</groupId>
+      <artifactId>commons-io</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.quartz-scheduler</groupId>
+      <artifactId>quartz</artifactId>
+    </dependency>
 
     <!-- Test scope -->
     <dependency>
-      <groupId>org.apache.maven.indexer</groupId>
-      <artifactId>indexer-core</artifactId>
-      <classifier>shaded-lucene</classifier>
+      <groupId>org.apache.archiva</groupId>
+      <artifactId>archiva-repository-admin-api</artifactId>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.logging.log4j</groupId>
+      <artifactId>log4j-jcl</artifactId>
+      <scope>test</scope>
     </dependency>
     <dependency>
-      <groupId>commons-beanutils</groupId>
-      <artifactId>commons-beanutils</artifactId>
+      <groupId>org.apache.archiva.maven</groupId>
+      <artifactId>archiva-maven-common</artifactId>
       <scope>test</scope>
     </dependency>
     <dependency>
       <scope>test</scope>
     </dependency>
     <dependency>
-      <groupId>org.apache.archiva</groupId>
-      <artifactId>archiva-test-utils</artifactId>
-      <version>${project.version}</version>
+      <groupId>org.apache.maven.wagon</groupId>
+      <artifactId>wagon-provider-api</artifactId>
       <scope>test</scope>
     </dependency>
     <dependency>
-      <groupId>org.apache.archiva</groupId>
-      <artifactId>archiva-mock</artifactId>
+      <groupId>org.apache.maven.wagon</groupId>
+      <artifactId>wagon-http-shared</artifactId>
       <scope>test</scope>
     </dependency>
     <dependency>
-      <groupId>org.mockito</groupId>
-      <artifactId>mockito-all</artifactId>
+      <groupId>org.springframework</groupId>
+      <artifactId>spring-test</artifactId>
       <scope>test</scope>
     </dependency>
-
     <dependency>
-      <groupId>org.ow2.asm</groupId>
-      <artifactId>asm</artifactId>
+      <groupId>org.apache.maven.indexer</groupId>
+      <artifactId>indexer-core</artifactId>
+      <classifier>shaded-lucene</classifier>
       <scope>test</scope>
     </dependency>
-
     <dependency>
-      <groupId>org.apache.archiva.components.cache</groupId>
-      <artifactId>archiva-components-spring-cache-ehcache</artifactId>
+      <groupId>org.apache.archiva</groupId>
+      <artifactId>archiva-test-utils</artifactId>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.archiva</groupId>
+      <artifactId>archiva-mock</artifactId>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.mockito</groupId>
+      <artifactId>mockito-all</artifactId>
       <scope>test</scope>
     </dependency>
 
index ed0dd1a2298f85df1b6b9f7053e8d618bfed31a1..c4080417f75101daf1298bf7f1063da0b6ca450e 100644 (file)
@@ -19,8 +19,6 @@ package org.apache.archiva.scheduler.repository;
  * under the License.
  */
 
-import org.apache.archiva.admin.model.RepositoryAdminException;
-import org.apache.archiva.admin.model.managed.ManagedRepositoryAdmin;
 import org.apache.archiva.metadata.repository.MetadataRepository;
 import org.apache.archiva.metadata.repository.MetadataRepositoryException;
 import org.apache.archiva.metadata.repository.RepositorySession;
@@ -60,9 +58,6 @@ public class ArchivaRepositoryScanningTaskExecutor
     @Inject
     RepositoryRegistry repositoryRegistry;
 
-    @Inject
-    private ManagedRepositoryAdmin managedRepositoryAdmin;
-
     @Inject
     private RepositoryScanner repoScanner;
 
@@ -195,12 +190,11 @@ public class ArchivaRepositoryScanningTaskExecutor
                 this.task = null;
             }
         }
-        catch ( RepositoryAdminException e )
+        catch ( MetadataRepositoryException e )
         {
-            log.error( e.getMessage(), e );
-            throw new TaskExecutionException( e.getMessage(), e );
+            e.printStackTrace( );
         }
-        catch ( MetadataRepositoryException e )
+        catch ( org.apache.archiva.consumers.ConsumerException e )
         {
             e.printStackTrace( );
         }
@@ -251,13 +245,4 @@ public class ArchivaRepositoryScanningTaskExecutor
         this.repositoryStatisticsManager = repositoryStatisticsManager;
     }
 
-    public ManagedRepositoryAdmin getManagedRepositoryAdmin()
-    {
-        return managedRepositoryAdmin;
-    }
-
-    public void setManagedRepositoryAdmin( ManagedRepositoryAdmin managedRepositoryAdmin )
-    {
-        this.managedRepositoryAdmin = managedRepositoryAdmin;
-    }
 }
diff --git a/archiva-modules/archiva-scheduler/archiva-scheduler-repository/src/test/java/org/apache/archiva/mock/MockManagedRepositoryAdmin.java b/archiva-modules/archiva-scheduler/archiva-scheduler-repository/src/test/java/org/apache/archiva/mock/MockManagedRepositoryAdmin.java
deleted file mode 100644 (file)
index c4b01b6..0000000
+++ /dev/null
@@ -1,124 +0,0 @@
-package org.apache.archiva.mock;
-/*
- * 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.archiva.admin.model.AuditInformation;
-import org.apache.archiva.admin.model.RepositoryAdminException;
-import org.apache.archiva.admin.model.beans.ManagedRepository;
-import org.apache.archiva.admin.model.managed.ManagedRepositoryAdmin;
-import org.apache.archiva.configuration.ArchivaConfiguration;
-import org.apache.archiva.configuration.ManagedRepositoryConfiguration;
-import org.apache.commons.lang3.StringUtils;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Locale;
-import java.util.Map;
-
-/**
- * @author Olivier Lamy
- */
-public class MockManagedRepositoryAdmin
-    implements ManagedRepositoryAdmin
-{
-    private ArchivaConfiguration archivaConfiguration;
-
-    @Override
-    public List<ManagedRepository> getManagedRepositories()
-        throws RepositoryAdminException
-    {
-        List<ManagedRepositoryConfiguration> managedRepoConfigs =
-            getArchivaConfiguration().getConfiguration().getManagedRepositories();
-
-        List<ManagedRepository> managedRepos = new ArrayList<>( managedRepoConfigs.size() );
-
-        for ( ManagedRepositoryConfiguration repoConfig : managedRepoConfigs )
-        {
-            // TODO add staging repo information back too
-            ManagedRepository repo =
-                new ManagedRepository( Locale.getDefault( ), repoConfig.getId(), repoConfig.getName(), repoConfig.getLocation(),
-                                       repoConfig.getLayout(), repoConfig.isSnapshots(), repoConfig.isReleases(),
-                                       repoConfig.isBlockRedeployments(), repoConfig.getRefreshCronExpression(),
-                                       repoConfig.getIndexDir(), repoConfig.isScanned(), repoConfig.getRetentionPeriod(),
-                                       repoConfig.getRetentionCount(), repoConfig.isDeleteReleasedSnapshots(), true );
-
-            managedRepos.add( repo );
-        }
-
-        return managedRepos;
-    }
-
-    @Override
-    public Map<String, ManagedRepository> getManagedRepositoriesAsMap()
-        throws RepositoryAdminException
-    {
-        return null;
-    }
-
-    @Override
-    public ManagedRepository getManagedRepository( String repositoryId )
-        throws RepositoryAdminException
-    {
-        List<ManagedRepository> repos = getManagedRepositories();
-        for ( ManagedRepository repo : repos )
-        {
-            if ( StringUtils.equals( repo.getId(), repositoryId ) )
-            {
-                return repo;
-            }
-        }
-        return null;
-    }
-
-    @Override
-    public Boolean deleteManagedRepository( String repositoryId, AuditInformation auditInformation,
-                                            boolean deleteContent )
-        throws RepositoryAdminException
-    {
-        return null;
-    }
-
-    @Override
-    public Boolean addManagedRepository( ManagedRepository managedRepository, boolean needStageRepo,
-                                         AuditInformation auditInformation )
-        throws RepositoryAdminException
-    {
-        return null;
-    }
-
-    @Override
-    public Boolean updateManagedRepository( ManagedRepository managedRepository, boolean needStageRepo,
-                                            AuditInformation auditInformation, boolean resetStats )
-        throws RepositoryAdminException
-    {
-        return null;
-    }
-
-    public ArchivaConfiguration getArchivaConfiguration()
-    {
-        return archivaConfiguration;
-    }
-
-    public void setArchivaConfiguration( ArchivaConfiguration archivaConfiguration )
-    {
-        this.archivaConfiguration = archivaConfiguration;
-    }
-
-
-}
index 1ff32198b1a4bfea8e9fe30cff3f5a73a26ebccb..1a6d39070ec8612a98c8249781953106c842c221 100644 (file)
@@ -20,6 +20,7 @@ package org.apache.archiva.scheduler.repository;
  */
 
 import junit.framework.TestCase;
+import org.apache.archiva.common.utils.FileUtils;
 import org.apache.archiva.configuration.ArchivaConfiguration;
 import org.apache.archiva.configuration.ManagedRepositoryConfiguration;
 import org.apache.archiva.metadata.repository.MetadataRepository;
@@ -30,7 +31,6 @@ import org.apache.archiva.repository.ManagedRepository;
 import org.apache.archiva.repository.RepositoryRegistry;
 import org.apache.archiva.scheduler.repository.model.RepositoryTask;
 import org.apache.archiva.test.utils.ArchivaSpringJUnit4ClassRunner;
-import org.codehaus.plexus.util.FileUtils;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.runner.RunWith;
@@ -101,12 +101,12 @@ public abstract class AbstractArchivaRepositoryScanningTaskExecutorTest
         Path sourceRepoDir = Paths.get( "src/test/repositories/default-repository" );
         repoDir = Paths.get( "target/default-repository" );
 
-        org.apache.archiva.common.utils.FileUtils.deleteDirectory( repoDir );
+        FileUtils.deleteDirectory( repoDir );
         assertFalse( "Default Test Repository should not exist.", Files.exists(repoDir) );
 
         Files.createDirectories(repoDir);
 
-        FileUtils.copyDirectoryStructure( sourceRepoDir.toFile(), repoDir.toFile() );
+        org.apache.commons.io.FileUtils.copyDirectory( sourceRepoDir.toFile(), repoDir.toFile() );
         // set the timestamps to a time well in the past
         Calendar cal = Calendar.getInstance();
         cal.add( Calendar.YEAR, -1 );
index 291d6678effe89219f289444557db816fa1b5240..1adefe033283135e3ec8335dd7b108475167f4ef 100644 (file)
@@ -24,7 +24,7 @@ import org.apache.archiva.metadata.repository.stats.model.DefaultRepositoryStati
 import org.apache.archiva.metadata.repository.stats.model.RepositoryStatistics;
 import org.apache.archiva.model.ArtifactReference;
 import org.apache.archiva.scheduler.repository.model.RepositoryTask;
-import org.codehaus.plexus.util.FileUtils;
+import org.apache.commons.io.FileUtils;
 import org.junit.Test;
 import org.springframework.test.context.ContextConfiguration;
 
@@ -78,7 +78,7 @@ public class ArchivaRepositoryScanningTaskExecutorPhase2Test
         Path newArtifactGroup = repoDir.resolve( "org/apache/archiva" );
         assertFalse( "newArtifactGroup should not exist.", Files.exists(newArtifactGroup) );
 
-        FileUtils.copyDirectoryStructure( Paths.get( "target/test-classes/test-repo/org/apache/archiva" ).toFile(),
+        FileUtils.copyDirectory( Paths.get( "target/test-classes/test-repo/org/apache/archiva" ).toFile(),
                                           newArtifactGroup.toFile() );
 
         // update last modified date
@@ -123,7 +123,7 @@ public class ArchivaRepositoryScanningTaskExecutorPhase2Test
         Path newArtifactGroup = repoDir.resolve( "org/apache/archiva" );
         assertFalse( "newArtifactGroup should not exist.", Files.exists(newArtifactGroup) );
 
-        FileUtils.copyDirectoryStructure( Paths.get( "target/test-classes/test-repo/org/apache/archiva" ).toFile(),
+        FileUtils.copyDirectory( Paths.get( "target/test-classes/test-repo/org/apache/archiva" ).toFile(),
                                           newArtifactGroup.toFile() );
 
         // update last modified date, placing shortly after last scan
@@ -170,7 +170,7 @@ public class ArchivaRepositoryScanningTaskExecutorPhase2Test
         Path newArtifactGroup = repoDir.resolve( "org/apache/archiva" );
         assertFalse( "newArtifactGroup should not exist.", Files.exists(newArtifactGroup) );
 
-        FileUtils.copyDirectoryStructure( Paths.get( "target/test-classes/test-repo/org/apache/archiva" ).toFile(),
+        FileUtils.copyDirectory( Paths.get( "target/test-classes/test-repo/org/apache/archiva" ).toFile(),
                                           newArtifactGroup.toFile() );
 
         // update last modified date, placing in middle of last scan
index 79dff8fdddf0e6eab92e37cf2fb622d71d091586..3d832345af376fa1cf48c6d96ae09bc1b58df5b1 100755 (executable)
@@ -29,9 +29,6 @@
 
   <context:annotation-config/>
 
-  <bean name="managedRepoAdmin#test" class="org.apache.archiva.mock.MockManagedRepositoryAdmin">
-    <property name="archivaConfiguration" ref="archivaConfiguration#test-repository-scanning"/>
-  </bean>
 
   <bean name="archivaAdministration#mock" class="org.apache.archiva.mock.MockArchivaAdministration">
     <property name="archivaConfiguration" ref="archivaConfiguration#test-repository-scanning"/>
@@ -42,7 +39,6 @@
   </bean>
 
   <bean name="taskExecutor#test-repository-scanning" class="org.apache.archiva.scheduler.repository.ArchivaRepositoryScanningTaskExecutor">
-    <property name="managedRepositoryAdmin" ref="managedRepoAdmin#test"/>
   </bean>
 
   <bean name="repositoryContentFactory#default" class="org.apache.archiva.repository.RepositoryContentFactory">
index e78875375582326eeab33ad1d865095f390549f2..c820ee2d4dcfc54f51e2e01791fec74f4139a539 100644 (file)
@@ -20,6 +20,7 @@ package org.apache.archiva.webdav;
  */
 
 import org.apache.archiva.admin.model.admin.ArchivaAdministration;
+import org.apache.archiva.consumers.ConsumerException;
 import org.apache.archiva.consumers.InvalidRepositoryContentConsumer;
 import org.apache.archiva.consumers.KnownRepositoryContentConsumer;
 import org.apache.archiva.repository.scanner.RepositoryContentConsumers;
@@ -35,13 +36,13 @@ public class StubRepositoryContentConsumers
     }
 
     @Override
-    public List<KnownRepositoryContentConsumer> getSelectedKnownConsumers()
+    public List<KnownRepositoryContentConsumer> getSelectedKnownConsumers() throws ConsumerException
     {
         return getAvailableKnownConsumers();
     }
 
     @Override
-    public synchronized List<InvalidRepositoryContentConsumer> getSelectedInvalidConsumers()
+    public synchronized List<InvalidRepositoryContentConsumer> getSelectedInvalidConsumers() throws ConsumerException
     {
         return getAvailableInvalidConsumers();
     }
index 1e16dd29f365be3b8f366caa21f47613a9c789c1..84980d53c065baa27d0ac7d3f4b47ac9e25debfd 100644 (file)
@@ -29,6 +29,9 @@ archiva-modules
   archiva-repository-admin
     archiva-repository-admin-api
     archiva-repository-admin-default
+ archiva-scheduler
+  archiva-scheduler-api
+  archiva-scheduler-repository