From: Olivier Lamy Date: Tue, 13 Sep 2011 12:12:39 +0000 (+0000) Subject: [MRM-1504] Add a new module for repository administration management X-Git-Tag: archiva-1.4-M1~323 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=919a5ac3eb725dc676e81fcbf868f3cc165598a4;p=archiva.git [MRM-1504] Add a new module for repository administration management split the repo admin in two modules : api and default implementation (to be able to more easily change the impl). Use the repo admin api consumers and indexing modules. git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1170135 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/.gitignore b/.gitignore index a298732fb..cd9bdbc42 100644 --- a/.gitignore +++ b/.gitignore @@ -15,3 +15,4 @@ archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/lib/ archiva-modules/archiva-web/archiva-webapp-test/cargo-installs/ *.ipr *.iws +.DS_Store diff --git a/archiva-cli/src/main/java/org/apache/maven/archiva/cli/AbstractProgressConsumer.java b/archiva-cli/src/main/java/org/apache/maven/archiva/cli/AbstractProgressConsumer.java index 14e7a87fd..c2f220cd0 100644 --- a/archiva-cli/src/main/java/org/apache/maven/archiva/cli/AbstractProgressConsumer.java +++ b/archiva-cli/src/main/java/org/apache/maven/archiva/cli/AbstractProgressConsumer.java @@ -19,13 +19,13 @@ package org.apache.maven.archiva.cli; * under the License. */ -import java.util.Date; - -import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration; +import org.apache.archiva.admin.model.managed.ManagedRepository; import org.apache.maven.archiva.consumers.AbstractMonitoredConsumer; import org.apache.maven.archiva.consumers.ConsumerException; import org.apache.maven.archiva.consumers.RepositoryContentConsumer; +import java.util.Date; + /** * AbstractProgressConsumer * @@ -37,13 +37,13 @@ public abstract class AbstractProgressConsumer { private int count = 0; - public void beginScan( ManagedRepositoryConfiguration repository, Date whenGathered ) + public void beginScan( ManagedRepository repository, Date whenGathered ) throws ConsumerException { this.count = 0; } - public void beginScan( ManagedRepositoryConfiguration repository, Date whenGathered, boolean executeOnEntireRepo ) + public void beginScan( ManagedRepository repository, Date whenGathered, boolean executeOnEntireRepo ) throws ConsumerException { beginScan( repository, whenGathered ); diff --git a/archiva-cli/src/main/java/org/apache/maven/archiva/cli/ArchivaCli.java b/archiva-cli/src/main/java/org/apache/maven/archiva/cli/ArchivaCli.java index a5e5adc06..43d6e76a1 100644 --- a/archiva-cli/src/main/java/org/apache/maven/archiva/cli/ArchivaCli.java +++ b/archiva-cli/src/main/java/org/apache/maven/archiva/cli/ArchivaCli.java @@ -21,6 +21,7 @@ package org.apache.maven.archiva.cli; import com.sampullara.cli.Args; import com.sampullara.cli.Argument; +import org.apache.archiva.admin.model.managed.ManagedRepository; import org.apache.archiva.common.plexusbridge.PlexusSisuBridge; import org.apache.archiva.common.plexusbridge.PlexusSisuBridgeException; import org.apache.archiva.repository.scanner.RepositoryScanStatistics; @@ -165,7 +166,7 @@ public class ArchivaCli WagonManager wagonManager = plexusSisuBridge.lookup( WagonManager.class ); wagonManager.addMirror( "internal", "*", new File( path ).toURL().toExternalForm() ); - ManagedRepositoryConfiguration repo = new ManagedRepositoryConfiguration(); + ManagedRepository repo = new ManagedRepository(); repo.setId( "cliRepo" ); repo.setName( "Archiva CLI Provided Repo" ); repo.setLocation( path ); diff --git a/archiva-modules/archiva-base/archiva-common/src/main/java/org/apache/maven/archiva/common/FileTypeUtils.java b/archiva-modules/archiva-base/archiva-common/src/main/java/org/apache/maven/archiva/common/FileTypeUtils.java new file mode 100644 index 000000000..d6d11cc93 --- /dev/null +++ b/archiva-modules/archiva-base/archiva-common/src/main/java/org/apache/maven/archiva/common/FileTypeUtils.java @@ -0,0 +1,39 @@ +package org.apache.maven.archiva.common; +/* + * 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.Arrays; +import java.util.List; + +/** + * @author Olivier Lamy + * @since 1.4 + */ +public class FileTypeUtils +{ + + /** + * Default exclusions from artifact consumers that are using the file types. Note that this is simplistic in the + * case of the support files (based on extension) as it is elsewhere - it may be better to match these to actual + * artifacts and exclude later during scanning. + */ + public static final List DEFAULT_EXCLUSIONS = + Arrays.asList( "**/maven-metadata.xml", "**/maven-metadata-*.xml", "**/*.sha1", "**/*.asc", "**/*.md5", + "**/*.pgp", "**/.index/**", "**/.indexer/**" ); +} diff --git a/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/FileTypes.java b/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/FileTypes.java index 80d04af87..35ae50d0e 100644 --- a/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/FileTypes.java +++ b/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/FileTypes.java @@ -22,6 +22,7 @@ package org.apache.maven.archiva.configuration; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.Predicate; import org.apache.commons.configuration.CombinedConfiguration; +import org.apache.maven.archiva.common.FileTypeUtils; import org.apache.maven.archiva.configuration.functors.FiletypeSelectionPredicate; import org.apache.maven.archiva.configuration.io.registry.ConfigurationRegistryReader; import org.codehaus.plexus.registry.Registry; @@ -77,10 +78,9 @@ public class FileTypes * Default exclusions from artifact consumers that are using the file types. Note that this is simplistic in the * case of the support files (based on extension) as it is elsewhere - it may be better to match these to actual * artifacts and exclude later during scanning. + * @deprecated */ - public static final List DEFAULT_EXCLUSIONS = - Arrays.asList( "**/maven-metadata.xml", "**/maven-metadata-*.xml", "**/*.sha1", "**/*.asc", "**/*.md5", - "**/*.pgp", "**/.index/**", "**/.indexer/**" ); + public static final List DEFAULT_EXCLUSIONS = FileTypeUtils.DEFAULT_EXCLUSIONS; public void setArchivaConfiguration( ArchivaConfiguration archivaConfiguration ) { diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-api/pom.xml b/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-api/pom.xml index 7ef684e82..d7b8bf863 100644 --- a/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-api/pom.xml +++ b/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-api/pom.xml @@ -32,7 +32,11 @@ org.apache.archiva - archiva-configuration + archiva-repository-admin-api + + + org.apache.archiva + archiva-common commons-collections diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-api/src/main/java/org/apache/maven/archiva/consumers/AbstractMonitoredConsumer.java b/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-api/src/main/java/org/apache/maven/archiva/consumers/AbstractMonitoredConsumer.java index be96186e1..55a94261a 100644 --- a/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-api/src/main/java/org/apache/maven/archiva/consumers/AbstractMonitoredConsumer.java +++ b/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-api/src/main/java/org/apache/maven/archiva/consumers/AbstractMonitoredConsumer.java @@ -19,13 +19,13 @@ package org.apache.maven.archiva.consumers; * under the License. */ +import org.apache.maven.archiva.common.FileTypeUtils; + import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Set; -import org.apache.maven.archiva.configuration.FileTypes; - /** * AbstractMonitoredConsumer * @@ -101,7 +101,7 @@ public abstract class AbstractMonitoredConsumer protected List getDefaultArtifactExclusions() { - return FileTypes.DEFAULT_EXCLUSIONS; + return FileTypeUtils.DEFAULT_EXCLUSIONS; } diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-api/src/main/java/org/apache/maven/archiva/consumers/InvalidRepositoryContentConsumer.java b/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-api/src/main/java/org/apache/maven/archiva/consumers/InvalidRepositoryContentConsumer.java index 005923e9a..e6196167e 100644 --- a/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-api/src/main/java/org/apache/maven/archiva/consumers/InvalidRepositoryContentConsumer.java +++ b/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-api/src/main/java/org/apache/maven/archiva/consumers/InvalidRepositoryContentConsumer.java @@ -27,5 +27,5 @@ package org.apache.maven.archiva.consumers; public interface InvalidRepositoryContentConsumer extends RepositoryContentConsumer { - + // no op } diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-api/src/main/java/org/apache/maven/archiva/consumers/RepositoryContentConsumer.java b/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-api/src/main/java/org/apache/maven/archiva/consumers/RepositoryContentConsumer.java index a29ad3d37..5a83b0798 100644 --- a/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-api/src/main/java/org/apache/maven/archiva/consumers/RepositoryContentConsumer.java +++ b/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-api/src/main/java/org/apache/maven/archiva/consumers/RepositoryContentConsumer.java @@ -19,7 +19,7 @@ package org.apache.maven.archiva.consumers; * under the License. */ -import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration; +import org.apache.archiva.admin.model.managed.ManagedRepository; import java.util.Date; import java.util.List; @@ -60,7 +60,7 @@ public interface RepositoryContentConsumer * @param whenGathered the start of the repository scan * @throws ConsumerException if there was a problem with using the provided repository with the consumer. */ - void beginScan( ManagedRepositoryConfiguration repository, Date whenGathered ) + void beginScan( ManagedRepository repository, Date whenGathered ) throws ConsumerException; /** @@ -73,9 +73,9 @@ public interface RepositoryContentConsumer * @param whenGathered the start of the repository scan * @param executeOnEntireRepo flags whether the consumer will be executed on an entire repository or just on a specific resource * @throws ConsumerException if there was a problem with using the provided repository with the consumer. - * @see RepositoryContentConsumer#beginScan(org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration, java.util.Date) + * @see RepositoryContentConsumer#beginScan(ManagedRepository, java.util.Date) */ - void beginScan( ManagedRepositoryConfiguration repository, Date whenGathered, boolean executeOnEntireRepo ) + void beginScan( ManagedRepository repository, Date whenGathered, boolean executeOnEntireRepo ) throws ConsumerException; /** diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/pom.xml b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/pom.xml index bc5b6b4c3..b080c2519 100644 --- a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/pom.xml +++ b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/pom.xml @@ -44,6 +44,10 @@ org.apache.archiva archiva-consumer-api + + org.apache.archiva + archiva-repository-admin-api + org.apache.archiva archiva-repository-layer @@ -84,10 +88,36 @@ mockito-all test + + org.apache.archiva + archiva-repository-admin-default + test + + + org.codehaus.redback + redback-rbac-cached + test + + + org.apache.derby + derby + test + + + org.apache.maven.plugins + maven-surefire-plugin + + + ${basedir}/target/appserver-base + ${project.build.outputDirectory} + ${project.build.outputDirectory} + + + org.apache.rat apache-rat-plugin diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/maven/archiva/consumers/core/ArtifactMissingChecksumsConsumer.java b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/maven/archiva/consumers/core/ArtifactMissingChecksumsConsumer.java index 54dfccc2b..c35bf60b6 100644 --- a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/maven/archiva/consumers/core/ArtifactMissingChecksumsConsumer.java +++ b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/maven/archiva/consumers/core/ArtifactMissingChecksumsConsumer.java @@ -19,12 +19,12 @@ package org.apache.maven.archiva.consumers.core; * under the License. */ +import org.apache.archiva.admin.model.managed.ManagedRepository; import org.apache.archiva.checksum.ChecksumAlgorithm; import org.apache.archiva.checksum.ChecksummedFile; import org.apache.maven.archiva.configuration.ArchivaConfiguration; import org.apache.maven.archiva.configuration.ConfigurationNames; import org.apache.maven.archiva.configuration.FileTypes; -import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration; import org.apache.maven.archiva.consumers.AbstractMonitoredConsumer; import org.apache.maven.archiva.consumers.ConsumerException; import org.apache.maven.archiva.consumers.KnownRepositoryContentConsumer; @@ -96,13 +96,13 @@ public class ArtifactMissingChecksumsConsumer return false; } - public void beginScan( ManagedRepositoryConfiguration repo, Date whenGathered ) + public void beginScan( ManagedRepository repo, Date whenGathered ) throws ConsumerException { this.repositoryDir = new File( repo.getLocation() ); } - public void beginScan( ManagedRepositoryConfiguration repo, Date whenGathered, boolean executeOnEntireRepo ) + public void beginScan( ManagedRepository repo, Date whenGathered, boolean executeOnEntireRepo ) throws ConsumerException { beginScan( repo, whenGathered ); diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/maven/archiva/consumers/core/AutoRemoveConsumer.java b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/maven/archiva/consumers/core/AutoRemoveConsumer.java index 99fe36e11..33fa0dcae 100644 --- a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/maven/archiva/consumers/core/AutoRemoveConsumer.java +++ b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/maven/archiva/consumers/core/AutoRemoveConsumer.java @@ -19,12 +19,10 @@ package org.apache.maven.archiva.consumers.core; * under the License. */ -import org.apache.commons.collections.CollectionUtils; -import org.apache.commons.lang.StringUtils; +import org.apache.archiva.admin.model.managed.ManagedRepository; import org.apache.maven.archiva.configuration.ArchivaConfiguration; import org.apache.maven.archiva.configuration.ConfigurationNames; import org.apache.maven.archiva.configuration.FileTypes; -import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration; import org.apache.maven.archiva.consumers.AbstractMonitoredConsumer; import org.apache.maven.archiva.consumers.ConsumerException; import org.apache.maven.archiva.consumers.KnownRepositoryContentConsumer; @@ -92,13 +90,13 @@ public class AutoRemoveConsumer return false; } - public void beginScan( ManagedRepositoryConfiguration repository, Date whenGathered ) + public void beginScan( ManagedRepository repository, Date whenGathered ) throws ConsumerException { this.repositoryDir = new File( repository.getLocation() ); } - public void beginScan( ManagedRepositoryConfiguration repository, Date whenGathered, boolean executeOnEntireRepo ) + public void beginScan( ManagedRepository repository, Date whenGathered, boolean executeOnEntireRepo ) throws ConsumerException { beginScan( repository, whenGathered ); diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/maven/archiva/consumers/core/AutoRenameConsumer.java b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/maven/archiva/consumers/core/AutoRenameConsumer.java index 33a6568bf..1990bfa12 100644 --- a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/maven/archiva/consumers/core/AutoRenameConsumer.java +++ b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/maven/archiva/consumers/core/AutoRenameConsumer.java @@ -19,8 +19,8 @@ package org.apache.maven.archiva.consumers.core; * under the License. */ +import org.apache.archiva.admin.model.managed.ManagedRepository; import org.apache.commons.io.FileUtils; -import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration; import org.apache.maven.archiva.consumers.AbstractMonitoredConsumer; import org.apache.maven.archiva.consumers.ConsumerException; import org.apache.maven.archiva.consumers.KnownRepositoryContentConsumer; @@ -91,13 +91,13 @@ public class AutoRenameConsumer return false; } - public void beginScan( ManagedRepositoryConfiguration repository, Date whenGathered ) + public void beginScan( ManagedRepository repository, Date whenGathered ) throws ConsumerException { this.repositoryDir = new File( repository.getLocation() ); } - public void beginScan( ManagedRepositoryConfiguration repository, Date whenGathered, boolean executeOnEntireRepo ) + public void beginScan( ManagedRepository repository, Date whenGathered, boolean executeOnEntireRepo ) throws ConsumerException { beginScan( repository, whenGathered ); diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/maven/archiva/consumers/core/MetadataUpdaterConsumer.java b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/maven/archiva/consumers/core/MetadataUpdaterConsumer.java index a2e657a62..f8003e384 100644 --- a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/maven/archiva/consumers/core/MetadataUpdaterConsumer.java +++ b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/maven/archiva/consumers/core/MetadataUpdaterConsumer.java @@ -19,16 +19,10 @@ package org.apache.maven.archiva.consumers.core; * under the License. */ -import java.io.File; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - +import org.apache.archiva.admin.model.managed.ManagedRepository; import org.apache.maven.archiva.configuration.ArchivaConfiguration; import org.apache.maven.archiva.configuration.ConfigurationNames; import org.apache.maven.archiva.configuration.FileTypes; -import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration; import org.apache.maven.archiva.consumers.AbstractMonitoredConsumer; import org.apache.maven.archiva.consumers.ConsumerException; import org.apache.maven.archiva.consumers.KnownRepositoryContentConsumer; @@ -52,6 +46,11 @@ import org.springframework.stereotype.Service; import javax.annotation.PostConstruct; import javax.inject.Inject; +import java.io.File; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; /** * MetadataUpdaterConsumer will create and update the metadata present within the repository. @@ -129,7 +128,7 @@ public class MetadataUpdaterConsumer this.includes = includes; } - public void beginScan( ManagedRepositoryConfiguration repoConfig, Date whenGathered ) + public void beginScan( ManagedRepository repoConfig, Date whenGathered ) throws ConsumerException { try @@ -148,7 +147,7 @@ public class MetadataUpdaterConsumer } } - public void beginScan( ManagedRepositoryConfiguration repository, Date whenGathered, boolean executeOnEntireRepo ) + public void beginScan( ManagedRepository repository, Date whenGathered, boolean executeOnEntireRepo ) throws ConsumerException { beginScan( repository, whenGathered ); diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/maven/archiva/consumers/core/ValidateChecksumConsumer.java b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/maven/archiva/consumers/core/ValidateChecksumConsumer.java index 2487ed727..d5357a3ff 100644 --- a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/maven/archiva/consumers/core/ValidateChecksumConsumer.java +++ b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/maven/archiva/consumers/core/ValidateChecksumConsumer.java @@ -19,10 +19,10 @@ package org.apache.maven.archiva.consumers.core; * under the License. */ +import org.apache.archiva.admin.model.managed.ManagedRepository; import org.apache.archiva.common.plexusbridge.DigesterUtils; import org.apache.archiva.common.plexusbridge.PlexusSisuBridge; import org.apache.archiva.common.plexusbridge.PlexusSisuBridgeException; -import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration; import org.apache.maven.archiva.consumers.AbstractMonitoredConsumer; import org.apache.maven.archiva.consumers.ConsumerException; import org.apache.maven.archiva.consumers.KnownRepositoryContentConsumer; @@ -39,7 +39,6 @@ import java.io.FileNotFoundException; import java.io.IOException; import java.util.ArrayList; import java.util.Date; -import java.util.Iterator; import java.util.List; /** @@ -106,13 +105,13 @@ public class ValidateChecksumConsumer return false; } - public void beginScan( ManagedRepositoryConfiguration repository, Date whenGathered ) + public void beginScan( ManagedRepository repository, Date whenGathered ) throws ConsumerException { this.repositoryDir = new File( repository.getLocation() ); } - public void beginScan( ManagedRepositoryConfiguration repository, Date whenGathered, boolean executeOnEntireRepo ) + public void beginScan( ManagedRepository repository, Date whenGathered, boolean executeOnEntireRepo ) throws ConsumerException { beginScan( repository, whenGathered ); diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/maven/archiva/consumers/core/repository/CleanupReleasedSnapshotsRepositoryPurge.java b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/maven/archiva/consumers/core/repository/CleanupReleasedSnapshotsRepositoryPurge.java index e12087439..52e5702ca 100644 --- a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/maven/archiva/consumers/core/repository/CleanupReleasedSnapshotsRepositoryPurge.java +++ b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/maven/archiva/consumers/core/repository/CleanupReleasedSnapshotsRepositoryPurge.java @@ -19,13 +19,14 @@ package org.apache.maven.archiva.consumers.core.repository; * under the License. */ +import org.apache.archiva.admin.model.RepositoryAdminException; +import org.apache.archiva.admin.model.managed.ManagedRepository; +import org.apache.archiva.admin.model.managed.ManagedRepositoryAdmin; import org.apache.archiva.metadata.repository.MetadataRepository; import org.apache.archiva.metadata.repository.RepositorySession; import org.apache.archiva.repository.events.RepositoryListener; import org.apache.maven.archiva.common.utils.VersionComparator; import org.apache.maven.archiva.common.utils.VersionUtil; -import org.apache.maven.archiva.configuration.ArchivaConfiguration; -import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration; import org.apache.maven.archiva.model.ArchivaArtifact; import org.apache.maven.archiva.model.ArtifactReference; import org.apache.maven.archiva.model.ProjectReference; @@ -50,7 +51,7 @@ import java.util.List; * This will look in a single managed repository, and purge any snapshots that are present * that have a corresponding released version on the same repository. *

- * + *

*

* So, if you have the following (presented in the m2/default layout form) ... *

@@ -74,19 +75,19 @@ public class CleanupReleasedSnapshotsRepositoryPurge
 {
     private MetadataTools metadataTools;
 
-    private ArchivaConfiguration archivaConfig;
+    private ManagedRepositoryAdmin managedRepositoryAdmin;
 
     private RepositoryContentFactory repoContentFactory;
 
     public CleanupReleasedSnapshotsRepositoryPurge( ManagedRepositoryContent repository, MetadataTools metadataTools,
-                                                    ArchivaConfiguration archivaConfig,
+                                                    ManagedRepositoryAdmin managedRepositoryAdmin,
                                                     RepositoryContentFactory repoContentFactory,
                                                     RepositorySession repositorySession,
                                                     List listeners )
     {
         super( repository, repositorySession, listeners );
         this.metadataTools = metadataTools;
-        this.archivaConfig = archivaConfig;
+        this.managedRepositoryAdmin = managedRepositoryAdmin;
         this.repoContentFactory = repoContentFactory;
     }
 
@@ -118,15 +119,15 @@ public class CleanupReleasedSnapshotsRepositoryPurge
             // Gather up all of the versions.
             List allVersions = new ArrayList( repository.getVersions( reference ) );
 
-            List repos = archivaConfig.getConfiguration().getManagedRepositories();
-            for ( ManagedRepositoryConfiguration repo : repos )
+            List repos = managedRepositoryAdmin.getManagedRepositories();
+            for ( ManagedRepository repo : repos )
             {
                 if ( repo.isReleases() && !repo.getId().equals( repository.getId() ) )
                 {
                     try
                     {
-                        ManagedRepositoryContent repoContent = repoContentFactory.getManagedRepositoryContent(
-                            repo.getId() );
+                        ManagedRepositoryContent repoContent =
+                            repoContentFactory.getManagedRepositoryContent( repo.getId() );
                         allVersions.addAll( repoContent.getVersions( reference ) );
                     }
                     catch ( RepositoryNotFoundException e )
@@ -167,9 +168,9 @@ public class CleanupReleasedSnapshotsRepositoryPurge
             versionRef.setGroupId( artifactRef.getGroupId() );
             versionRef.setArtifactId( artifactRef.getArtifactId() );
 
-            ArchivaArtifact artifact = new ArchivaArtifact( artifactRef.getGroupId(), artifactRef.getArtifactId(),
-                                                            artifactRef.getVersion(), artifactRef.getClassifier(),
-                                                            artifactRef.getType(), repository.getId() );
+            ArchivaArtifact artifact =
+                new ArchivaArtifact( artifactRef.getGroupId(), artifactRef.getArtifactId(), artifactRef.getVersion(),
+                                     artifactRef.getClassifier(), artifactRef.getType(), repository.getId() );
 
             MetadataRepository metadataRepository = repositorySession.getRepository();
             for ( String version : snapshotVersions )
@@ -195,6 +196,9 @@ public class CleanupReleasedSnapshotsRepositoryPurge
             {
                 updateMetadata( artifactRef );
             }
+        } catch ( RepositoryAdminException e )
+        {
+            throw new RepositoryPurgeException( e.getMessage(), e );
         }
         catch ( LayoutException e )
         {
diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/maven/archiva/consumers/core/repository/RepositoryPurgeConsumer.java b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/maven/archiva/consumers/core/repository/RepositoryPurgeConsumer.java
index 55ef8f1fd..791de8d76 100644
--- a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/maven/archiva/consumers/core/repository/RepositoryPurgeConsumer.java
+++ b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/maven/archiva/consumers/core/repository/RepositoryPurgeConsumer.java
@@ -19,13 +19,14 @@ package org.apache.maven.archiva.consumers.core.repository;
  * under the License.
  */
 
+import org.apache.archiva.admin.model.managed.ManagedRepository;
+import org.apache.archiva.admin.model.managed.ManagedRepositoryAdmin;
 import org.apache.archiva.metadata.repository.RepositorySession;
 import org.apache.archiva.metadata.repository.RepositorySessionFactory;
 import org.apache.archiva.repository.events.RepositoryListener;
 import org.apache.maven.archiva.configuration.ArchivaConfiguration;
 import org.apache.maven.archiva.configuration.ConfigurationNames;
 import org.apache.maven.archiva.configuration.FileTypes;
-import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration;
 import org.apache.maven.archiva.consumers.AbstractMonitoredConsumer;
 import org.apache.maven.archiva.consumers.ConsumerException;
 import org.apache.maven.archiva.consumers.KnownRepositoryContentConsumer;
@@ -36,7 +37,6 @@ import org.apache.maven.archiva.repository.RepositoryNotFoundException;
 import org.apache.maven.archiva.repository.metadata.MetadataTools;
 import org.codehaus.plexus.registry.Registry;
 import org.codehaus.plexus.registry.RegistryListener;
-import org.springframework.context.ApplicationContext;
 import org.springframework.context.annotation.Scope;
 import org.springframework.stereotype.Service;
 
@@ -75,11 +75,14 @@ public class RepositoryPurgeConsumer
     @Named( value = "archivaConfiguration#default" )
     private ArchivaConfiguration configuration;
 
+    @Inject
+    private ManagedRepositoryAdmin managedRepositoryAdmin;
+
     /**
      *
      */
     @Inject
-    @Named(value = "repositoryContentFactory#default")
+    @Named( value = "repositoryContentFactory#default" )
     private RepositoryContentFactory repositoryContentFactory;
 
     /**
@@ -92,7 +95,7 @@ public class RepositoryPurgeConsumer
      *
      */
     @Inject
-    @Named(value = "fileTypes")
+    @Named( value = "fileTypes" )
     private FileTypes filetypes;
 
     private List includes = new ArrayList();
@@ -111,7 +114,6 @@ public class RepositoryPurgeConsumer
 
     /**
      * TODO: this could be multiple implementations and needs to be configured.
-     *
      */
     @Inject
     private RepositorySessionFactory repositorySessionFactory;
@@ -143,7 +145,7 @@ public class RepositoryPurgeConsumer
         return this.includes;
     }
 
-    public void beginScan( ManagedRepositoryConfiguration repository, Date whenGathered )
+    public void beginScan( ManagedRepository repository, Date whenGathered )
         throws ConsumerException
     {
         ManagedRepositoryContent repositoryContent;
@@ -174,13 +176,13 @@ public class RepositoryPurgeConsumer
                                                    listeners );
         }
 
-        cleanUp = new CleanupReleasedSnapshotsRepositoryPurge( repositoryContent, metadataTools, configuration,
+        cleanUp = new CleanupReleasedSnapshotsRepositoryPurge( repositoryContent, metadataTools, managedRepositoryAdmin,
                                                                repositoryContentFactory, repositorySession, listeners );
 
         deleteReleasedSnapshots = repository.isDeleteReleasedSnapshots();
     }
 
-    public void beginScan( ManagedRepositoryConfiguration repository, Date whenGathered, boolean executeOnEntireRepo )
+    public void beginScan( ManagedRepository repository, Date whenGathered, boolean executeOnEntireRepo )
         throws ConsumerException
     {
         beginScan( repository, whenGathered );
diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/archiva/metadata/repository/TestMetadataRepository.java b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/archiva/metadata/repository/TestMetadataRepository.java
new file mode 100644
index 000000000..c78389e89
--- /dev/null
+++ b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/archiva/metadata/repository/TestMetadataRepository.java
@@ -0,0 +1,185 @@
+package org.apache.archiva.metadata.repository;
+
+/*
+ * 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.metadata.model.ArtifactMetadata;
+import org.apache.archiva.metadata.model.MetadataFacet;
+import org.apache.archiva.metadata.model.ProjectMetadata;
+import org.apache.archiva.metadata.model.ProjectVersionMetadata;
+import org.apache.archiva.metadata.model.ProjectVersionReference;
+
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Date;
+import java.util.List;
+
+public class TestMetadataRepository
+    implements MetadataRepository
+{
+    public ProjectMetadata getProject( String repoId, String namespace, String projectId )
+    {
+        return null;
+    }
+
+    public ProjectVersionMetadata getProjectVersion( String repoId, String namespace, String projectId,
+                                                     String projectVersion )
+    {
+        return null;
+    }
+
+    public Collection getArtifactVersions( String repoId, String namespace, String projectId,
+                                                   String projectVersion )
+    {
+        return null;
+    }
+
+    public Collection getProjectReferences( String repoId, String namespace, String projectId,
+                                                                     String projectVersion )
+    {
+        return null;
+    }
+
+    public Collection getRootNamespaces( String repoId )
+    {
+        return null;
+    }
+
+    public Collection getNamespaces( String repoId, String namespace )
+    {
+        return null;
+    }
+
+    public Collection getProjects( String repoId, String namespace )
+    {
+        return null;
+    }
+
+    public Collection getProjectVersions( String repoId, String namespace, String projectId )
+    {
+        return null;
+    }
+
+    public void updateProject( String repoId, ProjectMetadata project )
+    {
+    }
+
+    public void updateArtifact( String repoId, String namespace, String projectId, String projectVersion,
+                                ArtifactMetadata artifactMeta )
+    {
+
+    }
+
+    public void updateProjectVersion( String repoId, String namespace, String projectId,
+                                      ProjectVersionMetadata versionMetadata )
+    {
+
+    }
+
+    public void updateNamespace( String repoId, String namespace )
+    {
+
+    }
+
+    public List getMetadataFacets( String repodId, String facetId )
+    {
+        return Collections.emptyList();
+    }
+
+    public MetadataFacet getMetadataFacet( String repositoryId, String facetId, String name )
+    {
+        return null;
+    }
+
+    public void addMetadataFacet( String repositoryId, MetadataFacet metadataFacet )
+    {
+
+    }
+
+    public void removeMetadataFacets( String repositoryId, String facetId )
+    {
+
+    }
+
+    public void removeMetadataFacet( String repoId, String facetId, String name )
+    {
+
+    }
+
+    public List getArtifactsByDateRange( String repoId, Date startTime, Date endTime )
+    {
+        return null;
+    }
+
+    public Collection getRepositories()
+    {
+        return null;
+    }
+
+    public List getArtifactsByChecksum( String repoId, String checksum )
+    {
+        return null;
+    }
+
+    public void removeArtifact( String repositoryId, String namespace, String project, String version, String id )
+    {
+
+    }
+
+    public void removeRepository( String repoId )
+    {
+
+    }
+
+    public Collection getArtifacts( String repoId, String namespace, String projectId,
+                                                      String projectVersion )
+    {
+        return null;
+    }
+
+    public void save()
+    {
+
+    }
+
+    public void close()
+    {
+
+    }
+
+    public void revert()
+    {
+
+    }
+
+    public boolean canObtainAccess( Class aClass )
+    {
+        return false;
+    }
+
+    public Object obtainAccess( Class aClass )
+    {
+        return null;
+    }
+
+    public List getArtifacts( String repositoryId )
+    {
+        return null;
+    }
+}
diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/archiva/metadata/repository/TestRepositorySessionFactory.java b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/archiva/metadata/repository/TestRepositorySessionFactory.java
index 90dd98b5d..1ac5901ca 100644
--- a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/archiva/metadata/repository/TestRepositorySessionFactory.java
+++ b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/archiva/metadata/repository/TestRepositorySessionFactory.java
@@ -20,7 +20,7 @@ import org.springframework.stereotype.Service;
 * specific language governing permissions and limitations
 * under the License.
 */
-@Service("repositorySessionFactory#test")
+@Service( "repositorySessionFactory#test" )
 public class TestRepositorySessionFactory
     implements RepositorySessionFactory
 {
@@ -30,7 +30,14 @@ public class TestRepositorySessionFactory
 
     public RepositorySession createSession()
     {
-        return new RepositorySession( repository, resolver );
+        return new RepositorySession( new TestMetadataRepository(), resolver )
+        {
+            @Override
+            public void close()
+            {
+                return;
+            }
+        };
     }
 
     public void setRepository( MetadataRepository repository )
diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/maven/archiva/consumers/core/ArtifactMissingChecksumsConsumerTest.java b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/maven/archiva/consumers/core/ArtifactMissingChecksumsConsumerTest.java
index 67b3b3ffd..aa243dc2e 100644
--- a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/maven/archiva/consumers/core/ArtifactMissingChecksumsConsumerTest.java
+++ b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/maven/archiva/consumers/core/ArtifactMissingChecksumsConsumerTest.java
@@ -1,9 +1,9 @@
 package org.apache.maven.archiva.consumers.core;
 
+import org.apache.archiva.admin.model.managed.ManagedRepository;
 import org.apache.archiva.checksum.ChecksumAlgorithm;
 import org.apache.archiva.checksum.ChecksummedFile;
 import org.apache.commons.io.FileUtils;
-import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration;
 import org.apache.maven.archiva.consumers.KnownRepositoryContentConsumer;
 import org.junit.Before;
 import org.junit.Test;
@@ -33,7 +33,7 @@ import java.util.Calendar;
 public class ArtifactMissingChecksumsConsumerTest
     extends AbstractArtifactConsumerTest
 {
-    private ManagedRepositoryConfiguration repoConfig;
+    private ManagedRepository repoConfig;
 
     @Before
     public void setUp()
@@ -41,7 +41,7 @@ public class ArtifactMissingChecksumsConsumerTest
     {
         super.setUp();
 
-        repoConfig = new ManagedRepositoryConfiguration();
+        repoConfig = new ManagedRepository();
         repoConfig.setId( "test-repo" );
         repoConfig.setName( "Test Repository" );
         repoConfig.setLayout( "default" );
diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/maven/archiva/consumers/core/repository/AbstractRepositoryPurgeTest.java b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/maven/archiva/consumers/core/repository/AbstractRepositoryPurgeTest.java
index 2f63b653a..7abb869ce 100644
--- a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/maven/archiva/consumers/core/repository/AbstractRepositoryPurgeTest.java
+++ b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/maven/archiva/consumers/core/repository/AbstractRepositoryPurgeTest.java
@@ -20,6 +20,7 @@ package org.apache.maven.archiva.consumers.core.repository;
  */
 
 import junit.framework.TestCase;
+import org.apache.archiva.admin.model.managed.ManagedRepository;
 import org.apache.archiva.metadata.repository.MetadataRepository;
 import org.apache.archiva.metadata.repository.RepositorySession;
 import org.apache.archiva.repository.events.RepositoryListener;
@@ -76,7 +77,7 @@ public abstract class AbstractRepositoryPurgeTest
 
     protected static final String RELEASES_TEST_REPO_NAME = "Releases Test Repo One";
 
-    private ManagedRepositoryConfiguration config;
+    private ManagedRepository config;
 
     private ManagedRepositoryContent repo;
 
@@ -117,9 +118,9 @@ public abstract class AbstractRepositoryPurgeTest
         repo = null;
     }
 
-    public ManagedRepositoryConfiguration getRepoConfiguration( String repoId, String repoName )
+    public ManagedRepository getRepoConfiguration( String repoId, String repoName )
     {
-        config = new ManagedRepositoryConfiguration();
+        config = new ManagedRepository();
         config.setId( repoId );
         config.setName( repoName );
         config.setDaysOlder( TEST_DAYS_OLDER );
diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/maven/archiva/consumers/core/repository/CleanupReleasedSnapshotsRepositoryPurgeTest.java b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/maven/archiva/consumers/core/repository/CleanupReleasedSnapshotsRepositoryPurgeTest.java
index 47a35e1d6..c3f8c7b44 100644
--- a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/maven/archiva/consumers/core/repository/CleanupReleasedSnapshotsRepositoryPurgeTest.java
+++ b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/maven/archiva/consumers/core/repository/CleanupReleasedSnapshotsRepositoryPurgeTest.java
@@ -19,10 +19,11 @@ package org.apache.maven.archiva.consumers.core.repository;
  * under the License.
  */
 
+import org.apache.archiva.admin.model.managed.ManagedRepositoryAdmin;
+import org.apache.archiva.admin.repository.managed.DefaultManagedRepositoryAdmin;
 import org.apache.archiva.repository.events.RepositoryListener;
 import org.apache.commons.io.FileUtils;
 import org.apache.maven.archiva.configuration.ArchivaConfiguration;
-import org.apache.maven.archiva.configuration.Configuration;
 import org.apache.maven.archiva.repository.RepositoryContentFactory;
 import org.apache.maven.archiva.repository.metadata.MetadataTools;
 import org.custommonkey.xmlunit.XMLAssert;
@@ -67,7 +68,8 @@ public class CleanupReleasedSnapshotsRepositoryPurgeTest
         super.setUp();
 
         RepositoryContentFactory factory =
-            applicationContext.getBean( "repositoryContentFactory#cleanup-released-snapshots", RepositoryContentFactory.class );
+            applicationContext.getBean( "repositoryContentFactory#cleanup-released-snapshots",
+                                        RepositoryContentFactory.class );
 
         archivaConfiguration =
             applicationContext.getBean( "archivaConfiguration#cleanup-released-snapshots", ArchivaConfiguration.class );
@@ -76,18 +78,28 @@ public class CleanupReleasedSnapshotsRepositoryPurgeTest
 
         listener = (RepositoryListener) listenerControl.getMock();
         List listeners = Collections.singletonList( listener );
-        repoPurge =
-            new CleanupReleasedSnapshotsRepositoryPurge( getRepository(), metadataTools, archivaConfiguration, factory,
-                                                         repositorySession, listeners );
+        repoPurge = new CleanupReleasedSnapshotsRepositoryPurge( getRepository(), metadataTools,
+                                                                 applicationContext.getBean(
+                                                                     ManagedRepositoryAdmin.class ), factory,
+                                                                 repositorySession, listeners );
+
+        ( (DefaultManagedRepositoryAdmin) applicationContext.getBean(
+            ManagedRepositoryAdmin.class ) ).setArchivaConfiguration( archivaConfiguration );
     }
 
     @Test
     public void testReleasedSnapshotsExistsInSameRepo()
         throws Exception
     {
-        Configuration config = archivaConfiguration.getConfiguration();
-        config.removeManagedRepository( config.findManagedRepositoryById( TEST_REPO_ID ) );
-        config.addManagedRepository( getRepoConfiguration( TEST_REPO_ID, TEST_REPO_NAME ) );
+        /**
+         Configuration config = archivaConfiguration.getConfiguration();
+         config.removeManagedRepository( config.findManagedRepositoryById( TEST_REPO_ID ) );
+         config.addManagedRepository( getRepoConfiguration( TEST_REPO_ID, TEST_REPO_NAME ) );
+         **/
+
+        applicationContext.getBean( ManagedRepositoryAdmin.class ).deleteManagedRepository( TEST_REPO_ID, null, false );
+        applicationContext.getBean( ManagedRepositoryAdmin.class ).addManagedRepository(
+            getRepoConfiguration( TEST_REPO_ID, TEST_REPO_NAME ), false, null );
 
         String repoRoot = prepareTestRepos();
 
@@ -142,9 +154,13 @@ public class CleanupReleasedSnapshotsRepositoryPurgeTest
     public void testNonArtifactFile()
         throws Exception
     {
-        Configuration config = archivaConfiguration.getConfiguration();
+        /*Configuration config = archivaConfiguration.getConfiguration();
         config.removeManagedRepository( config.findManagedRepositoryById( TEST_REPO_ID ) );
-        config.addManagedRepository( getRepoConfiguration( TEST_REPO_ID, TEST_REPO_NAME ) );
+        config.addManagedRepository( getRepoConfiguration( TEST_REPO_ID, TEST_REPO_NAME ) );*/
+
+        applicationContext.getBean( ManagedRepositoryAdmin.class ).deleteManagedRepository( TEST_REPO_ID, null, false );
+        applicationContext.getBean( ManagedRepositoryAdmin.class ).addManagedRepository(
+            getRepoConfiguration( TEST_REPO_ID, TEST_REPO_NAME ), false, null );
 
         String repoRoot = prepareTestRepos();
 
@@ -152,7 +168,7 @@ public class CleanupReleasedSnapshotsRepositoryPurgeTest
         listenerControl.replay();
 
         File file = new File( repoRoot, INDEX_PATH );
-        if (!file.exists())
+        if ( !file.exists() )
         {
             // help windauze to create directory with .
             file.getParentFile().mkdirs();
@@ -171,10 +187,18 @@ public class CleanupReleasedSnapshotsRepositoryPurgeTest
     public void testReleasedSnapshotsExistsInDifferentRepo()
         throws Exception
     {
+        /*
         Configuration config = archivaConfiguration.getConfiguration();
         config.removeManagedRepository( config.findManagedRepositoryById( TEST_REPO_ID ) );
         config.addManagedRepository( getRepoConfiguration( TEST_REPO_ID, TEST_REPO_NAME ) );
         config.addManagedRepository( getRepoConfiguration( RELEASES_TEST_REPO_ID, RELEASES_TEST_REPO_NAME ) );
+        */
+        applicationContext.getBean( ManagedRepositoryAdmin.class ).deleteManagedRepository( TEST_REPO_ID, null, false );
+        applicationContext.getBean( ManagedRepositoryAdmin.class ).addManagedRepository(
+            getRepoConfiguration( TEST_REPO_ID, TEST_REPO_NAME ), false, null );
+
+        applicationContext.getBean( ManagedRepositoryAdmin.class ).addManagedRepository(
+            getRepoConfiguration( RELEASES_TEST_REPO_ID, RELEASES_TEST_REPO_NAME ), false, null );
 
         String repoRoot = prepareTestRepos();
 
@@ -217,9 +241,14 @@ public class CleanupReleasedSnapshotsRepositoryPurgeTest
     public void testHigherSnapshotExistsInSameRepo()
         throws Exception
     {
+        /*
         Configuration config = archivaConfiguration.getConfiguration();
         config.removeManagedRepository( config.findManagedRepositoryById( TEST_REPO_ID ) );
         config.addManagedRepository( getRepoConfiguration( TEST_REPO_ID, TEST_REPO_NAME ) );
+        */
+        applicationContext.getBean( ManagedRepositoryAdmin.class ).deleteManagedRepository( TEST_REPO_ID, null, false );
+        applicationContext.getBean( ManagedRepositoryAdmin.class ).addManagedRepository(
+            getRepoConfiguration( TEST_REPO_ID, TEST_REPO_NAME ), false, null );
 
         String repoRoot = prepareTestRepos();
 
diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/maven/archiva/consumers/core/repository/DaysOldRepositoryPurgeTest.java b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/maven/archiva/consumers/core/repository/DaysOldRepositoryPurgeTest.java
index 3f0ec595c..06f753800 100644
--- a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/maven/archiva/consumers/core/repository/DaysOldRepositoryPurgeTest.java
+++ b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/maven/archiva/consumers/core/repository/DaysOldRepositoryPurgeTest.java
@@ -19,6 +19,7 @@ package org.apache.maven.archiva.consumers.core.repository;
  * under the License.
  */
 
+import org.apache.archiva.admin.model.managed.ManagedRepository;
 import org.apache.archiva.repository.events.RepositoryListener;
 import org.apache.commons.lang.time.DateUtils;
 import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration;
@@ -52,7 +53,7 @@ public class DaysOldRepositoryPurgeTest
     public void testByLastModified()
         throws Exception
     {
-        ManagedRepositoryConfiguration repoConfiguration = getRepoConfiguration( TEST_REPO_ID, TEST_REPO_NAME );
+        ManagedRepository repoConfiguration = getRepoConfiguration( TEST_REPO_ID, TEST_REPO_NAME );
         repoPurge = new DaysOldRepositoryPurge( getRepository(), repoConfiguration.getDaysOlder(),
                                                 repoConfiguration.getRetentionCount(), repositorySession,
                                                 Collections.singletonList( listener ) );
@@ -114,7 +115,7 @@ public class DaysOldRepositoryPurgeTest
     public void testOrderOfDeletion()
         throws Exception
     {
-        ManagedRepositoryConfiguration repoConfiguration = getRepoConfiguration( TEST_REPO_ID, TEST_REPO_NAME );
+        ManagedRepository repoConfiguration = getRepoConfiguration( TEST_REPO_ID, TEST_REPO_NAME );
         List listeners = Collections.singletonList( listener );
         repoPurge = new DaysOldRepositoryPurge( getRepository(), repoConfiguration.getDaysOlder(),
                                                 repoConfiguration.getRetentionCount(), repositorySession, listeners );
@@ -165,7 +166,7 @@ public class DaysOldRepositoryPurgeTest
     public void testMetadataDrivenSnapshots()
         throws Exception
     {
-        ManagedRepositoryConfiguration repoConfiguration = getRepoConfiguration( TEST_REPO_ID, TEST_REPO_NAME );
+        ManagedRepository repoConfiguration = getRepoConfiguration( TEST_REPO_ID, TEST_REPO_NAME );
         List listeners = Collections.singletonList( listener );
         repoPurge = new DaysOldRepositoryPurge( getRepository(), repoConfiguration.getDaysOlder(),
                                                 repoConfiguration.getRetentionCount(), repositorySession, listeners );
diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/maven/archiva/consumers/core/repository/RepositoryPurgeConsumerTest.java b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/maven/archiva/consumers/core/repository/RepositoryPurgeConsumerTest.java
index 9da04bc00..8e4df2cd6 100644
--- a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/maven/archiva/consumers/core/repository/RepositoryPurgeConsumerTest.java
+++ b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/maven/archiva/consumers/core/repository/RepositoryPurgeConsumerTest.java
@@ -19,14 +19,15 @@ package org.apache.maven.archiva.consumers.core.repository;
  * under the License.
  */
 
+import org.apache.archiva.admin.model.managed.ManagedRepository;
+import org.apache.archiva.admin.model.managed.ManagedRepositoryAdmin;
+import org.apache.archiva.admin.repository.managed.DefaultManagedRepositoryAdmin;
 import org.apache.archiva.metadata.repository.TestRepositorySessionFactory;
 import org.apache.commons.io.FileUtils;
 import org.apache.maven.archiva.common.utils.BaseFile;
 import org.apache.maven.archiva.configuration.ArchivaConfiguration;
-import org.apache.maven.archiva.configuration.Configuration;
 import org.apache.maven.archiva.configuration.FileType;
 import org.apache.maven.archiva.configuration.FileTypes;
-import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration;
 import org.apache.maven.archiva.consumers.KnownRepositoryContentConsumer;
 import org.apache.maven.archiva.consumers.functors.ConsumerWantsFilePredicate;
 import org.custommonkey.xmlunit.XMLAssert;
@@ -43,6 +44,16 @@ import java.io.File;
 public class RepositoryPurgeConsumerTest
     extends AbstractRepositoryPurgeTest
 {
+    @Before
+    public void setUp()
+        throws Exception
+    {
+        super.setUp();
+
+        TestRepositorySessionFactory factory = applicationContext.getBean( TestRepositorySessionFactory.class );
+        factory.setRepository( metadataRepository );
+    }
+
     @Test
     public void testConsumption()
         throws Exception
@@ -117,7 +128,7 @@ public class RepositoryPurgeConsumerTest
             applicationContext.getBean( "knownRepositoryContentConsumer#repo-purge-consumer-by-retention-count",
                                         KnownRepositoryContentConsumer.class );
 
-        ManagedRepositoryConfiguration repoConfiguration = getRepoConfiguration( TEST_REPO_ID, TEST_REPO_NAME );
+        ManagedRepository repoConfiguration = getRepoConfiguration( TEST_REPO_ID, TEST_REPO_NAME );
         repoConfiguration.setDaysOlder( 0 ); // force days older off to allow retention count purge to execute.
         repoConfiguration.setRetentionCount( TEST_RETENTION_COUNT );
         addRepoToConfiguration( "retention-count", repoConfiguration );
@@ -163,32 +174,51 @@ public class RepositoryPurgeConsumerTest
         removeRepoFromConfiguration( "retention-count", repoConfiguration );
     }
 
-    private void addRepoToConfiguration( String configHint, ManagedRepositoryConfiguration repoConfiguration )
+    private void addRepoToConfiguration( String configHint, ManagedRepository repoConfiguration )
         throws Exception
     {
         ArchivaConfiguration archivaConfiguration =
             applicationContext.getBean( "archivaConfiguration#" + configHint, ArchivaConfiguration.class );
-        Configuration configuration = archivaConfiguration.getConfiguration();
-        ManagedRepositoryConfiguration managedRepositoryConfiguration =
-            configuration.findManagedRepositoryById( repoConfiguration.getId() );
-        if ( managedRepositoryConfiguration != null )
+        ( (DefaultManagedRepositoryAdmin) applicationContext.getBean(
+            ManagedRepositoryAdmin.class ) ).setArchivaConfiguration( archivaConfiguration );
+        /**
+         Configuration configuration = archivaConfiguration.getConfiguration();
+         ManagedRepositoryConfiguration managedRepositoryConfiguration =
+         configuration.findManagedRepositoryById( repoConfiguration.getId() );
+         if ( managedRepositoryConfiguration != null )
+         {
+         configuration.removeManagedRepository( managedRepositoryConfiguration );
+         }
+         configuration.addManagedRepository( repoConfiguration );
+         **/
+        ManagedRepositoryAdmin managedRepositoryAdmin = applicationContext.getBean( ManagedRepositoryAdmin.class );
+        if ( managedRepositoryAdmin.getManagedRepository( repoConfiguration.getId() ) != null )
         {
-            configuration.removeManagedRepository( managedRepositoryConfiguration );
+            managedRepositoryAdmin.deleteManagedRepository( repoConfiguration.getId(), null, false );
         }
-        configuration.addManagedRepository( repoConfiguration );
+        managedRepositoryAdmin.addManagedRepository( repoConfiguration, false, null );
     }
 
-    private void removeRepoFromConfiguration( String configHint, ManagedRepositoryConfiguration repoConfiguration )
+    private void removeRepoFromConfiguration( String configHint, ManagedRepository repoConfiguration )
         throws Exception
     {
         ArchivaConfiguration archivaConfiguration =
             applicationContext.getBean( "archivaConfiguration#" + configHint, ArchivaConfiguration.class );
-        Configuration configuration = archivaConfiguration.getConfiguration();
-        ManagedRepositoryConfiguration managedRepositoryConfiguration =
-            configuration.findManagedRepositoryById( repoConfiguration.getId() );
-        if ( managedRepositoryConfiguration != null )
+
+        ( (DefaultManagedRepositoryAdmin) applicationContext.getBean(
+            ManagedRepositoryAdmin.class ) ).setArchivaConfiguration( archivaConfiguration );
+        /**
+         Configuration configuration = archivaConfiguration.getConfiguration();
+         ManagedRepositoryConfiguration managedRepositoryConfiguration =
+         configuration.findManagedRepositoryById( repoConfiguration.getId() );
+         if ( managedRepositoryConfiguration != null )
+         {
+         configuration.removeManagedRepository( managedRepositoryConfiguration );
+         }*/
+        ManagedRepositoryAdmin managedRepositoryAdmin = applicationContext.getBean( ManagedRepositoryAdmin.class );
+        if ( managedRepositoryAdmin.getManagedRepository( repoConfiguration.getId() ) != null )
         {
-            configuration.removeManagedRepository( managedRepositoryConfiguration );
+            managedRepositoryAdmin.deleteManagedRepository( repoConfiguration.getId(), null, true );
         }
     }
 
@@ -200,7 +230,7 @@ public class RepositoryPurgeConsumerTest
             applicationContext.getBean( "knownRepositoryContentConsumer#repo-purge-consumer-by-days-old",
                                         KnownRepositoryContentConsumer.class );
 
-        ManagedRepositoryConfiguration repoConfiguration = getRepoConfiguration( TEST_REPO_ID, TEST_REPO_NAME );
+        ManagedRepository repoConfiguration = getRepoConfiguration( TEST_REPO_ID, TEST_REPO_NAME );
         repoConfiguration.setDaysOlder( TEST_DAYS_OLDER );
         addRepoToConfiguration( "days-old", repoConfiguration );
 
@@ -258,7 +288,7 @@ public class RepositoryPurgeConsumerTest
             applicationContext.getBean( "knownRepositoryContentConsumer#repo-purge-consumer-by-retention-count",
                                         KnownRepositoryContentConsumer.class );
 
-        ManagedRepositoryConfiguration repoConfiguration = getRepoConfiguration( TEST_REPO_ID, TEST_REPO_NAME );
+        ManagedRepository repoConfiguration = getRepoConfiguration( TEST_REPO_ID, TEST_REPO_NAME );
         repoConfiguration.setDeleteReleasedSnapshots( false ); // Set to NOT delete released snapshots.
         addRepoToConfiguration( "retention-count", repoConfiguration );
 
@@ -303,7 +333,7 @@ public class RepositoryPurgeConsumerTest
             applicationContext.getBean( "knownRepositoryContentConsumer#repo-purge-consumer-by-days-old",
                                         KnownRepositoryContentConsumer.class );
 
-        ManagedRepositoryConfiguration repoConfiguration = getRepoConfiguration( TEST_REPO_ID, TEST_REPO_NAME );
+        ManagedRepository repoConfiguration = getRepoConfiguration( TEST_REPO_ID, TEST_REPO_NAME );
         repoConfiguration.setDeleteReleasedSnapshots( true );
         addRepoToConfiguration( "days-old", repoConfiguration );
 
@@ -340,14 +370,4 @@ public class RepositoryPurgeConsumerTest
 
         removeRepoFromConfiguration( "days-old", repoConfiguration );
     }
-
-    @Before
-    public void setUp()
-        throws Exception
-    {
-        super.setUp();
-
-        TestRepositorySessionFactory factory = applicationContext.getBean( TestRepositorySessionFactory.class );
-        factory.setRepository( metadataRepository );
-    }
 }
diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/maven/archiva/consumers/core/repository/RetentionCountRepositoryPurgeTest.java b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/maven/archiva/consumers/core/repository/RetentionCountRepositoryPurgeTest.java
index be4c2f118..718bbd5c0 100644
--- a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/maven/archiva/consumers/core/repository/RetentionCountRepositoryPurgeTest.java
+++ b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/maven/archiva/consumers/core/repository/RetentionCountRepositoryPurgeTest.java
@@ -19,6 +19,7 @@ package org.apache.maven.archiva.consumers.core.repository;
  * under the License.
  */
 
+import org.apache.archiva.admin.model.managed.ManagedRepository;
 import org.apache.archiva.repository.events.RepositoryListener;
 import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration;
 import org.junit.Before;
@@ -39,7 +40,7 @@ public class RetentionCountRepositoryPurgeTest
     {
         super.setUp();
 
-        ManagedRepositoryConfiguration repoConfiguration = getRepoConfiguration( TEST_REPO_ID, TEST_REPO_NAME );
+        ManagedRepository repoConfiguration = getRepoConfiguration( TEST_REPO_ID, TEST_REPO_NAME );
         List listeners = Collections.singletonList( listener );
         repoPurge = new RetentionCountRepositoryPurge( getRepository(), repoConfiguration.getRetentionCount(),
                                                        repositorySession, listeners );
diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/META-INF/redback/redback-core.xml b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/META-INF/redback/redback-core.xml
new file mode 100644
index 000000000..ecc1de8fb
--- /dev/null
+++ b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/META-INF/redback/redback-core.xml
@@ -0,0 +1,213 @@
+
+    1.0.0
+    
+        
+          System
+          Roles that apply system-wide, across all of the applications
+        1.0.0
+        
+            
+                global
+                *
+                true
+                global resource implies full access for authorization
+            
+            
+                username
+                ${username}
+                true
+                replaced with the username of the principal at authorization check time
+            
+        
+        
+            
+                configuration-edit
+                configuration-edit
+                edit configuration
+                true
+            
+            
+                user-management-user-create
+                user-management-user-create
+                create user
+                true
+            
+            
+                user-management-user-edit
+                user-management-user-edit
+                edit user
+                true
+            
+            
+                user-management-user-role
+                user-management-user-role
+                user roles
+                true
+            
+            
+                user-management-user-delete
+                user-management-user-delete
+                delete user
+                true
+            
+            
+                user-management-user-list
+                user-management-user-list
+                list users
+                true
+            
+            
+                user-management-role-grant
+                user-management-role-grant
+                grant role
+                true
+            
+            
+                user-management-role-drop
+                user-management-role-drop
+                drop role
+                true
+            
+            
+                user-management-rbac-admin
+                user-management-rbac-admin
+                administer rbac
+                true
+            
+            
+                guest-access
+                guest-access
+                access guest
+                true
+            
+            
+                user-management-manage-data
+                user-management-manage-data
+                manage data
+                true
+                        
+        
+        
+            
+                system-administrator
+                System Administrator
+                true
+                true
+                
+                    
+                        edit-redback-configuration
+                        Edit Redback Configuration
+                        configuration-edit
+                        global
+                        true
+                    
+                    
+                        manage-rbac-setup
+                        User RBAC Management
+                        user-management-rbac-admin
+                        global
+                        true
+                    
+                    
+                        manage-rbac-data
+                        RBAC Manage Data
+                        user-management-manage-data
+                        global
+                        true
+                                        
+                
+                
+                    user-administrator
+                
+            
+            
+                user-administrator
+                User Administrator
+                true
+                true
+                
+                    
+                        drop-roles-for-anyone
+                        Drop Roles for Anyone
+                        user-management-role-drop
+                        global
+                        true
+                    
+                    
+                        grant-roles-for-anyone
+                        Grant Roles for Anyone
+                        user-management-role-grant
+                        global
+                        true
+                    
+                    
+                        user-create
+                        Create Users
+                        user-management-user-create
+                        global
+                        true
+                    
+                    
+                        user-delete
+                        Delete Users
+                        user-management-user-delete
+                        global
+                        true
+                    
+                    
+                        user-edit
+                        Edit Users
+                        user-management-user-edit
+                        global
+                        true
+                    
+                    
+                        access-users-roles
+                        Access Users Roles
+                        user-management-user-role
+                        global
+                        true
+                    
+                    
+                        access-user-list
+                        Access User List
+                        user-management-user-list
+                        global
+                        true
+                    
+                
+            
+            
+                registered-user
+                Registered User
+                true
+                true
+                
+                    
+                        edit-user-by-username
+                        Edit User Data by Username
+                        user-management-user-edit
+                        username
+                        true
+                    
+                
+            
+            
+                guest
+                Guest
+                true
+                true
+                
+                    
+                        guest-permission
+                        Guest Permission
+                        guest-access
+                        global
+                        true
+                    
+                
+            
+        
+        
+    
+
\ No newline at end of file
diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/META-INF/spring-context.xml b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/META-INF/spring-context.xml
new file mode 100644
index 000000000..176462a2f
--- /dev/null
+++ b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/META-INF/spring-context.xml
@@ -0,0 +1,41 @@
+
+
+
+
+
+  
+    
+      
+        scheduler1
+        org.quartz.simpl.SimpleThreadPool
+        2
+        4
+        org.quartz.simpl.RAMJobStore
+      
+    
+  
+
+
\ No newline at end of file
diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/main/java/org/apache/archiva/consumers/lucene/NexusIndexerConsumer.java b/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/main/java/org/apache/archiva/consumers/lucene/NexusIndexerConsumer.java
index 3e87693e9..3fdf86d9d 100644
--- a/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/main/java/org/apache/archiva/consumers/lucene/NexusIndexerConsumer.java
+++ b/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/main/java/org/apache/archiva/consumers/lucene/NexusIndexerConsumer.java
@@ -19,6 +19,7 @@ package org.apache.archiva.consumers.lucene;
  * under the License.
  */
 
+import org.apache.archiva.admin.model.managed.ManagedRepository;
 import org.apache.archiva.common.plexusbridge.MavenIndexerUtils;
 import org.apache.archiva.common.plexusbridge.PlexusSisuBridge;
 import org.apache.archiva.common.plexusbridge.PlexusSisuBridgeException;
@@ -27,7 +28,6 @@ import org.apache.archiva.scheduler.indexing.ArtifactIndexingTask;
 import org.apache.maven.archiva.configuration.ArchivaConfiguration;
 import org.apache.maven.archiva.configuration.ConfigurationNames;
 import org.apache.maven.archiva.configuration.FileTypes;
-import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration;
 import org.apache.maven.archiva.consumers.AbstractMonitoredConsumer;
 import org.apache.maven.archiva.consumers.ConsumerException;
 import org.apache.maven.archiva.consumers.KnownRepositoryContentConsumer;
@@ -35,14 +35,13 @@ import org.apache.maven.index.NexusIndexer;
 import org.apache.maven.index.context.IndexCreator;
 import org.apache.maven.index.context.IndexingContext;
 import org.apache.maven.index.context.UnsupportedExistingLuceneIndexException;
-import org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable;
-import org.codehaus.plexus.personality.plexus.lifecycle.phase.InitializationException;
 import org.codehaus.plexus.registry.Registry;
 import org.codehaus.plexus.registry.RegistryListener;
 import org.codehaus.plexus.taskqueue.TaskQueueException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import javax.annotation.PostConstruct;
 import java.io.File;
 import java.io.IOException;
 import java.util.ArrayList;
@@ -55,7 +54,7 @@ import java.util.List;
  */
 public class NexusIndexerConsumer
     extends AbstractMonitoredConsumer
-    implements KnownRepositoryContentConsumer, RegistryListener, Initializable
+    implements KnownRepositoryContentConsumer, RegistryListener
 {
     private Logger log = LoggerFactory.getLogger( NexusIndexerConsumer.class );
 
@@ -73,7 +72,7 @@ public class NexusIndexerConsumer
 
     private List includes = new ArrayList();
 
-    private ManagedRepositoryConfiguration repository;
+    private ManagedRepository repository;
 
     private List allIndexCreators;
 
@@ -104,7 +103,7 @@ public class NexusIndexerConsumer
         return false;
     }
 
-    public void beginScan( ManagedRepositoryConfiguration repository, Date whenGathered )
+    public void beginScan( ManagedRepository repository, Date whenGathered )
         throws ConsumerException
     {
         this.repository = repository;
@@ -125,7 +124,7 @@ public class NexusIndexerConsumer
         }
     }
 
-    public void beginScan( ManagedRepositoryConfiguration repository, Date whenGathered, boolean executeOnEntireRepo )
+    public void beginScan( ManagedRepository repository, Date whenGathered, boolean executeOnEntireRepo )
         throws ConsumerException
     {
         if ( executeOnEntireRepo )
@@ -238,8 +237,8 @@ public class NexusIndexerConsumer
         includes.addAll( filetypes.getFileTypePatterns( FileTypes.ARTIFACTS ) );
     }
 
+    @PostConstruct
     public void initialize()
-        throws InitializationException
     {
         configuration.addChangeListener( this );
 
diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/test/java/org/apache/archiva/consumers/lucene/NexusIndexerConsumerTest.java b/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/test/java/org/apache/archiva/consumers/lucene/NexusIndexerConsumerTest.java
index 53a8fc6bf..f9d8c8fb5 100644
--- a/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/test/java/org/apache/archiva/consumers/lucene/NexusIndexerConsumerTest.java
+++ b/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/test/java/org/apache/archiva/consumers/lucene/NexusIndexerConsumerTest.java
@@ -20,6 +20,7 @@ package org.apache.archiva.consumers.lucene;
  */
 
 import junit.framework.TestCase;
+import org.apache.archiva.admin.model.managed.ManagedRepository;
 import org.apache.archiva.common.plexusbridge.MavenIndexerUtils;
 import org.apache.archiva.common.plexusbridge.PlexusSisuBridge;
 import org.apache.archiva.scheduler.ArchivaTaskScheduler;
@@ -88,7 +89,7 @@ public class NexusIndexerConsumerTest
 
     private KnownRepositoryContentConsumer nexusIndexerConsumer;
 
-    private ManagedRepositoryConfiguration repositoryConfig;
+    private ManagedRepository repositoryConfig;
 
     private ArchivaTaskSchedulerStub scheduler;
 
@@ -119,9 +120,9 @@ public class NexusIndexerConsumerTest
             new NexusIndexerConsumer( scheduler, configuration, filetypes, plexusSisuBridge, mavenIndexerUtils );
 
         // initialize to set the file types to be processed
-        ( (Initializable) nexusIndexerConsumer ).initialize();
+        ( (NexusIndexerConsumer) nexusIndexerConsumer ).initialize();
 
-        repositoryConfig = new ManagedRepositoryConfiguration();
+        repositoryConfig = new ManagedRepository();
         repositoryConfig.setId( "test-repo" );
         repositoryConfig.setLocation( "target/test-classes/test-repo" );
         repositoryConfig.setLayout( "default" );
diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-metadata-consumer/src/main/java/org/apache/archiva/consumers/metadata/ArchivaMetadataCreationConsumer.java b/archiva-modules/archiva-base/archiva-consumers/archiva-metadata-consumer/src/main/java/org/apache/archiva/consumers/metadata/ArchivaMetadataCreationConsumer.java
index 223d0a353..034bad7d0 100644
--- a/archiva-modules/archiva-base/archiva-consumers/archiva-metadata-consumer/src/main/java/org/apache/archiva/consumers/metadata/ArchivaMetadataCreationConsumer.java
+++ b/archiva-modules/archiva-base/archiva-consumers/archiva-metadata-consumer/src/main/java/org/apache/archiva/consumers/metadata/ArchivaMetadataCreationConsumer.java
@@ -19,6 +19,7 @@ package org.apache.archiva.consumers.metadata;
  * under the License.
  */
 
+import org.apache.archiva.admin.model.managed.ManagedRepository;
 import org.apache.archiva.metadata.model.ArtifactMetadata;
 import org.apache.archiva.metadata.model.ProjectMetadata;
 import org.apache.archiva.metadata.model.ProjectVersionMetadata;
@@ -33,7 +34,6 @@ import org.apache.maven.archiva.common.utils.VersionUtil;
 import org.apache.maven.archiva.configuration.ArchivaConfiguration;
 import org.apache.maven.archiva.configuration.ConfigurationNames;
 import org.apache.maven.archiva.configuration.FileTypes;
-import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration;
 import org.apache.maven.archiva.consumers.AbstractMonitoredConsumer;
 import org.apache.maven.archiva.consumers.ConsumerException;
 import org.apache.maven.archiva.consumers.KnownRepositoryContentConsumer;
@@ -131,14 +131,14 @@ public class ArchivaMetadataCreationConsumer
         return this.includes;
     }
 
-    public void beginScan( ManagedRepositoryConfiguration repo, Date whenGathered )
+    public void beginScan( ManagedRepository repo, Date whenGathered )
         throws ConsumerException
     {
         repoId = repo.getId();
         this.whenGathered = whenGathered;
     }
 
-    public void beginScan( ManagedRepositoryConfiguration repository, Date whenGathered, boolean executeOnEntireRepo )
+    public void beginScan( ManagedRepository repository, Date whenGathered, boolean executeOnEntireRepo )
         throws ConsumerException
     {
         beginScan( repository, whenGathered );
diff --git a/archiva-modules/archiva-base/archiva-converter/src/main/java/org/apache/maven/archiva/converter/legacy/DefaultLegacyRepositoryConverter.java b/archiva-modules/archiva-base/archiva-converter/src/main/java/org/apache/maven/archiva/converter/legacy/DefaultLegacyRepositoryConverter.java
index 02950448b..dd45dce71 100644
--- a/archiva-modules/archiva-base/archiva-converter/src/main/java/org/apache/maven/archiva/converter/legacy/DefaultLegacyRepositoryConverter.java
+++ b/archiva-modules/archiva-base/archiva-converter/src/main/java/org/apache/maven/archiva/converter/legacy/DefaultLegacyRepositoryConverter.java
@@ -19,6 +19,7 @@ package org.apache.maven.archiva.converter.legacy;
  * under the License.
  */
 
+import org.apache.archiva.admin.model.managed.ManagedRepository;
 import org.apache.archiva.common.plexusbridge.PlexusSisuBridge;
 import org.apache.archiva.common.plexusbridge.PlexusSisuBridgeException;
 import org.apache.archiva.repository.scanner.RepositoryScanner;
@@ -89,7 +90,7 @@ public class DefaultLegacyRepositoryConverter
         {
             String defaultRepositoryUrl = PathUtil.toUrl( repositoryDirectory );
 
-            ManagedRepositoryConfiguration legacyRepository = new ManagedRepositoryConfiguration();
+            ManagedRepository legacyRepository = new ManagedRepository();
             legacyRepository.setId( "legacy" );
             legacyRepository.setName( "Legacy Repository" );
             legacyRepository.setLocation( legacyRepositoryDirectory.getAbsolutePath() );
diff --git a/archiva-modules/archiva-base/archiva-converter/src/main/java/org/apache/maven/archiva/converter/legacy/LegacyConverterArtifactConsumer.java b/archiva-modules/archiva-base/archiva-converter/src/main/java/org/apache/maven/archiva/converter/legacy/LegacyConverterArtifactConsumer.java
index 92a7d0cc6..9921de22f 100644
--- a/archiva-modules/archiva-base/archiva-converter/src/main/java/org/apache/maven/archiva/converter/legacy/LegacyConverterArtifactConsumer.java
+++ b/archiva-modules/archiva-base/archiva-converter/src/main/java/org/apache/maven/archiva/converter/legacy/LegacyConverterArtifactConsumer.java
@@ -19,9 +19,9 @@ package org.apache.maven.archiva.converter.legacy;
  * under the License.
  */
 
+import org.apache.archiva.admin.model.managed.ManagedRepository;
 import org.apache.archiva.common.plexusbridge.PlexusSisuBridge;
 import org.apache.archiva.common.plexusbridge.PlexusSisuBridgeException;
-import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration;
 import org.apache.maven.archiva.consumers.AbstractMonitoredConsumer;
 import org.apache.maven.archiva.consumers.ConsumerException;
 import org.apache.maven.archiva.consumers.KnownRepositoryContentConsumer;
@@ -88,14 +88,14 @@ public class LegacyConverterArtifactConsumer
         artifactFactory = plexusSisuBridge.lookup( ArtifactFactory.class );
     }
 
-    public void beginScan( ManagedRepositoryConfiguration repository, Date whenGathered )
+    public void beginScan( ManagedRepository repository, Date whenGathered )
         throws ConsumerException
     {
         this.managedRepository = new ManagedDefaultRepositoryContent();
         this.managedRepository.setRepository( repository );
     }
 
-    public void beginScan( ManagedRepositoryConfiguration repository, Date whenGathered, boolean executeOnEntireRepo )
+    public void beginScan( ManagedRepository repository, Date whenGathered, boolean executeOnEntireRepo )
         throws ConsumerException
     {
         beginScan( repository, whenGathered );
diff --git a/archiva-modules/archiva-base/archiva-converter/src/test/java/org/apache/maven/archiva/converter/mock/MockArchivaAdministration.java b/archiva-modules/archiva-base/archiva-converter/src/test/java/org/apache/maven/archiva/converter/mock/MockArchivaAdministration.java
new file mode 100644
index 000000000..4a3f6e91c
--- /dev/null
+++ b/archiva-modules/archiva-base/archiva-converter/src/test/java/org/apache/maven/archiva/converter/mock/MockArchivaAdministration.java
@@ -0,0 +1,148 @@
+package org.apache.maven.archiva.converter.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.admin.ArchivaAdministration;
+import org.apache.archiva.admin.model.admin.FileType;
+import org.apache.archiva.admin.model.admin.LegacyArtifactPath;
+import org.apache.archiva.admin.model.admin.OrganisationInformation;
+
+import java.util.List;
+
+/**
+ * @author Olivier Lamy
+ */
+public class MockArchivaAdministration implements ArchivaAdministration
+{
+    public List getLegacyArtifactPaths()
+        throws RepositoryAdminException
+    {
+        return null;
+    }
+
+    public void addLegacyArtifactPath( LegacyArtifactPath legacyArtifactPath, AuditInformation auditInformation )
+        throws RepositoryAdminException
+    {
+
+    }
+
+    public void deleteLegacyArtifactPath( String path, AuditInformation auditInformation )
+        throws RepositoryAdminException
+    {
+
+    }
+
+    public void addFileTypePattern( String fileTypeId, String pattern, AuditInformation auditInformation )
+        throws RepositoryAdminException
+    {
+
+    }
+
+    public void removeFileTypePattern( String fileTypeId, String pattern, AuditInformation auditInformation )
+        throws RepositoryAdminException
+    {
+
+    }
+
+    public List getFileTypes()
+        throws RepositoryAdminException
+    {
+        return null;
+    }
+
+    public FileType getFileType( String fileTypeId )
+        throws RepositoryAdminException
+    {
+        return null;
+    }
+
+    public void addFileType( FileType fileType, AuditInformation auditInformation )
+        throws RepositoryAdminException
+    {
+
+    }
+
+    public void removeFileType( String fileTypeId, AuditInformation auditInformation )
+        throws RepositoryAdminException
+    {
+
+    }
+
+    public void addKnownContentConsumer( String knownContentConsumer, AuditInformation auditInformation )
+        throws RepositoryAdminException
+    {
+
+    }
+
+    public void setKnownContentConsumers( List knownContentConsumers, AuditInformation auditInformation )
+        throws RepositoryAdminException
+    {
+
+    }
+
+    public List getKnownContentConsumers()
+        throws RepositoryAdminException
+    {
+        return null;
+    }
+
+    public void removeKnownContentConsumer( String knownContentConsumer, AuditInformation auditInformation )
+        throws RepositoryAdminException
+    {
+
+    }
+
+    public void addInvalidContentConsumer( String invalidContentConsumer, AuditInformation auditInformation )
+        throws RepositoryAdminException
+    {
+
+    }
+
+    public void setInvalidContentConsumers( List invalidContentConsumers, AuditInformation auditInformation )
+        throws RepositoryAdminException
+    {
+
+    }
+
+    public List getInvalidContentConsumers()
+        throws RepositoryAdminException
+    {
+        return null;
+    }
+
+    public void removeInvalidContentConsumer( String invalidContentConsumer, AuditInformation auditInformation )
+        throws RepositoryAdminException
+    {
+
+    }
+
+    public OrganisationInformation getOrganisationInformation()
+        throws RepositoryAdminException
+    {
+        return null;
+    }
+
+    public void setOrganisationInformation( OrganisationInformation organisationInformation )
+        throws RepositoryAdminException
+    {
+
+    }
+}
diff --git a/archiva-modules/archiva-base/archiva-converter/src/test/resources/spring-context.xml b/archiva-modules/archiva-base/archiva-converter/src/test/resources/spring-context.xml
index 60142d781..0f39f64a0 100644
--- a/archiva-modules/archiva-base/archiva-converter/src/test/resources/spring-context.xml
+++ b/archiva-modules/archiva-base/archiva-converter/src/test/resources/spring-context.xml
@@ -27,5 +27,6 @@
            http://www.springframework.org/schema/context/spring-context-3.0.xsd"
        default-lazy-init="true">
 
+  
 
 
\ No newline at end of file
diff --git a/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/archiva/indexer/search/NexusRepositorySearch.java b/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/archiva/indexer/search/NexusRepositorySearch.java
index e5c1e4f5b..f2db9cf3e 100644
--- a/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/archiva/indexer/search/NexusRepositorySearch.java
+++ b/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/archiva/indexer/search/NexusRepositorySearch.java
@@ -373,8 +373,8 @@ public class NexusRepositorySearch
                 hit = new SearchResultHit();
                 hit.setArtifactId( artifactInfo.artifactId );
                 hit.setGroupId( artifactInfo.groupId );
-                // do we still need to set the repository id even though we're merging everything?
-                //hit.setRepositoryId( artifactInfo.repository );
+                hit.setRepositoryId( artifactInfo.repository );
+                // FIXME archiva url ??
                 hit.setUrl( artifactInfo.repository + "/" + artifactInfo.fname );
                 hit.addVersion( artifactInfo.version );
                 hit.setBundleExportPackage( artifactInfo.bundleExportPackage );
diff --git a/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/archiva/indexer/search/SearchResultHit.java b/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/archiva/indexer/search/SearchResultHit.java
index bdec0c387..237c5d66f 100644
--- a/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/archiva/indexer/search/SearchResultHit.java
+++ b/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/archiva/indexer/search/SearchResultHit.java
@@ -200,11 +200,23 @@ public class SearchResultHit
     @Override
     public String toString()
     {
-        return "SearchResultHit{" + "context='" + context + '\'' + ", url='" + url + '\'' + ", groupId='" + groupId
-            + '\'' + ", artifactId='" + artifactId + '\'' + ", version='" + version + '\'' + ", repositoryId='"
-            + repositoryId + '\'' + ", versions=" + versions + ", bundleVersion='" + bundleVersion + '\''
-            + ", bundleSymbolicName='" + bundleSymbolicName + '\'' + ", bundleExportPackage='" + bundleExportPackage
-            + '\'' + ", bundleExportService='" + bundleExportService + '\'' + '}';
+        final StringBuilder sb = new StringBuilder();
+        sb.append( "SearchResultHit" );
+        sb.append( "{context='" ).append( context ).append( '\'' );
+        sb.append( ", url='" ).append( url ).append( '\'' );
+        sb.append( ", groupId='" ).append( groupId ).append( '\'' );
+        sb.append( ", artifactId='" ).append( artifactId ).append( '\'' );
+        sb.append( ", version='" ).append( version ).append( '\'' );
+        sb.append( ", repositoryId='" ).append( repositoryId ).append( '\'' );
+        sb.append( ", versions=" ).append( versions );
+        sb.append( ", bundleVersion='" ).append( bundleVersion ).append( '\'' );
+        sb.append( ", bundleSymbolicName='" ).append( bundleSymbolicName ).append( '\'' );
+        sb.append( ", bundleExportPackage='" ).append( bundleExportPackage ).append( '\'' );
+        sb.append( ", bundleExportService='" ).append( bundleExportService ).append( '\'' );
+        sb.append( '}' );
+        return sb.toString();
     }
 
+
+
 }
diff --git a/archiva-modules/archiva-base/archiva-proxy/pom.xml b/archiva-modules/archiva-base/archiva-proxy/pom.xml
index f2a6c4579..aac63c0ef 100644
--- a/archiva-modules/archiva-base/archiva-proxy/pom.xml
+++ b/archiva-modules/archiva-base/archiva-proxy/pom.xml
@@ -124,6 +124,25 @@
       slf4j-simple
       test
     
+    
+      org.apache.archiva
+      archiva-repository-admin-default
+      test
+    
+    
+      org.codehaus.redback
+      redback-rbac-cached
+      test
+    
+    
+      org.apache.derby
+      derby
+      test
+    
+    
+      org.apache.archiva
+      archiva-security-common
+    
   
   
     
@@ -132,6 +151,8 @@
         maven-surefire-plugin
         
           
+            ${basedir}/target/appserver-base
+            ${project.build.outputDirectory}
             ${project.build.outputDirectory}
           
         
diff --git a/archiva-modules/archiva-base/archiva-proxy/src/main/java/org/apache/maven/archiva/proxy/DefaultRepositoryProxyConnectors.java b/archiva-modules/archiva-base/archiva-proxy/src/main/java/org/apache/maven/archiva/proxy/DefaultRepositoryProxyConnectors.java
index 4d400b8d6..86281a7f8 100644
--- a/archiva-modules/archiva-base/archiva-proxy/src/main/java/org/apache/maven/archiva/proxy/DefaultRepositoryProxyConnectors.java
+++ b/archiva-modules/archiva-base/archiva-proxy/src/main/java/org/apache/maven/archiva/proxy/DefaultRepositoryProxyConnectors.java
@@ -1073,7 +1073,7 @@ public class DefaultRepositoryProxyConnectors
         }
 
         AuthenticationInfo authInfo = null;
-        String username = remoteRepository.getRepository().getUsername();
+        String username = remoteRepository.getRepository().getUserName();
         String password = remoteRepository.getRepository().getPassword();
 
         if ( StringUtils.isNotBlank( username ) && StringUtils.isNotBlank( password ) )
diff --git a/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/AbstractProxyTestCase.java b/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/AbstractProxyTestCase.java
index fc6ed6a24..32b93407a 100644
--- a/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/AbstractProxyTestCase.java
+++ b/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/AbstractProxyTestCase.java
@@ -20,6 +20,9 @@ package org.apache.maven.archiva.proxy;
  */
 
 import net.sf.ehcache.CacheManager;
+import org.apache.archiva.admin.model.managed.ManagedRepository;
+import org.apache.archiva.admin.model.managed.ManagedRepositoryAdmin;
+import org.apache.archiva.admin.repository.managed.DefaultManagedRepositoryAdmin;
 import org.apache.archiva.common.plexusbridge.PlexusSisuBridge;
 import org.apache.commons.lang.ArrayUtils;
 import org.apache.maven.archiva.configuration.ArchivaConfiguration;
@@ -45,6 +48,7 @@ import org.springframework.context.ApplicationContext;
 import org.springframework.test.context.ContextConfiguration;
 import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
 
+import javax.inject.Inject;
 import java.io.BufferedReader;
 import java.io.File;
 import java.io.FileReader;
@@ -56,7 +60,6 @@ import java.util.Calendar;
 import java.util.Collection;
 import java.util.Date;
 import java.util.Locale;
-import javax.inject.Inject;
 
 import static org.junit.Assert.*;
 
@@ -66,7 +69,7 @@ import static org.junit.Assert.*;
  * @version $Id$
  */
 @RunWith( SpringJUnit4ClassRunner.class )
-@ContextConfiguration( locations = {"classpath*:/META-INF/spring-context.xml", "classpath:/spring-context.xml"} )
+@ContextConfiguration( locations = { "classpath*:/META-INF/spring-context.xml", "classpath:/spring-context.xml" } )
 public abstract class AbstractProxyTestCase
 {
     @Inject
@@ -125,6 +128,9 @@ public abstract class AbstractProxyTestCase
 
     WagonDelegate delegate;
 
+    @Inject
+    protected ManagedRepositoryAdmin managedRepositoryAdmin;
+
     @Inject
     PlexusSisuBridge plexusSisuBridge;
 
@@ -132,8 +138,8 @@ public abstract class AbstractProxyTestCase
     public void setUp()
         throws Exception
     {
-        config = (MockConfiguration) applicationContext.getBean( "archivaConfiguration#mock",
-                                                                 ArchivaConfiguration.class );
+        config =
+            (MockConfiguration) applicationContext.getBean( "archivaConfiguration#mock", ArchivaConfiguration.class );
 
         config.getConfiguration().setManagedRepositories( new ArrayList() );
         config.getConfiguration().setRemoteRepositories( new ArrayList() );
@@ -144,14 +150,18 @@ public abstract class AbstractProxyTestCase
         String repoPath = "target/test-repository/managed/" + name;
         File repoLocation = new File( repoPath );
 
-        managedDefaultRepository = createRepository( ID_DEFAULT_MANAGED, "Default Managed Repository", repoPath,
-                                                     "default" );
+        managedDefaultRepository =
+            createRepository( ID_DEFAULT_MANAGED, "Default Managed Repository", repoPath, "default" );
 
         managedDefaultDir = new File( managedDefaultRepository.getRepoRoot() );
 
-        ManagedRepositoryConfiguration repoConfig = managedDefaultRepository.getRepository();
+        ManagedRepository repoConfig = managedDefaultRepository.getRepository();
 
-        config.getConfiguration().addManagedRepository( repoConfig );
+        ( (DefaultManagedRepositoryAdmin) applicationContext.getBean(
+            ManagedRepositoryAdmin.class ) ).setArchivaConfiguration( config );
+
+        applicationContext.getBean( ManagedRepositoryAdmin.class ).addManagedRepository( repoConfig, false, null );
+        //config.getConfiguration().addManagedRepository( repoConfig );
 
         // Setup source repository (using legacy layout)
         repoLocation = new File( REPOPATH_LEGACY_MANAGED_TARGET );
@@ -161,26 +171,28 @@ public abstract class AbstractProxyTestCase
         }
         copyDirectoryStructure( new File( REPOPATH_LEGACY_MANAGED ), repoLocation );
 
-        managedLegacyRepository = createRepository( ID_LEGACY_MANAGED, "Legacy Managed Repository",
-                                                    REPOPATH_LEGACY_MANAGED_TARGET, "legacy" );
+        managedLegacyRepository =
+            createRepository( ID_LEGACY_MANAGED, "Legacy Managed Repository", REPOPATH_LEGACY_MANAGED_TARGET,
+                              "legacy" );
 
         managedLegacyDir = new File( managedLegacyRepository.getRepoRoot() );
 
         repoConfig = managedLegacyRepository.getRepository();
 
-        config.getConfiguration().addManagedRepository( repoConfig );
+        //config.getConfiguration().addManagedRepository( repoConfig );
+        applicationContext.getBean( ManagedRepositoryAdmin.class ).addManagedRepository( repoConfig, false, null );
 
         // Setup target (proxied to) repository.
-        saveRemoteRepositoryConfig( ID_PROXIED1, "Proxied Repository 1", new File(
-            REPOPATH_PROXIED1 ).toURL().toExternalForm(), "default" );
+        saveRemoteRepositoryConfig( ID_PROXIED1, "Proxied Repository 1",
+                                    new File( REPOPATH_PROXIED1 ).toURL().toExternalForm(), "default" );
 
         // Setup target (proxied to) repository.
-        saveRemoteRepositoryConfig( ID_PROXIED2, "Proxied Repository 2", new File(
-            REPOPATH_PROXIED2 ).toURL().toExternalForm(), "default" );
+        saveRemoteRepositoryConfig( ID_PROXIED2, "Proxied Repository 2",
+                                    new File( REPOPATH_PROXIED2 ).toURL().toExternalForm(), "default" );
 
         // Setup target (proxied to) repository using legacy layout.
-        saveRemoteRepositoryConfig( ID_LEGACY_PROXIED, "Proxied Legacy Repository", new File(
-            REPOPATH_PROXIED_LEGACY ).toURL().toExternalForm(), "legacy" );
+        saveRemoteRepositoryConfig( ID_LEGACY_PROXIED, "Proxied Legacy Repository",
+                                    new File( REPOPATH_PROXIED_LEGACY ).toURL().toExternalForm(), "legacy" );
 
         // Setup the proxy handler.
         //proxyHandler = applicationContext.getBean (RepositoryProxyConnectors) lookup( RepositoryProxyConnectors.class.getName() );
@@ -209,8 +221,8 @@ public abstract class AbstractProxyTestCase
             {
                 return false;
             }
-            return MockControl.ARRAY_MATCHER.matches( ArrayUtils.remove( expected, 1 ), ArrayUtils.remove( actual,
-                                                                                                           1 ) );
+            return MockControl.ARRAY_MATCHER.matches( ArrayUtils.remove( expected, 1 ),
+                                                      ArrayUtils.remove( actual, 1 ) );
         }
 
         public String toString( Object[] arguments )
@@ -312,7 +324,8 @@ public abstract class AbstractProxyTestCase
             return;
         }
 
-        Collection tmpFiles = org.apache.commons.io.FileUtils.listFiles( workingDir, new String[]{"tmp"}, false );
+        Collection tmpFiles =
+            org.apache.commons.io.FileUtils.listFiles( workingDir, new String[]{ "tmp" }, false );
         if ( !tmpFiles.isEmpty() )
         {
             StringBuffer emsg = new StringBuffer();
@@ -400,14 +413,14 @@ public abstract class AbstractProxyTestCase
     protected ManagedRepositoryContent createRepository( String id, String name, String path, String layout )
         throws Exception
     {
-        ManagedRepositoryConfiguration repo = new ManagedRepositoryConfiguration();
+        ManagedRepository repo = new ManagedRepository();
         repo.setId( id );
         repo.setName( name );
         repo.setLocation( path );
         repo.setLayout( layout );
 
-        ManagedRepositoryContent repoContent = applicationContext.getBean( "managedRepositoryContent#" + layout,
-                                                                           ManagedRepositoryContent.class );
+        ManagedRepositoryContent repoContent =
+            applicationContext.getBean( "managedRepositoryContent#" + layout, ManagedRepositoryContent.class );
         repoContent.setRepository( repo );
         return repoContent;
     }
@@ -489,10 +502,10 @@ public abstract class AbstractProxyTestCase
         config.triggerChange( prefix + ".policies.checksum", connectorConfig.getPolicy( "checksum", "" ) );
         config.triggerChange( prefix + ".policies.snapshots", connectorConfig.getPolicy( "snapshots", "" ) );
         config.triggerChange( prefix + ".policies.cache-failures", connectorConfig.getPolicy( "cache-failures", "" ) );
-        config.triggerChange( prefix + ".policies.propagate-errors", connectorConfig.getPolicy( "propagate-errors",
-                                                                                                "" ) );
-        config.triggerChange( prefix + ".policies.propagate-errors-on-update", connectorConfig.getPolicy(
-            "propagate-errors-on-update", "" ) );
+        config.triggerChange( prefix + ".policies.propagate-errors",
+                              connectorConfig.getPolicy( "propagate-errors", "" ) );
+        config.triggerChange( prefix + ".policies.propagate-errors-on-update",
+                              connectorConfig.getPolicy( "propagate-errors-on-update", "" ) );
     }
 
     protected void saveManagedRepositoryConfig( String id, String name, String path, String layout )
@@ -644,9 +657,9 @@ public abstract class AbstractProxyTestCase
         String managedLegacyPath = managedLegacyDir.getCanonicalPath();
         String testFile = file.getCanonicalPath();
 
-        assertTrue( "Unit Test Failure: File <" + testFile +
-                        "> should be have been defined within the legacy managed path of <" + managedLegacyPath + ">",
-                    testFile.startsWith( managedLegacyPath ) );
+        assertTrue(
+            "Unit Test Failure: File <" + testFile + "> should be have been defined within the legacy managed path of <"
+                + managedLegacyPath + ">", testFile.startsWith( managedLegacyPath ) );
 
         assertFalse( "File < " + testFile + "> should not exist in managed legacy repository.", file.exists() );
     }
@@ -657,9 +670,9 @@ public abstract class AbstractProxyTestCase
         String managedDefaultPath = managedDefaultDir.getCanonicalPath();
         String testFile = file.getCanonicalPath();
 
-        assertTrue( "Unit Test Failure: File <" + testFile +
-                        "> should be have been defined within the managed default path of <" + managedDefaultPath + ">",
-                    testFile.startsWith( managedDefaultPath ) );
+        assertTrue( "Unit Test Failure: File <" + testFile
+                        + "> should be have been defined within the managed default path of <" + managedDefaultPath
+                        + ">", testFile.startsWith( managedDefaultPath ) );
 
         assertFalse( "File < " + testFile + "> should not exist in managed default repository.", file.exists() );
     }
diff --git a/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/HttpProxyTransferTest.java b/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/HttpProxyTransferTest.java
index 32f552965..ae913b284 100644
--- a/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/HttpProxyTransferTest.java
+++ b/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/HttpProxyTransferTest.java
@@ -19,9 +19,11 @@ package org.apache.maven.archiva.proxy;
  * under the License.
  */
 
+import org.apache.archiva.admin.model.managed.ManagedRepository;
+import org.apache.archiva.admin.model.managed.ManagedRepositoryAdmin;
+import org.apache.archiva.admin.repository.managed.DefaultManagedRepositoryAdmin;
 import org.apache.commons.io.FileUtils;
 import org.apache.maven.archiva.configuration.ArchivaConfiguration;
-import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration;
 import org.apache.maven.archiva.configuration.NetworkProxyConfiguration;
 import org.apache.maven.archiva.configuration.ProxyConnectorConfiguration;
 import org.apache.maven.archiva.configuration.RemoteRepositoryConfiguration;
@@ -45,12 +47,12 @@ import org.springframework.context.ApplicationContext;
 import org.springframework.test.context.ContextConfiguration;
 import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
 
-import java.io.File;
-import java.io.IOException;
 import javax.inject.Inject;
 import javax.servlet.ServletException;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
+import java.io.File;
+import java.io.IOException;
 
 import static org.junit.Assert.*;
 
@@ -60,7 +62,7 @@ import static org.junit.Assert.*;
  * @version $Id: ManagedDefaultTransferTest.java 677852 2008-07-18 08:16:24Z brett $
  */
 @RunWith( SpringJUnit4ClassRunner.class )
-@ContextConfiguration( locations = {"classpath*:/META-INF/spring-context.xml", "classpath:/spring-context.xml"} )
+@ContextConfiguration( locations = { "classpath*:/META-INF/spring-context.xml", "classpath:/spring-context.xml" } )
 public class HttpProxyTransferTest
 {
     private static final String PROXY_ID = "proxy";
@@ -108,19 +110,28 @@ public class HttpProxyTransferTest
         // Make the destination dir.
         destRepoDir.mkdirs();
 
-        ManagedRepositoryConfiguration repo = new ManagedRepositoryConfiguration();
+        ManagedRepository repo = new ManagedRepository();
         repo.setId( MANAGED_ID );
         repo.setName( "Default Managed Repository" );
         repo.setLocation( repoPath );
         repo.setLayout( "default" );
 
-        ManagedRepositoryContent repoContent = applicationContext.getBean( "managedRepositoryContent#default",
-                                                                           ManagedRepositoryContent.class );
+        ManagedRepositoryContent repoContent =
+            applicationContext.getBean( "managedRepositoryContent#default", ManagedRepositoryContent.class );
 
         repoContent.setRepository( repo );
         managedDefaultRepository = repoContent;
 
-        config.getConfiguration().addManagedRepository( repo );
+        ( (DefaultManagedRepositoryAdmin) applicationContext.getBean(
+            ManagedRepositoryAdmin.class ) ).setArchivaConfiguration( config );
+
+        ManagedRepositoryAdmin managedRepositoryAdmin = applicationContext.getBean( ManagedRepositoryAdmin.class );
+        if ( managedRepositoryAdmin.getManagedRepository( repo.getId() ) == null )
+        {
+            managedRepositoryAdmin.addManagedRepository( repo, false, null );
+        }
+
+        //config.getConfiguration().addManagedRepository( repo );
 
         Handler handler = new AbstractHandler()
         {
diff --git a/archiva-modules/archiva-base/archiva-proxy/src/test/resources/META-INF/redback/redback-core.xml b/archiva-modules/archiva-base/archiva-proxy/src/test/resources/META-INF/redback/redback-core.xml
new file mode 100644
index 000000000..ecc1de8fb
--- /dev/null
+++ b/archiva-modules/archiva-base/archiva-proxy/src/test/resources/META-INF/redback/redback-core.xml
@@ -0,0 +1,213 @@
+
+    1.0.0
+    
+        
+          System
+          Roles that apply system-wide, across all of the applications
+        1.0.0
+        
+            
+                global
+                *
+                true
+                global resource implies full access for authorization
+            
+            
+                username
+                ${username}
+                true
+                replaced with the username of the principal at authorization check time
+            
+        
+        
+            
+                configuration-edit
+                configuration-edit
+                edit configuration
+                true
+            
+            
+                user-management-user-create
+                user-management-user-create
+                create user
+                true
+            
+            
+                user-management-user-edit
+                user-management-user-edit
+                edit user
+                true
+            
+            
+                user-management-user-role
+                user-management-user-role
+                user roles
+                true
+            
+            
+                user-management-user-delete
+                user-management-user-delete
+                delete user
+                true
+            
+            
+                user-management-user-list
+                user-management-user-list
+                list users
+                true
+            
+            
+                user-management-role-grant
+                user-management-role-grant
+                grant role
+                true
+            
+            
+                user-management-role-drop
+                user-management-role-drop
+                drop role
+                true
+            
+            
+                user-management-rbac-admin
+                user-management-rbac-admin
+                administer rbac
+                true
+            
+            
+                guest-access
+                guest-access
+                access guest
+                true
+            
+            
+                user-management-manage-data
+                user-management-manage-data
+                manage data
+                true
+                        
+        
+        
+            
+                system-administrator
+                System Administrator
+                true
+                true
+                
+                    
+                        edit-redback-configuration
+                        Edit Redback Configuration
+                        configuration-edit
+                        global
+                        true
+                    
+                    
+                        manage-rbac-setup
+                        User RBAC Management
+                        user-management-rbac-admin
+                        global
+                        true
+                    
+                    
+                        manage-rbac-data
+                        RBAC Manage Data
+                        user-management-manage-data
+                        global
+                        true
+                                        
+                
+                
+                    user-administrator
+                
+            
+            
+                user-administrator
+                User Administrator
+                true
+                true
+                
+                    
+                        drop-roles-for-anyone
+                        Drop Roles for Anyone
+                        user-management-role-drop
+                        global
+                        true
+                    
+                    
+                        grant-roles-for-anyone
+                        Grant Roles for Anyone
+                        user-management-role-grant
+                        global
+                        true
+                    
+                    
+                        user-create
+                        Create Users
+                        user-management-user-create
+                        global
+                        true
+                    
+                    
+                        user-delete
+                        Delete Users
+                        user-management-user-delete
+                        global
+                        true
+                    
+                    
+                        user-edit
+                        Edit Users
+                        user-management-user-edit
+                        global
+                        true
+                    
+                    
+                        access-users-roles
+                        Access Users Roles
+                        user-management-user-role
+                        global
+                        true
+                    
+                    
+                        access-user-list
+                        Access User List
+                        user-management-user-list
+                        global
+                        true
+                    
+                
+            
+            
+                registered-user
+                Registered User
+                true
+                true
+                
+                    
+                        edit-user-by-username
+                        Edit User Data by Username
+                        user-management-user-edit
+                        username
+                        true
+                    
+                
+            
+            
+                guest
+                Guest
+                true
+                true
+                
+                    
+                        guest-permission
+                        Guest Permission
+                        guest-access
+                        global
+                        true
+                    
+                
+            
+        
+        
+    
+
\ No newline at end of file
diff --git a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/pom.xml b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/pom.xml
new file mode 100644
index 000000000..86a1d01c1
--- /dev/null
+++ b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/pom.xml
@@ -0,0 +1,45 @@
+
+
+
+
+  4.0.0
+  
+    org.apache.archiva
+    archiva-repository-admin
+    1.4-SNAPSHOT
+  
+  archiva-repository-admin-api
+  Archiva Base :: Repository Admin Api
+  
+    
+      commons-collections
+      commons-collections
+    
+    
+      commons-lang
+      commons-lang
+    
+    
+      org.codehaus.redback
+      redback-users-api
+    
+  
+
+
diff --git a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/AbstractRepository.java b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/AbstractRepository.java
new file mode 100644
index 000000000..053068454
--- /dev/null
+++ b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/AbstractRepository.java
@@ -0,0 +1,116 @@
+package org.apache.archiva.admin.model;
+/*
+ * 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.io.Serializable;
+
+/**
+ * @author Olivier Lamy
+ * @since 1.4
+ */
+public class AbstractRepository
+    implements Serializable
+{
+
+    private String id;
+
+    private String name;
+
+    private String layout = "default";
+
+    public AbstractRepository()
+    {
+        // no op
+    }
+
+    public AbstractRepository( String id, String name, String layout )
+    {
+        this.id = id;
+        this.name = name;
+        this.layout = layout;
+    }
+
+    public String getId()
+    {
+        return id;
+    }
+
+    public void setId( String id )
+    {
+        this.id = id;
+    }
+
+    public String getName()
+    {
+        return name;
+    }
+
+    public void setName( String name )
+    {
+        this.name = name;
+    }
+
+    public String getLayout()
+    {
+        return layout;
+    }
+
+    public void setLayout( String layout )
+    {
+        this.layout = layout;
+    }
+
+
+    public int hashCode()
+    {
+        int result = 17;
+        result = 37 * result + ( id != null ? id.hashCode() : 0 );
+        return result;
+    }
+
+    public boolean equals( Object other )
+    {
+        if ( this == other )
+        {
+            return true;
+        }
+
+        if ( !( other instanceof AbstractRepository ) )
+        {
+            return false;
+        }
+
+        AbstractRepository that = (AbstractRepository) other;
+        boolean result = true;
+        result = result && ( getId() == null ? that.getId() == null : getId().equals( that.getId() ) );
+        return result;
+    }
+
+    @Override
+    public String toString()
+    {
+        final StringBuilder sb = new StringBuilder();
+        sb.append( "AbstractRepository" );
+        sb.append( "{id='" ).append( id ).append( '\'' );
+        sb.append( ", name='" ).append( name ).append( '\'' );
+        sb.append( ", layout='" ).append( layout ).append( '\'' );
+        sb.append( '}' );
+        return sb.toString();
+    }
+}
diff --git a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/AbstractRepositoryConnector.java b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/AbstractRepositoryConnector.java
new file mode 100644
index 000000000..84f9a5117
--- /dev/null
+++ b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/AbstractRepositoryConnector.java
@@ -0,0 +1,401 @@
+package org.apache.archiva.admin.model;
+/*
+ * 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.io.Serializable;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author Olivier Lamy
+ * @since 1.4
+ */
+public abstract class AbstractRepositoryConnector
+    implements Serializable
+{
+    /**
+     * The Repository Source for this connector.
+     */
+    private String sourceRepoId;
+
+    /**
+     * The Repository Target for this connector.
+     */
+    private String targetRepoId;
+
+    /**
+     * The network proxy ID to use for this connector.
+     */
+    private String proxyId;
+
+    /**
+     * Field blackListPatterns.
+     */
+    private List blackListPatterns;
+
+    /**
+     * Field whiteListPatterns.
+     */
+    private List whiteListPatterns;
+
+    /**
+     * Field policies.
+     */
+    private Map policies;
+
+    /**
+     * Field properties.
+     */
+    private Map properties;
+
+    /**
+     * If the the repository proxy connector is disabled or not
+     */
+    private boolean disabled = false;
+
+    //-----------/
+    //- Methods -/
+    //-----------/
+
+    /**
+     * Method addBlackListPattern.
+     *
+     * @param string
+     */
+    public void addBlackListPattern( String string )
+    {
+        getBlackListPatterns().add( string );
+    }
+
+    /**
+     * Method addPolicy.
+     *
+     * @param key
+     * @param value
+     */
+    public void addPolicy( String key, String value )
+    {
+        getPolicies().put( key, value );
+    }
+
+    /**
+     * Method addProperty.
+     *
+     * @param key
+     * @param value
+     */
+    public void addProperty( String key, String value )
+    {
+        getProperties().put( key, value );
+    }
+
+    /**
+     * Method addWhiteListPattern.
+     *
+     * @param string
+     */
+    public void addWhiteListPattern( String string )
+    {
+        getWhiteListPatterns().add( string );
+    }
+
+    /**
+     * Method getBlackListPatterns.
+     *
+     * @return List
+     */
+    public List getBlackListPatterns()
+    {
+        if ( this.blackListPatterns == null )
+        {
+            this.blackListPatterns = new ArrayList();
+        }
+
+        return this.blackListPatterns;
+    }
+
+    /**
+     * Method getPolicies.
+     *
+     * @return Map
+     */
+    public Map getPolicies()
+    {
+        if ( this.policies == null )
+        {
+            this.policies = new HashMap();
+        }
+
+        return this.policies;
+    }
+
+    /**
+     * Method getProperties.
+     *
+     * @return Map
+     */
+    public Map getProperties()
+    {
+        if ( this.properties == null )
+        {
+            this.properties = new HashMap();
+        }
+
+        return this.properties;
+    }
+
+    /**
+     * Get the network proxy ID to use for this connector.
+     *
+     * @return String
+     */
+    public String getProxyId()
+    {
+        return this.proxyId;
+    }
+
+    /**
+     * Get the Repository Source for this connector.
+     *
+     * @return String
+     */
+    public String getSourceRepoId()
+    {
+        return this.sourceRepoId;
+    }
+
+    /**
+     * Get the Repository Target for this connector.
+     *
+     * @return String
+     */
+    public String getTargetRepoId()
+    {
+        return this.targetRepoId;
+    }
+
+    /**
+     * Method getWhiteListPatterns.
+     *
+     * @return List
+     */
+    public List getWhiteListPatterns()
+    {
+        if ( this.whiteListPatterns == null )
+        {
+            this.whiteListPatterns = new ArrayList();
+        }
+
+        return this.whiteListPatterns;
+    }
+
+    /**
+     * Get if the the repository proxy connector is disabled or not
+     * .
+     *
+     * @return boolean
+     */
+    public boolean isDisabled()
+    {
+        return this.disabled;
+    }
+
+    /**
+     * Method removeBlackListPattern.
+     *
+     * @param string
+     */
+    public void removeBlackListPattern( String string )
+    {
+        getBlackListPatterns().remove( string );
+    }
+
+    /**
+     * Method removeWhiteListPattern.
+     *
+     * @param string
+     */
+    public void removeWhiteListPattern( String string )
+    {
+        getWhiteListPatterns().remove( string );
+    }
+
+    /**
+     * Set the list of blacklisted patterns for this connector.
+     *
+     * @param blackListPatterns
+     */
+    public void setBlackListPatterns( List blackListPatterns )
+    {
+        this.blackListPatterns = blackListPatterns;
+    }
+
+    /**
+     * Set if the the repository proxy connector is
+     * disabled or not
+     * .
+     *
+     * @param disabled
+     */
+    public void setDisabled( boolean disabled )
+    {
+        this.disabled = disabled;
+    }
+
+    /**
+     * Set policy configuration for the connector.
+     *
+     * @param policies
+     */
+    public void setPolicies( Map policies )
+    {
+        this.policies = policies;
+    }
+
+    /**
+     * Set configuration for the connector.
+     *
+     * @param properties
+     */
+    public void setProperties( Map properties )
+    {
+        this.properties = properties;
+    }
+
+    /**
+     * Set the network proxy ID to use for this connector.
+     *
+     * @param proxyId
+     */
+    public void setProxyId( String proxyId )
+    {
+        this.proxyId = proxyId;
+    }
+
+    /**
+     * Set the Repository Source for this connector.
+     *
+     * @param sourceRepoId
+     */
+    public void setSourceRepoId( String sourceRepoId )
+    {
+        this.sourceRepoId = sourceRepoId;
+    }
+
+    /**
+     * Set the Repository Target for this connector.
+     *
+     * @param targetRepoId
+     */
+    public void setTargetRepoId( String targetRepoId )
+    {
+        this.targetRepoId = targetRepoId;
+    }
+
+    /**
+     * Set
+     * The list of whitelisted patterns for this
+     * connector.
+     *
+     * @param whiteListPatterns
+     */
+    public void setWhiteListPatterns( List whiteListPatterns )
+    {
+        this.whiteListPatterns = whiteListPatterns;
+    }
+
+
+    /**
+     * Obtain a specific policy from the underlying connector.
+     *
+     * @param policyId     the policy id to fetch.
+     * @param defaultValue the default value for the policy id.
+     * @return the configured policy value (or default value if not found).
+     */
+    public String getPolicy( String policyId, String defaultValue )
+    {
+        if ( this.getPolicies() == null )
+        {
+            return null;
+        }
+
+        String value = this.getPolicies().get( policyId );
+
+        if ( value == null )
+        {
+            return defaultValue;
+        }
+
+        return value;
+    }
+
+    @Override
+    public boolean equals( Object o )
+    {
+        if ( this == o )
+        {
+            return true;
+        }
+        if ( o == null || getClass() != o.getClass() )
+        {
+            return false;
+        }
+
+        AbstractRepositoryConnector that = (AbstractRepositoryConnector) o;
+
+        if ( sourceRepoId != null ? !sourceRepoId.equals( that.sourceRepoId ) : that.sourceRepoId != null )
+        {
+            return false;
+        }
+        if ( targetRepoId != null ? !targetRepoId.equals( that.targetRepoId ) : that.targetRepoId != null )
+        {
+            return false;
+        }
+
+        return true;
+    }
+
+    @Override
+    public int hashCode()
+    {
+        int result = sourceRepoId != null ? sourceRepoId.hashCode() : 0;
+        result = 31 * result + ( targetRepoId != null ? targetRepoId.hashCode() : 0 );
+        return result;
+    }
+
+    @Override
+    public String toString()
+    {
+        final StringBuilder sb = new StringBuilder();
+        sb.append( "AbstractRepositoryConnector" );
+        sb.append( "{sourceRepoId='" ).append( sourceRepoId ).append( '\'' );
+        sb.append( ", targetRepoId='" ).append( targetRepoId ).append( '\'' );
+        sb.append( ", proxyId='" ).append( proxyId ).append( '\'' );
+        sb.append( ", blackListPatterns=" ).append( blackListPatterns );
+        sb.append( ", whiteListPatterns=" ).append( whiteListPatterns );
+        sb.append( ", policies=" ).append( policies );
+        sb.append( ", properties=" ).append( properties );
+        sb.append( ", disabled=" ).append( disabled );
+        sb.append( '}' );
+        return sb.toString();
+    }
+}
+
diff --git a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/AuditInformation.java b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/AuditInformation.java
new file mode 100644
index 000000000..6d96a42e0
--- /dev/null
+++ b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/AuditInformation.java
@@ -0,0 +1,69 @@
+package org.apache.archiva.admin.model;
+/*
+ * 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.codehaus.plexus.redback.users.User;
+
+/**
+ * @author Olivier Lamy
+ * @since 1.4
+ */
+public class AuditInformation
+{
+    private User user;
+
+    private String remoteAddr;
+
+    public AuditInformation( User user, String remoteAddr )
+    {
+        this.user = user;
+        this.remoteAddr = remoteAddr;
+    }
+
+    public User getUser()
+    {
+        return user;
+    }
+
+    public void setUser( User user )
+    {
+        this.user = user;
+    }
+
+    public String getRemoteAddr()
+    {
+        return remoteAddr;
+    }
+
+    public void setRemoteAddr( String remoteAddr )
+    {
+        this.remoteAddr = remoteAddr;
+    }
+
+    @Override
+    public String toString()
+    {
+        final StringBuilder sb = new StringBuilder();
+        sb.append( "AuditInformation" );
+        sb.append( "{user=" ).append( user );
+        sb.append( ", remoteAddr='" ).append( remoteAddr ).append( '\'' );
+        sb.append( '}' );
+        return sb.toString();
+    }
+}
diff --git a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/RepositoryAdminException.java b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/RepositoryAdminException.java
new file mode 100644
index 000000000..0237bca8c
--- /dev/null
+++ b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/RepositoryAdminException.java
@@ -0,0 +1,38 @@
+package org.apache.archiva.admin.model;
+/*
+ * 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.
+ */
+
+
+/**
+ * @author Olivier Lamy
+ * @since 1.4
+ */
+public class RepositoryAdminException
+    extends Exception
+{
+    public RepositoryAdminException( String s )
+    {
+        super( s );
+    }
+
+    public RepositoryAdminException( String message, Throwable cause )
+    {
+        super( message, cause );
+    }
+}
diff --git a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/admin/ArchivaAdministration.java b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/admin/ArchivaAdministration.java
new file mode 100644
index 000000000..f7cc51497
--- /dev/null
+++ b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/admin/ArchivaAdministration.java
@@ -0,0 +1,90 @@
+package org.apache.archiva.admin.model.admin;
+/*
+ * 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 java.util.List;
+
+/**
+ * @author Olivier Lamy
+ * @since 1.4
+ */
+public interface ArchivaAdministration
+{
+
+    List getLegacyArtifactPaths()
+        throws RepositoryAdminException;
+
+    void addLegacyArtifactPath( LegacyArtifactPath legacyArtifactPath, AuditInformation auditInformation )
+        throws RepositoryAdminException;
+
+    void deleteLegacyArtifactPath( String path, AuditInformation auditInformation )
+        throws RepositoryAdminException;
+
+    void addFileTypePattern( String fileTypeId, String pattern, AuditInformation auditInformation )
+        throws RepositoryAdminException;
+
+    void removeFileTypePattern( String fileTypeId, String pattern, AuditInformation auditInformation )
+        throws RepositoryAdminException;
+
+    List getFileTypes()
+        throws RepositoryAdminException;
+
+    FileType getFileType( String fileTypeId )
+        throws RepositoryAdminException;
+
+    void addFileType( FileType fileType, AuditInformation auditInformation )
+        throws RepositoryAdminException;
+
+    void removeFileType( String fileTypeId, AuditInformation auditInformation )
+        throws RepositoryAdminException;
+
+    void addKnownContentConsumer( String knownContentConsumer, AuditInformation auditInformation )
+        throws RepositoryAdminException;
+
+    void setKnownContentConsumers( List knownContentConsumers, AuditInformation auditInformation )
+        throws RepositoryAdminException;
+
+    List getKnownContentConsumers()
+        throws RepositoryAdminException;
+
+    void removeKnownContentConsumer( String knownContentConsumer, AuditInformation auditInformation )
+        throws RepositoryAdminException;
+
+    void addInvalidContentConsumer( String invalidContentConsumer, AuditInformation auditInformation )
+        throws RepositoryAdminException;
+
+    void setInvalidContentConsumers( List invalidContentConsumers, AuditInformation auditInformation )
+        throws RepositoryAdminException;
+
+    List getInvalidContentConsumers()
+        throws RepositoryAdminException;
+
+    void removeInvalidContentConsumer( String invalidContentConsumer, AuditInformation auditInformation )
+        throws RepositoryAdminException;
+
+    OrganisationInformation getOrganisationInformation()
+        throws RepositoryAdminException;
+
+    void setOrganisationInformation( OrganisationInformation organisationInformation )
+        throws RepositoryAdminException;
+
+}
diff --git a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/admin/FileType.java b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/admin/FileType.java
new file mode 100644
index 000000000..5fe4e6afa
--- /dev/null
+++ b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/admin/FileType.java
@@ -0,0 +1,125 @@
+package org.apache.archiva.admin.model.admin;
+/*
+ * 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.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author Olivier Lamy
+ * @since 1.4
+ */
+public class FileType
+    implements Serializable
+{
+    /**
+     * Field id.
+     */
+    private String id;
+
+    /**
+     * Field patterns.
+     */
+    private List patterns;
+
+    public FileType()
+    {
+        // no op
+    }
+
+    public FileType( String id, List patterns )
+    {
+        this.id = id;
+        this.patterns = patterns;
+    }
+
+    public String getId()
+    {
+        return id;
+    }
+
+    public void setId( String id )
+    {
+        this.id = id;
+    }
+
+    public List getPatterns()
+    {
+        if ( patterns == null )
+        {
+            this.patterns = new ArrayList();
+        }
+        return patterns;
+    }
+
+    public void setPatterns( List patterns )
+    {
+        this.patterns = patterns;
+    }
+
+    public void addPattern( String pattern )
+    {
+        getPatterns().add( pattern );
+    }
+
+    public void removePattern( String pattern )
+    {
+        getPatterns().remove( pattern );
+    }
+
+    @Override
+    public boolean equals( Object o )
+    {
+        if ( this == o )
+        {
+            return true;
+        }
+        if ( o == null || getClass() != o.getClass() )
+        {
+            return false;
+        }
+
+        FileType fileType = (FileType) o;
+
+        if ( id != null ? !id.equals( fileType.id ) : fileType.id != null )
+        {
+            return false;
+        }
+
+        return true;
+    }
+
+    @Override
+    public int hashCode()
+    {
+        return id != null ? 37 + id.hashCode() : 0;
+    }
+
+    @Override
+    public String toString()
+    {
+        final StringBuilder sb = new StringBuilder();
+        sb.append( "FileType" );
+        sb.append( "{id='" ).append( id ).append( '\'' );
+        sb.append( ", patterns=" ).append( patterns );
+        sb.append( '}' );
+        return sb.toString();
+    }
+}
diff --git a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/admin/LegacyArtifactPath.java b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/admin/LegacyArtifactPath.java
new file mode 100644
index 000000000..2031d9569
--- /dev/null
+++ b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/admin/LegacyArtifactPath.java
@@ -0,0 +1,141 @@
+package org.apache.archiva.admin.model.admin;
+/*
+ * 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.io.Serializable;
+
+/**
+ * @author Olivier Lamy
+ * @since 1.4
+ */
+public class LegacyArtifactPath
+    implements Serializable
+{
+    /**
+     * The legacy path.
+     */
+    private String path;
+
+    /**
+     * The artifact reference, as " [groupId] :
+     * [artifactId] : [version] : [classifier] : [type] ".
+     */
+    private String artifact;
+
+    public LegacyArtifactPath()
+    {
+        // no op
+    }
+
+    public LegacyArtifactPath( String path, String artifact )
+    {
+        this.path = path;
+        this.artifact = artifact;
+    }
+
+    public String getPath()
+    {
+        return path;
+    }
+
+    public void setPath( String path )
+    {
+        this.path = path;
+    }
+
+    public String getArtifact()
+    {
+        return artifact;
+    }
+
+    public void setArtifact( String artifact )
+    {
+        this.artifact = artifact;
+    }
+
+    public boolean match( String path )
+    {
+        return path.equals( this.path );
+    }
+
+    public String getGroupId()
+    {
+        return artifact.split( ":" )[0];
+    }
+
+    public String getArtifactId()
+    {
+        return artifact.split( ":" )[1];
+    }
+
+    public String getVersion()
+    {
+        return artifact.split( ":" )[2];
+    }
+
+    public String getClassifier()
+    {
+        String classifier = artifact.split( ":" )[3];
+        return classifier.length() > 0 ? classifier : null;
+    }
+
+    public String getType()
+    {
+        return artifact.split( ":" )[4];
+    }
+
+    @Override
+    public boolean equals( Object o )
+    {
+        if ( this == o )
+        {
+            return true;
+        }
+        if ( o == null || getClass() != o.getClass() )
+        {
+            return false;
+        }
+
+        LegacyArtifactPath that = (LegacyArtifactPath) o;
+
+        if ( path != null ? !path.equals( that.path ) : that.path != null )
+        {
+            return false;
+        }
+
+        return true;
+    }
+
+    @Override
+    public int hashCode()
+    {
+        return path != null ? 37 + path.hashCode() : 0;
+    }
+
+    @Override
+    public String toString()
+    {
+        final StringBuilder sb = new StringBuilder();
+        sb.append( "LegacyArtifactPath" );
+        sb.append( "{path='" ).append( path ).append( '\'' );
+        sb.append( ", artifact='" ).append( artifact ).append( '\'' );
+        sb.append( '}' );
+        return sb.toString();
+    }
+}
diff --git a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/admin/OrganisationInformation.java b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/admin/OrganisationInformation.java
new file mode 100644
index 000000000..23941fe0a
--- /dev/null
+++ b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/admin/OrganisationInformation.java
@@ -0,0 +1,95 @@
+package org.apache.archiva.admin.model.admin;
+/*
+ * 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.
+ */
+
+/**
+ * @author Olivier Lamy
+ * @since 1.4
+ */
+public class OrganisationInformation
+{
+    /**
+     * name of the organisation.
+     */
+    private String name;
+
+    /**
+     * name of the organisation.
+     */
+    private String url;
+
+    /**
+     * name of the organisation.
+     */
+    private String logoLocation;
+
+    public OrganisationInformation()
+    {
+        // no op
+    }
+
+    public OrganisationInformation( String name, String url, String logoLocation )
+    {
+        this.name = name;
+        this.url = url;
+        this.logoLocation = logoLocation;
+    }
+
+    public String getName()
+    {
+        return name;
+    }
+
+    public void setName( String name )
+    {
+        this.name = name;
+    }
+
+    public String getUrl()
+    {
+        return url;
+    }
+
+    public void setUrl( String url )
+    {
+        this.url = url;
+    }
+
+    public String getLogoLocation()
+    {
+        return logoLocation;
+    }
+
+    public void setLogoLocation( String logoLocation )
+    {
+        this.logoLocation = logoLocation;
+    }
+
+    @Override
+    public String toString()
+    {
+        final StringBuilder sb = new StringBuilder();
+        sb.append( "OrganisationInformation" );
+        sb.append( "{name='" ).append( name ).append( '\'' );
+        sb.append( ", url='" ).append( url ).append( '\'' );
+        sb.append( ", logoLocation='" ).append( logoLocation ).append( '\'' );
+        sb.append( '}' );
+        return sb.toString();
+    }
+}
diff --git a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/group/RepositoryGroup.java b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/group/RepositoryGroup.java
new file mode 100644
index 000000000..e242bf441
--- /dev/null
+++ b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/group/RepositoryGroup.java
@@ -0,0 +1,153 @@
+package org.apache.archiva.admin.model.group;
+/*
+ * 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.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author Olivier Lamy
+ * @since 1.4
+ */
+public class RepositoryGroup
+    implements Serializable
+{
+    /**
+     * repository group Id
+     */
+    private String id;
+
+    /**
+     * repositories ids
+     */
+    private List repositories;
+
+    public RepositoryGroup()
+    {
+        // no op
+    }
+
+    public RepositoryGroup( String id, List repositories )
+    {
+        this.id = id;
+        this.repositories = repositories;
+    }
+
+    /**
+     * Method addRepository.
+     *
+     * @param string
+     */
+    public void addRepository( String string )
+    {
+        getRepositories().add( string );
+    }
+
+    /**
+     * Get the id of the repository group.
+     *
+     * @return String
+     */
+    public String getId()
+    {
+        return this.id;
+    }
+
+    /**
+     * Method getRepositories.
+     *
+     * @return List
+     */
+    public java.util.List getRepositories()
+    {
+        if ( this.repositories == null )
+        {
+            this.repositories = new ArrayList();
+        }
+
+        return this.repositories;
+    }
+
+    /**
+     * Method removeRepository.
+     *
+     * @param string
+     */
+    public void removeRepository( String string )
+    {
+        getRepositories().remove( string );
+    }
+
+    /**
+     * Set the id of the repository group.
+     *
+     * @param id
+     */
+    public void setId( String id )
+    {
+        this.id = id;
+    }
+
+    /**
+     * Set the list of repository ids under the group.
+     *
+     * @param repositories
+     */
+    public void setRepositories( List repositories )
+    {
+        this.repositories = repositories;
+    }
+
+    public boolean equals( Object other )
+    {
+        if ( this == other )
+        {
+            return true;
+        }
+
+        if ( !( other instanceof RepositoryGroup ) )
+        {
+            return false;
+        }
+
+        RepositoryGroup that = (RepositoryGroup) other;
+        boolean result = true;
+        result = result && ( getId() == null ? that.getId() == null : getId().equals( that.getId() ) );
+        return result;
+    }
+
+    public int hashCode()
+    {
+        int result = 17;
+        result = 37 * result + ( id != null ? id.hashCode() : 0 );
+        return result;
+    }
+
+    @Override
+    public String toString()
+    {
+        final StringBuilder sb = new StringBuilder();
+        sb.append( "RepositoryGroup" );
+        sb.append( "{id='" ).append( id ).append( '\'' );
+        sb.append( ", repositories=" ).append( repositories );
+        sb.append( '}' );
+        return sb.toString();
+    }
+}
diff --git a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/group/RepositoryGroupAdmin.java b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/group/RepositoryGroupAdmin.java
new file mode 100644
index 000000000..18c5c9469
--- /dev/null
+++ b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/group/RepositoryGroupAdmin.java
@@ -0,0 +1,75 @@
+package org.apache.archiva.admin.model.group;
+/*
+ * 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 java.util.List;
+import java.util.Map;
+
+/**
+ * @author Olivier Lamy
+ * @since 1.4
+ */
+public interface RepositoryGroupAdmin
+{
+    List getRepositoriesGroups()
+        throws RepositoryAdminException;
+
+    RepositoryGroup getRepositoryGroup( String repositoryGroupId )
+        throws RepositoryAdminException;
+
+    Boolean addRepositoryGroup( RepositoryGroup repositoryGroup, AuditInformation auditInformation )
+        throws RepositoryAdminException;
+
+    Boolean updateRepositoryGroup( RepositoryGroup repositoryGroup, AuditInformation auditInformation )
+        throws RepositoryAdminException;
+
+    Boolean deleteRepositoryGroup( String repositoryGroupId, AuditInformation auditInformation )
+        throws RepositoryAdminException;
+
+    Boolean addRepositoryToGroup( String repositoryGroupId, String repositoryId, AuditInformation auditInformation )
+        throws RepositoryAdminException;
+
+    Boolean deleteRepositoryFromGroup( String repositoryGroupId, String repositoryId,
+                                       AuditInformation auditInformation )
+        throws RepositoryAdminException;
+
+    /**
+     * @return Map with key repoGroupId and value repoGroup
+     * @throws RepositoryAdminException
+     */
+    Map getRepositoryGroupsAsMap()
+        throws RepositoryAdminException;
+
+    /**
+     * @return Map with key repoGroupId and value List of ManagedRepositories
+     * @throws RepositoryAdminException
+     */
+    Map> getGroupToRepositoryMap()
+        throws RepositoryAdminException;
+
+    /**
+     * @return Map with key managedRepo id and value List of repositoryGroup ids where the repo is
+     * @throws RepositoryAdminException
+     */
+    Map> getRepositoryToGroupMap()
+        throws RepositoryAdminException;
+}
diff --git a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/managed/ManagedRepository.java b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/managed/ManagedRepository.java
new file mode 100644
index 000000000..8d0e48bad
--- /dev/null
+++ b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/managed/ManagedRepository.java
@@ -0,0 +1,232 @@
+package org.apache.archiva.admin.model.managed;
+
+/*
+ * 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.AbstractRepository;
+
+import java.io.Serializable;
+
+/**
+ * @author Olivier Lamy
+ * @since 1.4
+ */
+public class ManagedRepository
+    extends AbstractRepository
+    implements Serializable
+{
+
+    private String location;
+
+    private boolean snapshots = false;
+
+    private boolean releases = true;
+
+    private boolean blockRedeployments = false;
+
+    /**
+     * default model value
+     */
+    private String cronExpression = "0 0 * * * ?";
+
+
+    /**
+     * not need when creating the repo : only available when reading
+     */
+    private ManagedRepository stagingRepository;
+
+    private boolean scanned = false;
+
+    private String indexDirectory;
+
+    /**
+     * default model value
+     */
+    private int daysOlder = 100;
+
+    /**
+     * default model value
+     */
+    private int retentionCount = 2;
+
+    private boolean deleteReleasedSnapshots;
+
+    public ManagedRepository()
+    {
+        // no op
+    }
+
+    public ManagedRepository( String id, String name, String location, String layout, boolean snapshots,
+                              boolean releases, boolean blockRedeployments, String cronExpression, String indexDir,
+                              boolean scanned, int daysOlder, int retentionCount, boolean deleteReleasedSnapshots )
+    {
+        super(id, name, layout);
+
+        this.location = location;
+        this.snapshots = snapshots;
+        this.releases = releases;
+        this.blockRedeployments = blockRedeployments;
+        this.cronExpression = cronExpression;
+        this.indexDirectory = indexDir;
+        this.scanned = scanned;
+        this.daysOlder = daysOlder;
+        this.retentionCount = retentionCount;
+        this.deleteReleasedSnapshots = deleteReleasedSnapshots;
+    }
+
+    public String getLocation()
+    {
+        return this.location;
+    }
+
+
+    public boolean isReleases()
+    {
+        return this.releases;
+    }
+
+    /**
+     * Get null
+     */
+    public boolean isSnapshots()
+    {
+        return this.snapshots;
+    }
+
+
+    public void setReleases( boolean releases )
+    {
+        this.releases = releases;
+    }
+
+    public void setSnapshots( boolean snapshots )
+    {
+        this.snapshots = snapshots;
+    }
+
+    public void setLocation( String location )
+    {
+        this.location = location;
+    }
+
+    public boolean isBlockRedeployments()
+    {
+        return blockRedeployments;
+    }
+
+    public void setBlockRedeployments( boolean blockRedeployments )
+    {
+        this.blockRedeployments = blockRedeployments;
+    }
+
+    public String getCronExpression()
+    {
+        return cronExpression;
+    }
+
+    public void setCronExpression( String cronExpression )
+    {
+        this.cronExpression = cronExpression;
+    }
+
+    public ManagedRepository getStagingRepository()
+    {
+        return stagingRepository;
+    }
+
+
+    public void setStagingRepository( ManagedRepository stagingRepository )
+    {
+        this.stagingRepository = stagingRepository;
+    }
+
+    public boolean isScanned()
+    {
+        return scanned;
+    }
+
+    public void setScanned( boolean scanned )
+    {
+        this.scanned = scanned;
+    }
+
+    public String getIndexDirectory()
+    {
+        return indexDirectory;
+    }
+
+    public void setIndexDirectory( String indexDirectory )
+    {
+        this.indexDirectory = indexDirectory;
+    }
+
+    public int getDaysOlder()
+    {
+        return daysOlder;
+    }
+
+    public void setDaysOlder( int daysOlder )
+    {
+        this.daysOlder = daysOlder;
+    }
+
+    public int getRetentionCount()
+    {
+        return retentionCount;
+    }
+
+    public void setRetentionCount( int retentionCount )
+    {
+        this.retentionCount = retentionCount;
+    }
+
+    public boolean isDeleteReleasedSnapshots()
+    {
+        return deleteReleasedSnapshots;
+    }
+
+    public void setDeleteReleasedSnapshots( boolean deleteReleasedSnapshots )
+    {
+        this.deleteReleasedSnapshots = deleteReleasedSnapshots;
+    }
+
+
+    @Override
+    public String toString()
+    {
+        final StringBuilder sb = new StringBuilder();
+        sb.append( "ManagedRepository" );
+        sb.append( "{location='" ).append( location ).append( '\'' );
+        sb.append( ", snapshots=" ).append( snapshots );
+        sb.append( ", releases=" ).append( releases );
+        sb.append( ", blockRedeployments=" ).append( blockRedeployments );
+        sb.append( ", cronExpression='" ).append( cronExpression ).append( '\'' );
+        sb.append( ", stagingRepository=" ).append( stagingRepository );
+        sb.append( ", scanned=" ).append( scanned );
+        sb.append( ", indexDirectory='" ).append( indexDirectory ).append( '\'' );
+        sb.append( ", daysOlder=" ).append( daysOlder );
+        sb.append( ", retentionCount=" ).append( retentionCount );
+        sb.append( ", deleteReleasedSnapshots=" ).append( deleteReleasedSnapshots );
+        sb.append( '}' );
+        sb.append( super.toString() );
+        return sb.toString();
+    }
+
+
+}
\ No newline at end of file
diff --git a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/managed/ManagedRepositoryAdmin.java b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/managed/ManagedRepositoryAdmin.java
new file mode 100644
index 000000000..cf79f4316
--- /dev/null
+++ b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/managed/ManagedRepositoryAdmin.java
@@ -0,0 +1,56 @@
+package org.apache.archiva.admin.model.managed;
+/*
+ * 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 java.util.List;
+import java.util.Map;
+
+/**
+ * @author Olivier Lamy
+ * @since 1.4
+ */
+public interface ManagedRepositoryAdmin
+{
+    List getManagedRepositories()
+        throws RepositoryAdminException;
+
+    Map getManagedRepositoriesAsMap()
+        throws RepositoryAdminException;
+
+    ManagedRepository getManagedRepository( String repositoryId )
+        throws RepositoryAdminException;
+
+    Boolean deleteManagedRepository( String repositoryId, AuditInformation auditInformation, boolean deleteContent )
+        throws RepositoryAdminException;
+
+    Boolean addManagedRepository( ManagedRepository managedRepository, boolean needStageRepo,
+                                  AuditInformation auditInformation )
+        throws RepositoryAdminException;
+
+
+    Boolean updateManagedRepository( ManagedRepository managedRepository, boolean needStageRepo,
+                                     AuditInformation auditInformation, boolean resetStats )
+        throws RepositoryAdminException;
+
+
+}
diff --git a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/networkproxy/NetworkProxy.java b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/networkproxy/NetworkProxy.java
new file mode 100644
index 000000000..b60138fbc
--- /dev/null
+++ b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/networkproxy/NetworkProxy.java
@@ -0,0 +1,177 @@
+package org.apache.archiva.admin.model.networkproxy;
+/*
+ * 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.io.Serializable;
+
+/**
+ * @author Olivier Lamy
+ * @since 1.4
+ */
+public class NetworkProxy
+    implements Serializable
+{
+    private String id;
+
+    /**
+     * The network protocol to use with this proxy: "http", "socks-4"
+     * .
+     */
+    private String protocol = "http";
+
+    /**
+     * The proxy host.
+     */
+    private String host;
+
+    /**
+     * The proxy port.
+     */
+    private int port = 8080;
+
+    /**
+     * The proxy user.
+     */
+    private String username;
+
+    /**
+     * The proxy password.
+     */
+    private String password;
+
+    public NetworkProxy()
+    {
+        // no op
+    }
+
+    public NetworkProxy( String id, String protocol, String host, int port, String username, String password )
+    {
+        this.id = id;
+        this.protocol = protocol;
+        this.host = host;
+        this.port = port;
+        this.username = username;
+        this.password = password;
+    }
+
+    public String getId()
+    {
+        return id;
+    }
+
+    public void setId( String id )
+    {
+        this.id = id;
+    }
+
+    public String getProtocol()
+    {
+        return protocol;
+    }
+
+    public void setProtocol( String protocol )
+    {
+        this.protocol = protocol;
+    }
+
+    public String getHost()
+    {
+        return host;
+    }
+
+    public void setHost( String host )
+    {
+        this.host = host;
+    }
+
+    public int getPort()
+    {
+        return port;
+    }
+
+    public void setPort( int port )
+    {
+        this.port = port;
+    }
+
+    public String getUsername()
+    {
+        return username;
+    }
+
+    public void setUsername( String username )
+    {
+        this.username = username;
+    }
+
+    public String getPassword()
+    {
+        return password;
+    }
+
+    public void setPassword( String password )
+    {
+        this.password = password;
+    }
+
+    @Override
+    public boolean equals( Object o )
+    {
+        if ( this == o )
+        {
+            return true;
+        }
+        if ( o == null || getClass() != o.getClass() )
+        {
+            return false;
+        }
+
+        NetworkProxy that = (NetworkProxy) o;
+
+        if ( id != null ? !id.equals( that.id ) : that.id != null )
+        {
+            return false;
+        }
+
+        return true;
+    }
+
+    @Override
+    public int hashCode()
+    {
+        int result = 17;
+        result = 37 * result + ( id != null ? id.hashCode() : 0 );
+        return result;
+    }
+
+    @Override
+    public String toString()
+    {
+        final StringBuilder sb = new StringBuilder();
+        sb.append( "NetworkProxy" );
+        sb.append( "{id='" ).append( id ).append( '\'' );
+        sb.append( ", protocol='" ).append( protocol ).append( '\'' );
+        sb.append( ", host='" ).append( host ).append( '\'' );
+        sb.append( ", port=" ).append( port );
+        sb.append( ", username='" ).append( username ).append( '\'' );
+        sb.append( ", password='" ).append( password ).append( '\'' );
+        sb.append( '}' );
+        return sb.toString();
+    }
+}
diff --git a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/networkproxy/NetworkProxyAdmin.java b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/networkproxy/NetworkProxyAdmin.java
new file mode 100644
index 000000000..52e2bd2af
--- /dev/null
+++ b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/networkproxy/NetworkProxyAdmin.java
@@ -0,0 +1,46 @@
+package org.apache.archiva.admin.model.networkproxy;
+/*
+ * 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 java.util.List;
+
+/**
+ * @author Olivier Lamy
+ * @since 1.4
+ */
+public interface NetworkProxyAdmin
+{
+    List getNetworkProxies()
+        throws RepositoryAdminException;
+
+    NetworkProxy getNetworkProxy( String networkProxyId )
+        throws RepositoryAdminException;
+
+    void addNetworkProxy( NetworkProxy networkProxy, AuditInformation auditInformation )
+        throws RepositoryAdminException;
+
+    void updateNetworkProxy( NetworkProxy networkProxy, AuditInformation auditInformation )
+        throws RepositoryAdminException;
+
+    void deleteNetworkProxy( String networkProxyId, AuditInformation auditInformation )
+        throws RepositoryAdminException;
+}
diff --git a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/proxyconnector/ProxyConnector.java b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/proxyconnector/ProxyConnector.java
new file mode 100644
index 000000000..57838eab7
--- /dev/null
+++ b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/proxyconnector/ProxyConnector.java
@@ -0,0 +1,116 @@
+package org.apache.archiva.admin.model.proxyconnector;
+/*
+ * 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.AbstractRepositoryConnector;
+
+import java.io.Serializable;
+
+/**
+ * @author Olivier Lamy
+ * @since 1.4
+ */
+public class ProxyConnector
+    extends AbstractRepositoryConnector
+    implements Serializable
+{
+    /**
+     * The order id for UNORDERED
+     */
+    public static final int UNORDERED = 0;
+
+    /**
+     * The policy key {@link #getPolicies()} for error handling.
+     * See {@link org.apache.maven.archiva.policies.DownloadErrorPolicy}
+     * for details on potential values to this policy key.
+     */
+    public static final String POLICY_PROPAGATE_ERRORS = "propagate-errors";
+
+    /**
+     * The policy key {@link #getPolicies()} for error handling when an artifact is present.
+     * See {@link org.apache.maven.archiva.policies.DownloadErrorPolicy}
+     * for details on potential values to this policy key.
+     */
+    public static final String POLICY_PROPAGATE_ERRORS_ON_UPDATE = "propagate-errors-on-update";
+
+    /**
+     * The policy key {@link #getPolicies()} for snapshot handling.
+     * See {@link org.apache.maven.archiva.policies.SnapshotsPolicy}
+     * for details on potential values to this policy key.
+     */
+    public static final String POLICY_SNAPSHOTS = "snapshots";
+
+    /**
+     * The policy key {@link #getPolicies()} for releases handling.
+     * See {@link org.apache.maven.archiva.policies.ReleasesPolicy}
+     * for details on potential values to this policy key.
+     */
+    public static final String POLICY_RELEASES = "releases";
+
+    /**
+     * The policy key {@link #getPolicies()} for checksum handling.
+     * See {@link org.apache.maven.archiva.policies.ChecksumPolicy}
+     * for details on potential values to this policy key.
+     */
+    public static final String POLICY_CHECKSUM = "checksum";
+
+    /**
+     * The policy key {@link #getPolicies()} for cache-failures handling.
+     * See {@link org.apache.maven.archiva.policies.CachedFailuresPolicy}
+     * for details on potential values to this policy key.
+     */
+    public static final String POLICY_CACHE_FAILURES = "cache-failures";
+
+    /**
+     *
+     * The order of the proxy connectors. (0 means no order specified)
+     *           .
+     */
+    private int order = 0;
+
+    /**
+     * Get the order of the proxy connectors. (0 means no order specified)
+     * @return int
+     */
+    public int getOrder()
+    {
+        return this.order;
+    }
+
+
+    /**
+     * Set the order of the proxy connectors. (0 means no order specified)
+     * @param order
+     */
+    public void setOrder( int order )
+    {
+        this.order = order;
+    }
+
+    @Override
+    public String toString()
+    {
+        final StringBuilder sb = new StringBuilder();
+        sb.append( "ProxyConnector" );
+        sb.append( "{order=" ).append( order );
+        sb.append( '}' );
+        sb.append( super.toString() );
+        return sb.toString();
+    }
+}
diff --git a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/proxyconnector/ProxyConnectorAdmin.java b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/proxyconnector/ProxyConnectorAdmin.java
new file mode 100644
index 000000000..1c31b996d
--- /dev/null
+++ b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/proxyconnector/ProxyConnectorAdmin.java
@@ -0,0 +1,61 @@
+package org.apache.archiva.admin.model.proxyconnector;
+/*
+ * 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 java.util.List;
+import java.util.Map;
+
+/**
+ * No update method for changing source and target here as id is : sourceRepoId and targetRepoId, use delete then add.
+ *
+ * @author Olivier Lamy
+ * @since 1.4
+ */
+public interface ProxyConnectorAdmin
+{
+    List getProxyConnectors()
+        throws RepositoryAdminException;
+
+    ProxyConnector getProxyConnector( String sourceRepoId, String targetRepoId )
+        throws RepositoryAdminException;
+
+    Boolean addProxyConnector( ProxyConnector proxyConnector, AuditInformation auditInformation )
+        throws RepositoryAdminException;
+
+    Boolean deleteProxyConnector( ProxyConnector proxyConnector, AuditInformation auditInformation )
+        throws RepositoryAdminException;
+
+    /**
+     * only for enabled/disable or changing bean values except target/source
+     * @param proxyConnector
+     * @param auditInformation
+     * @return
+     * @throws RepositoryAdminException
+     */
+    Boolean updateProxyConnector( ProxyConnector proxyConnector, AuditInformation auditInformation )
+            throws RepositoryAdminException;
+
+
+    Map> getProxyConnectorAsMap()
+        throws RepositoryAdminException;
+
+}
diff --git a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/proxyconnector/ProxyConnectorOrderComparator.java b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/proxyconnector/ProxyConnectorOrderComparator.java
new file mode 100644
index 000000000..34aee666c
--- /dev/null
+++ b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/proxyconnector/ProxyConnectorOrderComparator.java
@@ -0,0 +1,68 @@
+package org.apache.archiva.admin.model.proxyconnector;
+/*
+ * 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.Comparator;
+
+/**
+ * @author Olivier Lamy
+ * @since 1.4
+ */
+public class ProxyConnectorOrderComparator
+    implements Comparator
+{
+    private static ProxyConnectorOrderComparator INSTANCE = new ProxyConnectorOrderComparator();
+
+    public int compare( ProxyConnector o1, ProxyConnector o2 )
+    {
+        if ( o1 == null && o2 == null )
+        {
+            return 0;
+        }
+
+        // Ensure null goes to end of list.
+        if ( o1 == null && o2 != null )
+        {
+            return 1;
+        }
+
+        if ( o1 != null && o2 == null )
+        {
+            return -1;
+        }
+
+        // Ensure 0 (unordered) goes to end of list.
+        if ( o1.getOrder() == 0 && o2.getOrder() != 0 )
+        {
+            return 1;
+        }
+
+        if ( o1.getOrder() != 0 && o2.getOrder() == 0 )
+        {
+            return -1;
+        }
+
+        return o1.getOrder() - o2.getOrder();
+    }
+
+    public static ProxyConnectorOrderComparator getInstance()
+    {
+        return INSTANCE;
+    }
+}
diff --git a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/proxyconnector/ProxyConnectorSelectionPredicate.java b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/proxyconnector/ProxyConnectorSelectionPredicate.java
new file mode 100644
index 000000000..953c9f194
--- /dev/null
+++ b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/proxyconnector/ProxyConnectorSelectionPredicate.java
@@ -0,0 +1,54 @@
+package org.apache.archiva.admin.model.proxyconnector;
+/*
+ * 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.collections.Predicate;
+import org.apache.commons.lang.StringUtils;
+
+/**
+ * @author Olivier Lamy
+ * @since 1.4
+ */
+public class ProxyConnectorSelectionPredicate
+    implements Predicate
+{
+    private String sourceId;
+
+    private String targetId;
+
+    public ProxyConnectorSelectionPredicate( String sourceId, String targetId )
+    {
+        this.sourceId = sourceId;
+        this.targetId = targetId;
+    }
+
+    public boolean evaluate( Object object )
+    {
+        boolean satisfies = false;
+
+        if ( object instanceof ProxyConnector )
+        {
+            ProxyConnector connector = (ProxyConnector) object;
+            return ( StringUtils.equals( sourceId, connector.getSourceRepoId() ) && StringUtils.equals( targetId,
+                                                                                                        connector.getTargetRepoId() ) );
+        }
+
+        return satisfies;
+    }
+}
diff --git a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/remote/RemoteRepository.java b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/remote/RemoteRepository.java
new file mode 100644
index 000000000..ced425b63
--- /dev/null
+++ b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/remote/RemoteRepository.java
@@ -0,0 +1,119 @@
+package org.apache.archiva.admin.model.remote;
+
+/*
+ * 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.AbstractRepository;
+
+import java.io.Serializable;
+
+/**
+ * @author Olivier Lamy
+ * @since 1.4
+ */
+public class RemoteRepository
+    extends AbstractRepository
+    implements Serializable
+{
+
+    private String url;
+
+    private String userName;
+
+    private String password;
+
+    private int timeout = 60;
+
+    public RemoteRepository()
+    {
+        // no op
+    }
+
+    public RemoteRepository( String id, String name, String url, String layout )
+    {
+        super( id, name, layout );
+        this.url = url;
+    }
+
+    public RemoteRepository( String id, String name, String url, String layout, String userName, String password,
+                             int timeOut )
+    {
+        super( id, name, layout );
+        this.url = url;
+        this.userName = userName;
+        this.password = password;
+        this.timeout = timeOut;
+    }
+
+    public String getUrl()
+    {
+        return url;
+    }
+
+    public void setUrl( String url )
+    {
+        this.url = url;
+    }
+
+    public String getUserName()
+    {
+        return userName;
+    }
+
+    public void setUserName( String userName )
+    {
+        this.userName = userName;
+    }
+
+    public String getPassword()
+    {
+        return password;
+    }
+
+    public void setPassword( String password )
+    {
+        this.password = password;
+    }
+
+    public int getTimeout()
+    {
+        return timeout;
+    }
+
+    public void setTimeout( int timeout )
+    {
+        this.timeout = timeout;
+    }
+
+    @Override
+    public String toString()
+    {
+        final StringBuilder sb = new StringBuilder();
+        sb.append( "RemoteRepository" );
+        sb.append( "{url='" ).append( url ).append( '\'' );
+        sb.append( ", userName='" ).append( userName ).append( '\'' );
+        sb.append( ", password='" ).append( password ).append( '\'' );
+        sb.append( ", timeout=" ).append( timeout );
+        sb.append( '}' );
+        sb.append( super.toString() );
+        return sb.toString();
+    }
+
+
+}
\ No newline at end of file
diff --git a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/remote/RemoteRepositoryAdmin.java b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/remote/RemoteRepositoryAdmin.java
new file mode 100644
index 000000000..0753f9019
--- /dev/null
+++ b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/remote/RemoteRepositoryAdmin.java
@@ -0,0 +1,51 @@
+package org.apache.archiva.admin.model.remote;
+/*
+ * 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 java.util.List;
+import java.util.Map;
+
+/**
+ * @author Olivier Lamy
+ * @since 1.4
+ */
+public interface RemoteRepositoryAdmin
+{
+    List getRemoteRepositories()
+        throws RepositoryAdminException;
+
+    RemoteRepository getRemoteRepository( String repositoryId )
+        throws RepositoryAdminException;
+
+    Boolean deleteRemoteRepository( String repositoryId, AuditInformation auditInformation )
+        throws RepositoryAdminException;
+
+    Boolean addRemoteRepository( RemoteRepository remoteRepository, AuditInformation auditInformation )
+        throws RepositoryAdminException;
+
+    Boolean updateRemoteRepository( RemoteRepository remoteRepository, AuditInformation auditInformation )
+        throws RepositoryAdminException;
+
+    Map getRemoteRepositoriesAsMap()
+        throws RepositoryAdminException;
+}
diff --git a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/pom.xml b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/pom.xml
new file mode 100644
index 000000000..a2f4721da
--- /dev/null
+++ b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/pom.xml
@@ -0,0 +1,200 @@
+
+
+
+
+  4.0.0
+  
+    org.apache.archiva
+    archiva-repository-admin
+    1.4-SNAPSHOT
+  
+  archiva-repository-admin-default
+  Archiva Base :: Repository Admin Default
+  
+    
+      org.apache.archiva
+      archiva-configuration
+    
+    
+      org.apache.archiva
+      archiva-security-common
+    
+     
+      org.apache.archiva
+      archiva-scheduler-repository
+    
+    
+      org.apache.archiva
+      archiva-repository-admin-api
+    
+    
+      org.apache.archiva
+      audit
+    
+    
+      javax.inject
+      javax.inject
+    
+    
+      net.sf.beanlib
+      beanlib
+        
+          
+            cglib
+            cglib
+          
+          
+            aopalliance
+            aopalliance
+          
+        
+    
+    
+      org.springframework
+      spring-context-support
+      ${spring.version}
+      
+        
+          commons-logging
+          commons-logging
+        
+      
+    
+    
+      org.springframework
+      spring-context
+      ${spring.version}
+      
+        
+          commons-logging
+          commons-logging
+        
+      
+    
+    
+      org.slf4j
+      slf4j-api
+    
+    
+      commons-validator
+      commons-validator
+    
+    
+      oro
+      oro
+    
+    
+      org.codehaus.redback.components
+      spring-quartz
+    
+    
+      org.codehaus.redback
+      redback-rbac-role-manager
+      
+        
+          commons-logging
+          commons-logging
+        
+      
+    
+    
+      org.codehaus.redback
+      redback-authentication-api
+        
+          
+            commons-logging
+            commons-logging
+          
+        
+    
+    
+      junit
+      junit
+      test
+    
+    
+      org.slf4j
+      slf4j-log4j12
+      test
+    
+
+    
+      org.codehaus.redback
+      redback-users-memory
+      test
+      ${redback.version}
+    
+
+    
+      org.codehaus.redback
+      redback-keys-memory
+      test
+      ${redback.version}
+    
+
+    
+      org.codehaus.redback
+      redback-rbac-cached
+      ${redback.version}
+      test
+      
+        
+          commons-logging
+          commons-logging
+        
+      
+    
+
+    
+      org.apache.derby
+      derby
+      test
+    
+
+    
+      org.slf4j
+      jcl-over-slf4j
+      test
+    
+
+    
+      org.apache.archiva
+      metadata-store-file
+      test
+    
+
+  
+
+  
+    
+      
+        org.apache.maven.plugins
+        maven-surefire-plugin
+        
+          
+            ${project.build.outputDirectory}
+            ${project.build.outputDirectory}
+          
+        
+
+      
+    
+  
+
diff --git a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/AbstractRepositoryAdmin.java b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/AbstractRepositoryAdmin.java
new file mode 100644
index 000000000..298705f83
--- /dev/null
+++ b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/AbstractRepositoryAdmin.java
@@ -0,0 +1,132 @@
+package org.apache.archiva.admin.repository;
+/*
+ * 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.audit.AuditEvent;
+import org.apache.archiva.audit.AuditListener;
+import org.apache.maven.archiva.configuration.ArchivaConfiguration;
+import org.apache.maven.archiva.configuration.Configuration;
+import org.apache.maven.archiva.configuration.IndeterminateConfigurationException;
+import org.codehaus.plexus.redback.users.User;
+import org.codehaus.plexus.registry.Registry;
+import org.codehaus.plexus.registry.RegistryException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.inject.Inject;
+import javax.inject.Named;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author Olivier Lamy
+ * @since 1.4
+ */
+public abstract class AbstractRepositoryAdmin
+{
+    protected Logger log = LoggerFactory.getLogger( getClass() );
+
+    @Inject
+    private List auditListeners = new ArrayList();
+
+
+    @Inject
+    private RepositoryCommonValidator repositoryCommonValidator;
+
+    @Inject
+    private ArchivaConfiguration archivaConfiguration;
+
+    @Inject
+    @Named( value = "commons-configuration" )
+    private Registry registry;
+
+    protected void triggerAuditEvent( String repositoryId, String resource, String action,
+                                      AuditInformation auditInformation )
+    {
+        User user = auditInformation == null ? null : auditInformation.getUser();
+        AuditEvent event =
+            new AuditEvent( repositoryId, user == null ? "null" : (String) user.getPrincipal(), resource, action );
+        event.setRemoteIP( auditInformation == null ? "null" : auditInformation.getRemoteAddr() );
+
+        for ( AuditListener listener : getAuditListeners() )
+        {
+            listener.auditEvent( event );
+        }
+
+    }
+
+    protected void saveConfiguration( Configuration config )
+        throws RepositoryAdminException
+    {
+        try
+        {
+            getArchivaConfiguration().save( config );
+        }
+        catch ( RegistryException e )
+        {
+            throw new RepositoryAdminException( "Error occurred in the registry.", e );
+        }
+        catch ( IndeterminateConfigurationException e )
+        {
+            throw new RepositoryAdminException( "Error occurred while saving the configuration.", e );
+        }
+    }
+
+    public List getAuditListeners()
+    {
+        return auditListeners;
+    }
+
+    public void setAuditListeners( List auditListeners )
+    {
+        this.auditListeners = auditListeners;
+    }
+
+    public void setArchivaConfiguration( ArchivaConfiguration archivaConfiguration )
+    {
+        this.archivaConfiguration = archivaConfiguration;
+    }
+
+    public ArchivaConfiguration getArchivaConfiguration()
+    {
+        return archivaConfiguration;
+    }
+
+    public RepositoryCommonValidator getRepositoryCommonValidator()
+    {
+        return repositoryCommonValidator;
+    }
+
+    public void setRepositoryCommonValidator( RepositoryCommonValidator repositoryCommonValidator )
+    {
+        this.repositoryCommonValidator = repositoryCommonValidator;
+    }
+
+    public Registry getRegistry()
+    {
+        return registry;
+    }
+
+    public void setRegistry( Registry registry )
+    {
+        this.registry = registry;
+    }
+}
diff --git a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/RepositoryCommonValidator.java b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/RepositoryCommonValidator.java
new file mode 100644
index 000000000..5ac48f34b
--- /dev/null
+++ b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/RepositoryCommonValidator.java
@@ -0,0 +1,150 @@
+package org.apache.archiva.admin.repository;
+/*
+ * 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.AbstractRepository;
+import org.apache.archiva.admin.model.RepositoryAdminException;
+import org.apache.commons.lang.StringUtils;
+import org.apache.commons.validator.GenericValidator;
+import org.apache.maven.archiva.configuration.ArchivaConfiguration;
+import org.apache.maven.archiva.configuration.Configuration;
+import org.codehaus.plexus.registry.Registry;
+import org.springframework.stereotype.Service;
+
+import javax.inject.Inject;
+import javax.inject.Named;
+
+/**
+ * apply basic repository validation : id and name.
+ * Check if already exists.
+ *
+ * @author Olivier Lamy
+ * @since 1.4
+ */
+@Service
+public class RepositoryCommonValidator
+{
+
+    public static final String REPOSITORY_ID_VALID_EXPRESSION = "^[a-zA-Z0-9._-]+$";
+
+    public static final String REPOSITORY_NAME_VALID_EXPRESSION = "^([a-zA-Z0-9.)/_(-]|\\s)+$";
+
+
+    @Inject
+    private ArchivaConfiguration archivaConfiguration;
+
+    @Inject
+    @Named( value = "commons-configuration" )
+    private Registry registry;
+
+    /**
+     * @param abstractRepository
+     * @param update             in update mode if yes already exists won't be check
+     * @throws RepositoryAdminException
+     */
+    public void basicValidation( AbstractRepository abstractRepository, boolean update )
+        throws RepositoryAdminException
+    {
+        Configuration config = archivaConfiguration.getConfiguration();
+
+        String repoId = abstractRepository.getId();
+
+        if ( !update )
+        {
+
+            if ( config.getManagedRepositoriesAsMap().containsKey( repoId ) )
+            {
+                throw new RepositoryAdminException( "Unable to add new repository with id [" + repoId
+                                                        + "], that id already exists as a managed repository." );
+            }
+            else if ( config.getRepositoryGroupsAsMap().containsKey( repoId ) )
+            {
+                throw new RepositoryAdminException( "Unable to add new repository with id [" + repoId
+                                                        + "], that id already exists as a repository group." );
+            }
+            else if ( config.getRemoteRepositoriesAsMap().containsKey( repoId ) )
+            {
+                throw new RepositoryAdminException( "Unable to add new repository with id [" + repoId
+                                                        + "], that id already exists as a remote repository." );
+            }
+        }
+
+        if ( StringUtils.isBlank( repoId ) )
+        {
+            throw new RepositoryAdminException( "Repository ID cannot be empty." );
+        }
+
+        if ( !GenericValidator.matchRegexp( repoId, REPOSITORY_ID_VALID_EXPRESSION ) )
+        {
+            throw new RepositoryAdminException(
+                "Invalid repository ID. Identifier must only contain alphanumeric characters, underscores(_), dots(.), and dashes(-)." );
+        }
+
+        String name = abstractRepository.getName();
+
+        if ( StringUtils.isBlank( name ) )
+        {
+            throw new RepositoryAdminException( "repository name cannot be empty" );
+        }
+
+        if ( !GenericValidator.matchRegexp( name, REPOSITORY_NAME_VALID_EXPRESSION ) )
+        {
+            throw new RepositoryAdminException(
+                "Invalid repository name. Repository Name must only contain alphanumeric characters, white-spaces(' '), "
+                    + "forward-slashes(/), open-parenthesis('('), close-parenthesis(')'),  underscores(_), dots(.), and dashes(-)." );
+        }
+
+
+    }
+
+    /**
+     * replace some interpolations ${appserver.base} with correct values
+     *
+     * @param directory
+     * @return
+     */
+    public String removeExpressions( String directory )
+    {
+        String value = StringUtils.replace( directory, "${appserver.base}",
+                                            getRegistry().getString( "appserver.base", "${appserver.base}" ) );
+        value = StringUtils.replace( value, "${appserver.home}",
+                                     getRegistry().getString( "appserver.home", "${appserver.home}" ) );
+        return value;
+    }
+
+    public ArchivaConfiguration getArchivaConfiguration()
+    {
+        return archivaConfiguration;
+    }
+
+    public void setArchivaConfiguration( ArchivaConfiguration archivaConfiguration )
+    {
+        this.archivaConfiguration = archivaConfiguration;
+    }
+
+    public Registry getRegistry()
+    {
+        return registry;
+    }
+
+    public void setRegistry( Registry registry )
+    {
+        this.registry = registry;
+    }
+}
diff --git a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/admin/DefaultArchivaAdministration.java b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/admin/DefaultArchivaAdministration.java
new file mode 100644
index 000000000..e89952352
--- /dev/null
+++ b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/admin/DefaultArchivaAdministration.java
@@ -0,0 +1,305 @@
+package org.apache.archiva.admin.repository.admin;
+/*
+ * 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 net.sf.beanlib.provider.replicator.BeanReplicator;
+import org.apache.archiva.admin.model.AuditInformation;
+import org.apache.archiva.admin.model.RepositoryAdminException;
+import org.apache.archiva.admin.model.admin.ArchivaAdministration;
+import org.apache.archiva.admin.model.admin.FileType;
+import org.apache.archiva.admin.model.admin.LegacyArtifactPath;
+import org.apache.archiva.admin.model.admin.OrganisationInformation;
+import org.apache.archiva.admin.repository.AbstractRepositoryAdmin;
+import org.apache.archiva.audit.AuditEvent;
+import org.apache.commons.lang.StringUtils;
+import org.apache.maven.archiva.configuration.Configuration;
+import org.springframework.stereotype.Service;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * @author Olivier Lamy
+ */
+@Service( "archivaAdministration#default" )
+public class DefaultArchivaAdministration
+    extends AbstractRepositoryAdmin
+    implements ArchivaAdministration
+{
+    public List getLegacyArtifactPaths()
+        throws RepositoryAdminException
+    {
+        List legacyArtifactPaths = new ArrayList();
+        for ( org.apache.maven.archiva.configuration.LegacyArtifactPath legacyArtifactPath : getArchivaConfiguration().getConfiguration().getLegacyArtifactPaths() )
+        {
+            legacyArtifactPaths.add(
+                new BeanReplicator().replicateBean( legacyArtifactPath, LegacyArtifactPath.class ) );
+        }
+        return legacyArtifactPaths;
+
+    }
+
+    public void addLegacyArtifactPath( LegacyArtifactPath legacyArtifactPath, AuditInformation auditInformation )
+        throws RepositoryAdminException
+    {
+        Configuration configuration = getArchivaConfiguration().getConfiguration();
+
+        configuration.addLegacyArtifactPath( new BeanReplicator().replicateBean( legacyArtifactPath,
+                                                                                 org.apache.maven.archiva.configuration.LegacyArtifactPath.class ) );
+
+        saveConfiguration( configuration );
+        triggerAuditEvent( "", "", AuditEvent.ADD_LEGACY_PATH, auditInformation );
+    }
+
+    public void deleteLegacyArtifactPath( String path, AuditInformation auditInformation )
+        throws RepositoryAdminException
+    {
+        Configuration configuration = getArchivaConfiguration().getConfiguration();
+        org.apache.maven.archiva.configuration.LegacyArtifactPath legacyArtifactPath =
+            new org.apache.maven.archiva.configuration.LegacyArtifactPath();
+
+        legacyArtifactPath.setPath( path );
+        configuration.removeLegacyArtifactPath( legacyArtifactPath );
+
+        saveConfiguration( configuration );
+        triggerAuditEvent( "", "", AuditEvent.REMOVE_LEGACY_PATH, auditInformation );
+    }
+
+
+    public void addFileTypePattern( String fileTypeId, String pattern, AuditInformation auditInformation )
+        throws RepositoryAdminException
+    {
+        Configuration configuration = getArchivaConfiguration().getConfiguration();
+
+        org.apache.maven.archiva.configuration.FileType fileType = getFileTypeById( fileTypeId, configuration );
+        if ( fileType == null )
+        {
+            return;
+        }
+        fileType.addPattern( pattern );
+
+        saveConfiguration( configuration );
+        triggerAuditEvent( "", "", AuditEvent.ADD_PATTERN, auditInformation );
+    }
+
+    public void removeFileTypePattern( String fileTypeId, String pattern, AuditInformation auditInformation )
+        throws RepositoryAdminException
+    {
+        Configuration configuration = getArchivaConfiguration().getConfiguration();
+
+        org.apache.maven.archiva.configuration.FileType fileType = getFileTypeById( fileTypeId, configuration );
+        if ( fileType == null )
+        {
+            return;
+        }
+        fileType.removePattern( pattern );
+
+        saveConfiguration( configuration );
+        triggerAuditEvent( "", "", AuditEvent.REMOVE_PATTERN, auditInformation );
+    }
+
+    public FileType getFileType( String fileTypeId )
+        throws RepositoryAdminException
+    {
+        org.apache.maven.archiva.configuration.FileType fileType =
+            getFileTypeById( fileTypeId, getArchivaConfiguration().getConfiguration() );
+        if ( fileType == null )
+        {
+            return null;
+        }
+        return new BeanReplicator().replicateBean( fileType, FileType.class );
+    }
+
+    public void addFileType( FileType fileType, AuditInformation auditInformation )
+        throws RepositoryAdminException
+    {
+        Configuration configuration = getArchivaConfiguration().getConfiguration();
+        if ( getFileTypeById( fileType.getId(), configuration ) != null )
+        {
+            throw new RepositoryAdminException(
+                "impossible to FileType with id " + fileType.getId() + " already exists" );
+        }
+
+        configuration.getRepositoryScanning().addFileType(
+            new BeanReplicator().replicateBean( fileType, org.apache.maven.archiva.configuration.FileType.class ) );
+        saveConfiguration( configuration );
+    }
+
+    public void removeFileType( String fileTypeId, AuditInformation auditInformation )
+        throws RepositoryAdminException
+    {
+        Configuration configuration = getArchivaConfiguration().getConfiguration();
+        org.apache.maven.archiva.configuration.FileType fileType =
+            new org.apache.maven.archiva.configuration.FileType();
+        fileType.setId( fileTypeId );
+        configuration.getRepositoryScanning().removeFileType( fileType );
+        saveConfiguration( configuration );
+    }
+
+    public void addKnownContentConsumer( String knownContentConsumer, AuditInformation auditInformation )
+        throws RepositoryAdminException
+    {
+        Configuration configuration = getArchivaConfiguration().getConfiguration();
+        if ( configuration.getRepositoryScanning().getKnownContentConsumers().contains( knownContentConsumer ) )
+        {
+            log.warn( "skip adding knownContentConsumer {} as already here", knownContentConsumer );
+            return;
+        }
+        configuration.getRepositoryScanning().addKnownContentConsumer( knownContentConsumer );
+        saveConfiguration( configuration );
+        triggerAuditEvent( "", "", AuditEvent.ENABLE_REPO_CONSUMER, auditInformation );
+    }
+
+    public void removeKnownContentConsumer( String knownContentConsumer, AuditInformation auditInformation )
+        throws RepositoryAdminException
+    {
+        Configuration configuration = getArchivaConfiguration().getConfiguration();
+        configuration.getRepositoryScanning().removeKnownContentConsumer( knownContentConsumer );
+        saveConfiguration( configuration );
+        triggerAuditEvent( "", "", AuditEvent.DISABLE_REPO_CONSUMER, auditInformation );
+    }
+
+    public void addInvalidContentConsumer( String invalidContentConsumer, AuditInformation auditInformation )
+        throws RepositoryAdminException
+    {
+        Configuration configuration = getArchivaConfiguration().getConfiguration();
+        if ( configuration.getRepositoryScanning().getInvalidContentConsumers().contains( invalidContentConsumer ) )
+        {
+            log.warn( "skip adding invalidContentConsumer {} as already here", invalidContentConsumer );
+            return;
+        }
+        configuration.getRepositoryScanning().addInvalidContentConsumer( invalidContentConsumer );
+        saveConfiguration( configuration );
+        triggerAuditEvent( "", "", AuditEvent.ENABLE_REPO_CONSUMER, auditInformation );
+    }
+
+    public void removeInvalidContentConsumer( String invalidContentConsumer, AuditInformation auditInformation )
+        throws RepositoryAdminException
+    {
+        Configuration configuration = getArchivaConfiguration().getConfiguration();
+        configuration.getRepositoryScanning().removeInvalidContentConsumer( invalidContentConsumer );
+        saveConfiguration( configuration );
+        triggerAuditEvent( "", "", AuditEvent.DISABLE_REPO_CONSUMER, auditInformation );
+    }
+
+    public void setKnownContentConsumers( List knownContentConsumers, AuditInformation auditInformation )
+        throws RepositoryAdminException
+    {
+        if ( knownContentConsumers == null )
+        {
+            return;
+        }
+        for ( String knowContentConsumer : knownContentConsumers )
+        {
+            addKnownContentConsumer( knowContentConsumer, auditInformation );
+        }
+    }
+
+    public void setInvalidContentConsumers( List invalidContentConsumers, AuditInformation auditInformation )
+        throws RepositoryAdminException
+    {
+        if ( invalidContentConsumers == null )
+        {
+            return;
+        }
+        for ( String invalidContentConsumer : invalidContentConsumers )
+        {
+            addKnownContentConsumer( invalidContentConsumer, auditInformation );
+        }
+    }
+
+    public List getFileTypes()
+        throws RepositoryAdminException
+    {
+        List configFileTypes =
+            getArchivaConfiguration().getConfiguration().getRepositoryScanning().getFileTypes();
+        if ( configFileTypes == null || configFileTypes.isEmpty() )
+        {
+            return Collections.emptyList();
+        }
+        List fileTypes = new ArrayList();
+        for ( org.apache.maven.archiva.configuration.FileType fileType : configFileTypes )
+        {
+            fileTypes.add( new BeanReplicator().replicateBean( fileType, FileType.class ) );
+        }
+        return fileTypes;
+    }
+
+    public List getKnownContentConsumers()
+        throws RepositoryAdminException
+    {
+        return new ArrayList(
+            getArchivaConfiguration().getConfiguration().getRepositoryScanning().getKnownContentConsumers() );
+    }
+
+    public List getInvalidContentConsumers()
+        throws RepositoryAdminException
+    {
+        return new ArrayList(
+            getArchivaConfiguration().getConfiguration().getRepositoryScanning().getInvalidContentConsumers() );
+    }
+
+    public OrganisationInformation getOrganisationInformation()
+        throws RepositoryAdminException
+    {
+        org.apache.maven.archiva.configuration.OrganisationInformation organisationInformation =
+            getArchivaConfiguration().getConfiguration().getOrganisationInfo();
+        if ( organisationInformation == null )
+        {
+            return null;
+        }
+        return new BeanReplicator().replicateBean( organisationInformation, OrganisationInformation.class );
+    }
+
+    public void setOrganisationInformation( OrganisationInformation organisationInformation )
+        throws RepositoryAdminException
+    {
+        Configuration configuration = getArchivaConfiguration().getConfiguration();
+        if ( organisationInformation != null )
+        {
+            org.apache.maven.archiva.configuration.OrganisationInformation organisationInformationModel =
+                new BeanReplicator().replicateBean( organisationInformation,
+                                                    org.apache.maven.archiva.configuration.OrganisationInformation.class );
+            configuration.setOrganisationInfo( organisationInformationModel );
+        }
+        else
+        {
+            configuration.setOrganisationInfo( null );
+        }
+        saveConfiguration( configuration );
+    }
+
+    //-------------------------
+    //
+    //-------------------------
+
+    private org.apache.maven.archiva.configuration.FileType getFileTypeById( String id, Configuration configuration )
+    {
+        for ( org.apache.maven.archiva.configuration.FileType fileType : configuration.getRepositoryScanning().getFileTypes() )
+        {
+            if ( StringUtils.equals( id, fileType.getId() ) )
+            {
+                return fileType;
+            }
+        }
+        return null;
+    }
+
+}
diff --git a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/admin/FiletypeToMapClosure.java b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/admin/FiletypeToMapClosure.java
new file mode 100644
index 000000000..b48392e5e
--- /dev/null
+++ b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/admin/FiletypeToMapClosure.java
@@ -0,0 +1,51 @@
+package org.apache.archiva.admin.repository.admin;
+
+/*
+ * 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.admin.FileType;
+import org.apache.commons.collections.Closure;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * FiletypeToMapClosure 
+ *
+ * @since 1.4
+ */
+public class FiletypeToMapClosure
+    implements Closure
+{
+    private Map map = new HashMap();
+
+    public void execute( Object input )
+    {
+        if ( input instanceof FileType )
+        {
+            FileType filetype = (FileType) input;
+            map.put( filetype.getId(), filetype );
+        }
+    }
+
+    public Map getMap()
+    {
+        return map;
+    }
+}
diff --git a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/group/DefaultRepositoryGroupAdmin.java b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/group/DefaultRepositoryGroupAdmin.java
new file mode 100644
index 000000000..e3c2b6376
--- /dev/null
+++ b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/group/DefaultRepositoryGroupAdmin.java
@@ -0,0 +1,327 @@
+package org.apache.archiva.admin.repository.group;
+/*
+ * 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.group.RepositoryGroup;
+import org.apache.archiva.admin.model.group.RepositoryGroupAdmin;
+import org.apache.archiva.admin.model.managed.ManagedRepository;
+import org.apache.archiva.admin.model.managed.ManagedRepositoryAdmin;
+import org.apache.archiva.admin.repository.AbstractRepositoryAdmin;
+import org.apache.archiva.audit.AuditEvent;
+import org.apache.commons.lang.StringUtils;
+import org.apache.maven.archiva.configuration.Configuration;
+import org.apache.maven.archiva.configuration.RepositoryGroupConfiguration;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.stereotype.Service;
+
+import javax.inject.Inject;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+/**
+ * @author Olivier Lamy
+ */
+@Service( "repositoryGroupAdmin#default" )
+public class DefaultRepositoryGroupAdmin
+    extends AbstractRepositoryAdmin
+    implements RepositoryGroupAdmin
+{
+
+    private Logger log = LoggerFactory.getLogger( getClass() );
+
+    private static final Pattern REPO_GROUP_ID_PATTERN = Pattern.compile( "[A-Za-z0-9\\._\\-]+" );
+
+    @Inject
+    private ManagedRepositoryAdmin managedRepositoryAdmin;
+
+    public List getRepositoriesGroups()
+        throws RepositoryAdminException
+    {
+        List repositoriesGroups = new ArrayList();
+
+        for ( RepositoryGroupConfiguration repositoryGroupConfiguration : getArchivaConfiguration().getConfiguration().getRepositoryGroups() )
+        {
+            repositoriesGroups.add( new RepositoryGroup( repositoryGroupConfiguration.getId(), new ArrayList(
+                repositoryGroupConfiguration.getRepositories() ) ) );
+        }
+
+        return repositoriesGroups;
+    }
+
+    public RepositoryGroup getRepositoryGroup( String repositoryGroupId )
+        throws RepositoryAdminException
+    {
+        List repositoriesGroups = getRepositoriesGroups();
+        for ( RepositoryGroup repositoryGroup : repositoriesGroups )
+        {
+            if ( StringUtils.equals( repositoryGroupId, repositoryGroup.getId() ) )
+            {
+                return repositoryGroup;
+            }
+        }
+        return null;
+    }
+
+    public Boolean addRepositoryGroup( RepositoryGroup repositoryGroup, AuditInformation auditInformation )
+        throws RepositoryAdminException
+    {
+        validateRepositoryGroup( repositoryGroup, false );
+        validateManagedRepositoriesExists( repositoryGroup.getRepositories() );
+        RepositoryGroupConfiguration repositoryGroupConfiguration = new RepositoryGroupConfiguration();
+        repositoryGroupConfiguration.setId( repositoryGroup.getId() );
+        repositoryGroupConfiguration.setRepositories( repositoryGroup.getRepositories() );
+        Configuration configuration = getArchivaConfiguration().getConfiguration();
+        configuration.addRepositoryGroup( repositoryGroupConfiguration );
+        saveConfiguration( configuration );
+        triggerAuditEvent( repositoryGroup.getId(), null, AuditEvent.ADD_REPO_GROUP, auditInformation );
+        return Boolean.TRUE;
+    }
+
+    public Boolean deleteRepositoryGroup( String repositoryGroupId, AuditInformation auditInformation )
+        throws RepositoryAdminException
+    {
+        Configuration configuration = getArchivaConfiguration().getConfiguration();
+        RepositoryGroupConfiguration repositoryGroupConfiguration =
+            configuration.getRepositoryGroupsAsMap().get( repositoryGroupId );
+        if ( repositoryGroupConfiguration == null )
+        {
+            throw new RepositoryAdminException(
+                "repositoryGroup with id " + repositoryGroupId + " doesn't not exists so cannot remove" );
+        }
+        configuration.removeRepositoryGroup( repositoryGroupConfiguration );
+        triggerAuditEvent( repositoryGroupId, null, AuditEvent.DELETE_REPO_GROUP, auditInformation );
+        return Boolean.TRUE;
+    }
+
+    public Boolean updateRepositoryGroup( RepositoryGroup repositoryGroup, AuditInformation auditInformation )
+        throws RepositoryAdminException
+    {
+        return updateRepositoryGroup( repositoryGroup, auditInformation, true );
+    }
+
+    private Boolean updateRepositoryGroup( RepositoryGroup repositoryGroup, AuditInformation auditInformation,
+                                           boolean triggerAuditEvent )
+        throws RepositoryAdminException
+    {
+        validateRepositoryGroup( repositoryGroup, true );
+        validateManagedRepositoriesExists( repositoryGroup.getRepositories() );
+        Configuration configuration = getArchivaConfiguration().getConfiguration();
+
+        RepositoryGroupConfiguration repositoryGroupConfiguration =
+            configuration.getRepositoryGroupsAsMap().get( repositoryGroup.getId() );
+
+        configuration.removeRepositoryGroup( repositoryGroupConfiguration );
+
+        repositoryGroupConfiguration.setRepositories( repositoryGroup.getRepositories() );
+        configuration.addRepositoryGroup( repositoryGroupConfiguration );
+
+        saveConfiguration( configuration );
+        if ( triggerAuditEvent )
+        {
+            triggerAuditEvent( repositoryGroup.getId(), null, AuditEvent.MODIFY_REPO_GROUP, auditInformation );
+        }
+        return Boolean.TRUE;
+    }
+
+
+    public Boolean addRepositoryToGroup( String repositoryGroupId, String repositoryId,
+                                         AuditInformation auditInformation )
+        throws RepositoryAdminException
+    {
+        RepositoryGroup repositoryGroup = getRepositoryGroup( repositoryGroupId );
+        if ( repositoryGroup == null )
+        {
+            throw new RepositoryAdminException(
+                "repositoryGroup with id " + repositoryGroupId + " doesn't not exists so cannot add repository to it" );
+        }
+
+        if ( repositoryGroup.getRepositories().contains( repositoryId ) )
+        {
+            throw new RepositoryAdminException(
+                "repositoryGroup with id " + repositoryGroupId + " already contain repository with id" + repositoryId );
+        }
+        validateManagedRepositoriesExists( Arrays.asList( repositoryId ) );
+
+        repositoryGroup.addRepository( repositoryId );
+        updateRepositoryGroup( repositoryGroup, auditInformation, false );
+        triggerAuditEvent( repositoryGroup.getId(), null, AuditEvent.ADD_REPO_TO_GROUP, auditInformation );
+        return Boolean.TRUE;
+    }
+
+    public Boolean deleteRepositoryFromGroup( String repositoryGroupId, String repositoryId,
+                                              AuditInformation auditInformation )
+        throws RepositoryAdminException
+    {
+        RepositoryGroup repositoryGroup = getRepositoryGroup( repositoryGroupId );
+        if ( repositoryGroup == null )
+        {
+            throw new RepositoryAdminException( "repositoryGroup with id " + repositoryGroupId
+                                                    + " doesn't not exists so cannot remove repository from it" );
+        }
+
+        if ( !repositoryGroup.getRepositories().contains( repositoryId ) )
+        {
+            throw new RepositoryAdminException(
+                "repositoryGroup with id " + repositoryGroupId + " doesn't not contains repository with id"
+                    + repositoryId );
+        }
+
+        repositoryGroup.removeRepository( repositoryId );
+        updateRepositoryGroup( repositoryGroup, auditInformation, false );
+        triggerAuditEvent( repositoryGroup.getId(), null, AuditEvent.DELETE_REPO_FROM_GROUP, auditInformation );
+        return Boolean.TRUE;
+    }
+
+    public Map getRepositoryGroupsAsMap()
+        throws RepositoryAdminException
+    {
+        List repositoriesGroups = getRepositoriesGroups();
+        Map map = new HashMap( repositoriesGroups.size() );
+        for ( RepositoryGroup repositoryGroup : repositoriesGroups )
+        {
+            map.put( repositoryGroup.getId(), repositoryGroup );
+        }
+        return map;
+    }
+
+    public Map> getGroupToRepositoryMap()
+        throws RepositoryAdminException
+    {
+
+        java.util.Map> map = new java.util.HashMap>();
+
+        for ( ManagedRepository repo : getManagedRepositoryAdmin().getManagedRepositories() )
+        {
+            for ( RepositoryGroup group : getRepositoriesGroups() )
+            {
+                if ( !group.getRepositories().contains( repo.getId() ) )
+                {
+                    String groupId = group.getId();
+                    java.util.List repos = map.get( groupId );
+                    if ( repos == null )
+                    {
+                        repos = new java.util.ArrayList();
+                        map.put( groupId, repos );
+                    }
+                    repos.add( repo.getId() );
+                }
+            }
+        }
+        return map;
+    }
+
+    public Map> getRepositoryToGroupMap()
+        throws RepositoryAdminException
+    {
+        java.util.Map> map = new java.util.HashMap>();
+
+        for ( RepositoryGroup group : getRepositoriesGroups() )
+        {
+            for ( String repositoryId : group.getRepositories() )
+            {
+                java.util.List groups = map.get( repositoryId );
+                if ( groups == null )
+                {
+                    groups = new java.util.ArrayList();
+                    map.put( repositoryId, groups );
+                }
+                groups.add( group.getId() );
+            }
+        }
+        return map;
+    }
+
+    public Boolean validateRepositoryGroup( RepositoryGroup repositoryGroup, boolean updateMode )
+        throws RepositoryAdminException
+    {
+        String repoGroupId = repositoryGroup.getId();
+        if ( StringUtils.isBlank( repoGroupId ) )
+        {
+            throw new RepositoryAdminException( "repositoryGroup id cannot be empty" );
+        }
+
+        if ( repoGroupId.length() > 100 )
+        {
+            throw new RepositoryAdminException(
+                "Identifier [" + repoGroupId + "] is over the maximum limit of 100 characters" );
+
+        }
+
+        Matcher matcher = REPO_GROUP_ID_PATTERN.matcher( repoGroupId );
+        if ( !matcher.matches() )
+        {
+            throw new RepositoryAdminException(
+                "Invalid character(s) found in identifier. Only the following characters are allowed: alphanumeric, '.', '-' and '_'" );
+        }
+
+        Configuration configuration = getArchivaConfiguration().getConfiguration();
+
+        if ( configuration.getRepositoryGroupsAsMap().containsKey( repoGroupId ) )
+        {
+            if ( !updateMode )
+            {
+                throw new RepositoryAdminException( "Unable to add new repository group with id [" + repoGroupId
+                                                        + "], that id already exists as a repository group." );
+            }
+        }
+        else if ( configuration.getManagedRepositoriesAsMap().containsKey( repoGroupId ) )
+        {
+            throw new RepositoryAdminException( "Unable to add new repository group with id [" + repoGroupId
+                                                    + "], that id already exists as a managed repository." );
+        }
+        else if ( configuration.getRemoteRepositoriesAsMap().containsKey( repoGroupId ) )
+        {
+            throw new RepositoryAdminException( "Unable to add new repository group with id [" + repoGroupId
+                                                    + "], that id already exists as a remote repository." );
+        }
+
+        return Boolean.TRUE;
+    }
+
+    private void validateManagedRepositoriesExists( List managedRepositoriesIds )
+        throws RepositoryAdminException
+    {
+        for ( String id : managedRepositoriesIds )
+        {
+            if ( getManagedRepositoryAdmin().getManagedRepository( id ) == null )
+            {
+                throw new RepositoryAdminException(
+                    "managedRepository with id " + id + " not exists so cannot be used in a repositoryGroup" );
+            }
+        }
+    }
+
+    public ManagedRepositoryAdmin getManagedRepositoryAdmin()
+    {
+        return managedRepositoryAdmin;
+    }
+
+    public void setManagedRepositoryAdmin( ManagedRepositoryAdmin managedRepositoryAdmin )
+    {
+        this.managedRepositoryAdmin = managedRepositoryAdmin;
+    }
+}
diff --git a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/managed/DefaultManagedRepositoryAdmin.java b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/managed/DefaultManagedRepositoryAdmin.java
new file mode 100644
index 000000000..bee986948
--- /dev/null
+++ b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/managed/DefaultManagedRepositoryAdmin.java
@@ -0,0 +1,600 @@
+package org.apache.archiva.admin.repository.managed;
+/*
+ * 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.managed.ManagedRepository;
+import org.apache.archiva.admin.model.managed.ManagedRepositoryAdmin;
+import org.apache.archiva.admin.repository.AbstractRepositoryAdmin;
+import org.apache.archiva.audit.AuditEvent;
+import org.apache.archiva.metadata.repository.MetadataRepository;
+import org.apache.archiva.metadata.repository.MetadataRepositoryException;
+import org.apache.archiva.metadata.repository.RepositorySession;
+import org.apache.archiva.metadata.repository.RepositorySessionFactory;
+import org.apache.archiva.metadata.repository.stats.RepositoryStatisticsManager;
+import org.apache.archiva.scheduler.repository.RepositoryArchivaTaskScheduler;
+import org.apache.archiva.scheduler.repository.RepositoryTask;
+import org.apache.archiva.security.common.ArchivaRoleConstants;
+import org.apache.commons.io.FileUtils;
+import org.apache.commons.lang.StringUtils;
+import org.apache.commons.validator.GenericValidator;
+import org.apache.maven.archiva.configuration.Configuration;
+import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration;
+import org.apache.maven.archiva.configuration.ProxyConnectorConfiguration;
+import org.apache.maven.archiva.configuration.RepositoryGroupConfiguration;
+import org.codehaus.plexus.redback.role.RoleManager;
+import org.codehaus.plexus.redback.role.RoleManagerException;
+import org.codehaus.plexus.taskqueue.TaskQueueException;
+import org.codehaus.redback.components.scheduler.CronExpressionValidator;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.stereotype.Service;
+
+import javax.inject.Inject;
+import javax.inject.Named;
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * FIXME remove all generic Exception to have usefull ones
+ * FIXME review the staging mechanism to have a per user session one
+ *
+ * @author Olivier Lamy
+ */
+@Service( "managedRepositoryAdmin#default" )
+public class DefaultManagedRepositoryAdmin
+    extends AbstractRepositoryAdmin
+    implements ManagedRepositoryAdmin
+{
+
+    public static final String REPOSITORY_LOCATION_VALID_EXPRESSION = "^[-a-zA-Z0-9._/~:?!&=\\\\]+$";
+
+    private Logger log = LoggerFactory.getLogger( getClass() );
+
+    public static final String STAGE_REPO_ID_END = "-stage";
+
+
+    @Inject
+    @Named( value = "archivaTaskScheduler#repository" )
+    private RepositoryArchivaTaskScheduler repositoryTaskScheduler;
+
+    @Inject
+    private RepositorySessionFactory repositorySessionFactory;
+
+    @Inject
+    private RepositoryStatisticsManager repositoryStatisticsManager;
+
+
+    @Inject
+    protected RoleManager roleManager;
+
+    public List getManagedRepositories()
+        throws RepositoryAdminException
+    {
+        List managedRepoConfigs =
+            getArchivaConfiguration().getConfiguration().getManagedRepositories();
+
+        List managedRepos = new ArrayList( managedRepoConfigs.size() );
+
+        for ( ManagedRepositoryConfiguration repoConfig : managedRepoConfigs )
+        {
+            // TODO add staging repo information back too
+            ManagedRepository repo =
+                new ManagedRepository( repoConfig.getId(), repoConfig.getName(), repoConfig.getLocation(),
+                                       repoConfig.getLayout(), repoConfig.isSnapshots(), repoConfig.isReleases(),
+                                       repoConfig.isBlockRedeployments(), repoConfig.getRefreshCronExpression(),
+                                       repoConfig.getIndexDir(), repoConfig.isScanned(), repoConfig.getDaysOlder(),
+                                       repoConfig.getRetentionCount(), repoConfig.isDeleteReleasedSnapshots() );
+
+            managedRepos.add( repo );
+        }
+
+        return managedRepos;
+    }
+
+    public Map getManagedRepositoriesAsMap()
+        throws RepositoryAdminException
+    {
+        List managedRepositories = getManagedRepositories();
+        Map repositoriesMap =
+            new HashMap( managedRepositories.size() );
+        for ( ManagedRepository managedRepository : managedRepositories )
+        {
+            repositoriesMap.put( managedRepository.getId(), managedRepository );
+        }
+        return repositoriesMap;
+    }
+
+    public ManagedRepository getManagedRepository( String repositoryId )
+        throws RepositoryAdminException
+    {
+        List repos = getManagedRepositories();
+        for ( ManagedRepository repo : repos )
+        {
+            if ( StringUtils.equals( repo.getId(), repositoryId ) )
+            {
+                return repo;
+            }
+        }
+        return null;
+    }
+
+    public Boolean addManagedRepository( ManagedRepository managedRepository, boolean needStageRepo,
+                                         AuditInformation auditInformation )
+        throws RepositoryAdminException
+    {
+
+        getRepositoryCommonValidator().basicValidation( managedRepository, false );
+        triggerAuditEvent( managedRepository.getId(), null, AuditEvent.ADD_MANAGED_REPO, auditInformation );
+        return
+            addManagedRepository( managedRepository.getId(), managedRepository.getLayout(), managedRepository.getName(),
+                                  managedRepository.getLocation(), managedRepository.isBlockRedeployments(),
+                                  managedRepository.isReleases(), managedRepository.isSnapshots(), needStageRepo,
+                                  managedRepository.getCronExpression(), managedRepository.getIndexDirectory(),
+                                  managedRepository.getDaysOlder(), managedRepository.getRetentionCount(),
+                                  managedRepository.isDeleteReleasedSnapshots(), auditInformation,
+                                  getArchivaConfiguration().getConfiguration() ) != null;
+
+    }
+
+    private ManagedRepositoryConfiguration addManagedRepository( String repoId, String layout, String name,
+                                                                 String location, boolean blockRedeployments,
+                                                                 boolean releasesIncluded, boolean snapshotsIncluded,
+                                                                 boolean stageRepoNeeded, String cronExpression,
+                                                                 String indexDir, int daysOlder, int retentionCount,
+                                                                 boolean deteleReleasedSnapshots,
+                                                                 AuditInformation auditInformation,
+                                                                 Configuration config )
+        throws RepositoryAdminException
+    {
+
+        // FIXME : olamy can be empty to avoid scheduled scan ?
+        if ( StringUtils.isNotBlank( cronExpression ) )
+        {
+            CronExpressionValidator validator = new CronExpressionValidator();
+
+            if ( !validator.validate( cronExpression ) )
+            {
+                throw new RepositoryAdminException( "Invalid cron expression." );
+            }
+        }
+        else
+        {
+            throw new RepositoryAdminException( "Cron expression cannot be empty." );
+        }
+
+        String repoLocation = getRepositoryCommonValidator().removeExpressions( location );
+
+        if ( !GenericValidator.matchRegexp( repoLocation, REPOSITORY_LOCATION_VALID_EXPRESSION ) )
+        {
+            throw new RepositoryAdminException(
+                "Invalid repository location. Directory must only contain alphanumeric characters, equals(=), question-marks(?), "
+                    + "exclamation-points(!), ampersands(&), forward-slashes(/), back-slashes(\\), underscores(_), dots(.), colons(:), tildes(~), and dashes(-)." );
+        }
+
+        ManagedRepositoryConfiguration repository = new ManagedRepositoryConfiguration();
+
+        repository.setId( repoId );
+        repository.setBlockRedeployments( blockRedeployments );
+        repository.setReleases( releasesIncluded );
+        repository.setSnapshots( snapshotsIncluded );
+        repository.setName( name );
+        repository.setLocation( repoLocation );
+        repository.setLayout( layout );
+        repository.setRefreshCronExpression( cronExpression );
+        repository.setIndexDir( indexDir );
+        repository.setDaysOlder( daysOlder );
+        repository.setRetentionCount( retentionCount );
+        repository.setDeleteReleasedSnapshots( deteleReleasedSnapshots );
+
+
+        try
+        {
+            addRepository( repository, config );
+            addRepositoryRoles( repository );
+
+            if ( stageRepoNeeded )
+            {
+                ManagedRepositoryConfiguration stagingRepository = getStageRepoConfig( repository );
+                addRepository( stagingRepository, config );
+                addRepositoryRoles( stagingRepository );
+                triggerAuditEvent( stagingRepository.getId(), null, AuditEvent.ADD_MANAGED_REPO, auditInformation );
+            }
+        }
+        catch ( RoleManagerException e )
+        {
+            throw new RepositoryAdminException( "failed to add repository roles " + e.getMessage(), e );
+        }
+        catch ( IOException e )
+        {
+            throw new RepositoryAdminException( "failed to add repository " + e.getMessage(), e );
+        }
+
+        saveConfiguration( config );
+
+        //MRM-1342 Repository statistics report doesn't appear to be working correctly
+        //scan repository when adding of repository is successful
+        try
+        {
+            scanRepository( repoId, true );
+            // olamy no need of scanning staged repo
+            /*
+            if ( stageRepoNeeded )
+            {
+                ManagedRepositoryConfiguration stagingRepository = getStageRepoConfig( repository );
+                scanRepository( stagingRepository.getId(), true );
+            }*/
+        }
+        catch ( Exception e )
+        {
+            log.warn( new StringBuilder( "Unable to scan repository [" ).append( repoId ).append( "]: " ).append(
+                e.getMessage() ).toString(), e );
+        }
+
+        return repository;
+    }
+
+
+    // FIXME cleanup repositoryGroups when deleting a ManagedRepo
+    public Boolean deleteManagedRepository( String repositoryId, AuditInformation auditInformation,
+                                            boolean deleteContent )
+        throws RepositoryAdminException
+    {
+        Configuration config = getArchivaConfiguration().getConfiguration();
+
+        ManagedRepositoryConfiguration repository = config.findManagedRepositoryById( repositoryId );
+
+        if ( repository == null )
+        {
+            throw new RepositoryAdminException( "A repository with that id does not exist" );
+        }
+
+        triggerAuditEvent( repositoryId, null, AuditEvent.DELETE_MANAGED_REPO, auditInformation );
+
+        deleteManagedRepository( repository, deleteContent, config, false );
+
+        // stage repo exists ?
+        ManagedRepositoryConfiguration stagingRepository =
+            getArchivaConfiguration().getConfiguration().findManagedRepositoryById( repositoryId + STAGE_REPO_ID_END );
+        if ( stagingRepository != null )
+        {
+            // do not trigger event when deleting the staged one
+            //triggerAuditEvent( stagingRepository.getId(), null, AuditEvent.DELETE_MANAGED_REPO, auditInformation );
+            deleteManagedRepository( stagingRepository, deleteContent, config, true );
+        }
+
+        try
+        {
+            saveConfiguration( config );
+        }
+        catch ( Exception e )
+        {
+            throw new RepositoryAdminException( "Error saving configuration for delete action" + e.getMessage() );
+        }
+
+        return Boolean.TRUE;
+    }
+
+    private Boolean deleteManagedRepository( ManagedRepositoryConfiguration repository, boolean deleteContent,
+                                             Configuration config, boolean stagedOne )
+        throws RepositoryAdminException
+    {
+        if ( !stagedOne )
+        {
+            RepositorySession repositorySession = getRepositorySessionFactory().createSession();
+            try
+            {
+                MetadataRepository metadataRepository = repositorySession.getRepository();
+                metadataRepository.removeRepository( repository.getId() );
+                log.debug( "call repositoryStatisticsManager.deleteStatistics" );
+                getRepositoryStatisticsManager().deleteStatistics( metadataRepository, repository.getId() );
+                repositorySession.save();
+            }
+            catch ( MetadataRepositoryException e )
+            {
+                throw new RepositoryAdminException( e.getMessage(), e );
+            }
+            finally
+            {
+                repositorySession.close();
+            }
+        }
+        config.removeManagedRepository( repository );
+
+        if ( deleteContent )
+        {
+            // TODO could be async ? as directory can be huge
+            File dir = new File( repository.getLocation() );
+            if ( !FileUtils.deleteQuietly( dir ) )
+            {
+                throw new RepositoryAdminException( "Cannot delete repository " + dir );
+            }
+        }
+
+        // olamy: copy list for reading as a unit test in webapp fail with ConcurrentModificationException
+        List proxyConnectors =
+            new ArrayList( config.getProxyConnectors() );
+        for ( ProxyConnectorConfiguration proxyConnector : proxyConnectors )
+        {
+            if ( StringUtils.equals( proxyConnector.getSourceRepoId(), repository.getId() ) )
+            {
+                config.removeProxyConnector( proxyConnector );
+            }
+        }
+
+        Map> repoToGroupMap = config.getRepositoryToGroupMap();
+        if ( repoToGroupMap != null )
+        {
+            if ( repoToGroupMap.containsKey( repository.getId() ) )
+            {
+                List repoGroups = repoToGroupMap.get( repository.getId() );
+                for ( String repoGroup : repoGroups )
+                {
+                    // copy to prevent UnsupportedOperationException
+                    RepositoryGroupConfiguration repositoryGroupConfiguration =
+                        config.findRepositoryGroupById( repoGroup );
+                    List repos = new ArrayList( repositoryGroupConfiguration.getRepositories() );
+                    config.removeRepositoryGroup( repositoryGroupConfiguration );
+                    repos.remove( repository.getId() );
+                    repositoryGroupConfiguration.setRepositories( repos );
+                    config.addRepositoryGroup( repositoryGroupConfiguration );
+                }
+            }
+        }
+
+        try
+        {
+            removeRepositoryRoles( repository );
+        }
+        catch ( RoleManagerException e )
+        {
+            throw new RepositoryAdminException(
+                "fail to remove repository roles for repository " + repository.getId() + " : " + e.getMessage(), e );
+        }
+
+        saveConfiguration( config );
+
+        return Boolean.TRUE;
+    }
+
+
+    public Boolean updateManagedRepository( ManagedRepository managedRepository, boolean needStageRepo,
+                                            AuditInformation auditInformation, boolean resetStats )
+        throws RepositoryAdminException
+    {
+
+        log.debug( "updateManagedConfiguration repo {} needStage {} resetStats {} ",
+                   Arrays.asList( managedRepository, needStageRepo, resetStats ).toArray() );
+
+        // Ensure that the fields are valid.
+
+        getRepositoryCommonValidator().basicValidation( managedRepository, true );
+
+        Configuration configuration = getArchivaConfiguration().getConfiguration();
+
+        ManagedRepositoryConfiguration toremove = configuration.findManagedRepositoryById( managedRepository.getId() );
+
+        if ( toremove != null )
+        {
+            configuration.removeManagedRepository( toremove );
+        }
+
+        ManagedRepositoryConfiguration stagingRepository = getStageRepoConfig( toremove );
+
+        // TODO remove content from old if path has changed !!!!!
+
+        if ( stagingRepository != null )
+        {
+            configuration.removeManagedRepository( stagingRepository );
+        }
+
+        ManagedRepositoryConfiguration managedRepositoryConfiguration =
+            addManagedRepository( managedRepository.getId(), managedRepository.getLayout(), managedRepository.getName(),
+                                  managedRepository.getLocation(), managedRepository.isBlockRedeployments(),
+                                  managedRepository.isReleases(), managedRepository.isSnapshots(), needStageRepo,
+                                  managedRepository.getCronExpression(), managedRepository.getIndexDirectory(),
+                                  managedRepository.getDaysOlder(), managedRepository.getRetentionCount(),
+                                  managedRepository.isDeleteReleasedSnapshots(), auditInformation,
+                                  getArchivaConfiguration().getConfiguration() );
+
+        // Save the repository configuration.
+        RepositorySession repositorySession = getRepositorySessionFactory().createSession();
+
+        try
+        {
+            triggerAuditEvent( managedRepositoryConfiguration.getId(), null, AuditEvent.MODIFY_MANAGED_REPO,
+                               auditInformation );
+
+            saveConfiguration( this.getArchivaConfiguration().getConfiguration() );
+            if ( resetStats )
+            {
+                log.debug( "call repositoryStatisticsManager.deleteStatistics" );
+                getRepositoryStatisticsManager().deleteStatistics( repositorySession.getRepository(),
+                                                                   managedRepositoryConfiguration.getId() );
+                repositorySession.save();
+            }
+
+        }
+        catch ( MetadataRepositoryException e )
+        {
+            throw new RepositoryAdminException( e.getMessage(), e );
+        }
+        finally
+        {
+            repositorySession.close();
+        }
+
+        return true;
+    }
+
+    //--------------------------
+    // utils methods
+    //--------------------------
+
+
+    protected void addRepository( ManagedRepositoryConfiguration repository, Configuration configuration )
+        throws RepositoryAdminException, IOException
+    {
+        // Normalize the path
+        File file = new File( repository.getLocation() );
+        repository.setLocation( file.getCanonicalPath() );
+        if ( !file.exists() )
+        {
+            file.mkdirs();
+        }
+        if ( !file.exists() || !file.isDirectory() )
+        {
+            throw new RepositoryAdminException(
+                "Unable to add repository - no write access, can not create the root directory: " + file );
+        }
+
+        configuration.addManagedRepository( repository );
+    }
+
+    private ManagedRepositoryConfiguration getStageRepoConfig( ManagedRepositoryConfiguration repository )
+    {
+        ManagedRepositoryConfiguration stagingRepository = new ManagedRepositoryConfiguration();
+        stagingRepository.setId( repository.getId() + STAGE_REPO_ID_END );
+        stagingRepository.setLayout( repository.getLayout() );
+        stagingRepository.setName( repository.getName() + STAGE_REPO_ID_END );
+        stagingRepository.setBlockRedeployments( repository.isBlockRedeployments() );
+        stagingRepository.setDaysOlder( repository.getDaysOlder() );
+        stagingRepository.setDeleteReleasedSnapshots( repository.isDeleteReleasedSnapshots() );
+        stagingRepository.setIndexDir( repository.getIndexDir() );
+        String path = repository.getLocation();
+        int lastIndex = path.lastIndexOf( '/' );
+        stagingRepository.setLocation( path.substring( 0, lastIndex ) + "/" + stagingRepository.getId() );
+        stagingRepository.setRefreshCronExpression( repository.getRefreshCronExpression() );
+        stagingRepository.setReleases( repository.isReleases() );
+        stagingRepository.setRetentionCount( repository.getRetentionCount() );
+        stagingRepository.setScanned( repository.isScanned() );
+        stagingRepository.setSnapshots( repository.isSnapshots() );
+        return stagingRepository;
+    }
+
+    public Boolean scanRepository( String repositoryId, boolean fullScan )
+    {
+        if ( getRepositoryTaskScheduler().isProcessingRepositoryTask( repositoryId ) )
+        {
+            log.info( "scanning of repository with id {} already scheduled", repositoryId );
+        }
+        RepositoryTask task = new RepositoryTask();
+        task.setRepositoryId( repositoryId );
+        task.setScanAll( fullScan );
+        try
+        {
+            getRepositoryTaskScheduler().queueTask( task );
+        }
+        catch ( TaskQueueException e )
+        {
+            log.error( "failed to schedule scanning of repo with id {}", repositoryId, e );
+            return false;
+        }
+        return true;
+    }
+
+    protected void addRepositoryRoles( ManagedRepositoryConfiguration newRepository )
+        throws RoleManagerException
+    {
+        String repoId = newRepository.getId();
+
+        // TODO: double check these are configured on start up
+        // TODO: belongs in the business logic
+
+        if ( !getRoleManager().templatedRoleExists( ArchivaRoleConstants.TEMPLATE_REPOSITORY_OBSERVER, repoId ) )
+        {
+            getRoleManager().createTemplatedRole( ArchivaRoleConstants.TEMPLATE_REPOSITORY_OBSERVER, repoId );
+        }
+
+        if ( !getRoleManager().templatedRoleExists( ArchivaRoleConstants.TEMPLATE_REPOSITORY_MANAGER, repoId ) )
+        {
+            getRoleManager().createTemplatedRole( ArchivaRoleConstants.TEMPLATE_REPOSITORY_MANAGER, repoId );
+        }
+    }
+
+    protected void removeRepositoryRoles( ManagedRepositoryConfiguration existingRepository )
+        throws RoleManagerException
+    {
+        String repoId = existingRepository.getId();
+
+        if ( getRoleManager().templatedRoleExists( ArchivaRoleConstants.TEMPLATE_REPOSITORY_MANAGER, repoId ) )
+        {
+            getRoleManager().removeTemplatedRole( ArchivaRoleConstants.TEMPLATE_REPOSITORY_MANAGER, repoId );
+        }
+
+        if ( getRoleManager().templatedRoleExists( ArchivaRoleConstants.TEMPLATE_REPOSITORY_OBSERVER, repoId ) )
+        {
+            getRoleManager().removeTemplatedRole( ArchivaRoleConstants.TEMPLATE_REPOSITORY_OBSERVER, repoId );
+        }
+
+        log.debug( "removed user roles associated with repository {}", repoId );
+    }
+
+    //--------------------------
+    // setters/getters
+    //--------------------------
+
+
+    public RoleManager getRoleManager()
+    {
+        return roleManager;
+    }
+
+    public void setRoleManager( RoleManager roleManager )
+    {
+        this.roleManager = roleManager;
+    }
+
+    public RepositoryStatisticsManager getRepositoryStatisticsManager()
+    {
+        return repositoryStatisticsManager;
+    }
+
+    public void setRepositoryStatisticsManager( RepositoryStatisticsManager repositoryStatisticsManager )
+    {
+        this.repositoryStatisticsManager = repositoryStatisticsManager;
+    }
+
+    public RepositorySessionFactory getRepositorySessionFactory()
+    {
+        return repositorySessionFactory;
+    }
+
+    public void setRepositorySessionFactory( RepositorySessionFactory repositorySessionFactory )
+    {
+        this.repositorySessionFactory = repositorySessionFactory;
+    }
+
+
+    public RepositoryArchivaTaskScheduler getRepositoryTaskScheduler()
+    {
+        return repositoryTaskScheduler;
+    }
+
+    public void setRepositoryTaskScheduler( RepositoryArchivaTaskScheduler repositoryTaskScheduler )
+    {
+        this.repositoryTaskScheduler = repositoryTaskScheduler;
+    }
+}
diff --git a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/networkproxy/DefaultNetworkProxyAdmin.java b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/networkproxy/DefaultNetworkProxyAdmin.java
new file mode 100644
index 000000000..1455354ae
--- /dev/null
+++ b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/networkproxy/DefaultNetworkProxyAdmin.java
@@ -0,0 +1,145 @@
+package org.apache.archiva.admin.repository.networkproxy;
+/*
+ * 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 net.sf.beanlib.provider.replicator.BeanReplicator;
+import org.apache.archiva.admin.model.AuditInformation;
+import org.apache.archiva.admin.model.RepositoryAdminException;
+import org.apache.archiva.admin.model.networkproxy.NetworkProxy;
+import org.apache.archiva.admin.model.networkproxy.NetworkProxyAdmin;
+import org.apache.archiva.admin.repository.AbstractRepositoryAdmin;
+import org.apache.archiva.audit.AuditEvent;
+import org.apache.commons.lang.StringUtils;
+import org.apache.maven.archiva.configuration.Configuration;
+import org.apache.maven.archiva.configuration.NetworkProxyConfiguration;
+import org.springframework.stereotype.Service;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author Olivier Lamy
+ * @since 1.4
+ */
+@Service( "networkProxyAdmin#default" )
+public class DefaultNetworkProxyAdmin
+    extends AbstractRepositoryAdmin
+    implements NetworkProxyAdmin
+{
+
+    public List getNetworkProxies()
+        throws RepositoryAdminException
+    {
+        List networkProxies = new ArrayList();
+        for ( NetworkProxyConfiguration networkProxyConfiguration : getArchivaConfiguration().getConfiguration().getNetworkProxies() )
+        {
+            networkProxies.add( getNetworkProxy( networkProxyConfiguration ) );
+        }
+        return networkProxies;
+    }
+
+    public NetworkProxy getNetworkProxy( String networkProxyId )
+        throws RepositoryAdminException
+    {
+        for ( NetworkProxy networkProxy : getNetworkProxies() )
+        {
+            if ( StringUtils.equals( networkProxyId, networkProxy.getId() ) )
+            {
+                return networkProxy;
+            }
+        }
+
+        return null;
+    }
+
+    public void addNetworkProxy( NetworkProxy networkProxy, AuditInformation auditInformation )
+        throws RepositoryAdminException
+    {
+        if ( networkProxy == null )
+        {
+            return;
+        }
+        if ( getNetworkProxy( networkProxy.getId() ) != null )
+        {
+            throw new RepositoryAdminException(
+                "cannot add NetworkProxy with id " + networkProxy.getId() + " already exist" );
+        }
+        Configuration configuration = getArchivaConfiguration().getConfiguration();
+        configuration.addNetworkProxy( getNetworkProxyConfiguration( networkProxy ) );
+
+        triggerAuditEvent( networkProxy.getId(), null, AuditEvent.ADD_NETWORK_PROXY, auditInformation );
+
+        saveConfiguration( configuration );
+    }
+
+    public void updateNetworkProxy( NetworkProxy networkProxy, AuditInformation auditInformation )
+        throws RepositoryAdminException
+    {
+        if ( networkProxy == null )
+        {
+            return;
+        }
+        if ( getNetworkProxy( networkProxy.getId() ) == null )
+        {
+            throw new RepositoryAdminException(
+                "cannot update NetworkProxy with id " + networkProxy.getId() + " as not exist" );
+        }
+        Configuration configuration = getArchivaConfiguration().getConfiguration();
+        NetworkProxyConfiguration networkProxyConfiguration = getNetworkProxyConfiguration( networkProxy );
+        configuration.removeNetworkProxy( networkProxyConfiguration );
+        configuration.addNetworkProxy( networkProxyConfiguration );
+
+        triggerAuditEvent( networkProxy.getId(), null, AuditEvent.MODIFY_NETWORK_PROXY, auditInformation );
+
+        saveConfiguration( configuration );
+    }
+
+    public void deleteNetworkProxy( String networkProxyId, AuditInformation auditInformation )
+        throws RepositoryAdminException
+    {
+
+        NetworkProxy networkProxy = getNetworkProxy( networkProxyId );
+        if ( networkProxy == null )
+        {
+            throw new RepositoryAdminException(
+                "cannot delete NetworkProxy with id " + networkProxyId + " as not exist" );
+        }
+        Configuration configuration = getArchivaConfiguration().getConfiguration();
+        NetworkProxyConfiguration networkProxyConfiguration = getNetworkProxyConfiguration( networkProxy );
+        configuration.removeNetworkProxy( networkProxyConfiguration );
+
+        triggerAuditEvent( networkProxy.getId(), null, AuditEvent.DELETE_NETWORK_PROXY, auditInformation );
+
+        saveConfiguration( configuration );
+    }
+
+    protected NetworkProxy getNetworkProxy( NetworkProxyConfiguration networkProxyConfiguration )
+    {
+        return networkProxyConfiguration == null
+            ? null
+            : new BeanReplicator().replicateBean( networkProxyConfiguration, NetworkProxy.class );
+    }
+
+    protected NetworkProxyConfiguration getNetworkProxyConfiguration( NetworkProxy networkProxy )
+    {
+        return networkProxy == null
+            ? null
+            : new BeanReplicator().replicateBean( networkProxy, NetworkProxyConfiguration.class );
+    }
+}
diff --git a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/proxyconnector/DefaultProxyConnectorAdmin.java b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/proxyconnector/DefaultProxyConnectorAdmin.java
new file mode 100644
index 000000000..fc3580e28
--- /dev/null
+++ b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/proxyconnector/DefaultProxyConnectorAdmin.java
@@ -0,0 +1,254 @@
+package org.apache.archiva.admin.repository.proxyconnector;
+/*
+ * 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 net.sf.beanlib.provider.replicator.BeanReplicator;
+import org.apache.archiva.admin.model.AuditInformation;
+import org.apache.archiva.admin.model.RepositoryAdminException;
+import org.apache.archiva.admin.model.managed.ManagedRepositoryAdmin;
+import org.apache.archiva.admin.model.proxyconnector.ProxyConnector;
+import org.apache.archiva.admin.model.proxyconnector.ProxyConnectorAdmin;
+import org.apache.archiva.admin.model.proxyconnector.ProxyConnectorOrderComparator;
+import org.apache.archiva.admin.model.remote.RemoteRepositoryAdmin;
+import org.apache.archiva.admin.repository.AbstractRepositoryAdmin;
+import org.apache.archiva.audit.AuditEvent;
+import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.lang.StringUtils;
+import org.apache.maven.archiva.configuration.Configuration;
+import org.apache.maven.archiva.configuration.ProxyConnectorConfiguration;
+import org.apache.maven.archiva.configuration.functors.ProxyConnectorSelectionPredicate;
+import org.springframework.stereotype.Service;
+
+import javax.inject.Inject;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author Olivier Lamy
+ * @since 1.4
+ */
+@Service( "proxyConnectorAdmin#default" )
+public class DefaultProxyConnectorAdmin
+    extends AbstractRepositoryAdmin
+    implements ProxyConnectorAdmin
+{
+
+    @Inject
+    private ManagedRepositoryAdmin managedRepositoryAdmin;
+
+    @Inject
+    private RemoteRepositoryAdmin remoteRepositoryAdmin;
+
+    public List getProxyConnectors()
+        throws RepositoryAdminException
+    {
+        List proxyConnectorConfigurations =
+            getArchivaConfiguration().getConfiguration().getProxyConnectors();
+        List proxyConnectors = new ArrayList( proxyConnectorConfigurations.size() );
+        for ( ProxyConnectorConfiguration configuration : proxyConnectorConfigurations )
+        {
+            proxyConnectors.add( getProxyConnector( configuration ) );
+        }
+
+        return proxyConnectors;
+    }
+
+    public ProxyConnector getProxyConnector( String sourceRepoId, String targetRepoId )
+        throws RepositoryAdminException
+    {
+        for ( ProxyConnector proxyConnector : getProxyConnectors() )
+        {
+            if ( StringUtils.equals( sourceRepoId, proxyConnector.getSourceRepoId() ) && StringUtils.equals(
+                targetRepoId, proxyConnector.getTargetRepoId() ) )
+            {
+                return proxyConnector;
+            }
+        }
+        return null;
+    }
+
+    public Boolean addProxyConnector( ProxyConnector proxyConnector, AuditInformation auditInformation )
+        throws RepositoryAdminException
+    {
+        if ( getProxyConnector( proxyConnector.getSourceRepoId(), proxyConnector.getTargetRepoId() ) != null )
+        {
+            throw new RepositoryAdminException(
+                "Unable to add proxy connector, as one already exists with source repository id ["
+                    + proxyConnector.getSourceRepoId() + "] and target repository id ["
+                    + proxyConnector.getTargetRepoId() + "]." );
+        }
+
+        validateProxyConnector( proxyConnector );
+
+        proxyConnector.setBlackListPatterns( unescapePatterns( proxyConnector.getBlackListPatterns() ) );
+        proxyConnector.setWhiteListPatterns( unescapePatterns( proxyConnector.getWhiteListPatterns() ) );
+
+        Configuration configuration = getArchivaConfiguration().getConfiguration();
+
+        ProxyConnectorConfiguration proxyConnectorConfiguration = getProxyConnectorConfiguration( proxyConnector );
+        configuration.addProxyConnector( proxyConnectorConfiguration );
+        saveConfiguration( configuration );
+        triggerAuditEvent( proxyConnector.getSourceRepoId() + "-" + proxyConnector.getTargetRepoId(), null,
+                           AuditEvent.ADD_PROXY_CONNECTOR, auditInformation );
+        return Boolean.TRUE;
+
+    }
+
+    public Boolean deleteProxyConnector( ProxyConnector proxyConnector, AuditInformation auditInformation )
+        throws RepositoryAdminException
+    {
+        Configuration configuration = getArchivaConfiguration().getConfiguration();
+        ProxyConnectorConfiguration proxyConnectorConfiguration =
+            findProxyConnector( proxyConnector.getSourceRepoId(), proxyConnector.getTargetRepoId(), configuration );
+        if ( proxyConnectorConfiguration == null )
+        {
+            throw new RepositoryAdminException(
+                "unable to find ProxyConnector with source " + proxyConnector.getSourceRepoId() + " and target "
+                    + proxyConnector.getTargetRepoId() );
+        }
+        configuration.removeProxyConnector( proxyConnectorConfiguration );
+        saveConfiguration( configuration );
+        triggerAuditEvent( proxyConnector.getSourceRepoId() + "-" + proxyConnector.getTargetRepoId(), null,
+                           AuditEvent.DELETE_PROXY_CONNECTOR, auditInformation );
+        return Boolean.TRUE;
+    }
+
+    public Boolean updateProxyConnector( ProxyConnector proxyConnector, AuditInformation auditInformation )
+        throws RepositoryAdminException
+    {
+        Configuration configuration = getArchivaConfiguration().getConfiguration();
+        ProxyConnectorConfiguration proxyConnectorConfiguration =
+            findProxyConnector( proxyConnector.getSourceRepoId(), proxyConnector.getTargetRepoId(), configuration );
+        configuration.removeProxyConnector( proxyConnectorConfiguration );
+        configuration.addProxyConnector( getProxyConnectorConfiguration( proxyConnector ) );
+        triggerAuditEvent( proxyConnector.getSourceRepoId() + "-" + proxyConnector.getTargetRepoId(), null,
+                           AuditEvent.MODIFY_PROXY_CONNECTOR, auditInformation );
+        return Boolean.TRUE;
+    }
+
+    protected List unescapePatterns( List patterns )
+    {
+        List rawPatterns = new ArrayList();
+        if ( patterns != null )
+        {
+            for ( String pattern : patterns )
+            {
+                rawPatterns.add( StringUtils.replace( pattern, "\\\\", "\\" ) );
+            }
+        }
+
+        return rawPatterns;
+    }
+
+    public Map> getProxyConnectorAsMap()
+        throws RepositoryAdminException
+    {
+        Map> proxyConnectorMap = new HashMap>();
+
+        Iterator it = getProxyConnectors().iterator();
+        while ( it.hasNext() )
+        {
+            ProxyConnector proxyConfig = it.next();
+            String key = proxyConfig.getSourceRepoId();
+
+            List connectors = proxyConnectorMap.get( key );
+            if ( connectors == null )
+            {
+                connectors = new ArrayList();
+                proxyConnectorMap.put( key, connectors );
+            }
+
+            connectors.add( proxyConfig );
+
+            Collections.sort( connectors, ProxyConnectorOrderComparator.getInstance() );
+        }
+
+        return proxyConnectorMap;
+    }
+
+    private ProxyConnectorConfiguration findProxyConnector( String sourceId, String targetId,
+                                                            Configuration configuration )
+    {
+        if ( StringUtils.isBlank( sourceId ) )
+        {
+            return null;
+        }
+
+        if ( StringUtils.isBlank( targetId ) )
+        {
+            return null;
+        }
+
+        ProxyConnectorSelectionPredicate selectedProxy = new ProxyConnectorSelectionPredicate( sourceId, targetId );
+        return (ProxyConnectorConfiguration) CollectionUtils.find( configuration.getProxyConnectors(), selectedProxy );
+    }
+
+    protected ProxyConnectorConfiguration getProxyConnectorConfiguration( ProxyConnector proxyConnector )
+    {
+        /*
+        ProxyConnectorConfiguration proxyConnectorConfiguration = new ProxyConnectorConfiguration();
+        proxyConnectorConfiguration.setOrder( proxyConnector.getOrder() );
+        proxyConnectorConfiguration.setBlackListPatterns(
+            new ArrayList( proxyConnector.getBlackListPatterns() ) );
+        proxyConnectorConfiguration.setWhiteListPatterns(
+            new ArrayList( proxyConnector.getWhiteListPatterns() ) );
+        proxyConnectorConfiguration.setDisabled( proxyConnector.isDisabled() );
+        proxyConnectorConfiguration.setPolicies( new HashMap( proxyConnector.getPolicies() ) );
+        proxyConnectorConfiguration.setProperties( new HashMap( proxyConnector.getProperties() ) );
+        proxyConnectorConfiguration.setProxyId( proxyConnector.getProxyId() );
+        proxyConnectorConfiguration.setSourceRepoId( proxyConnector.getSourceRepoId() );
+        proxyConnectorConfiguration.setTargetRepoId( proxyConnector.getTargetRepoId() );
+        return proxyConnectorConfiguration;*/
+
+        return proxyConnector == null
+            ? null
+            : new BeanReplicator().replicateBean( proxyConnector, ProxyConnectorConfiguration.class );
+    }
+
+    protected ProxyConnector getProxyConnector( ProxyConnectorConfiguration proxyConnectorConfiguration )
+    {
+        return proxyConnectorConfiguration == null
+            ? null
+            : new BeanReplicator().replicateBean( proxyConnectorConfiguration, ProxyConnector.class );
+    }
+
+    protected void validateProxyConnector( ProxyConnector proxyConnector )
+        throws RepositoryAdminException
+    {
+        // validate source a Managed target a Remote
+        if ( managedRepositoryAdmin.getManagedRepository( proxyConnector.getSourceRepoId() ) == null )
+        {
+            throw new RepositoryAdminException(
+                "non valid ProxyConnector sourceRepo with id " + proxyConnector.getSourceRepoId()
+                    + " is not a ManagedRepository" );
+        }
+        if ( remoteRepositoryAdmin.getRemoteRepository( proxyConnector.getTargetRepoId() ) == null )
+        {
+            throw new RepositoryAdminException(
+                "non valid ProxyConnector sourceRepo with id " + proxyConnector.getTargetRepoId()
+                    + " is not a RemoteRepository" );
+        }
+
+        // FIXME validate NetworkProxyConfiguration too when available
+    }
+}
diff --git a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/remote/DefaultRemoteRepositoryAdmin.java b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/remote/DefaultRemoteRepositoryAdmin.java
new file mode 100644
index 000000000..b2c48e170
--- /dev/null
+++ b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/remote/DefaultRemoteRepositoryAdmin.java
@@ -0,0 +1,192 @@
+package org.apache.archiva.admin.repository.remote;
+/*
+ * 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.remote.RemoteRepository;
+import org.apache.archiva.admin.model.remote.RemoteRepositoryAdmin;
+import org.apache.archiva.admin.repository.AbstractRepositoryAdmin;
+import org.apache.archiva.audit.AuditEvent;
+import org.apache.commons.lang.StringUtils;
+import org.apache.maven.archiva.configuration.Configuration;
+import org.apache.maven.archiva.configuration.ProxyConnectorConfiguration;
+import org.apache.maven.archiva.configuration.RemoteRepositoryConfiguration;
+import org.springframework.stereotype.Service;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author Olivier Lamy
+ * @since 1.4
+ */
+@Service( "remoteRepositoryAdmin#default" )
+public class DefaultRemoteRepositoryAdmin
+    extends AbstractRepositoryAdmin
+    implements RemoteRepositoryAdmin
+{
+
+
+    public List getRemoteRepositories()
+        throws RepositoryAdminException
+    {
+        List remoteRepositories = new ArrayList();
+        for ( RemoteRepositoryConfiguration repositoryConfiguration : getArchivaConfiguration().getConfiguration().getRemoteRepositories() )
+        {
+            remoteRepositories.add(
+                new RemoteRepository( repositoryConfiguration.getId(), repositoryConfiguration.getName(),
+                                      repositoryConfiguration.getUrl(), repositoryConfiguration.getLayout(),
+                                      repositoryConfiguration.getUsername(), repositoryConfiguration.getPassword(),
+                                      repositoryConfiguration.getTimeout() ) );
+        }
+        return remoteRepositories;
+    }
+
+    public RemoteRepository getRemoteRepository( String repositoryId )
+        throws RepositoryAdminException
+    {
+        for ( RemoteRepository remoteRepository : getRemoteRepositories() )
+        {
+            if ( StringUtils.equals( repositoryId, remoteRepository.getId() ) )
+            {
+                return remoteRepository;
+            }
+        }
+        return null;
+    }
+
+    public Boolean addRemoteRepository( RemoteRepository remoteRepository, AuditInformation auditInformation )
+        throws RepositoryAdminException
+    {
+        triggerAuditEvent( remoteRepository.getId(), null, AuditEvent.ADD_REMOTE_REPO, auditInformation );
+        getRepositoryCommonValidator().basicValidation( remoteRepository, false );
+
+        //TODO we can validate it's a good uri/url
+        if ( StringUtils.isEmpty( remoteRepository.getUrl() ) )
+        {
+            throw new RepositoryAdminException( "url cannot be null" );
+        }
+
+        //MRM-752 - url needs trimming
+        remoteRepository.setUrl( StringUtils.trim( remoteRepository.getUrl() ) );
+
+        RemoteRepositoryConfiguration remoteRepositoryConfiguration =
+            getRemoteRepositoryConfiguration( remoteRepository );
+
+        Configuration configuration = getArchivaConfiguration().getConfiguration();
+        configuration.addRemoteRepository( remoteRepositoryConfiguration );
+        saveConfiguration( configuration );
+
+        return Boolean.TRUE;
+    }
+
+    public Boolean deleteRemoteRepository( String repositoryId, AuditInformation auditInformation )
+        throws RepositoryAdminException
+    {
+
+        triggerAuditEvent( repositoryId, null, AuditEvent.DELETE_REMOTE_REPO, auditInformation );
+
+        Configuration configuration = getArchivaConfiguration().getConfiguration();
+
+        RemoteRepositoryConfiguration remoteRepositoryConfiguration =
+            configuration.getRemoteRepositoriesAsMap().get( repositoryId );
+        if ( remoteRepositoryConfiguration == null )
+        {
+            throw new RepositoryAdminException(
+                "remoteRepository with id " + repositoryId + " not exist cannot remove it" );
+        }
+
+        configuration.removeRemoteRepository( remoteRepositoryConfiguration );
+
+        // TODO use ProxyConnectorAdmin interface ?
+        // [MRM-520] Proxy Connectors are not deleted with the deletion of a Repository.
+        List proxyConnectors =
+            new ArrayList( configuration.getProxyConnectors() );
+        for ( ProxyConnectorConfiguration proxyConnector : proxyConnectors )
+        {
+            if ( StringUtils.equals( proxyConnector.getTargetRepoId(), repositoryId ) )
+            {
+                configuration.removeProxyConnector( proxyConnector );
+            }
+        }
+
+        saveConfiguration( configuration );
+
+        return Boolean.TRUE;
+    }
+
+    public Boolean updateRemoteRepository( RemoteRepository remoteRepository, AuditInformation auditInformation )
+        throws RepositoryAdminException
+    {
+
+        String repositoryId = remoteRepository.getId();
+
+        triggerAuditEvent( repositoryId, null, AuditEvent.MODIFY_REMOTE_REPO, auditInformation );
+
+        // update means : remove and add
+
+        Configuration configuration = getArchivaConfiguration().getConfiguration();
+
+        RemoteRepositoryConfiguration remoteRepositoryConfiguration =
+            configuration.getRemoteRepositoriesAsMap().get( repositoryId );
+        if ( remoteRepositoryConfiguration == null )
+        {
+            throw new RepositoryAdminException(
+                "remoteRepository with id " + repositoryId + " not exist cannot remove it" );
+        }
+
+        configuration.removeRemoteRepository( remoteRepositoryConfiguration );
+
+        remoteRepositoryConfiguration = getRemoteRepositoryConfiguration( remoteRepository );
+        configuration.addRemoteRepository( remoteRepositoryConfiguration );
+        saveConfiguration( configuration );
+
+        return Boolean.TRUE;
+    }
+
+    public Map getRemoteRepositoriesAsMap()
+        throws RepositoryAdminException
+    {
+        java.util.Map map = new HashMap();
+
+        for ( RemoteRepository repo : getRemoteRepositories() )
+        {
+            map.put( repo.getId(), repo );
+        }
+
+        return map;
+    }
+
+    private RemoteRepositoryConfiguration getRemoteRepositoryConfiguration( RemoteRepository remoteRepository )
+    {
+        RemoteRepositoryConfiguration remoteRepositoryConfiguration = new RemoteRepositoryConfiguration();
+        remoteRepositoryConfiguration.setId( remoteRepository.getId() );
+        remoteRepositoryConfiguration.setPassword( remoteRepository.getPassword() );
+        remoteRepositoryConfiguration.setTimeout( remoteRepository.getTimeout() );
+        remoteRepositoryConfiguration.setUrl( remoteRepository.getUrl() );
+        remoteRepositoryConfiguration.setUsername( remoteRepository.getUserName() );
+        remoteRepositoryConfiguration.setLayout( remoteRepository.getLayout() );
+        remoteRepositoryConfiguration.setName( remoteRepository.getName() );
+        return remoteRepositoryConfiguration;
+    }
+
+}
diff --git a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/utils/RepositoryComparator.java b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/utils/RepositoryComparator.java
new file mode 100644
index 000000000..c65c2308d
--- /dev/null
+++ b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/utils/RepositoryComparator.java
@@ -0,0 +1,51 @@
+package org.apache.archiva.admin.repository.utils;
+/*
+ * 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.AbstractRepository;
+
+import java.util.Comparator;
+
+/**
+ * @author Olivier Lamy
+ * @since 1.4
+ */
+public class RepositoryComparator
+    implements Comparator
+{
+    public int compare( AbstractRepository o1, AbstractRepository o2 )
+    {
+        if ( o1 == null && o2 == null )
+        {
+            return 0;
+        }
+
+        if ( o1 == null )
+        {
+            return -1;
+        }
+
+        if ( o2 == null )
+        {
+            return 1;
+        }
+
+        return o1.getId().compareToIgnoreCase( o2.getId() );
+    }
+}
diff --git a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/resources/META-INF/spring-context.xml b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/resources/META-INF/spring-context.xml
new file mode 100644
index 000000000..3a9866691
--- /dev/null
+++ b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/resources/META-INF/spring-context.xml
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+  
+  
+
+
+
+
\ No newline at end of file
diff --git a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/test/java/org/apache/archiva/admin/mock/MockAuditListener.java b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/test/java/org/apache/archiva/admin/mock/MockAuditListener.java
new file mode 100644
index 000000000..42387a64d
--- /dev/null
+++ b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/test/java/org/apache/archiva/admin/mock/MockAuditListener.java
@@ -0,0 +1,52 @@
+package org.apache.archiva.admin.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.audit.AuditEvent;
+import org.apache.archiva.audit.AuditListener;
+import org.springframework.stereotype.Service;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author Olivier Lamy
+ */
+@Service( "auditListener#mock" )
+public class MockAuditListener
+    implements AuditListener
+{
+
+    private List auditEvents = new ArrayList();
+
+    public void auditEvent( AuditEvent event )
+    {
+        auditEvents.add( event );
+    }
+
+    public List getAuditEvents()
+    {
+        return auditEvents;
+    }
+
+    public void clearEvents()
+    {
+        auditEvents.clear();
+    }
+}
diff --git a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/test/java/org/apache/archiva/admin/repository/AbstractRepositoryAdminTest.java b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/test/java/org/apache/archiva/admin/repository/AbstractRepositoryAdminTest.java
new file mode 100644
index 000000000..254783779
--- /dev/null
+++ b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/test/java/org/apache/archiva/admin/repository/AbstractRepositoryAdminTest.java
@@ -0,0 +1,140 @@
+package org.apache.archiva.admin.repository;
+/*
+ * 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 junit.framework.TestCase;
+import org.apache.archiva.admin.mock.MockAuditListener;
+import org.apache.archiva.admin.model.AuditInformation;
+import org.apache.archiva.admin.model.managed.ManagedRepository;
+import org.apache.archiva.admin.model.managed.ManagedRepositoryAdmin;
+import org.apache.archiva.admin.model.proxyconnector.ProxyConnectorAdmin;
+import org.apache.archiva.admin.model.remote.RemoteRepository;
+import org.apache.archiva.admin.model.remote.RemoteRepositoryAdmin;
+import org.apache.commons.io.FileUtils;
+import org.apache.commons.lang.StringUtils;
+import org.codehaus.plexus.redback.role.RoleManager;
+import org.codehaus.plexus.redback.users.User;
+import org.codehaus.plexus.redback.users.memory.SimpleUser;
+import org.junit.runner.RunWith;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.test.context.ContextConfiguration;
+import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
+
+import javax.inject.Inject;
+import java.io.File;
+import java.util.List;
+
+/**
+ * @author Olivier Lamy
+ */
+@RunWith( SpringJUnit4ClassRunner.class )
+@ContextConfiguration( locations = { "classpath*:/META-INF/spring-context.xml", "classpath:/spring-context.xml" } )
+public abstract class AbstractRepositoryAdminTest
+    extends TestCase
+{
+    protected Logger log = LoggerFactory.getLogger( getClass() );
+
+    public static final String APPSERVER_BASE_PATH = System.getProperty( "appserver.base" );
+
+    @Inject
+    protected MockAuditListener mockAuditListener;
+
+    @Inject
+    protected RoleManager roleManager;
+
+    @Inject
+    protected RemoteRepositoryAdmin remoteRepositoryAdmin;
+
+    @Inject
+    protected ManagedRepositoryAdmin managedRepositoryAdmin;
+
+    @Inject
+    protected ProxyConnectorAdmin proxyConnectorAdmin;
+
+    protected AuditInformation getFakeAuditInformation()
+    {
+        AuditInformation auditInformation = new AuditInformation( getFakeUser(), "archiva-localhost" );
+        return auditInformation;
+    }
+
+    protected User getFakeUser()
+    {
+        SimpleUser user = new SimpleUser()
+        {
+            @Override
+            public Object getPrincipal()
+            {
+                return "root";
+            }
+
+        };
+
+        user.setUsername( "root" );
+        user.setFullName( "The top user" );
+        return user;
+    }
+
+    protected ManagedRepository getTestManagedRepository( String repoId, String repoLocation )
+    {
+        return new ManagedRepository( repoId, "test repo", repoLocation, "default", false, true, true, "0 0 * * * ?",
+                                      repoLocation + "/.index", false, 1, 2, true );
+    }
+
+    protected File clearRepoLocation( String path )
+        throws Exception
+    {
+        File repoDir = new File( path );
+        if ( repoDir.exists() )
+        {
+            FileUtils.deleteDirectory( repoDir );
+        }
+        assertFalse( repoDir.exists() );
+        return repoDir;
+    }
+
+    protected ManagedRepository findManagedRepoById( List repos, String id )
+    {
+        for ( ManagedRepository repo : repos )
+        {
+            if ( StringUtils.equals( id, repo.getId() ) )
+            {
+                return repo;
+            }
+        }
+        return null;
+    }
+
+    protected RemoteRepository getRemoteRepository()
+    {
+        return getRemoteRepository( "foo" );
+    }
+
+    protected RemoteRepository getRemoteRepository(String id)
+    {
+        RemoteRepository remoteRepository = new RemoteRepository();
+        remoteRepository.setUrl( "http://foo.com/maven-it-rocks" );
+        remoteRepository.setTimeout( 10 );
+        remoteRepository.setName( "maven foo" );
+        remoteRepository.setUserName( "foo-name" );
+        remoteRepository.setPassword( "toto" );
+        remoteRepository.setId( id );
+        return remoteRepository;
+    }
+}
diff --git a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/test/java/org/apache/archiva/admin/repository/admin/ArchivaAdministrationTest.java b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/test/java/org/apache/archiva/admin/repository/admin/ArchivaAdministrationTest.java
new file mode 100644
index 000000000..2b8a1ce31
--- /dev/null
+++ b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/test/java/org/apache/archiva/admin/repository/admin/ArchivaAdministrationTest.java
@@ -0,0 +1,194 @@
+package org.apache.archiva.admin.repository.admin;
+/*
+ * 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.RepositoryAdminException;
+import org.apache.archiva.admin.model.admin.ArchivaAdministration;
+import org.apache.archiva.admin.model.admin.FileType;
+import org.apache.archiva.admin.model.admin.LegacyArtifactPath;
+import org.apache.archiva.admin.model.admin.OrganisationInformation;
+import org.apache.archiva.admin.repository.AbstractRepositoryAdminTest;
+import org.apache.archiva.audit.AuditEvent;
+import org.junit.Test;
+
+import javax.inject.Inject;
+import java.util.Arrays;
+
+/**
+ * @author Olivier Lamy
+ */
+public class ArchivaAdministrationTest
+    extends AbstractRepositoryAdminTest
+{
+    @Inject
+    ArchivaAdministration archivaAdministration;
+
+
+    @Test
+    public void getAllLegacyPaths()
+        throws Exception
+    {
+        assertNotNull( archivaAdministration.getLegacyArtifactPaths() );
+        assertFalse( archivaAdministration.getLegacyArtifactPaths().isEmpty() );
+        assertEquals( 1, archivaAdministration.getLegacyArtifactPaths().size() );
+        log.info( "all legacy paths {}", archivaAdministration.getLegacyArtifactPaths() );
+    }
+
+    public void addAndDeleteLegacyPath()
+        throws Exception
+    {
+        int initialSize = archivaAdministration.getLegacyArtifactPaths().size();
+
+        LegacyArtifactPath legacyArtifactPath = new LegacyArtifactPath( "foo", "bar" );
+        archivaAdministration.addLegacyArtifactPath( legacyArtifactPath, getFakeAuditInformation() );
+
+        assertTrue( archivaAdministration.getLegacyArtifactPaths().contains( new LegacyArtifactPath( "foo", "bar" ) ) );
+        assertEquals( initialSize + 1, archivaAdministration.getLegacyArtifactPaths().size() );
+
+        archivaAdministration.deleteLegacyArtifactPath( legacyArtifactPath.getPath(), getFakeAuditInformation() );
+
+        assertFalse(
+            archivaAdministration.getLegacyArtifactPaths().contains( new LegacyArtifactPath( "foo", "bar" ) ) );
+        assertEquals( initialSize, archivaAdministration.getLegacyArtifactPaths().size() );
+        mockAuditListener.clearEvents();
+    }
+
+    @Test
+    public void addAndUpdateAndDeleteFileType()
+        throws RepositoryAdminException
+    {
+        int initialSize = archivaAdministration.getFileTypes().size();
+
+        FileType fileType = new FileType();
+        fileType.setId( "foo" );
+        fileType.setPatterns( Arrays.asList( "bar", "toto" ) );
+
+        archivaAdministration.addFileType( fileType, getFakeAuditInformation() );
+
+        assertEquals( initialSize + 1, archivaAdministration.getFileTypes().size() );
+
+        archivaAdministration.addFileTypePattern( "foo", "zorro", getFakeAuditInformation() );
+
+        assertEquals( initialSize + 1, archivaAdministration.getFileTypes().size() );
+
+        assertEquals( 3, archivaAdministration.getFileType( "foo" ).getPatterns().size() );
+
+        assertTrue( archivaAdministration.getFileType( "foo" ).getPatterns().contains( "bar" ) );
+        assertTrue( archivaAdministration.getFileType( "foo" ).getPatterns().contains( "toto" ) );
+        assertTrue( archivaAdministration.getFileType( "foo" ).getPatterns().contains( "zorro" ) );
+
+        archivaAdministration.removeFileTypePattern( "foo", "zorro", getFakeAuditInformation() );
+
+        assertEquals( initialSize + 1, archivaAdministration.getFileTypes().size() );
+
+        assertEquals( 2, archivaAdministration.getFileType( "foo" ).getPatterns().size() );
+
+        assertTrue( archivaAdministration.getFileType( "foo" ).getPatterns().contains( "bar" ) );
+        assertTrue( archivaAdministration.getFileType( "foo" ).getPatterns().contains( "toto" ) );
+        assertFalse( archivaAdministration.getFileType( "foo" ).getPatterns().contains( "zorro" ) );
+
+        archivaAdministration.removeFileType( "foo", getFakeAuditInformation() );
+
+        assertEquals( initialSize, archivaAdministration.getFileTypes().size() );
+        assertNull( archivaAdministration.getFileType( "foo" ) );
+        mockAuditListener.clearEvents();
+    }
+
+    @Test
+    public void knownContentConsumersTest()
+        throws Exception
+    {
+        int initialSize = archivaAdministration.getKnownContentConsumers().size();
+
+        archivaAdministration.addKnownContentConsumer( "foo", getFakeAuditInformation() );
+
+        assertEquals( initialSize + 1, archivaAdministration.getKnownContentConsumers().size() );
+        assertTrue( archivaAdministration.getKnownContentConsumers().contains( "foo" ) );
+
+        // ensure we don't add it twice as it's an ArrayList as storage
+        archivaAdministration.addKnownContentConsumer( "foo", getFakeAuditInformation() );
+
+        assertEquals( initialSize + 1, archivaAdministration.getKnownContentConsumers().size() );
+        assertTrue( archivaAdministration.getKnownContentConsumers().contains( "foo" ) );
+
+        archivaAdministration.removeKnownContentConsumer( "foo", getFakeAuditInformation() );
+
+        assertEquals( initialSize, archivaAdministration.getKnownContentConsumers().size() );
+        assertFalse( archivaAdministration.getKnownContentConsumers().contains( "foo" ) );
+
+        assertEquals( 2, mockAuditListener.getAuditEvents().size() );
+        assertEquals( AuditEvent.ENABLE_REPO_CONSUMER, mockAuditListener.getAuditEvents().get( 0 ).getAction() );
+        assertEquals( AuditEvent.DISABLE_REPO_CONSUMER, mockAuditListener.getAuditEvents().get( 1 ).getAction() );
+
+        mockAuditListener.clearEvents();
+
+    }
+
+    @Test
+    public void invalidContentConsumersTest()
+        throws Exception
+    {
+        int initialSize = archivaAdministration.getInvalidContentConsumers().size();
+
+        archivaAdministration.addInvalidContentConsumer( "foo", getFakeAuditInformation() );
+
+        assertEquals( initialSize + 1, archivaAdministration.getInvalidContentConsumers().size() );
+        assertTrue( archivaAdministration.getInvalidContentConsumers().contains( "foo" ) );
+
+        // ensure we don't add it twice as it's an ArrayList as storage
+        archivaAdministration.addInvalidContentConsumer( "foo", getFakeAuditInformation() );
+
+        assertEquals( initialSize + 1, archivaAdministration.getInvalidContentConsumers().size() );
+        assertTrue( archivaAdministration.getInvalidContentConsumers().contains( "foo" ) );
+
+        archivaAdministration.removeInvalidContentConsumer( "foo", getFakeAuditInformation() );
+
+        assertEquals( initialSize, archivaAdministration.getInvalidContentConsumers().size() );
+        assertFalse( archivaAdministration.getInvalidContentConsumers().contains( "foo" ) );
+
+        assertEquals( 2, mockAuditListener.getAuditEvents().size() );
+        assertEquals( AuditEvent.ENABLE_REPO_CONSUMER, mockAuditListener.getAuditEvents().get( 0 ).getAction() );
+        assertEquals( AuditEvent.DISABLE_REPO_CONSUMER, mockAuditListener.getAuditEvents().get( 1 ).getAction() );
+
+        mockAuditListener.clearEvents();
+
+    }
+
+
+    public void organisationInfoUpdate()
+        throws Exception
+    {
+        OrganisationInformation organisationInformation = archivaAdministration.getOrganisationInformation();
+        assertNull( organisationInformation );
+
+        organisationInformation = new OrganisationInformation();
+        organisationInformation.setLogoLocation( "http://foo.com/bar.png" );
+        organisationInformation.setName( "foo org" );
+        organisationInformation.setUrl( "http:/foo.com" );
+
+        archivaAdministration.setOrganisationInformation( organisationInformation );
+
+        organisationInformation = archivaAdministration.getOrganisationInformation();
+        assertNotNull( organisationInformation );
+        assertEquals( "http://foo.com/bar.png", organisationInformation.getLogoLocation() );
+        assertEquals( "foo org", organisationInformation.getName() );
+        assertEquals( "http://foo.com", organisationInformation.getUrl() );
+
+    }
+}
diff --git a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/test/java/org/apache/archiva/admin/repository/group/RepositoryGroupAdminTest.java b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/test/java/org/apache/archiva/admin/repository/group/RepositoryGroupAdminTest.java
new file mode 100644
index 000000000..465f21fe7
--- /dev/null
+++ b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/test/java/org/apache/archiva/admin/repository/group/RepositoryGroupAdminTest.java
@@ -0,0 +1,202 @@
+package org.apache.archiva.admin.repository.group;
+/*
+ * 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.group.RepositoryGroup;
+import org.apache.archiva.admin.model.group.RepositoryGroupAdmin;
+import org.apache.archiva.admin.model.managed.ManagedRepository;
+import org.apache.archiva.admin.repository.AbstractRepositoryAdminTest;
+import org.apache.archiva.audit.AuditEvent;
+import org.junit.Test;
+
+import javax.inject.Inject;
+import java.io.File;
+import java.util.Arrays;
+
+/**
+ * @author Olivier Lamy
+ */
+public class RepositoryGroupAdminTest
+    extends AbstractRepositoryAdminTest
+{
+    @Inject
+    RepositoryGroupAdmin repositoryGroupAdmin;
+
+    @Test
+    public void addAndDeleteGroup()
+        throws Exception
+    {
+        try
+        {
+            ManagedRepository managedRepositoryOne =
+                getTestManagedRepository( "test-new-one", APPSERVER_BASE_PATH + File.separator + "test-new-one" );
+
+            ManagedRepository managedRepositoryTwo =
+                getTestManagedRepository( "test-new-two", APPSERVER_BASE_PATH + File.separator + "test-new-two" );
+
+            managedRepositoryAdmin.addManagedRepository( managedRepositoryOne, false, getFakeAuditInformation() );
+
+            managedRepositoryAdmin.addManagedRepository( managedRepositoryTwo, false, getFakeAuditInformation() );
+
+            RepositoryGroup repositoryGroup =
+                new RepositoryGroup( "repo-group-one", Arrays.asList( "test-new-one", "test-new-two" ) );
+
+            mockAuditListener.clearEvents();
+
+            repositoryGroupAdmin.addRepositoryGroup( repositoryGroup, getFakeAuditInformation() );
+
+            assertEquals( 1, repositoryGroupAdmin.getRepositoriesGroups().size() );
+            assertEquals( "repo-group-one", repositoryGroupAdmin.getRepositoriesGroups().get( 0 ).getId() );
+            assertEquals( 2, repositoryGroupAdmin.getRepositoriesGroups().get( 0 ).getRepositories().size() );
+            assertEquals( Arrays.asList( "test-new-one", "test-new-two" ),
+                          repositoryGroupAdmin.getRepositoriesGroups().get( 0 ).getRepositories() );
+
+            repositoryGroupAdmin.deleteRepositoryGroup( "repo-group-one", getFakeAuditInformation() );
+
+            assertEquals( 0, repositoryGroupAdmin.getRepositoriesGroups().size() );
+
+            assertEquals( 2, mockAuditListener.getAuditEvents().size() );
+
+            assertEquals( AuditEvent.ADD_REPO_GROUP, mockAuditListener.getAuditEvents().get( 0 ).getAction() );
+            assertEquals( AuditEvent.DELETE_REPO_GROUP, mockAuditListener.getAuditEvents().get( 1 ).getAction() );
+        }
+        finally
+        {
+            mockAuditListener.clearEvents();
+            managedRepositoryAdmin.deleteManagedRepository( "test-new-one", getFakeAuditInformation(), true );
+            managedRepositoryAdmin.deleteManagedRepository( "test-new-two", getFakeAuditInformation(), true );
+        }
+    }
+
+    @Test
+    public void addAndUpdateAndDeleteGroup()
+        throws Exception
+    {
+        try
+        {
+            ManagedRepository managedRepositoryOne =
+                getTestManagedRepository( "test-new-one", APPSERVER_BASE_PATH + File.separator + "test-new-one" );
+
+            ManagedRepository managedRepositoryTwo =
+                getTestManagedRepository( "test-new-two", APPSERVER_BASE_PATH + File.separator + "test-new-two" );
+
+            managedRepositoryAdmin.addManagedRepository( managedRepositoryOne, false, getFakeAuditInformation() );
+
+            managedRepositoryAdmin.addManagedRepository( managedRepositoryTwo, false, getFakeAuditInformation() );
+
+            RepositoryGroup repositoryGroup = new RepositoryGroup( "repo-group-one", Arrays.asList( "test-new-one" ) );
+
+            mockAuditListener.clearEvents();
+
+            repositoryGroupAdmin.addRepositoryGroup( repositoryGroup, getFakeAuditInformation() );
+
+            assertEquals( 1, repositoryGroupAdmin.getRepositoriesGroups().size() );
+            assertEquals( "repo-group-one", repositoryGroupAdmin.getRepositoriesGroups().get( 0 ).getId() );
+            assertEquals( 1, repositoryGroupAdmin.getRepositoriesGroups().get( 0 ).getRepositories().size() );
+            assertEquals( Arrays.asList( "test-new-one" ),
+                          repositoryGroupAdmin.getRepositoriesGroups().get( 0 ).getRepositories() );
+
+            repositoryGroup = repositoryGroupAdmin.getRepositoryGroup( "repo-group-one" );
+            assertNotNull( repositoryGroup );
+
+            repositoryGroup.addRepository( managedRepositoryTwo.getId() );
+
+            repositoryGroupAdmin.updateRepositoryGroup( repositoryGroup, getFakeAuditInformation() );
+
+            assertEquals( 1, repositoryGroupAdmin.getRepositoriesGroups().size() );
+            assertEquals( "repo-group-one", repositoryGroupAdmin.getRepositoriesGroups().get( 0 ).getId() );
+            assertEquals( 2, repositoryGroupAdmin.getRepositoriesGroups().get( 0 ).getRepositories().size() );
+            assertEquals( Arrays.asList( "test-new-one", "test-new-two" ),
+                          repositoryGroupAdmin.getRepositoriesGroups().get( 0 ).getRepositories() );
+
+            repositoryGroupAdmin.deleteRepositoryGroup( "repo-group-one", getFakeAuditInformation() );
+
+            assertEquals( 0, repositoryGroupAdmin.getRepositoriesGroups().size() );
+
+            assertEquals( 3, mockAuditListener.getAuditEvents().size() );
+
+            assertEquals( AuditEvent.ADD_REPO_GROUP, mockAuditListener.getAuditEvents().get( 0 ).getAction() );
+            assertEquals( AuditEvent.MODIFY_REPO_GROUP, mockAuditListener.getAuditEvents().get( 1 ).getAction() );
+            assertEquals( AuditEvent.DELETE_REPO_GROUP, mockAuditListener.getAuditEvents().get( 2 ).getAction() );
+        }
+        finally
+        {
+            mockAuditListener.clearEvents();
+            managedRepositoryAdmin.deleteManagedRepository( "test-new-one", getFakeAuditInformation(), true );
+            managedRepositoryAdmin.deleteManagedRepository( "test-new-two", getFakeAuditInformation(), true );
+        }
+    }
+
+
+    @Test
+    public void addAndDeleteGroupWithRemowingManagedRepo()
+        throws Exception
+    {
+        try
+        {
+            ManagedRepository managedRepositoryOne =
+                getTestManagedRepository( "test-new-one", APPSERVER_BASE_PATH + File.separator + "test-new-one" );
+
+            ManagedRepository managedRepositoryTwo =
+                getTestManagedRepository( "test-new-two", APPSERVER_BASE_PATH + File.separator + "test-new-two" );
+
+            managedRepositoryAdmin.addManagedRepository( managedRepositoryOne, false, getFakeAuditInformation() );
+
+            managedRepositoryAdmin.addManagedRepository( managedRepositoryTwo, false, getFakeAuditInformation() );
+
+            RepositoryGroup repositoryGroup =
+                new RepositoryGroup( "repo-group-one", Arrays.asList( "test-new-one", "test-new-two" ) );
+
+            mockAuditListener.clearEvents();
+
+            repositoryGroupAdmin.addRepositoryGroup( repositoryGroup, getFakeAuditInformation() );
+
+            assertEquals( 1, repositoryGroupAdmin.getRepositoriesGroups().size() );
+            assertEquals( "repo-group-one", repositoryGroupAdmin.getRepositoriesGroups().get( 0 ).getId() );
+            assertEquals( 2, repositoryGroupAdmin.getRepositoriesGroups().get( 0 ).getRepositories().size() );
+            assertEquals( Arrays.asList( "test-new-one", "test-new-two" ),
+                          repositoryGroupAdmin.getRepositoriesGroups().get( 0 ).getRepositories() );
+
+            // deleting a managed repo to validate repogroup correctly updated !
+            managedRepositoryAdmin.deleteManagedRepository( "test-new-one", getFakeAuditInformation(), true );
+
+            assertEquals( 1, repositoryGroupAdmin.getRepositoriesGroups().size() );
+            assertEquals( "repo-group-one", repositoryGroupAdmin.getRepositoriesGroups().get( 0 ).getId() );
+            assertEquals( 1, repositoryGroupAdmin.getRepositoriesGroups().get( 0 ).getRepositories().size() );
+            assertEquals( Arrays.asList( "test-new-two" ),
+                          repositoryGroupAdmin.getRepositoriesGroups().get( 0 ).getRepositories() );
+
+            repositoryGroupAdmin.deleteRepositoryGroup( "repo-group-one", getFakeAuditInformation() );
+
+            assertEquals( 0, repositoryGroupAdmin.getRepositoriesGroups().size() );
+
+            assertEquals( 3, mockAuditListener.getAuditEvents().size() );
+
+            assertEquals( AuditEvent.ADD_REPO_GROUP, mockAuditListener.getAuditEvents().get( 0 ).getAction() );
+            assertEquals( AuditEvent.DELETE_MANAGED_REPO, mockAuditListener.getAuditEvents().get( 1 ).getAction() );
+            assertEquals( AuditEvent.DELETE_REPO_GROUP, mockAuditListener.getAuditEvents().get( 2 ).getAction() );
+        }
+        finally
+        {
+            mockAuditListener.clearEvents();
+
+            managedRepositoryAdmin.deleteManagedRepository( "test-new-two", getFakeAuditInformation(), true );
+        }
+    }
+}
diff --git a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/test/java/org/apache/archiva/admin/repository/managed/ManagedRepositoryAdminTest.java b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/test/java/org/apache/archiva/admin/repository/managed/ManagedRepositoryAdminTest.java
new file mode 100644
index 000000000..9cdf7f2a0
--- /dev/null
+++ b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/test/java/org/apache/archiva/admin/repository/managed/ManagedRepositoryAdminTest.java
@@ -0,0 +1,378 @@
+package org.apache.archiva.admin.repository.managed;
+/*
+ * 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.managed.ManagedRepository;
+import org.apache.archiva.admin.repository.AbstractRepositoryAdminTest;
+import org.apache.archiva.audit.AuditEvent;
+import org.apache.archiva.security.common.ArchivaRoleConstants;
+import org.junit.Test;
+
+import java.io.File;
+import java.util.List;
+
+/**
+ * @author Olivier Lamy
+ */
+public class ManagedRepositoryAdminTest
+    extends AbstractRepositoryAdminTest
+{
+    public static final String STAGE_REPO_ID_END = DefaultManagedRepositoryAdmin.STAGE_REPO_ID_END;
+
+    @Test
+    public void getAllManagedRepos()
+        throws Exception
+    {
+        mockAuditListener.clearEvents();
+        List repos = managedRepositoryAdmin.getManagedRepositories();
+        assertNotNull( repos );
+        assertTrue( repos.size() > 0 );
+        log.info( "repos " + repos );
+
+        // check default internal
+        ManagedRepository internal = findManagedRepoById( repos, "internal" );
+        assertNotNull( internal );
+        assertTrue( internal.isReleases() );
+        assertFalse( internal.isSnapshots() );
+        mockAuditListener.clearEvents();
+    }
+
+    @Test
+    public void getById()
+        throws Exception
+    {
+        mockAuditListener.clearEvents();
+        ManagedRepository repo = managedRepositoryAdmin.getManagedRepository( "internal" );
+        assertNotNull( repo );
+        mockAuditListener.clearEvents();
+    }
+
+    @Test
+    public void addDeleteManagedRepo()
+        throws Exception
+    {
+        mockAuditListener.clearEvents();
+
+        String repoId = "test-new-one";
+
+        String repoLocation = APPSERVER_BASE_PATH + File.separator + repoId;
+
+        File repoDir = clearRepoLocation( repoLocation );
+
+        List repos = managedRepositoryAdmin.getManagedRepositories();
+        assertNotNull( repos );
+        int initialSize = repos.size();
+        assertTrue( initialSize > 0 );
+
+        ManagedRepository repo = new ManagedRepository();
+        repo.setId( repoId );
+        repo.setName( "test repo" );
+        repo.setLocation( repoLocation );
+        repo.setCronExpression( "0 0 * * * ?" );
+        managedRepositoryAdmin.addManagedRepository( repo, false, getFakeAuditInformation() );
+        repos = managedRepositoryAdmin.getManagedRepositories();
+        assertNotNull( repos );
+        assertEquals( initialSize + 1, repos.size() );
+
+        assertNotNull( managedRepositoryAdmin.getManagedRepository( repoId ) );
+
+        assertTemplateRoleExists( repoId );
+
+        managedRepositoryAdmin.deleteManagedRepository( repoId, getFakeAuditInformation(), false );
+
+        // deleteContents false
+        assertTrue( repoDir.exists() );
+
+        repos = managedRepositoryAdmin.getManagedRepositories();
+        assertNotNull( repos );
+        assertEquals( initialSize, repos.size() );
+
+        assertTemplateRoleNotExists( repoId );
+
+        assertEquals( 2, mockAuditListener.getAuditEvents().size() );
+
+        assertAuditListenerCallAddAndDelete();
+
+        mockAuditListener.clearEvents();
+    }
+
+    @Test
+    public void updateDeleteManagedRepo()
+        throws Exception
+    {
+        String repoId = "test-new-one";
+
+        String repoLocation = APPSERVER_BASE_PATH + File.separator + "new-path";
+
+        File repoDir = clearRepoLocation( repoLocation );
+
+        mockAuditListener.clearEvents();
+        List repos = managedRepositoryAdmin.getManagedRepositories();
+        assertNotNull( repos );
+        int initialSize = repos.size();
+        assertTrue( initialSize > 0 );
+
+        ManagedRepository repo = new ManagedRepository();
+        repo.setId( repoId );
+        repo.setName( "test repo" );
+        repo.setLocation( repoLocation );
+        repo.setCronExpression( "0 0 * * * ?" );
+        managedRepositoryAdmin.addManagedRepository( repo, false, getFakeAuditInformation() );
+
+        assertTemplateRoleExists( repoId );
+
+        repos = managedRepositoryAdmin.getManagedRepositories();
+        assertNotNull( repos );
+        assertEquals( initialSize + 1, repos.size() );
+
+        String newName = "test repo update";
+
+        repo.setName( newName );
+
+        repo.setLocation( repoLocation );
+        repo.setCronExpression( "0 0 * * * ?" );
+
+        managedRepositoryAdmin.updateManagedRepository( repo, false, getFakeAuditInformation(), false );
+
+        repo = managedRepositoryAdmin.getManagedRepository( repoId );
+        assertNotNull( repo );
+        assertEquals( newName, repo.getName() );
+        assertEquals( new File( repoLocation ).getCanonicalPath(), new File( repo.getLocation() ).getCanonicalPath() );
+        assertTrue( new File( repoLocation ).exists() );
+
+        assertTemplateRoleExists( repoId );
+
+        managedRepositoryAdmin.deleteManagedRepository( repo.getId(), getFakeAuditInformation(), false );
+
+        // check deleteContents false
+        assertTrue( repoDir.exists() );
+
+        assertTemplateRoleNotExists( repoId );
+
+        assertAuditListenerCallAndUpdateAddAndDelete( false );
+
+        mockAuditListener.clearEvents();
+
+    }
+
+
+    @Test
+    public void addDeleteManagedRepoWithStaged()
+        throws Exception
+    {
+
+        String repoId = "test-new-one";
+        String repoLocation = APPSERVER_BASE_PATH + File.separator + repoId;
+
+        File repoDir = clearRepoLocation( repoLocation );
+
+        mockAuditListener.clearEvents();
+        List repos = managedRepositoryAdmin.getManagedRepositories();
+        assertNotNull( repos );
+        int initialSize = repos.size();
+        assertTrue( initialSize > 0 );
+
+        ManagedRepository repo = new ManagedRepository();
+        repo.setId( repoId );
+        repo.setName( "test repo" );
+        repo.setLocation( repoLocation );
+        repo.setCronExpression( "0 0 * * * ?" );
+        managedRepositoryAdmin.addManagedRepository( repo, true, getFakeAuditInformation() );
+        repos = managedRepositoryAdmin.getManagedRepositories();
+        assertNotNull( repos );
+        assertEquals( initialSize + 2, repos.size() );
+
+        assertNotNull( managedRepositoryAdmin.getManagedRepository( repoId ) );
+
+        assertTemplateRoleExists( repoId );
+
+        assertTrue( repoDir.exists() );
+
+        assertNotNull( managedRepositoryAdmin.getManagedRepository( repoId + STAGE_REPO_ID_END ) );
+
+        assertTemplateRoleExists( repoId + STAGE_REPO_ID_END );
+
+        assertTrue( new File( repoLocation + STAGE_REPO_ID_END ).exists() );
+
+        managedRepositoryAdmin.deleteManagedRepository( repoId, getFakeAuditInformation(), true );
+
+        assertFalse( repoDir.exists() );
+
+        assertFalse( new File( repoLocation + STAGE_REPO_ID_END ).exists() );
+
+        assertTemplateRoleNotExists( repoId + STAGE_REPO_ID_END );
+
+        repos = managedRepositoryAdmin.getManagedRepositories();
+        assertNotNull( repos );
+        assertEquals( initialSize, repos.size() );
+
+        assertTemplateRoleNotExists( repoId );
+
+        assertTemplateRoleNotExists( repoId + STAGE_REPO_ID_END );
+
+        mockAuditListener.clearEvents();
+
+    }
+
+    @Test
+    public void updateDeleteManagedRepoWithStagedRepo()
+        throws Exception
+    {
+        String repoId = "test-new-one";
+
+        String repoLocation = APPSERVER_BASE_PATH + File.separator + "new-path";
+
+        String stageRepoLocation = APPSERVER_BASE_PATH + File.separator + repoId;
+
+        File repoDir = clearRepoLocation( repoLocation );
+
+        mockAuditListener.clearEvents();
+        List repos = managedRepositoryAdmin.getManagedRepositories();
+        assertNotNull( repos );
+        int initialSize = repos.size();
+        assertTrue( initialSize > 0 );
+
+        ManagedRepository repo = getTestManagedRepository( repoId, repoLocation );
+
+        managedRepositoryAdmin.addManagedRepository( repo, false, getFakeAuditInformation() );
+
+        assertTemplateRoleExists( repoId );
+
+        assertFalse( new File( repoLocation + STAGE_REPO_ID_END ).exists() );
+
+        assertTemplateRoleNotExists( repoId + STAGE_REPO_ID_END );
+
+        repos = managedRepositoryAdmin.getManagedRepositories();
+        assertNotNull( repos );
+        assertEquals( initialSize + 1, repos.size() );
+
+        repo = managedRepositoryAdmin.getManagedRepository( repoId );
+
+        assertEquals( getTestManagedRepository( repoId, repoLocation ).getIndexDirectory(), repo.getIndexDirectory() );
+
+        String newName = "test repo update";
+
+        repo.setName( newName );
+
+        repo.setLocation( repoLocation );
+
+        managedRepositoryAdmin.updateManagedRepository( repo, true, getFakeAuditInformation(), false );
+
+        repo = managedRepositoryAdmin.getManagedRepository( repoId );
+        assertNotNull( repo );
+        assertEquals( newName, repo.getName() );
+        assertEquals( new File( repoLocation ).getCanonicalPath(), new File( repo.getLocation() ).getCanonicalPath() );
+        assertTrue( new File( repoLocation ).exists() );
+        assertEquals( getTestManagedRepository( repoId, repoLocation ).getCronExpression(), repo.getCronExpression() );
+        assertEquals( getTestManagedRepository( repoId, repoLocation ).getLayout(), repo.getLayout() );
+        assertEquals( getTestManagedRepository( repoId, repoLocation ).getId(), repo.getId() );
+        assertEquals( getTestManagedRepository( repoId, repoLocation ).getIndexDirectory(), repo.getIndexDirectory() );
+
+        assertEquals( getTestManagedRepository( repoId, repoLocation ).getDaysOlder(), repo.getDaysOlder() );
+        assertEquals( getTestManagedRepository( repoId, repoLocation ).getRetentionCount(), repo.getRetentionCount() );
+        assertEquals( getTestManagedRepository( repoId, repoLocation ).isDeleteReleasedSnapshots(),
+                      repo.isDeleteReleasedSnapshots() );
+
+        assertTemplateRoleExists( repoId );
+
+        assertTrue( new File( stageRepoLocation + STAGE_REPO_ID_END ).exists() );
+
+        assertTemplateRoleExists( repoId + STAGE_REPO_ID_END );
+
+        managedRepositoryAdmin.deleteManagedRepository( repo.getId(), getFakeAuditInformation(), false );
+
+        // check deleteContents false
+        assertTrue( repoDir.exists() );
+
+        assertTemplateRoleNotExists( repoId );
+
+        assertTrue( new File( stageRepoLocation + STAGE_REPO_ID_END ).exists() );
+
+        assertTemplateRoleNotExists( repoId + STAGE_REPO_ID_END );
+
+        assertAuditListenerCallAndUpdateAddAndDelete( true );
+
+        mockAuditListener.clearEvents();
+
+    }
+
+    //----------------------------------
+    // utility methods
+    //----------------------------------
+
+    private void assertTemplateRoleExists( String repoId )
+        throws Exception
+    {
+        assertTrue( roleManager.templatedRoleExists( ArchivaRoleConstants.TEMPLATE_REPOSITORY_OBSERVER, repoId ) );
+        assertTrue( roleManager.templatedRoleExists( ArchivaRoleConstants.TEMPLATE_REPOSITORY_MANAGER, repoId ) );
+    }
+
+
+    private void assertTemplateRoleNotExists( String repoId )
+        throws Exception
+    {
+        assertFalse( roleManager.templatedRoleExists( ArchivaRoleConstants.TEMPLATE_REPOSITORY_OBSERVER, repoId ) );
+        assertFalse( roleManager.templatedRoleExists( ArchivaRoleConstants.TEMPLATE_REPOSITORY_MANAGER, repoId ) );
+    }
+
+    private void assertAuditListenerCallAddAndDelete()
+    {
+        assertEquals( 2, mockAuditListener.getAuditEvents().size() );
+
+        assertEquals( AuditEvent.ADD_MANAGED_REPO, mockAuditListener.getAuditEvents().get( 0 ).getAction() );
+        assertEquals( "root", mockAuditListener.getAuditEvents().get( 0 ).getUserId() );
+        assertEquals( "archiva-localhost", mockAuditListener.getAuditEvents().get( 0 ).getRemoteIP() );
+
+        assertEquals( AuditEvent.DELETE_MANAGED_REPO, mockAuditListener.getAuditEvents().get( 1 ).getAction() );
+        assertEquals( "root", mockAuditListener.getAuditEvents().get( 0 ).getUserId() );
+    }
+
+    private void assertAuditListenerCallAndUpdateAddAndDelete( boolean stageNeeded )
+    {
+        if ( stageNeeded )
+        {
+            assertEquals( "not 4 audit events " + mockAuditListener.getAuditEvents(), 4,
+                          mockAuditListener.getAuditEvents().size() );
+        }
+        else
+        {
+            assertEquals( "not 3 audit events " + mockAuditListener.getAuditEvents(), 3,
+                          mockAuditListener.getAuditEvents().size() );
+        }
+        assertEquals( AuditEvent.ADD_MANAGED_REPO, mockAuditListener.getAuditEvents().get( 0 ).getAction() );
+        assertEquals( "root", mockAuditListener.getAuditEvents().get( 0 ).getUserId() );
+        assertEquals( "archiva-localhost", mockAuditListener.getAuditEvents().get( 0 ).getRemoteIP() );
+
+        if ( stageNeeded )
+        {
+            assertEquals( AuditEvent.ADD_MANAGED_REPO, mockAuditListener.getAuditEvents().get( 1 ).getAction() );
+            assertEquals( AuditEvent.MODIFY_MANAGED_REPO, mockAuditListener.getAuditEvents().get( 2 ).getAction() );
+            assertEquals( AuditEvent.DELETE_MANAGED_REPO, mockAuditListener.getAuditEvents().get( 3 ).getAction() );
+        }
+        else
+        {
+            assertEquals( AuditEvent.MODIFY_MANAGED_REPO, mockAuditListener.getAuditEvents().get( 1 ).getAction() );
+            assertEquals( AuditEvent.DELETE_MANAGED_REPO, mockAuditListener.getAuditEvents().get( 2 ).getAction() );
+        }
+
+    }
+
+
+
+}
diff --git a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/test/java/org/apache/archiva/admin/repository/networkproxy/NetworkProxyAdminTest.java b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/test/java/org/apache/archiva/admin/repository/networkproxy/NetworkProxyAdminTest.java
new file mode 100644
index 000000000..02eec580f
--- /dev/null
+++ b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/test/java/org/apache/archiva/admin/repository/networkproxy/NetworkProxyAdminTest.java
@@ -0,0 +1,144 @@
+package org.apache.archiva.admin.repository.networkproxy;
+/*
+ * 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.networkproxy.NetworkProxy;
+import org.apache.archiva.admin.model.networkproxy.NetworkProxyAdmin;
+import org.apache.archiva.admin.repository.AbstractRepositoryAdminTest;
+import org.apache.archiva.audit.AuditEvent;
+import org.junit.Test;
+
+import javax.inject.Inject;
+
+/**
+ * @author Olivier Lamy
+ */
+public class NetworkProxyAdminTest
+    extends AbstractRepositoryAdminTest
+{
+
+    @Inject
+    private NetworkProxyAdmin networkProxyAdmin;
+
+    @Test
+    public void getAllEmpty()
+        throws Exception
+    {
+        assertNotNull( networkProxyAdmin.getNetworkProxies() );
+    }
+
+    @Test
+    public void addAndDelete()
+        throws Exception
+    {
+        mockAuditListener.clearEvents();
+        int initialSize = networkProxyAdmin.getNetworkProxies().size();
+        NetworkProxy networkProxy = getNetworkProxyTest( "foo" );
+
+        networkProxyAdmin.addNetworkProxy( networkProxy, getFakeAuditInformation() );
+
+        assertEquals( initialSize + 1, networkProxyAdmin.getNetworkProxies().size() );
+
+        networkProxy = networkProxyAdmin.getNetworkProxy( "foo" );
+
+        assertNotNull( networkProxy );
+        assertEquals( getNetworkProxyTest( "foo" ).getId(), networkProxy.getId() );
+        assertEquals( getNetworkProxyTest( "foo" ).getHost(), networkProxy.getHost() );
+        assertEquals( getNetworkProxyTest( "foo" ).getPassword(), networkProxy.getPassword() );
+        assertEquals( getNetworkProxyTest( "foo" ).getPort(), networkProxy.getPort() );
+        assertEquals( getNetworkProxyTest( "foo" ).getUsername(), networkProxy.getUsername() );
+        assertEquals( getNetworkProxyTest( "foo" ).getProtocol(), networkProxy.getProtocol() );
+
+        networkProxyAdmin.deleteNetworkProxy( "foo", getFakeAuditInformation() );
+
+        assertNull( networkProxyAdmin.getNetworkProxy( "foo" ) );
+
+        assertEquals( 2, mockAuditListener.getAuditEvents().size() );
+
+        assertEquals( AuditEvent.ADD_NETWORK_PROXY, mockAuditListener.getAuditEvents().get( 0 ).getAction() );
+        assertEquals( AuditEvent.DELETE_NETWORK_PROXY, mockAuditListener.getAuditEvents().get( 1 ).getAction() );
+
+        mockAuditListener.clearEvents();
+    }
+
+    @Test
+    public void addAndUpdateAndDelete()
+        throws Exception
+    {
+        mockAuditListener.clearEvents();
+        int initialSize = networkProxyAdmin.getNetworkProxies().size();
+        NetworkProxy networkProxy = getNetworkProxyTest( "foo" );
+
+        networkProxyAdmin.addNetworkProxy( networkProxy, getFakeAuditInformation() );
+
+        assertEquals( initialSize + 1, networkProxyAdmin.getNetworkProxies().size() );
+
+        networkProxy = networkProxyAdmin.getNetworkProxy( "foo" );
+
+        assertNotNull( networkProxy );
+        assertEquals( getNetworkProxyTest( "foo" ).getId(), networkProxy.getId() );
+        assertEquals( getNetworkProxyTest( "foo" ).getHost(), networkProxy.getHost() );
+        assertEquals( getNetworkProxyTest( "foo" ).getPassword(), networkProxy.getPassword() );
+        assertEquals( getNetworkProxyTest( "foo" ).getPort(), networkProxy.getPort() );
+        assertEquals( getNetworkProxyTest( "foo" ).getUsername(), networkProxy.getUsername() );
+        assertEquals( getNetworkProxyTest( "foo" ).getProtocol(), networkProxy.getProtocol() );
+
+        networkProxy.setHost( "https://toto.com" );
+        networkProxy.setPassword( "newpasswd" );
+        networkProxy.setPort( 9191 );
+        networkProxy.setProtocol( "http" );
+        networkProxy.setUsername( "newusername" );
+
+        networkProxyAdmin.updateNetworkProxy( networkProxy, getFakeAuditInformation() );
+
+        NetworkProxy updatedNetworkProxy = networkProxyAdmin.getNetworkProxy( "foo" );
+
+        assertNotNull( updatedNetworkProxy );
+        assertEquals( networkProxy.getId(), updatedNetworkProxy.getId() );
+        assertEquals( networkProxy.getHost(), updatedNetworkProxy.getHost() );
+        assertEquals( networkProxy.getPassword(), updatedNetworkProxy.getPassword() );
+        assertEquals( networkProxy.getPort(), updatedNetworkProxy.getPort() );
+        assertEquals( networkProxy.getUsername(), updatedNetworkProxy.getUsername() );
+        assertEquals( networkProxy.getProtocol(), updatedNetworkProxy.getProtocol() );
+
+        networkProxyAdmin.deleteNetworkProxy( "foo", getFakeAuditInformation() );
+
+        assertEquals( 3, mockAuditListener.getAuditEvents().size() );
+
+        assertEquals( AuditEvent.ADD_NETWORK_PROXY, mockAuditListener.getAuditEvents().get( 0 ).getAction() );
+        assertEquals( AuditEvent.MODIFY_NETWORK_PROXY, mockAuditListener.getAuditEvents().get( 1 ).getAction() );
+        assertEquals( AuditEvent.DELETE_NETWORK_PROXY, mockAuditListener.getAuditEvents().get( 2 ).getAction() );
+
+        mockAuditListener.clearEvents();
+    }
+
+
+    protected NetworkProxy getNetworkProxyTest( String id )
+    {
+        NetworkProxy networkProxy = new NetworkProxy();
+        networkProxy.setId( "foo" );
+        networkProxy.setHost( "http://foo.com" );
+        networkProxy.setPassword( "passwd" );
+        networkProxy.setPort( 9090 );
+        networkProxy.setUsername( "root" );
+        networkProxy.setProtocol( "https" );
+        return networkProxy;
+    }
+
+}
diff --git a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/test/java/org/apache/archiva/admin/repository/proxyconnector/ProxyConnectorAdminTest.java b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/test/java/org/apache/archiva/admin/repository/proxyconnector/ProxyConnectorAdminTest.java
new file mode 100644
index 000000000..b90c3b04a
--- /dev/null
+++ b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/test/java/org/apache/archiva/admin/repository/proxyconnector/ProxyConnectorAdminTest.java
@@ -0,0 +1,166 @@
+package org.apache.archiva.admin.repository.proxyconnector;
+/*
+ * 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.proxyconnector.ProxyConnector;
+import org.apache.archiva.admin.model.remote.RemoteRepository;
+import org.apache.archiva.admin.repository.AbstractRepositoryAdminTest;
+import org.apache.archiva.audit.AuditEvent;
+import org.junit.Test;
+
+import java.util.Arrays;
+
+/**
+ * @author Olivier Lamy
+ */
+public class ProxyConnectorAdminTest
+    extends AbstractRepositoryAdminTest
+{
+
+    @Test
+    public void addAndDelete()
+        throws Exception
+    {
+        mockAuditListener.clearEvents();
+        assertEquals( "not proxyConnectors 2 " + proxyConnectorAdmin.getProxyConnectors(), 2,
+                      proxyConnectorAdmin.getProxyConnectors().size() );
+        assertFalse( proxyConnectorAdmin.getProxyConnectors().isEmpty() );
+        ProxyConnector proxyConnector = new ProxyConnector();
+        proxyConnector.setSourceRepoId( "snapshots" );
+        proxyConnector.setTargetRepoId( "central" );
+        proxyConnectorAdmin.addProxyConnector( proxyConnector, getFakeAuditInformation() );
+
+        assertFalse( proxyConnectorAdmin.getProxyConnectors().isEmpty() );
+        assertEquals( 3, proxyConnectorAdmin.getProxyConnectors().size() );
+
+        assertNotNull( proxyConnectorAdmin.getProxyConnector( "snapshots", "central" ) );
+
+        proxyConnectorAdmin.deleteProxyConnector( proxyConnector, getFakeAuditInformation() );
+
+        assertEquals( 2, proxyConnectorAdmin.getProxyConnectors().size() );
+        assertFalse( proxyConnectorAdmin.getProxyConnectors().isEmpty() );
+
+        assertEquals( 2, mockAuditListener.getAuditEvents().size() );
+
+        assertEquals( AuditEvent.ADD_PROXY_CONNECTOR, mockAuditListener.getAuditEvents().get( 0 ).getAction() );
+        assertEquals( "root", mockAuditListener.getAuditEvents().get( 0 ).getUserId() );
+        assertEquals( "archiva-localhost", mockAuditListener.getAuditEvents().get( 0 ).getRemoteIP() );
+
+        assertEquals( AuditEvent.DELETE_PROXY_CONNECTOR, mockAuditListener.getAuditEvents().get( 1 ).getAction() );
+        assertEquals( "root", mockAuditListener.getAuditEvents().get( 1 ).getUserId() );
+
+        assertNull( proxyConnectorAdmin.getProxyConnector( "snapshots", "central" ) );
+
+        mockAuditListener.clearEvents();
+    }
+
+    @Test
+    public void addAndUpdateAndDelete()
+        throws Exception
+    {
+        mockAuditListener.clearEvents();
+        RemoteRepository remoteRepository = getRemoteRepository( "test-new-one" );
+
+        remoteRepositoryAdmin.addRemoteRepository( remoteRepository, getFakeAuditInformation() );
+
+        assertEquals( "not proxyConnectors 2 " + proxyConnectorAdmin.getProxyConnectors(), 2,
+                      proxyConnectorAdmin.getProxyConnectors().size() );
+        assertFalse( proxyConnectorAdmin.getProxyConnectors().isEmpty() );
+        ProxyConnector proxyConnector = new ProxyConnector();
+        proxyConnector.setSourceRepoId( "snapshots" );
+        proxyConnector.setTargetRepoId( "central" );
+        proxyConnector.setWhiteListPatterns( Arrays.asList( "foo", "bar" ) );
+        proxyConnectorAdmin.addProxyConnector( proxyConnector, getFakeAuditInformation() );
+
+        assertFalse( proxyConnectorAdmin.getProxyConnectors().isEmpty() );
+        assertEquals( 3, proxyConnectorAdmin.getProxyConnectors().size() );
+
+        assertNotNull( proxyConnectorAdmin.getProxyConnector( "snapshots", "central" ) );
+        assertEquals( Arrays.asList( "foo", "bar" ),
+                      proxyConnectorAdmin.getProxyConnector( "snapshots", "central" ).getWhiteListPatterns() );
+
+        proxyConnectorAdmin.deleteProxyConnector( proxyConnector, getFakeAuditInformation() );
+
+        proxyConnector.setTargetRepoId( remoteRepository.getId() );
+        proxyConnectorAdmin.addProxyConnector( proxyConnector, getFakeAuditInformation() );
+
+        assertNull( proxyConnectorAdmin.getProxyConnector( "snapshots", "central" ) );
+        assertNotNull( remoteRepository.getId(),
+                       proxyConnectorAdmin.getProxyConnector( "snapshots", remoteRepository.getId() ) );
+
+        proxyConnectorAdmin.deleteProxyConnector( proxyConnector, getFakeAuditInformation() );
+
+        assertNull( proxyConnectorAdmin.getProxyConnector( "snapshots", "central" ) );
+
+        assertEquals( 2, proxyConnectorAdmin.getProxyConnectors().size() );
+        assertFalse( proxyConnectorAdmin.getProxyConnectors().isEmpty() );
+
+        assertEquals( 5, mockAuditListener.getAuditEvents().size() );
+
+        assertEquals( AuditEvent.ADD_REMOTE_REPO, mockAuditListener.getAuditEvents().get( 0 ).getAction() );
+
+        assertEquals( AuditEvent.ADD_PROXY_CONNECTOR, mockAuditListener.getAuditEvents().get( 1 ).getAction() );
+        assertEquals( "root", mockAuditListener.getAuditEvents().get( 2 ).getUserId() );
+        assertEquals( "archiva-localhost", mockAuditListener.getAuditEvents().get( 2 ).getRemoteIP() );
+
+        assertEquals( AuditEvent.DELETE_PROXY_CONNECTOR, mockAuditListener.getAuditEvents().get( 2 ).getAction() );
+
+        assertEquals( AuditEvent.ADD_PROXY_CONNECTOR, mockAuditListener.getAuditEvents().get( 3 ).getAction() );
+
+        assertEquals( AuditEvent.DELETE_PROXY_CONNECTOR, mockAuditListener.getAuditEvents().get( 4 ).getAction() );
+        assertEquals( "root", mockAuditListener.getAuditEvents().get( 4 ).getUserId() );
+
+        remoteRepositoryAdmin.deleteRemoteRepository( remoteRepository.getId(), getFakeAuditInformation() );
+        mockAuditListener.clearEvents();
+    }
+
+    @Test
+    public void findProxyConnector()
+        throws Exception
+    {
+        ProxyConnector proxyConnector = proxyConnectorAdmin.getProxyConnector( "internal", "central" );
+        assertNotNull( proxyConnector );
+    }
+
+    @Test
+    public void updateProxyConnector()
+        throws Exception
+    {
+        mockAuditListener.clearEvents();
+        ProxyConnector proxyConnector = proxyConnectorAdmin.getProxyConnector( "internal", "central" );
+        assertNotNull( proxyConnector );
+        proxyConnector.setDisabled( false );
+        proxyConnectorAdmin.updateProxyConnector( proxyConnector, getFakeAuditInformation() );
+        proxyConnector = proxyConnectorAdmin.getProxyConnector( "internal", "central" );
+        assertFalse( proxyConnector.isDisabled() );
+
+        proxyConnector.setDisabled( true );
+        proxyConnectorAdmin.updateProxyConnector( proxyConnector, getFakeAuditInformation() );
+        proxyConnector = proxyConnectorAdmin.getProxyConnector( "internal", "central" );
+        assertTrue( proxyConnector.isDisabled() );
+
+        proxyConnector.setOrder( 4 );
+        proxyConnectorAdmin.updateProxyConnector( proxyConnector, getFakeAuditInformation() );
+        proxyConnector = proxyConnectorAdmin.getProxyConnector( "internal", "central" );
+        assertEquals( 4, proxyConnector.getOrder() );
+        mockAuditListener.clearEvents();
+
+    }
+
+}
diff --git a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/test/java/org/apache/archiva/admin/repository/remote/RemoteRepositoryAdminTest.java b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/test/java/org/apache/archiva/admin/repository/remote/RemoteRepositoryAdminTest.java
new file mode 100644
index 000000000..ffc5a3311
--- /dev/null
+++ b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/test/java/org/apache/archiva/admin/repository/remote/RemoteRepositoryAdminTest.java
@@ -0,0 +1,154 @@
+package org.apache.archiva.admin.repository.remote;
+/*
+ * 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.remote.RemoteRepository;
+import org.apache.archiva.admin.repository.AbstractRepositoryAdminTest;
+import org.apache.archiva.audit.AuditEvent;
+import org.junit.Test;
+
+import java.util.List;
+
+/**
+ * @author Olivier Lamy
+ */
+public class RemoteRepositoryAdminTest
+    extends AbstractRepositoryAdminTest
+{
+
+    @Test
+    public void getAll()
+        throws Exception
+    {
+        List remoteRepositories = remoteRepositoryAdmin.getRemoteRepositories();
+        assertNotNull( remoteRepositories );
+        assertTrue( remoteRepositories.size() > 0 );
+        log.info( "remote " + remoteRepositories );
+    }
+
+    @Test
+    public void getById()
+        throws Exception
+    {
+        RemoteRepository central = remoteRepositoryAdmin.getRemoteRepository( "central" );
+        assertNotNull( central );
+        assertEquals( "http://repo1.maven.org/maven2", central.getUrl() );
+        assertEquals( 60, central.getTimeout() );
+        assertNull( central.getUserName() );
+        assertNull( central.getPassword() );
+    }
+
+    @Test
+    public void addAndDelete()
+        throws Exception
+    {
+        mockAuditListener.clearEvents();
+        int initialSize = remoteRepositoryAdmin.getRemoteRepositories().size();
+
+        RemoteRepository remoteRepository = getRemoteRepository();
+
+        remoteRepositoryAdmin.addRemoteRepository( remoteRepository, getFakeAuditInformation() );
+
+        assertEquals( initialSize + 1, remoteRepositoryAdmin.getRemoteRepositories().size() );
+
+        RemoteRepository repo = remoteRepositoryAdmin.getRemoteRepository( "foo" );
+        assertNotNull( repo );
+        assertEquals( getRemoteRepository().getPassword(), repo.getPassword() );
+        assertEquals( getRemoteRepository().getUrl(), repo.getUrl() );
+        assertEquals( getRemoteRepository().getUserName(), repo.getUserName() );
+        assertEquals( getRemoteRepository().getName(), repo.getName() );
+        assertEquals( getRemoteRepository().getTimeout(), repo.getTimeout() );
+
+        remoteRepositoryAdmin.deleteRemoteRepository( "foo", getFakeAuditInformation() );
+
+        assertEquals( initialSize, remoteRepositoryAdmin.getRemoteRepositories().size() );
+
+        repo = remoteRepositoryAdmin.getRemoteRepository( "foo" );
+        assertNull( repo );
+
+        assertEquals( 2, mockAuditListener.getAuditEvents().size() );
+
+        assertEquals( AuditEvent.ADD_REMOTE_REPO, mockAuditListener.getAuditEvents().get( 0 ).getAction() );
+        assertEquals( "root", mockAuditListener.getAuditEvents().get( 0 ).getUserId() );
+        assertEquals( "archiva-localhost", mockAuditListener.getAuditEvents().get( 0 ).getRemoteIP() );
+
+        assertEquals( AuditEvent.DELETE_REMOTE_REPO, mockAuditListener.getAuditEvents().get( 1 ).getAction() );
+        assertEquals( "root", mockAuditListener.getAuditEvents().get( 1 ).getUserId() );
+
+    }
+
+
+    @Test
+    public void addAndUpdateAndDelete()
+        throws Exception
+    {
+        mockAuditListener.clearEvents();
+        int initialSize = remoteRepositoryAdmin.getRemoteRepositories().size();
+
+        RemoteRepository remoteRepository = getRemoteRepository();
+
+        remoteRepositoryAdmin.addRemoteRepository( remoteRepository, getFakeAuditInformation() );
+
+        assertEquals( initialSize + 1, remoteRepositoryAdmin.getRemoteRepositories().size() );
+
+        RemoteRepository repo = remoteRepositoryAdmin.getRemoteRepository( "foo" );
+        assertNotNull( repo );
+        assertEquals( getRemoteRepository().getPassword(), repo.getPassword() );
+        assertEquals( getRemoteRepository().getUrl(), repo.getUrl() );
+        assertEquals( getRemoteRepository().getUserName(), repo.getUserName() );
+        assertEquals( getRemoteRepository().getName(), repo.getName() );
+        assertEquals( getRemoteRepository().getTimeout(), repo.getTimeout() );
+
+        repo.setUserName( "foo-name-changed" );
+        repo.setPassword( "titi" );
+        repo.setUrl( "http://foo.com/maven-really-rocks" );
+
+        remoteRepositoryAdmin.updateRemoteRepository( repo, getFakeAuditInformation() );
+
+        repo = remoteRepositoryAdmin.getRemoteRepository( "foo" );
+
+        assertEquals( "foo-name-changed", repo.getUserName() );
+        assertEquals( "titi", repo.getPassword() );
+        assertEquals( "http://foo.com/maven-really-rocks", repo.getUrl() );
+
+        remoteRepositoryAdmin.deleteRemoteRepository( "foo", getFakeAuditInformation() );
+
+        assertEquals( initialSize, remoteRepositoryAdmin.getRemoteRepositories().size() );
+
+        repo = remoteRepositoryAdmin.getRemoteRepository( "foo" );
+        assertNull( repo );
+
+        assertEquals( 3, mockAuditListener.getAuditEvents().size() );
+
+        assertEquals( AuditEvent.ADD_REMOTE_REPO, mockAuditListener.getAuditEvents().get( 0 ).getAction() );
+        assertEquals( "root", mockAuditListener.getAuditEvents().get( 0 ).getUserId() );
+        assertEquals( "archiva-localhost", mockAuditListener.getAuditEvents().get( 0 ).getRemoteIP() );
+
+        assertEquals( AuditEvent.MODIFY_REMOTE_REPO, mockAuditListener.getAuditEvents().get( 1 ).getAction() );
+        assertEquals( "root", mockAuditListener.getAuditEvents().get( 1 ).getUserId() );
+        assertEquals( "archiva-localhost", mockAuditListener.getAuditEvents().get( 1 ).getRemoteIP() );
+
+        assertEquals( AuditEvent.DELETE_REMOTE_REPO, mockAuditListener.getAuditEvents().get( 2 ).getAction() );
+        assertEquals( "root", mockAuditListener.getAuditEvents().get( 2 ).getUserId() );
+
+    }
+
+
+
+}
diff --git a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/test/resources/META-INF/redback/redback-core.xml b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/test/resources/META-INF/redback/redback-core.xml
new file mode 100644
index 000000000..ecc1de8fb
--- /dev/null
+++ b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/test/resources/META-INF/redback/redback-core.xml
@@ -0,0 +1,213 @@
+
+    1.0.0
+    
+        
+          System
+          Roles that apply system-wide, across all of the applications
+        1.0.0
+        
+            
+                global
+                *
+                true
+                global resource implies full access for authorization
+            
+            
+                username
+                ${username}
+                true
+                replaced with the username of the principal at authorization check time
+            
+        
+        
+            
+                configuration-edit
+                configuration-edit
+                edit configuration
+                true
+            
+            
+                user-management-user-create
+                user-management-user-create
+                create user
+                true
+            
+            
+                user-management-user-edit
+                user-management-user-edit
+                edit user
+                true
+            
+            
+                user-management-user-role
+                user-management-user-role
+                user roles
+                true
+            
+            
+                user-management-user-delete
+                user-management-user-delete
+                delete user
+                true
+            
+            
+                user-management-user-list
+                user-management-user-list
+                list users
+                true
+            
+            
+                user-management-role-grant
+                user-management-role-grant
+                grant role
+                true
+            
+            
+                user-management-role-drop
+                user-management-role-drop
+                drop role
+                true
+            
+            
+                user-management-rbac-admin
+                user-management-rbac-admin
+                administer rbac
+                true
+            
+            
+                guest-access
+                guest-access
+                access guest
+                true
+            
+            
+                user-management-manage-data
+                user-management-manage-data
+                manage data
+                true
+                        
+        
+        
+            
+                system-administrator
+                System Administrator
+                true
+                true
+                
+                    
+                        edit-redback-configuration
+                        Edit Redback Configuration
+                        configuration-edit
+                        global
+                        true
+                    
+                    
+                        manage-rbac-setup
+                        User RBAC Management
+                        user-management-rbac-admin
+                        global
+                        true
+                    
+                    
+                        manage-rbac-data
+                        RBAC Manage Data
+                        user-management-manage-data
+                        global
+                        true
+                                        
+                
+                
+                    user-administrator
+                
+            
+            
+                user-administrator
+                User Administrator
+                true
+                true
+                
+                    
+                        drop-roles-for-anyone
+                        Drop Roles for Anyone
+                        user-management-role-drop
+                        global
+                        true
+                    
+                    
+                        grant-roles-for-anyone
+                        Grant Roles for Anyone
+                        user-management-role-grant
+                        global
+                        true
+                    
+                    
+                        user-create
+                        Create Users
+                        user-management-user-create
+                        global
+                        true
+                    
+                    
+                        user-delete
+                        Delete Users
+                        user-management-user-delete
+                        global
+                        true
+                    
+                    
+                        user-edit
+                        Edit Users
+                        user-management-user-edit
+                        global
+                        true
+                    
+                    
+                        access-users-roles
+                        Access Users Roles
+                        user-management-user-role
+                        global
+                        true
+                    
+                    
+                        access-user-list
+                        Access User List
+                        user-management-user-list
+                        global
+                        true
+                    
+                
+            
+            
+                registered-user
+                Registered User
+                true
+                true
+                
+                    
+                        edit-user-by-username
+                        Edit User Data by Username
+                        user-management-user-edit
+                        username
+                        true
+                    
+                
+            
+            
+                guest
+                Guest
+                true
+                true
+                
+                    
+                        guest-permission
+                        Guest Permission
+                        guest-access
+                        global
+                        true
+                    
+                
+            
+        
+        
+    
+
\ No newline at end of file
diff --git a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/test/resources/log4j.xml b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/test/resources/log4j.xml
new file mode 100644
index 000000000..9b1a6585b
--- /dev/null
+++ b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/test/resources/log4j.xml
@@ -0,0 +1,49 @@
+
+
+
+
+
+
+
+  
+    
+      
+    
+  
+
+
+
+  
+    
+  
+  
+    
+  
+
+  
+    
+  
+
+  
+    
+    
+  
+
+
diff --git a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/test/resources/spring-context.xml b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/test/resources/spring-context.xml
new file mode 100644
index 000000000..a18703d6d
--- /dev/null
+++ b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/test/resources/spring-context.xml
@@ -0,0 +1,59 @@
+
+
+
+
+
+  
+  
+
+  
+    
+      
+        scheduler1
+        org.quartz.simpl.SimpleThreadPool
+        2
+        4
+        org.quartz.simpl.RAMJobStore
+      
+    
+  
+
+  
+    
+      
+        
+          
+          
+        
+        ]]>
+      
+    
+  
+
+
\ No newline at end of file
diff --git a/archiva-modules/archiva-base/archiva-repository-admin/pom.xml b/archiva-modules/archiva-base/archiva-repository-admin/pom.xml
index 541eb7f70..54bc04819 100644
--- a/archiva-modules/archiva-base/archiva-repository-admin/pom.xml
+++ b/archiva-modules/archiva-base/archiva-repository-admin/pom.xml
@@ -27,170 +27,9 @@
   
   archiva-repository-admin
   Archiva Base :: Repository Admin
-  
-    
-      org.apache.archiva
-      archiva-configuration
-    
-    
-      org.apache.archiva
-      archiva-security-common
-    
-     
-      org.apache.archiva
-      archiva-scheduler-repository
-    
-    
-      org.apache.archiva
-      audit
-    
-    
-      javax.inject
-      javax.inject
-    
-    
-      net.sf.beanlib
-      beanlib
-        
-          
-            cglib
-            cglib
-          
-          
-            aopalliance
-            aopalliance
-          
-        
-    
-    
-      org.springframework
-      spring-context-support
-      ${spring.version}
-      
-        
-          commons-logging
-          commons-logging
-        
-      
-    
-    
-      org.springframework
-      spring-context
-      ${spring.version}
-      
-        
-          commons-logging
-          commons-logging
-        
-      
-    
-    
-      org.slf4j
-      slf4j-api
-    
-    
-      commons-validator
-      commons-validator
-    
-    
-      oro
-      oro
-    
-    
-      org.codehaus.redback.components
-      spring-quartz
-    
-    
-      org.codehaus.redback
-      redback-rbac-role-manager
-      
-        
-          commons-logging
-          commons-logging
-        
-      
-    
-    
-      org.codehaus.redback
-      redback-authentication-api
-        
-          
-            commons-logging
-            commons-logging
-          
-        
-    
-    
-      junit
-      junit
-      test
-    
-    
-      org.slf4j
-      slf4j-log4j12
-      test
-    
-
-    
-      org.codehaus.redback
-      redback-users-memory
-      test
-      ${redback.version}
-    
-
-    
-      org.codehaus.redback
-      redback-keys-memory
-      test
-      ${redback.version}
-    
-
-    
-      org.codehaus.redback
-      redback-rbac-cached
-      ${redback.version}
-      test
-      
-        
-          commons-logging
-          commons-logging
-        
-      
-    
-
-    
-      org.apache.derby
-      derby
-      test
-    
-
-    
-      org.slf4j
-      jcl-over-slf4j
-      test
-    
-
-    
-      org.apache.archiva
-      metadata-store-file
-      test
-    
-
-  
-
-  
-    
-      
-        org.apache.maven.plugins
-        maven-surefire-plugin
-        
-          
-            ${project.build.outputDirectory}
-            ${project.build.outputDirectory}
-          
-        
-
-      
-    
-  
+  pom
+  
+    archiva-repository-admin-api
+    archiva-repository-admin-default
+  
 
diff --git a/archiva-modules/archiva-base/archiva-repository-admin/src/main/java/org/apache/archiva/admin/AuditInformation.java b/archiva-modules/archiva-base/archiva-repository-admin/src/main/java/org/apache/archiva/admin/AuditInformation.java
deleted file mode 100644
index 098e09351..000000000
--- a/archiva-modules/archiva-base/archiva-repository-admin/src/main/java/org/apache/archiva/admin/AuditInformation.java
+++ /dev/null
@@ -1,69 +0,0 @@
-package org.apache.archiva.admin;
-/*
- * 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.codehaus.plexus.redback.users.User;
-
-/**
- * @author Olivier Lamy
- * @since 1.4
- */
-public class AuditInformation
-{
-    private User user;
-
-    private String remoteAddr;
-
-    public AuditInformation( User user, String remoteAddr )
-    {
-        this.user = user;
-        this.remoteAddr = remoteAddr;
-    }
-
-    public User getUser()
-    {
-        return user;
-    }
-
-    public void setUser( User user )
-    {
-        this.user = user;
-    }
-
-    public String getRemoteAddr()
-    {
-        return remoteAddr;
-    }
-
-    public void setRemoteAddr( String remoteAddr )
-    {
-        this.remoteAddr = remoteAddr;
-    }
-
-    @Override
-    public String toString()
-    {
-        final StringBuilder sb = new StringBuilder();
-        sb.append( "AuditInformation" );
-        sb.append( "{user=" ).append( user );
-        sb.append( ", remoteAddr='" ).append( remoteAddr ).append( '\'' );
-        sb.append( '}' );
-        return sb.toString();
-    }
-}
diff --git a/archiva-modules/archiva-base/archiva-repository-admin/src/main/java/org/apache/archiva/admin/repository/AbstractRepository.java b/archiva-modules/archiva-base/archiva-repository-admin/src/main/java/org/apache/archiva/admin/repository/AbstractRepository.java
deleted file mode 100644
index 6f7cf8286..000000000
--- a/archiva-modules/archiva-base/archiva-repository-admin/src/main/java/org/apache/archiva/admin/repository/AbstractRepository.java
+++ /dev/null
@@ -1,116 +0,0 @@
-package org.apache.archiva.admin.repository;
-/*
- * 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.io.Serializable;
-
-/**
- * @author Olivier Lamy
- * @since 1.4
- */
-public class AbstractRepository
-    implements Serializable
-{
-
-    private String id;
-
-    private String name;
-
-    private String layout = "default";
-
-    public AbstractRepository()
-    {
-        // no op
-    }
-
-    public AbstractRepository( String id, String name, String layout )
-    {
-        this.id = id;
-        this.name = name;
-        this.layout = layout;
-    }
-
-    public String getId()
-    {
-        return id;
-    }
-
-    public void setId( String id )
-    {
-        this.id = id;
-    }
-
-    public String getName()
-    {
-        return name;
-    }
-
-    public void setName( String name )
-    {
-        this.name = name;
-    }
-
-    public String getLayout()
-    {
-        return layout;
-    }
-
-    public void setLayout( String layout )
-    {
-        this.layout = layout;
-    }
-
-
-    public int hashCode()
-    {
-        int result = 17;
-        result = 37 * result + ( id != null ? id.hashCode() : 0 );
-        return result;
-    }
-
-    public boolean equals( Object other )
-    {
-        if ( this == other )
-        {
-            return true;
-        }
-
-        if ( !( other instanceof AbstractRepository ) )
-        {
-            return false;
-        }
-
-        AbstractRepository that = (AbstractRepository) other;
-        boolean result = true;
-        result = result && ( getId() == null ? that.getId() == null : getId().equals( that.getId() ) );
-        return result;
-    }
-
-    @Override
-    public String toString()
-    {
-        final StringBuilder sb = new StringBuilder();
-        sb.append( "AbstractRepository" );
-        sb.append( "{id='" ).append( id ).append( '\'' );
-        sb.append( ", name='" ).append( name ).append( '\'' );
-        sb.append( ", layout='" ).append( layout ).append( '\'' );
-        sb.append( '}' );
-        return sb.toString();
-    }
-}
diff --git a/archiva-modules/archiva-base/archiva-repository-admin/src/main/java/org/apache/archiva/admin/repository/AbstractRepositoryAdmin.java b/archiva-modules/archiva-base/archiva-repository-admin/src/main/java/org/apache/archiva/admin/repository/AbstractRepositoryAdmin.java
deleted file mode 100644
index d917a6a48..000000000
--- a/archiva-modules/archiva-base/archiva-repository-admin/src/main/java/org/apache/archiva/admin/repository/AbstractRepositoryAdmin.java
+++ /dev/null
@@ -1,131 +0,0 @@
-package org.apache.archiva.admin.repository;
-/*
- * 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.AuditInformation;
-import org.apache.archiva.audit.AuditEvent;
-import org.apache.archiva.audit.AuditListener;
-import org.apache.maven.archiva.configuration.ArchivaConfiguration;
-import org.apache.maven.archiva.configuration.Configuration;
-import org.apache.maven.archiva.configuration.IndeterminateConfigurationException;
-import org.codehaus.plexus.redback.users.User;
-import org.codehaus.plexus.registry.Registry;
-import org.codehaus.plexus.registry.RegistryException;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.inject.Inject;
-import javax.inject.Named;
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * @author Olivier Lamy
- * @since 1.4
- */
-public abstract class AbstractRepositoryAdmin
-{
-    protected Logger log = LoggerFactory.getLogger( getClass() );
-
-    @Inject
-    private List auditListeners = new ArrayList();
-
-
-    @Inject
-    private RepositoryCommonValidator repositoryCommonValidator;
-
-    @Inject
-    private ArchivaConfiguration archivaConfiguration;
-
-    @Inject
-    @Named( value = "commons-configuration" )
-    private Registry registry;
-
-    protected void triggerAuditEvent( String repositoryId, String resource, String action,
-                                      AuditInformation auditInformation )
-    {
-        User user = auditInformation == null ? null : auditInformation.getUser();
-        AuditEvent event =
-            new AuditEvent( repositoryId, user == null ? "null" : (String) user.getPrincipal(), resource, action );
-        event.setRemoteIP( auditInformation == null ? "null" : auditInformation.getRemoteAddr() );
-
-        for ( AuditListener listener : getAuditListeners() )
-        {
-            listener.auditEvent( event );
-        }
-
-    }
-
-    protected void saveConfiguration( Configuration config )
-        throws RepositoryAdminException
-    {
-        try
-        {
-            getArchivaConfiguration().save( config );
-        }
-        catch ( RegistryException e )
-        {
-            throw new RepositoryAdminException( "Error occurred in the registry.", e );
-        }
-        catch ( IndeterminateConfigurationException e )
-        {
-            throw new RepositoryAdminException( "Error occurred while saving the configuration.", e );
-        }
-    }
-
-    public List getAuditListeners()
-    {
-        return auditListeners;
-    }
-
-    public void setAuditListeners( List auditListeners )
-    {
-        this.auditListeners = auditListeners;
-    }
-
-    public void setArchivaConfiguration( ArchivaConfiguration archivaConfiguration )
-    {
-        this.archivaConfiguration = archivaConfiguration;
-    }
-
-    public ArchivaConfiguration getArchivaConfiguration()
-    {
-        return archivaConfiguration;
-    }
-
-    public RepositoryCommonValidator getRepositoryCommonValidator()
-    {
-        return repositoryCommonValidator;
-    }
-
-    public void setRepositoryCommonValidator( RepositoryCommonValidator repositoryCommonValidator )
-    {
-        this.repositoryCommonValidator = repositoryCommonValidator;
-    }
-
-    public Registry getRegistry()
-    {
-        return registry;
-    }
-
-    public void setRegistry( Registry registry )
-    {
-        this.registry = registry;
-    }
-}
diff --git a/archiva-modules/archiva-base/archiva-repository-admin/src/main/java/org/apache/archiva/admin/repository/AbstractRepositoryConnector.java b/archiva-modules/archiva-base/archiva-repository-admin/src/main/java/org/apache/archiva/admin/repository/AbstractRepositoryConnector.java
deleted file mode 100644
index c5ecf32ec..000000000
--- a/archiva-modules/archiva-base/archiva-repository-admin/src/main/java/org/apache/archiva/admin/repository/AbstractRepositoryConnector.java
+++ /dev/null
@@ -1,401 +0,0 @@
-package org.apache.archiva.admin.repository;
-/*
- * 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.io.Serializable;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-/**
- * @author Olivier Lamy
- * @since 1.4
- */
-public abstract class AbstractRepositoryConnector
-    implements Serializable
-{
-    /**
-     * The Repository Source for this connector.
-     */
-    private String sourceRepoId;
-
-    /**
-     * The Repository Target for this connector.
-     */
-    private String targetRepoId;
-
-    /**
-     * The network proxy ID to use for this connector.
-     */
-    private String proxyId;
-
-    /**
-     * Field blackListPatterns.
-     */
-    private List blackListPatterns;
-
-    /**
-     * Field whiteListPatterns.
-     */
-    private List whiteListPatterns;
-
-    /**
-     * Field policies.
-     */
-    private Map policies;
-
-    /**
-     * Field properties.
-     */
-    private Map properties;
-
-    /**
-     * If the the repository proxy connector is disabled or not
-     */
-    private boolean disabled = false;
-
-    //-----------/
-    //- Methods -/
-    //-----------/
-
-    /**
-     * Method addBlackListPattern.
-     *
-     * @param string
-     */
-    public void addBlackListPattern( String string )
-    {
-        getBlackListPatterns().add( string );
-    }
-
-    /**
-     * Method addPolicy.
-     *
-     * @param key
-     * @param value
-     */
-    public void addPolicy( String key, String value )
-    {
-        getPolicies().put( key, value );
-    }
-
-    /**
-     * Method addProperty.
-     *
-     * @param key
-     * @param value
-     */
-    public void addProperty( String key, String value )
-    {
-        getProperties().put( key, value );
-    }
-
-    /**
-     * Method addWhiteListPattern.
-     *
-     * @param string
-     */
-    public void addWhiteListPattern( String string )
-    {
-        getWhiteListPatterns().add( string );
-    }
-
-    /**
-     * Method getBlackListPatterns.
-     *
-     * @return List
-     */
-    public List getBlackListPatterns()
-    {
-        if ( this.blackListPatterns == null )
-        {
-            this.blackListPatterns = new ArrayList();
-        }
-
-        return this.blackListPatterns;
-    }
-
-    /**
-     * Method getPolicies.
-     *
-     * @return Map
-     */
-    public Map getPolicies()
-    {
-        if ( this.policies == null )
-        {
-            this.policies = new HashMap();
-        }
-
-        return this.policies;
-    }
-
-    /**
-     * Method getProperties.
-     *
-     * @return Map
-     */
-    public Map getProperties()
-    {
-        if ( this.properties == null )
-        {
-            this.properties = new HashMap();
-        }
-
-        return this.properties;
-    }
-
-    /**
-     * Get the network proxy ID to use for this connector.
-     *
-     * @return String
-     */
-    public String getProxyId()
-    {
-        return this.proxyId;
-    }
-
-    /**
-     * Get the Repository Source for this connector.
-     *
-     * @return String
-     */
-    public String getSourceRepoId()
-    {
-        return this.sourceRepoId;
-    }
-
-    /**
-     * Get the Repository Target for this connector.
-     *
-     * @return String
-     */
-    public String getTargetRepoId()
-    {
-        return this.targetRepoId;
-    }
-
-    /**
-     * Method getWhiteListPatterns.
-     *
-     * @return List
-     */
-    public List getWhiteListPatterns()
-    {
-        if ( this.whiteListPatterns == null )
-        {
-            this.whiteListPatterns = new ArrayList();
-        }
-
-        return this.whiteListPatterns;
-    }
-
-    /**
-     * Get if the the repository proxy connector is disabled or not
-     * .
-     *
-     * @return boolean
-     */
-    public boolean isDisabled()
-    {
-        return this.disabled;
-    }
-
-    /**
-     * Method removeBlackListPattern.
-     *
-     * @param string
-     */
-    public void removeBlackListPattern( String string )
-    {
-        getBlackListPatterns().remove( string );
-    }
-
-    /**
-     * Method removeWhiteListPattern.
-     *
-     * @param string
-     */
-    public void removeWhiteListPattern( String string )
-    {
-        getWhiteListPatterns().remove( string );
-    }
-
-    /**
-     * Set the list of blacklisted patterns for this connector.
-     *
-     * @param blackListPatterns
-     */
-    public void setBlackListPatterns( List blackListPatterns )
-    {
-        this.blackListPatterns = blackListPatterns;
-    }
-
-    /**
-     * Set if the the repository proxy connector is
-     * disabled or not
-     * .
-     *
-     * @param disabled
-     */
-    public void setDisabled( boolean disabled )
-    {
-        this.disabled = disabled;
-    }
-
-    /**
-     * Set policy configuration for the connector.
-     *
-     * @param policies
-     */
-    public void setPolicies( Map policies )
-    {
-        this.policies = policies;
-    }
-
-    /**
-     * Set configuration for the connector.
-     *
-     * @param properties
-     */
-    public void setProperties( Map properties )
-    {
-        this.properties = properties;
-    }
-
-    /**
-     * Set the network proxy ID to use for this connector.
-     *
-     * @param proxyId
-     */
-    public void setProxyId( String proxyId )
-    {
-        this.proxyId = proxyId;
-    }
-
-    /**
-     * Set the Repository Source for this connector.
-     *
-     * @param sourceRepoId
-     */
-    public void setSourceRepoId( String sourceRepoId )
-    {
-        this.sourceRepoId = sourceRepoId;
-    }
-
-    /**
-     * Set the Repository Target for this connector.
-     *
-     * @param targetRepoId
-     */
-    public void setTargetRepoId( String targetRepoId )
-    {
-        this.targetRepoId = targetRepoId;
-    }
-
-    /**
-     * Set
-     * The list of whitelisted patterns for this
-     * connector.
-     *
-     * @param whiteListPatterns
-     */
-    public void setWhiteListPatterns( List whiteListPatterns )
-    {
-        this.whiteListPatterns = whiteListPatterns;
-    }
-
-
-    /**
-     * Obtain a specific policy from the underlying connector.
-     *
-     * @param policyId     the policy id to fetch.
-     * @param defaultValue the default value for the policy id.
-     * @return the configured policy value (or default value if not found).
-     */
-    public String getPolicy( String policyId, String defaultValue )
-    {
-        if ( this.getPolicies() == null )
-        {
-            return null;
-        }
-
-        String value = this.getPolicies().get( policyId );
-
-        if ( value == null )
-        {
-            return defaultValue;
-        }
-
-        return value;
-    }
-
-    @Override
-    public boolean equals( Object o )
-    {
-        if ( this == o )
-        {
-            return true;
-        }
-        if ( o == null || getClass() != o.getClass() )
-        {
-            return false;
-        }
-
-        AbstractRepositoryConnector that = (AbstractRepositoryConnector) o;
-
-        if ( sourceRepoId != null ? !sourceRepoId.equals( that.sourceRepoId ) : that.sourceRepoId != null )
-        {
-            return false;
-        }
-        if ( targetRepoId != null ? !targetRepoId.equals( that.targetRepoId ) : that.targetRepoId != null )
-        {
-            return false;
-        }
-
-        return true;
-    }
-
-    @Override
-    public int hashCode()
-    {
-        int result = sourceRepoId != null ? sourceRepoId.hashCode() : 0;
-        result = 31 * result + ( targetRepoId != null ? targetRepoId.hashCode() : 0 );
-        return result;
-    }
-
-    @Override
-    public String toString()
-    {
-        final StringBuilder sb = new StringBuilder();
-        sb.append( "AbstractRepositoryConnector" );
-        sb.append( "{sourceRepoId='" ).append( sourceRepoId ).append( '\'' );
-        sb.append( ", targetRepoId='" ).append( targetRepoId ).append( '\'' );
-        sb.append( ", proxyId='" ).append( proxyId ).append( '\'' );
-        sb.append( ", blackListPatterns=" ).append( blackListPatterns );
-        sb.append( ", whiteListPatterns=" ).append( whiteListPatterns );
-        sb.append( ", policies=" ).append( policies );
-        sb.append( ", properties=" ).append( properties );
-        sb.append( ", disabled=" ).append( disabled );
-        sb.append( '}' );
-        return sb.toString();
-    }
-}
-
diff --git a/archiva-modules/archiva-base/archiva-repository-admin/src/main/java/org/apache/archiva/admin/repository/RepositoryAdminException.java b/archiva-modules/archiva-base/archiva-repository-admin/src/main/java/org/apache/archiva/admin/repository/RepositoryAdminException.java
deleted file mode 100644
index 12f9b1b10..000000000
--- a/archiva-modules/archiva-base/archiva-repository-admin/src/main/java/org/apache/archiva/admin/repository/RepositoryAdminException.java
+++ /dev/null
@@ -1,38 +0,0 @@
-package org.apache.archiva.admin.repository;
-/*
- * 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.
- */
-
-
-/**
- * @author Olivier Lamy
- * @since 1.4
- */
-public class RepositoryAdminException
-    extends Exception
-{
-    public RepositoryAdminException( String s )
-    {
-        super( s );
-    }
-
-    public RepositoryAdminException( String message, Throwable cause )
-    {
-        super( message, cause );
-    }
-}
diff --git a/archiva-modules/archiva-base/archiva-repository-admin/src/main/java/org/apache/archiva/admin/repository/RepositoryCommonValidator.java b/archiva-modules/archiva-base/archiva-repository-admin/src/main/java/org/apache/archiva/admin/repository/RepositoryCommonValidator.java
deleted file mode 100644
index e49fb3e0d..000000000
--- a/archiva-modules/archiva-base/archiva-repository-admin/src/main/java/org/apache/archiva/admin/repository/RepositoryCommonValidator.java
+++ /dev/null
@@ -1,148 +0,0 @@
-package org.apache.archiva.admin.repository;
-/*
- * 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.commons.validator.GenericValidator;
-import org.apache.maven.archiva.configuration.ArchivaConfiguration;
-import org.apache.maven.archiva.configuration.Configuration;
-import org.codehaus.plexus.registry.Registry;
-import org.springframework.stereotype.Service;
-
-import javax.inject.Inject;
-import javax.inject.Named;
-
-/**
- * apply basic repository validation : id and name.
- * Check if already exists.
- *
- * @author Olivier Lamy
- * @since 1.4
- */
-@Service
-public class RepositoryCommonValidator
-{
-
-    public static final String REPOSITORY_ID_VALID_EXPRESSION = "^[a-zA-Z0-9._-]+$";
-
-    public static final String REPOSITORY_NAME_VALID_EXPRESSION = "^([a-zA-Z0-9.)/_(-]|\\s)+$";
-
-
-    @Inject
-    private ArchivaConfiguration archivaConfiguration;
-
-    @Inject
-    @Named( value = "commons-configuration" )
-    private Registry registry;
-
-    /**
-     * @param abstractRepository
-     * @param update             in update mode if yes already exists won't be check
-     * @throws RepositoryAdminException
-     */
-    public void basicValidation( AbstractRepository abstractRepository, boolean update )
-        throws RepositoryAdminException
-    {
-        Configuration config = archivaConfiguration.getConfiguration();
-
-        String repoId = abstractRepository.getId();
-
-        if ( !update )
-        {
-
-            if ( config.getManagedRepositoriesAsMap().containsKey( repoId ) )
-            {
-                throw new RepositoryAdminException( "Unable to add new repository with id [" + repoId
-                                                        + "], that id already exists as a managed repository." );
-            }
-            else if ( config.getRepositoryGroupsAsMap().containsKey( repoId ) )
-            {
-                throw new RepositoryAdminException( "Unable to add new repository with id [" + repoId
-                                                        + "], that id already exists as a repository group." );
-            }
-            else if ( config.getRemoteRepositoriesAsMap().containsKey( repoId ) )
-            {
-                throw new RepositoryAdminException( "Unable to add new repository with id [" + repoId
-                                                        + "], that id already exists as a remote repository." );
-            }
-        }
-
-        if ( StringUtils.isBlank( repoId ) )
-        {
-            throw new RepositoryAdminException( "Repository ID cannot be empty." );
-        }
-
-        if ( !GenericValidator.matchRegexp( repoId, REPOSITORY_ID_VALID_EXPRESSION ) )
-        {
-            throw new RepositoryAdminException(
-                "Invalid repository ID. Identifier must only contain alphanumeric characters, underscores(_), dots(.), and dashes(-)." );
-        }
-
-        String name = abstractRepository.getName();
-
-        if ( StringUtils.isBlank( name ) )
-        {
-            throw new RepositoryAdminException( "repository name cannot be empty" );
-        }
-
-        if ( !GenericValidator.matchRegexp( name, REPOSITORY_NAME_VALID_EXPRESSION ) )
-        {
-            throw new RepositoryAdminException(
-                "Invalid repository name. Repository Name must only contain alphanumeric characters, white-spaces(' '), "
-                    + "forward-slashes(/), open-parenthesis('('), close-parenthesis(')'),  underscores(_), dots(.), and dashes(-)." );
-        }
-
-
-    }
-
-    /**
-     * replace some interpolations ${appserver.base} with correct values
-     *
-     * @param directory
-     * @return
-     */
-    public String removeExpressions( String directory )
-    {
-        String value = StringUtils.replace( directory, "${appserver.base}",
-                                            getRegistry().getString( "appserver.base", "${appserver.base}" ) );
-        value = StringUtils.replace( value, "${appserver.home}",
-                                     getRegistry().getString( "appserver.home", "${appserver.home}" ) );
-        return value;
-    }
-
-    public ArchivaConfiguration getArchivaConfiguration()
-    {
-        return archivaConfiguration;
-    }
-
-    public void setArchivaConfiguration( ArchivaConfiguration archivaConfiguration )
-    {
-        this.archivaConfiguration = archivaConfiguration;
-    }
-
-    public Registry getRegistry()
-    {
-        return registry;
-    }
-
-    public void setRegistry( Registry registry )
-    {
-        this.registry = registry;
-    }
-}
diff --git a/archiva-modules/archiva-base/archiva-repository-admin/src/main/java/org/apache/archiva/admin/repository/admin/ArchivaAdministration.java b/archiva-modules/archiva-base/archiva-repository-admin/src/main/java/org/apache/archiva/admin/repository/admin/ArchivaAdministration.java
deleted file mode 100644
index 48a365faf..000000000
--- a/archiva-modules/archiva-base/archiva-repository-admin/src/main/java/org/apache/archiva/admin/repository/admin/ArchivaAdministration.java
+++ /dev/null
@@ -1,90 +0,0 @@
-package org.apache.archiva.admin.repository.admin;
-/*
- * 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.AuditInformation;
-import org.apache.archiva.admin.repository.RepositoryAdminException;
-
-import java.util.List;
-
-/**
- * @author Olivier Lamy
- * @since 1.4
- */
-public interface ArchivaAdministration
-{
-
-    List getLegacyArtifactPaths()
-        throws RepositoryAdminException;
-
-    void addLegacyArtifactPath( LegacyArtifactPath legacyArtifactPath, AuditInformation auditInformation )
-        throws RepositoryAdminException;
-
-    void deleteLegacyArtifactPath( String path, AuditInformation auditInformation )
-        throws RepositoryAdminException;
-
-    void addFileTypePattern( String fileTypeId, String pattern, AuditInformation auditInformation )
-        throws RepositoryAdminException;
-
-    void removeFileTypePattern( String fileTypeId, String pattern, AuditInformation auditInformation )
-        throws RepositoryAdminException;
-
-    List getFileTypes()
-        throws RepositoryAdminException;
-
-    FileType getFileType( String fileTypeId )
-        throws RepositoryAdminException;
-
-    void addFileType( FileType fileType, AuditInformation auditInformation )
-        throws RepositoryAdminException;
-
-    void removeFileType( String fileTypeId, AuditInformation auditInformation )
-        throws RepositoryAdminException;
-
-    void addKnownContentConsumer( String knownContentConsumer, AuditInformation auditInformation )
-        throws RepositoryAdminException;
-
-    void setKnownContentConsumers( List knownContentConsumers, AuditInformation auditInformation )
-        throws RepositoryAdminException;
-
-    List getKnownContentConsumers()
-        throws RepositoryAdminException;
-
-    void removeKnownContentConsumer( String knownContentConsumer, AuditInformation auditInformation )
-        throws RepositoryAdminException;
-
-    void addInvalidContentConsumer( String invalidContentConsumer, AuditInformation auditInformation )
-        throws RepositoryAdminException;
-
-    void setInvalidContentConsumers( List invalidContentConsumers, AuditInformation auditInformation )
-        throws RepositoryAdminException;
-
-    List getInvalidContentConsumers()
-        throws RepositoryAdminException;
-
-    void removeInvalidContentConsumer( String invalidContentConsumer, AuditInformation auditInformation )
-        throws RepositoryAdminException;
-
-    OrganisationInformation getOrganisationInformation()
-        throws RepositoryAdminException;
-
-    void setOrganisationInformation( OrganisationInformation organisationInformation )
-        throws RepositoryAdminException;
-
-}
diff --git a/archiva-modules/archiva-base/archiva-repository-admin/src/main/java/org/apache/archiva/admin/repository/admin/DefaultArchivaAdministration.java b/archiva-modules/archiva-base/archiva-repository-admin/src/main/java/org/apache/archiva/admin/repository/admin/DefaultArchivaAdministration.java
deleted file mode 100644
index 084869214..000000000
--- a/archiva-modules/archiva-base/archiva-repository-admin/src/main/java/org/apache/archiva/admin/repository/admin/DefaultArchivaAdministration.java
+++ /dev/null
@@ -1,301 +0,0 @@
-package org.apache.archiva.admin.repository.admin;
-/*
- * 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 net.sf.beanlib.provider.replicator.BeanReplicator;
-import org.apache.archiva.admin.AuditInformation;
-import org.apache.archiva.admin.repository.AbstractRepositoryAdmin;
-import org.apache.archiva.admin.repository.RepositoryAdminException;
-import org.apache.archiva.audit.AuditEvent;
-import org.apache.commons.lang.StringUtils;
-import org.apache.maven.archiva.configuration.Configuration;
-import org.springframework.stereotype.Service;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-/**
- * @author Olivier Lamy
- */
-@Service( "archivaAdministration#default" )
-public class DefaultArchivaAdministration
-    extends AbstractRepositoryAdmin
-    implements ArchivaAdministration
-{
-    public List getLegacyArtifactPaths()
-        throws RepositoryAdminException
-    {
-        List legacyArtifactPaths = new ArrayList();
-        for ( org.apache.maven.archiva.configuration.LegacyArtifactPath legacyArtifactPath : getArchivaConfiguration().getConfiguration().getLegacyArtifactPaths() )
-        {
-            legacyArtifactPaths.add(
-                new BeanReplicator().replicateBean( legacyArtifactPath, LegacyArtifactPath.class ) );
-        }
-        return legacyArtifactPaths;
-
-    }
-
-    public void addLegacyArtifactPath( LegacyArtifactPath legacyArtifactPath, AuditInformation auditInformation )
-        throws RepositoryAdminException
-    {
-        Configuration configuration = getArchivaConfiguration().getConfiguration();
-
-        configuration.addLegacyArtifactPath( new BeanReplicator().replicateBean( legacyArtifactPath,
-                                                                                 org.apache.maven.archiva.configuration.LegacyArtifactPath.class ) );
-
-        saveConfiguration( configuration );
-        triggerAuditEvent( "", "", AuditEvent.ADD_LEGACY_PATH, auditInformation );
-    }
-
-    public void deleteLegacyArtifactPath( String path, AuditInformation auditInformation )
-        throws RepositoryAdminException
-    {
-        Configuration configuration = getArchivaConfiguration().getConfiguration();
-        org.apache.maven.archiva.configuration.LegacyArtifactPath legacyArtifactPath =
-            new org.apache.maven.archiva.configuration.LegacyArtifactPath();
-
-        legacyArtifactPath.setPath( path );
-        configuration.removeLegacyArtifactPath( legacyArtifactPath );
-
-        saveConfiguration( configuration );
-        triggerAuditEvent( "", "", AuditEvent.REMOVE_LEGACY_PATH, auditInformation );
-    }
-
-
-    public void addFileTypePattern( String fileTypeId, String pattern, AuditInformation auditInformation )
-        throws RepositoryAdminException
-    {
-        Configuration configuration = getArchivaConfiguration().getConfiguration();
-
-        org.apache.maven.archiva.configuration.FileType fileType = getFileTypeById( fileTypeId, configuration );
-        if ( fileType == null )
-        {
-            return;
-        }
-        fileType.addPattern( pattern );
-
-        saveConfiguration( configuration );
-        triggerAuditEvent( "", "", AuditEvent.ADD_PATTERN, auditInformation );
-    }
-
-    public void removeFileTypePattern( String fileTypeId, String pattern, AuditInformation auditInformation )
-        throws RepositoryAdminException
-    {
-        Configuration configuration = getArchivaConfiguration().getConfiguration();
-
-        org.apache.maven.archiva.configuration.FileType fileType = getFileTypeById( fileTypeId, configuration );
-        if ( fileType == null )
-        {
-            return;
-        }
-        fileType.removePattern( pattern );
-
-        saveConfiguration( configuration );
-        triggerAuditEvent( "", "", AuditEvent.REMOVE_PATTERN, auditInformation );
-    }
-
-    public FileType getFileType( String fileTypeId )
-        throws RepositoryAdminException
-    {
-        org.apache.maven.archiva.configuration.FileType fileType =
-            getFileTypeById( fileTypeId, getArchivaConfiguration().getConfiguration() );
-        if ( fileType == null )
-        {
-            return null;
-        }
-        return new BeanReplicator().replicateBean( fileType, FileType.class );
-    }
-
-    public void addFileType( FileType fileType, AuditInformation auditInformation )
-        throws RepositoryAdminException
-    {
-        Configuration configuration = getArchivaConfiguration().getConfiguration();
-        if ( getFileTypeById( fileType.getId(), configuration ) != null )
-        {
-            throw new RepositoryAdminException(
-                "impossible to FileType with id " + fileType.getId() + " already exists" );
-        }
-
-        configuration.getRepositoryScanning().addFileType(
-            new BeanReplicator().replicateBean( fileType, org.apache.maven.archiva.configuration.FileType.class ) );
-        saveConfiguration( configuration );
-    }
-
-    public void removeFileType( String fileTypeId, AuditInformation auditInformation )
-        throws RepositoryAdminException
-    {
-        Configuration configuration = getArchivaConfiguration().getConfiguration();
-        org.apache.maven.archiva.configuration.FileType fileType =
-            new org.apache.maven.archiva.configuration.FileType();
-        fileType.setId( fileTypeId );
-        configuration.getRepositoryScanning().removeFileType( fileType );
-        saveConfiguration( configuration );
-    }
-
-    public void addKnownContentConsumer( String knownContentConsumer, AuditInformation auditInformation )
-        throws RepositoryAdminException
-    {
-        Configuration configuration = getArchivaConfiguration().getConfiguration();
-        if ( configuration.getRepositoryScanning().getKnownContentConsumers().contains( knownContentConsumer ) )
-        {
-            log.warn( "skip adding knownContentConsumer {} as already here", knownContentConsumer );
-            return;
-        }
-        configuration.getRepositoryScanning().addKnownContentConsumer( knownContentConsumer );
-        saveConfiguration( configuration );
-        triggerAuditEvent( "", "", AuditEvent.ENABLE_REPO_CONSUMER, auditInformation );
-    }
-
-    public void removeKnownContentConsumer( String knownContentConsumer, AuditInformation auditInformation )
-        throws RepositoryAdminException
-    {
-        Configuration configuration = getArchivaConfiguration().getConfiguration();
-        configuration.getRepositoryScanning().removeKnownContentConsumer( knownContentConsumer );
-        saveConfiguration( configuration );
-        triggerAuditEvent( "", "", AuditEvent.DISABLE_REPO_CONSUMER, auditInformation );
-    }
-
-    public void addInvalidContentConsumer( String invalidContentConsumer, AuditInformation auditInformation )
-        throws RepositoryAdminException
-    {
-        Configuration configuration = getArchivaConfiguration().getConfiguration();
-        if ( configuration.getRepositoryScanning().getInvalidContentConsumers().contains( invalidContentConsumer ) )
-        {
-            log.warn( "skip adding invalidContentConsumer {} as already here", invalidContentConsumer );
-            return;
-        }
-        configuration.getRepositoryScanning().addInvalidContentConsumer( invalidContentConsumer );
-        saveConfiguration( configuration );
-        triggerAuditEvent( "", "", AuditEvent.ENABLE_REPO_CONSUMER, auditInformation );
-    }
-
-    public void removeInvalidContentConsumer( String invalidContentConsumer, AuditInformation auditInformation )
-        throws RepositoryAdminException
-    {
-        Configuration configuration = getArchivaConfiguration().getConfiguration();
-        configuration.getRepositoryScanning().removeInvalidContentConsumer( invalidContentConsumer );
-        saveConfiguration( configuration );
-        triggerAuditEvent( "", "", AuditEvent.DISABLE_REPO_CONSUMER, auditInformation );
-    }
-
-    public void setKnownContentConsumers( List knownContentConsumers, AuditInformation auditInformation )
-        throws RepositoryAdminException
-    {
-        if ( knownContentConsumers == null )
-        {
-            return;
-        }
-        for ( String knowContentConsumer : knownContentConsumers )
-        {
-            addKnownContentConsumer( knowContentConsumer, auditInformation );
-        }
-    }
-
-    public void setInvalidContentConsumers( List invalidContentConsumers, AuditInformation auditInformation )
-        throws RepositoryAdminException
-    {
-        if ( invalidContentConsumers == null )
-        {
-            return;
-        }
-        for ( String invalidContentConsumer : invalidContentConsumers )
-        {
-            addKnownContentConsumer( invalidContentConsumer, auditInformation );
-        }
-    }
-
-    public List getFileTypes()
-        throws RepositoryAdminException
-    {
-        List configFileTypes =
-            getArchivaConfiguration().getConfiguration().getRepositoryScanning().getFileTypes();
-        if ( configFileTypes == null || configFileTypes.isEmpty() )
-        {
-            return Collections.emptyList();
-        }
-        List fileTypes = new ArrayList();
-        for ( org.apache.maven.archiva.configuration.FileType fileType : configFileTypes )
-        {
-            fileTypes.add( new BeanReplicator().replicateBean( fileType, FileType.class ) );
-        }
-        return fileTypes;
-    }
-
-    public List getKnownContentConsumers()
-        throws RepositoryAdminException
-    {
-        return new ArrayList(
-            getArchivaConfiguration().getConfiguration().getRepositoryScanning().getKnownContentConsumers() );
-    }
-
-    public List getInvalidContentConsumers()
-        throws RepositoryAdminException
-    {
-        return new ArrayList(
-            getArchivaConfiguration().getConfiguration().getRepositoryScanning().getInvalidContentConsumers() );
-    }
-
-    public OrganisationInformation getOrganisationInformation()
-        throws RepositoryAdminException
-    {
-        org.apache.maven.archiva.configuration.OrganisationInformation organisationInformation =
-            getArchivaConfiguration().getConfiguration().getOrganisationInfo();
-        if ( organisationInformation == null )
-        {
-            return null;
-        }
-        return new BeanReplicator().replicateBean( organisationInformation, OrganisationInformation.class );
-    }
-
-    public void setOrganisationInformation( OrganisationInformation organisationInformation )
-        throws RepositoryAdminException
-    {
-        Configuration configuration = getArchivaConfiguration().getConfiguration();
-        if ( organisationInformation != null )
-        {
-            org.apache.maven.archiva.configuration.OrganisationInformation organisationInformationModel =
-                new BeanReplicator().replicateBean( organisationInformation,
-                                                    org.apache.maven.archiva.configuration.OrganisationInformation.class );
-            configuration.setOrganisationInfo( organisationInformationModel );
-        }
-        else
-        {
-            configuration.setOrganisationInfo( null );
-        }
-        saveConfiguration( configuration );
-    }
-
-    //-------------------------
-    //
-    //-------------------------
-
-    private org.apache.maven.archiva.configuration.FileType getFileTypeById( String id, Configuration configuration )
-    {
-        for ( org.apache.maven.archiva.configuration.FileType fileType : configuration.getRepositoryScanning().getFileTypes() )
-        {
-            if ( StringUtils.equals( id, fileType.getId() ) )
-            {
-                return fileType;
-            }
-        }
-        return null;
-    }
-
-}
diff --git a/archiva-modules/archiva-base/archiva-repository-admin/src/main/java/org/apache/archiva/admin/repository/admin/FileType.java b/archiva-modules/archiva-base/archiva-repository-admin/src/main/java/org/apache/archiva/admin/repository/admin/FileType.java
deleted file mode 100644
index 8f3a3f24d..000000000
--- a/archiva-modules/archiva-base/archiva-repository-admin/src/main/java/org/apache/archiva/admin/repository/admin/FileType.java
+++ /dev/null
@@ -1,125 +0,0 @@
-package org.apache.archiva.admin.repository.admin;
-/*
- * 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.io.Serializable;
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * @author Olivier Lamy
- * @since 1.4
- */
-public class FileType
-    implements Serializable
-{
-    /**
-     * Field id.
-     */
-    private String id;
-
-    /**
-     * Field patterns.
-     */
-    private List patterns;
-
-    public FileType()
-    {
-        // no op
-    }
-
-    public FileType( String id, List patterns )
-    {
-        this.id = id;
-        this.patterns = patterns;
-    }
-
-    public String getId()
-    {
-        return id;
-    }
-
-    public void setId( String id )
-    {
-        this.id = id;
-    }
-
-    public List getPatterns()
-    {
-        if ( patterns == null )
-        {
-            this.patterns = new ArrayList();
-        }
-        return patterns;
-    }
-
-    public void setPatterns( List patterns )
-    {
-        this.patterns = patterns;
-    }
-
-    public void addPattern( String pattern )
-    {
-        getPatterns().add( pattern );
-    }
-
-    public void removePattern( String pattern )
-    {
-        getPatterns().remove( pattern );
-    }
-
-    @Override
-    public boolean equals( Object o )
-    {
-        if ( this == o )
-        {
-            return true;
-        }
-        if ( o == null || getClass() != o.getClass() )
-        {
-            return false;
-        }
-
-        FileType fileType = (FileType) o;
-
-        if ( id != null ? !id.equals( fileType.id ) : fileType.id != null )
-        {
-            return false;
-        }
-
-        return true;
-    }
-
-    @Override
-    public int hashCode()
-    {
-        return id != null ? 37 + id.hashCode() : 0;
-    }
-
-    @Override
-    public String toString()
-    {
-        final StringBuilder sb = new StringBuilder();
-        sb.append( "FileType" );
-        sb.append( "{id='" ).append( id ).append( '\'' );
-        sb.append( ", patterns=" ).append( patterns );
-        sb.append( '}' );
-        return sb.toString();
-    }
-}
diff --git a/archiva-modules/archiva-base/archiva-repository-admin/src/main/java/org/apache/archiva/admin/repository/admin/FiletypeToMapClosure.java b/archiva-modules/archiva-base/archiva-repository-admin/src/main/java/org/apache/archiva/admin/repository/admin/FiletypeToMapClosure.java
deleted file mode 100644
index 5465b6e71..000000000
--- a/archiva-modules/archiva-base/archiva-repository-admin/src/main/java/org/apache/archiva/admin/repository/admin/FiletypeToMapClosure.java
+++ /dev/null
@@ -1,50 +0,0 @@
-package org.apache.archiva.admin.repository.admin;
-
-/*
- * 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.collections.Closure;
-
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * FiletypeToMapClosure 
- *
- * @since 1.4
- */
-public class FiletypeToMapClosure
-    implements Closure
-{
-    private Map map = new HashMap();
-
-    public void execute( Object input )
-    {
-        if ( input instanceof FileType )
-        {
-            FileType filetype = (FileType) input;
-            map.put( filetype.getId(), filetype );
-        }
-    }
-
-    public Map getMap()
-    {
-        return map;
-    }
-}
diff --git a/archiva-modules/archiva-base/archiva-repository-admin/src/main/java/org/apache/archiva/admin/repository/admin/LegacyArtifactPath.java b/archiva-modules/archiva-base/archiva-repository-admin/src/main/java/org/apache/archiva/admin/repository/admin/LegacyArtifactPath.java
deleted file mode 100644
index e9489489e..000000000
--- a/archiva-modules/archiva-base/archiva-repository-admin/src/main/java/org/apache/archiva/admin/repository/admin/LegacyArtifactPath.java
+++ /dev/null
@@ -1,141 +0,0 @@
-package org.apache.archiva.admin.repository.admin;
-/*
- * 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.io.Serializable;
-
-/**
- * @author Olivier Lamy
- * @since 1.4
- */
-public class LegacyArtifactPath
-    implements Serializable
-{
-    /**
-     * The legacy path.
-     */
-    private String path;
-
-    /**
-     * The artifact reference, as " [groupId] :
-     * [artifactId] : [version] : [classifier] : [type] ".
-     */
-    private String artifact;
-
-    public LegacyArtifactPath()
-    {
-        // no op
-    }
-
-    public LegacyArtifactPath( String path, String artifact )
-    {
-        this.path = path;
-        this.artifact = artifact;
-    }
-
-    public String getPath()
-    {
-        return path;
-    }
-
-    public void setPath( String path )
-    {
-        this.path = path;
-    }
-
-    public String getArtifact()
-    {
-        return artifact;
-    }
-
-    public void setArtifact( String artifact )
-    {
-        this.artifact = artifact;
-    }
-
-    public boolean match( String path )
-    {
-        return path.equals( this.path );
-    }
-
-    public String getGroupId()
-    {
-        return artifact.split( ":" )[0];
-    }
-
-    public String getArtifactId()
-    {
-        return artifact.split( ":" )[1];
-    }
-
-    public String getVersion()
-    {
-        return artifact.split( ":" )[2];
-    }
-
-    public String getClassifier()
-    {
-        String classifier = artifact.split( ":" )[3];
-        return classifier.length() > 0 ? classifier : null;
-    }
-
-    public String getType()
-    {
-        return artifact.split( ":" )[4];
-    }
-
-    @Override
-    public boolean equals( Object o )
-    {
-        if ( this == o )
-        {
-            return true;
-        }
-        if ( o == null || getClass() != o.getClass() )
-        {
-            return false;
-        }
-
-        LegacyArtifactPath that = (LegacyArtifactPath) o;
-
-        if ( path != null ? !path.equals( that.path ) : that.path != null )
-        {
-            return false;
-        }
-
-        return true;
-    }
-
-    @Override
-    public int hashCode()
-    {
-        return path != null ? 37 + path.hashCode() : 0;
-    }
-
-    @Override
-    public String toString()
-    {
-        final StringBuilder sb = new StringBuilder();
-        sb.append( "LegacyArtifactPath" );
-        sb.append( "{path='" ).append( path ).append( '\'' );
-        sb.append( ", artifact='" ).append( artifact ).append( '\'' );
-        sb.append( '}' );
-        return sb.toString();
-    }
-}
diff --git a/archiva-modules/archiva-base/archiva-repository-admin/src/main/java/org/apache/archiva/admin/repository/admin/OrganisationInformation.java b/archiva-modules/archiva-base/archiva-repository-admin/src/main/java/org/apache/archiva/admin/repository/admin/OrganisationInformation.java
deleted file mode 100644
index 77bd06d0d..000000000
--- a/archiva-modules/archiva-base/archiva-repository-admin/src/main/java/org/apache/archiva/admin/repository/admin/OrganisationInformation.java
+++ /dev/null
@@ -1,95 +0,0 @@
-package org.apache.archiva.admin.repository.admin;
-/*
- * 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.
- */
-
-/**
- * @author Olivier Lamy
- * @since 1.4
- */
-public class OrganisationInformation
-{
-    /**
-     * name of the organisation.
-     */
-    private String name;
-
-    /**
-     * name of the organisation.
-     */
-    private String url;
-
-    /**
-     * name of the organisation.
-     */
-    private String logoLocation;
-
-    public OrganisationInformation()
-    {
-        // no op
-    }
-
-    public OrganisationInformation( String name, String url, String logoLocation )
-    {
-        this.name = name;
-        this.url = url;
-        this.logoLocation = logoLocation;
-    }
-
-    public String getName()
-    {
-        return name;
-    }
-
-    public void setName( String name )
-    {
-        this.name = name;
-    }
-
-    public String getUrl()
-    {
-        return url;
-    }
-
-    public void setUrl( String url )
-    {
-        this.url = url;
-    }
-
-    public String getLogoLocation()
-    {
-        return logoLocation;
-    }
-
-    public void setLogoLocation( String logoLocation )
-    {
-        this.logoLocation = logoLocation;
-    }
-
-    @Override
-    public String toString()
-    {
-        final StringBuilder sb = new StringBuilder();
-        sb.append( "OrganisationInformation" );
-        sb.append( "{name='" ).append( name ).append( '\'' );
-        sb.append( ", url='" ).append( url ).append( '\'' );
-        sb.append( ", logoLocation='" ).append( logoLocation ).append( '\'' );
-        sb.append( '}' );
-        return sb.toString();
-    }
-}
diff --git a/archiva-modules/archiva-base/archiva-repository-admin/src/main/java/org/apache/archiva/admin/repository/group/DefaultRepositoryGroupAdmin.java b/archiva-modules/archiva-base/archiva-repository-admin/src/main/java/org/apache/archiva/admin/repository/group/DefaultRepositoryGroupAdmin.java
deleted file mode 100644
index 78e183ba3..000000000
--- a/archiva-modules/archiva-base/archiva-repository-admin/src/main/java/org/apache/archiva/admin/repository/group/DefaultRepositoryGroupAdmin.java
+++ /dev/null
@@ -1,325 +0,0 @@
-package org.apache.archiva.admin.repository.group;
-/*
- * 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.AuditInformation;
-import org.apache.archiva.admin.repository.AbstractRepositoryAdmin;
-import org.apache.archiva.admin.repository.RepositoryAdminException;
-import org.apache.archiva.admin.repository.managed.ManagedRepository;
-import org.apache.archiva.admin.repository.managed.ManagedRepositoryAdmin;
-import org.apache.archiva.audit.AuditEvent;
-import org.apache.commons.lang.StringUtils;
-import org.apache.maven.archiva.configuration.Configuration;
-import org.apache.maven.archiva.configuration.RepositoryGroupConfiguration;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.stereotype.Service;
-
-import javax.inject.Inject;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-/**
- * @author Olivier Lamy
- */
-@Service( "repositoryGroupAdmin#default" )
-public class DefaultRepositoryGroupAdmin
-    extends AbstractRepositoryAdmin
-    implements RepositoryGroupAdmin
-{
-
-    private Logger log = LoggerFactory.getLogger( getClass() );
-
-    private static final Pattern REPO_GROUP_ID_PATTERN = Pattern.compile( "[A-Za-z0-9\\._\\-]+" );
-
-    @Inject
-    private ManagedRepositoryAdmin managedRepositoryAdmin;
-
-    public List getRepositoriesGroups()
-        throws RepositoryAdminException
-    {
-        List repositoriesGroups = new ArrayList();
-
-        for ( RepositoryGroupConfiguration repositoryGroupConfiguration : getArchivaConfiguration().getConfiguration().getRepositoryGroups() )
-        {
-            repositoriesGroups.add( new RepositoryGroup( repositoryGroupConfiguration.getId(), new ArrayList(
-                repositoryGroupConfiguration.getRepositories() ) ) );
-        }
-
-        return repositoriesGroups;
-    }
-
-    public RepositoryGroup getRepositoryGroup( String repositoryGroupId )
-        throws RepositoryAdminException
-    {
-        List repositoriesGroups = getRepositoriesGroups();
-        for ( RepositoryGroup repositoryGroup : repositoriesGroups )
-        {
-            if ( StringUtils.equals( repositoryGroupId, repositoryGroup.getId() ) )
-            {
-                return repositoryGroup;
-            }
-        }
-        return null;
-    }
-
-    public Boolean addRepositoryGroup( RepositoryGroup repositoryGroup, AuditInformation auditInformation )
-        throws RepositoryAdminException
-    {
-        validateRepositoryGroup( repositoryGroup, false );
-        validateManagedRepositoriesExists( repositoryGroup.getRepositories() );
-        RepositoryGroupConfiguration repositoryGroupConfiguration = new RepositoryGroupConfiguration();
-        repositoryGroupConfiguration.setId( repositoryGroup.getId() );
-        repositoryGroupConfiguration.setRepositories( repositoryGroup.getRepositories() );
-        Configuration configuration = getArchivaConfiguration().getConfiguration();
-        configuration.addRepositoryGroup( repositoryGroupConfiguration );
-        saveConfiguration( configuration );
-        triggerAuditEvent( repositoryGroup.getId(), null, AuditEvent.ADD_REPO_GROUP, auditInformation );
-        return Boolean.TRUE;
-    }
-
-    public Boolean deleteRepositoryGroup( String repositoryGroupId, AuditInformation auditInformation )
-        throws RepositoryAdminException
-    {
-        Configuration configuration = getArchivaConfiguration().getConfiguration();
-        RepositoryGroupConfiguration repositoryGroupConfiguration =
-            configuration.getRepositoryGroupsAsMap().get( repositoryGroupId );
-        if ( repositoryGroupConfiguration == null )
-        {
-            throw new RepositoryAdminException(
-                "repositoryGroup with id " + repositoryGroupId + " doesn't not exists so cannot remove" );
-        }
-        configuration.removeRepositoryGroup( repositoryGroupConfiguration );
-        triggerAuditEvent( repositoryGroupId, null, AuditEvent.DELETE_REPO_GROUP, auditInformation );
-        return Boolean.TRUE;
-    }
-
-    public Boolean updateRepositoryGroup( RepositoryGroup repositoryGroup, AuditInformation auditInformation )
-        throws RepositoryAdminException
-    {
-        return updateRepositoryGroup( repositoryGroup, auditInformation, true );
-    }
-
-    private Boolean updateRepositoryGroup( RepositoryGroup repositoryGroup, AuditInformation auditInformation,
-                                           boolean triggerAuditEvent )
-        throws RepositoryAdminException
-    {
-        validateRepositoryGroup( repositoryGroup, true );
-        validateManagedRepositoriesExists( repositoryGroup.getRepositories() );
-        Configuration configuration = getArchivaConfiguration().getConfiguration();
-
-        RepositoryGroupConfiguration repositoryGroupConfiguration =
-            configuration.getRepositoryGroupsAsMap().get( repositoryGroup.getId() );
-
-        configuration.removeRepositoryGroup( repositoryGroupConfiguration );
-
-        repositoryGroupConfiguration.setRepositories( repositoryGroup.getRepositories() );
-        configuration.addRepositoryGroup( repositoryGroupConfiguration );
-
-        saveConfiguration( configuration );
-        if ( triggerAuditEvent )
-        {
-            triggerAuditEvent( repositoryGroup.getId(), null, AuditEvent.MODIFY_REPO_GROUP, auditInformation );
-        }
-        return Boolean.TRUE;
-    }
-
-
-    public Boolean addRepositoryToGroup( String repositoryGroupId, String repositoryId,
-                                         AuditInformation auditInformation )
-        throws RepositoryAdminException
-    {
-        RepositoryGroup repositoryGroup = getRepositoryGroup( repositoryGroupId );
-        if ( repositoryGroup == null )
-        {
-            throw new RepositoryAdminException(
-                "repositoryGroup with id " + repositoryGroupId + " doesn't not exists so cannot add repository to it" );
-        }
-
-        if ( repositoryGroup.getRepositories().contains( repositoryId ) )
-        {
-            throw new RepositoryAdminException(
-                "repositoryGroup with id " + repositoryGroupId + " already contain repository with id" + repositoryId );
-        }
-        validateManagedRepositoriesExists( Arrays.asList( repositoryId ) );
-
-        repositoryGroup.addRepository( repositoryId );
-        updateRepositoryGroup( repositoryGroup, auditInformation, false );
-        triggerAuditEvent( repositoryGroup.getId(), null, AuditEvent.ADD_REPO_TO_GROUP, auditInformation );
-        return Boolean.TRUE;
-    }
-
-    public Boolean deleteRepositoryFromGroup( String repositoryGroupId, String repositoryId,
-                                              AuditInformation auditInformation )
-        throws RepositoryAdminException
-    {
-        RepositoryGroup repositoryGroup = getRepositoryGroup( repositoryGroupId );
-        if ( repositoryGroup == null )
-        {
-            throw new RepositoryAdminException( "repositoryGroup with id " + repositoryGroupId
-                                                    + " doesn't not exists so cannot remove repository from it" );
-        }
-
-        if ( !repositoryGroup.getRepositories().contains( repositoryId ) )
-        {
-            throw new RepositoryAdminException(
-                "repositoryGroup with id " + repositoryGroupId + " doesn't not contains repository with id"
-                    + repositoryId );
-        }
-
-        repositoryGroup.removeRepository( repositoryId );
-        updateRepositoryGroup( repositoryGroup, auditInformation, false );
-        triggerAuditEvent( repositoryGroup.getId(), null, AuditEvent.DELETE_REPO_FROM_GROUP, auditInformation );
-        return Boolean.TRUE;
-    }
-
-    public Map getRepositoryGroupsAsMap()
-        throws RepositoryAdminException
-    {
-        List repositoriesGroups = getRepositoriesGroups();
-        Map map = new HashMap( repositoriesGroups.size() );
-        for ( RepositoryGroup repositoryGroup : repositoriesGroups )
-        {
-            map.put( repositoryGroup.getId(), repositoryGroup );
-        }
-        return map;
-    }
-
-    public Map> getGroupToRepositoryMap()
-        throws RepositoryAdminException
-    {
-
-        java.util.Map> map = new java.util.HashMap>();
-
-        for ( ManagedRepository repo : getManagedRepositoryAdmin().getManagedRepositories() )
-        {
-            for ( RepositoryGroup group : getRepositoriesGroups() )
-            {
-                if ( !group.getRepositories().contains( repo.getId() ) )
-                {
-                    String groupId = group.getId();
-                    java.util.List repos = map.get( groupId );
-                    if ( repos == null )
-                    {
-                        repos = new java.util.ArrayList();
-                        map.put( groupId, repos );
-                    }
-                    repos.add( repo.getId() );
-                }
-            }
-        }
-        return map;
-    }
-
-    public Map> getRepositoryToGroupMap()
-        throws RepositoryAdminException
-    {
-        java.util.Map> map = new java.util.HashMap>();
-
-        for ( RepositoryGroup group : getRepositoriesGroups() )
-        {
-            for ( String repositoryId : group.getRepositories() )
-            {
-                java.util.List groups = map.get( repositoryId );
-                if ( groups == null )
-                {
-                    groups = new java.util.ArrayList();
-                    map.put( repositoryId, groups );
-                }
-                groups.add( group.getId() );
-            }
-        }
-        return map;
-    }
-
-    public Boolean validateRepositoryGroup( RepositoryGroup repositoryGroup, boolean updateMode )
-        throws RepositoryAdminException
-    {
-        String repoGroupId = repositoryGroup.getId();
-        if ( StringUtils.isBlank( repoGroupId ) )
-        {
-            throw new RepositoryAdminException( "repositoryGroup id cannot be empty" );
-        }
-
-        if ( repoGroupId.length() > 100 )
-        {
-            throw new RepositoryAdminException(
-                "Identifier [" + repoGroupId + "] is over the maximum limit of 100 characters" );
-
-        }
-
-        Matcher matcher = REPO_GROUP_ID_PATTERN.matcher( repoGroupId );
-        if ( !matcher.matches() )
-        {
-            throw new RepositoryAdminException(
-                "Invalid character(s) found in identifier. Only the following characters are allowed: alphanumeric, '.', '-' and '_'" );
-        }
-
-        Configuration configuration = getArchivaConfiguration().getConfiguration();
-
-        if ( configuration.getRepositoryGroupsAsMap().containsKey( repoGroupId ) )
-        {
-            if ( !updateMode )
-            {
-                throw new RepositoryAdminException( "Unable to add new repository group with id [" + repoGroupId
-                                                        + "], that id already exists as a repository group." );
-            }
-        }
-        else if ( configuration.getManagedRepositoriesAsMap().containsKey( repoGroupId ) )
-        {
-            throw new RepositoryAdminException( "Unable to add new repository group with id [" + repoGroupId
-                                                    + "], that id already exists as a managed repository." );
-        }
-        else if ( configuration.getRemoteRepositoriesAsMap().containsKey( repoGroupId ) )
-        {
-            throw new RepositoryAdminException( "Unable to add new repository group with id [" + repoGroupId
-                                                    + "], that id already exists as a remote repository." );
-        }
-
-        return Boolean.TRUE;
-    }
-
-    private void validateManagedRepositoriesExists( List managedRepositoriesIds )
-        throws RepositoryAdminException
-    {
-        for ( String id : managedRepositoriesIds )
-        {
-            if ( getManagedRepositoryAdmin().getManagedRepository( id ) == null )
-            {
-                throw new RepositoryAdminException(
-                    "managedRepository with id " + id + " not exists so cannot be used in a repositoryGroup" );
-            }
-        }
-    }
-
-    public ManagedRepositoryAdmin getManagedRepositoryAdmin()
-    {
-        return managedRepositoryAdmin;
-    }
-
-    public void setManagedRepositoryAdmin( ManagedRepositoryAdmin managedRepositoryAdmin )
-    {
-        this.managedRepositoryAdmin = managedRepositoryAdmin;
-    }
-}
diff --git a/archiva-modules/archiva-base/archiva-repository-admin/src/main/java/org/apache/archiva/admin/repository/group/RepositoryGroup.java b/archiva-modules/archiva-base/archiva-repository-admin/src/main/java/org/apache/archiva/admin/repository/group/RepositoryGroup.java
deleted file mode 100644
index 5e44596ed..000000000
--- a/archiva-modules/archiva-base/archiva-repository-admin/src/main/java/org/apache/archiva/admin/repository/group/RepositoryGroup.java
+++ /dev/null
@@ -1,153 +0,0 @@
-package org.apache.archiva.admin.repository.group;
-/*
- * 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.io.Serializable;
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * @author Olivier Lamy
- * @since 1.4
- */
-public class RepositoryGroup
-    implements Serializable
-{
-    /**
-     * repository group Id
-     */
-    private String id;
-
-    /**
-     * repositories ids
-     */
-    private List repositories;
-
-    public RepositoryGroup()
-    {
-        // no op
-    }
-
-    public RepositoryGroup( String id, List repositories )
-    {
-        this.id = id;
-        this.repositories = repositories;
-    }
-
-    /**
-     * Method addRepository.
-     *
-     * @param string
-     */
-    public void addRepository( String string )
-    {
-        getRepositories().add( string );
-    }
-
-    /**
-     * Get the id of the repository group.
-     *
-     * @return String
-     */
-    public String getId()
-    {
-        return this.id;
-    }
-
-    /**
-     * Method getRepositories.
-     *
-     * @return List
-     */
-    public java.util.List getRepositories()
-    {
-        if ( this.repositories == null )
-        {
-            this.repositories = new ArrayList();
-        }
-
-        return this.repositories;
-    }
-
-    /**
-     * Method removeRepository.
-     *
-     * @param string
-     */
-    public void removeRepository( String string )
-    {
-        getRepositories().remove( string );
-    }
-
-    /**
-     * Set the id of the repository group.
-     *
-     * @param id
-     */
-    public void setId( String id )
-    {
-        this.id = id;
-    }
-
-    /**
-     * Set the list of repository ids under the group.
-     *
-     * @param repositories
-     */
-    public void setRepositories( List repositories )
-    {
-        this.repositories = repositories;
-    }
-
-    public boolean equals( Object other )
-    {
-        if ( this == other )
-        {
-            return true;
-        }
-
-        if ( !( other instanceof RepositoryGroup ) )
-        {
-            return false;
-        }
-
-        RepositoryGroup that = (RepositoryGroup) other;
-        boolean result = true;
-        result = result && ( getId() == null ? that.getId() == null : getId().equals( that.getId() ) );
-        return result;
-    }
-
-    public int hashCode()
-    {
-        int result = 17;
-        result = 37 * result + ( id != null ? id.hashCode() : 0 );
-        return result;
-    }
-
-    @Override
-    public String toString()
-    {
-        final StringBuilder sb = new StringBuilder();
-        sb.append( "RepositoryGroup" );
-        sb.append( "{id='" ).append( id ).append( '\'' );
-        sb.append( ", repositories=" ).append( repositories );
-        sb.append( '}' );
-        return sb.toString();
-    }
-}
diff --git a/archiva-modules/archiva-base/archiva-repository-admin/src/main/java/org/apache/archiva/admin/repository/group/RepositoryGroupAdmin.java b/archiva-modules/archiva-base/archiva-repository-admin/src/main/java/org/apache/archiva/admin/repository/group/RepositoryGroupAdmin.java
deleted file mode 100644
index 7c21b3a5b..000000000
--- a/archiva-modules/archiva-base/archiva-repository-admin/src/main/java/org/apache/archiva/admin/repository/group/RepositoryGroupAdmin.java
+++ /dev/null
@@ -1,75 +0,0 @@
-package org.apache.archiva.admin.repository.group;
-/*
- * 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.AuditInformation;
-import org.apache.archiva.admin.repository.RepositoryAdminException;
-
-import java.util.List;
-import java.util.Map;
-
-/**
- * @author Olivier Lamy
- * @since 1.4
- */
-public interface RepositoryGroupAdmin
-{
-    List getRepositoriesGroups()
-        throws RepositoryAdminException;
-
-    RepositoryGroup getRepositoryGroup( String repositoryGroupId )
-        throws RepositoryAdminException;
-
-    Boolean addRepositoryGroup( RepositoryGroup repositoryGroup, AuditInformation auditInformation )
-        throws RepositoryAdminException;
-
-    Boolean updateRepositoryGroup( RepositoryGroup repositoryGroup, AuditInformation auditInformation )
-        throws RepositoryAdminException;
-
-    Boolean deleteRepositoryGroup( String repositoryGroupId, AuditInformation auditInformation )
-        throws RepositoryAdminException;
-
-    Boolean addRepositoryToGroup( String repositoryGroupId, String repositoryId, AuditInformation auditInformation )
-        throws RepositoryAdminException;
-
-    Boolean deleteRepositoryFromGroup( String repositoryGroupId, String repositoryId,
-                                       AuditInformation auditInformation )
-        throws RepositoryAdminException;
-
-    /**
-     * @return Map with key repoGroupId and value repoGroup
-     * @throws RepositoryAdminException
-     */
-    Map getRepositoryGroupsAsMap()
-        throws RepositoryAdminException;
-
-    /**
-     * @return Map with key repoGroupId and value List of ManagedRepositories
-     * @throws RepositoryAdminException
-     */
-    Map> getGroupToRepositoryMap()
-        throws RepositoryAdminException;
-
-    /**
-     * @return Map with key managedRepo id and value List of repositoryGroup ids where the repo is
-     * @throws RepositoryAdminException
-     */
-    Map> getRepositoryToGroupMap()
-        throws RepositoryAdminException;
-}
diff --git a/archiva-modules/archiva-base/archiva-repository-admin/src/main/java/org/apache/archiva/admin/repository/managed/DefaultManagedRepositoryAdmin.java b/archiva-modules/archiva-base/archiva-repository-admin/src/main/java/org/apache/archiva/admin/repository/managed/DefaultManagedRepositoryAdmin.java
deleted file mode 100644
index e525c3bc9..000000000
--- a/archiva-modules/archiva-base/archiva-repository-admin/src/main/java/org/apache/archiva/admin/repository/managed/DefaultManagedRepositoryAdmin.java
+++ /dev/null
@@ -1,596 +0,0 @@
-package org.apache.archiva.admin.repository.managed;
-/*
- * 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.AuditInformation;
-import org.apache.archiva.admin.repository.AbstractRepositoryAdmin;
-import org.apache.archiva.admin.repository.RepositoryAdminException;
-import org.apache.archiva.audit.AuditEvent;
-import org.apache.archiva.metadata.repository.MetadataRepository;
-import org.apache.archiva.metadata.repository.MetadataRepositoryException;
-import org.apache.archiva.metadata.repository.RepositorySession;
-import org.apache.archiva.metadata.repository.RepositorySessionFactory;
-import org.apache.archiva.metadata.repository.stats.RepositoryStatisticsManager;
-import org.apache.archiva.scheduler.repository.RepositoryArchivaTaskScheduler;
-import org.apache.archiva.scheduler.repository.RepositoryTask;
-import org.apache.archiva.security.common.ArchivaRoleConstants;
-import org.apache.commons.io.FileUtils;
-import org.apache.commons.lang.StringUtils;
-import org.apache.commons.validator.GenericValidator;
-import org.apache.maven.archiva.configuration.Configuration;
-import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration;
-import org.apache.maven.archiva.configuration.ProxyConnectorConfiguration;
-import org.apache.maven.archiva.configuration.RepositoryGroupConfiguration;
-import org.codehaus.plexus.redback.role.RoleManager;
-import org.codehaus.plexus.redback.role.RoleManagerException;
-import org.codehaus.plexus.taskqueue.TaskQueueException;
-import org.codehaus.redback.components.scheduler.CronExpressionValidator;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.stereotype.Service;
-
-import javax.inject.Inject;
-import javax.inject.Named;
-import java.io.File;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-/**
- * FIXME remove all generic Exception to have usefull ones
- * FIXME review the staging mechanism to have a per user session one
- *
- * @author Olivier Lamy
- */
-@Service( "managedRepositoryAdmin#default" )
-public class DefaultManagedRepositoryAdmin
-    extends AbstractRepositoryAdmin
-    implements ManagedRepositoryAdmin
-{
-
-    public static final String REPOSITORY_LOCATION_VALID_EXPRESSION = "^[-a-zA-Z0-9._/~:?!&=\\\\]+$";
-
-    private Logger log = LoggerFactory.getLogger( getClass() );
-
-    public static final String STAGE_REPO_ID_END = "-stage";
-
-
-    @Inject
-    @Named( value = "archivaTaskScheduler#repository" )
-    private RepositoryArchivaTaskScheduler repositoryTaskScheduler;
-
-    @Inject
-    private RepositorySessionFactory repositorySessionFactory;
-
-    @Inject
-    private RepositoryStatisticsManager repositoryStatisticsManager;
-
-
-    @Inject
-    protected RoleManager roleManager;
-
-    public List getManagedRepositories()
-        throws RepositoryAdminException
-    {
-        List managedRepoConfigs =
-            getArchivaConfiguration().getConfiguration().getManagedRepositories();
-
-        List managedRepos = new ArrayList( managedRepoConfigs.size() );
-
-        for ( ManagedRepositoryConfiguration repoConfig : managedRepoConfigs )
-        {
-            // TODO add staging repo information back too
-            ManagedRepository repo =
-                new ManagedRepository( repoConfig.getId(), repoConfig.getName(), repoConfig.getLocation(),
-                                       repoConfig.getLayout(), repoConfig.isSnapshots(), repoConfig.isReleases(),
-                                       repoConfig.isBlockRedeployments(), repoConfig.getRefreshCronExpression(),
-                                       repoConfig.getIndexDir(), repoConfig.isScanned(), repoConfig.getDaysOlder(),
-                                       repoConfig.getRetentionCount(), repoConfig.isDeleteReleasedSnapshots() );
-
-            managedRepos.add( repo );
-        }
-
-        return managedRepos;
-    }
-
-    public Map getManagedRepositoriesAsMap()
-        throws RepositoryAdminException
-    {
-        List managedRepositories = getManagedRepositories();
-        Map repositoriesMap =
-            new HashMap( managedRepositories.size() );
-        for ( ManagedRepository managedRepository : managedRepositories )
-        {
-            repositoriesMap.put( managedRepository.getId(), managedRepository );
-        }
-        return repositoriesMap;
-    }
-
-    public ManagedRepository getManagedRepository( String repositoryId )
-        throws RepositoryAdminException
-    {
-        List repos = getManagedRepositories();
-        for ( ManagedRepository repo : repos )
-        {
-            if ( StringUtils.equals( repo.getId(), repositoryId ) )
-            {
-                return repo;
-            }
-        }
-        return null;
-    }
-
-    public Boolean addManagedRepository( ManagedRepository managedRepository, boolean needStageRepo,
-                                         AuditInformation auditInformation )
-        throws RepositoryAdminException
-    {
-
-        getRepositoryCommonValidator().basicValidation( managedRepository, false );
-        triggerAuditEvent( managedRepository.getId(), null, AuditEvent.ADD_MANAGED_REPO, auditInformation );
-        return
-            addManagedRepository( managedRepository.getId(), managedRepository.getLayout(), managedRepository.getName(),
-                                  managedRepository.getLocation(), managedRepository.isBlockRedeployments(),
-                                  managedRepository.isReleases(), managedRepository.isSnapshots(), needStageRepo,
-                                  managedRepository.getCronExpression(), managedRepository.getIndexDirectory(),
-                                  managedRepository.getDaysOlder(), managedRepository.getRetentionCount(),
-                                  managedRepository.isDeleteReleasedSnapshots(), auditInformation,
-                                  getArchivaConfiguration().getConfiguration() ) != null;
-
-    }
-
-    private ManagedRepositoryConfiguration addManagedRepository( String repoId, String layout, String name,
-                                                                 String location, boolean blockRedeployments,
-                                                                 boolean releasesIncluded, boolean snapshotsIncluded,
-                                                                 boolean stageRepoNeeded, String cronExpression,
-                                                                 String indexDir, int daysOlder, int retentionCount,
-                                                                 boolean deteleReleasedSnapshots,
-                                                                 AuditInformation auditInformation,
-                                                                 Configuration config )
-        throws RepositoryAdminException
-    {
-
-        // FIXME : olamy can be empty to avoid scheduled scan ?
-        if ( StringUtils.isNotBlank( cronExpression ) )
-        {
-            CronExpressionValidator validator = new CronExpressionValidator();
-
-            if ( !validator.validate( cronExpression ) )
-            {
-                throw new RepositoryAdminException( "Invalid cron expression." );
-            }
-        }
-        else
-        {
-            throw new RepositoryAdminException( "Cron expression cannot be empty." );
-        }
-
-        String repoLocation = getRepositoryCommonValidator().removeExpressions( location );
-
-        if ( !GenericValidator.matchRegexp( repoLocation, REPOSITORY_LOCATION_VALID_EXPRESSION ) )
-        {
-            throw new RepositoryAdminException(
-                "Invalid repository location. Directory must only contain alphanumeric characters, equals(=), question-marks(?), "
-                    + "exclamation-points(!), ampersands(&), forward-slashes(/), back-slashes(\\), underscores(_), dots(.), colons(:), tildes(~), and dashes(-)." );
-        }
-
-        ManagedRepositoryConfiguration repository = new ManagedRepositoryConfiguration();
-
-        repository.setId( repoId );
-        repository.setBlockRedeployments( blockRedeployments );
-        repository.setReleases( releasesIncluded );
-        repository.setSnapshots( snapshotsIncluded );
-        repository.setName( name );
-        repository.setLocation( repoLocation );
-        repository.setLayout( layout );
-        repository.setRefreshCronExpression( cronExpression );
-        repository.setIndexDir( indexDir );
-        repository.setDaysOlder( daysOlder );
-        repository.setRetentionCount( retentionCount );
-        repository.setDeleteReleasedSnapshots( deteleReleasedSnapshots );
-        try
-        {
-            addRepository( repository, config );
-            addRepositoryRoles( repository );
-
-            if ( stageRepoNeeded )
-            {
-                ManagedRepositoryConfiguration stagingRepository = getStageRepoConfig( repository );
-                addRepository( stagingRepository, config );
-                addRepositoryRoles( stagingRepository );
-                triggerAuditEvent( stagingRepository.getId(), null, AuditEvent.ADD_MANAGED_REPO, auditInformation );
-            }
-        }
-        catch ( RoleManagerException e )
-        {
-            throw new RepositoryAdminException( "failed to add repository roles " + e.getMessage(), e );
-        }
-        catch ( IOException e )
-        {
-            throw new RepositoryAdminException( "failed to add repository " + e.getMessage(), e );
-        }
-
-        saveConfiguration( config );
-
-        //MRM-1342 Repository statistics report doesn't appear to be working correctly
-        //scan repository when adding of repository is successful
-        try
-        {
-            scanRepository( repoId, true );
-            // olamy no need of scanning staged repo
-            /*
-            if ( stageRepoNeeded )
-            {
-                ManagedRepositoryConfiguration stagingRepository = getStageRepoConfig( repository );
-                scanRepository( stagingRepository.getId(), true );
-            }*/
-        }
-        catch ( Exception e )
-        {
-            log.warn( new StringBuilder( "Unable to scan repository [" ).append( repoId ).append( "]: " ).append(
-                e.getMessage() ).toString(), e );
-        }
-
-        return repository;
-    }
-
-
-    // FIXME cleanup repositoryGroups when deleting a ManagedRepo
-    public Boolean deleteManagedRepository( String repositoryId, AuditInformation auditInformation,
-                                            boolean deleteContent )
-        throws RepositoryAdminException
-    {
-        Configuration config = getArchivaConfiguration().getConfiguration();
-
-        ManagedRepositoryConfiguration repository = config.findManagedRepositoryById( repositoryId );
-
-        if ( repository == null )
-        {
-            throw new RepositoryAdminException( "A repository with that id does not exist" );
-        }
-
-        triggerAuditEvent( repositoryId, null, AuditEvent.DELETE_MANAGED_REPO, auditInformation );
-
-        deleteManagedRepository( repository, deleteContent, config, false );
-
-        // stage repo exists ?
-        ManagedRepositoryConfiguration stagingRepository =
-            getArchivaConfiguration().getConfiguration().findManagedRepositoryById( repositoryId + STAGE_REPO_ID_END );
-        if ( stagingRepository != null )
-        {
-            // do not trigger event when deleting the staged one
-            //triggerAuditEvent( stagingRepository.getId(), null, AuditEvent.DELETE_MANAGED_REPO, auditInformation );
-            deleteManagedRepository( stagingRepository, deleteContent, config, true );
-        }
-
-        try
-        {
-            saveConfiguration( config );
-        }
-        catch ( Exception e )
-        {
-            throw new RepositoryAdminException( "Error saving configuration for delete action" + e.getMessage() );
-        }
-
-        return Boolean.TRUE;
-    }
-
-    private Boolean deleteManagedRepository( ManagedRepositoryConfiguration repository, boolean deleteContent,
-                                             Configuration config, boolean stagedOne )
-        throws RepositoryAdminException
-    {
-        if ( !stagedOne )
-        {
-            RepositorySession repositorySession = getRepositorySessionFactory().createSession();
-            try
-            {
-                MetadataRepository metadataRepository = repositorySession.getRepository();
-                metadataRepository.removeRepository( repository.getId() );
-                log.debug( "call repositoryStatisticsManager.deleteStatistics" );
-                getRepositoryStatisticsManager().deleteStatistics( metadataRepository, repository.getId() );
-                repositorySession.save();
-            }
-            catch ( MetadataRepositoryException e )
-            {
-                throw new RepositoryAdminException( e.getMessage(), e );
-            }
-            finally
-            {
-                repositorySession.close();
-            }
-        }
-        config.removeManagedRepository( repository );
-
-        if ( deleteContent )
-        {
-            // TODO could be async ? as directory can be huge
-            File dir = new File( repository.getLocation() );
-            if ( !FileUtils.deleteQuietly( dir ) )
-            {
-                throw new RepositoryAdminException( "Cannot delete repository " + dir );
-            }
-        }
-
-        // olamy: copy list for reading as a unit test in webapp fail with ConcurrentModificationException
-        List proxyConnectors =
-            new ArrayList( config.getProxyConnectors() );
-        for ( ProxyConnectorConfiguration proxyConnector : proxyConnectors )
-        {
-            if ( StringUtils.equals( proxyConnector.getSourceRepoId(), repository.getId() ) )
-            {
-                config.removeProxyConnector( proxyConnector );
-            }
-        }
-
-        Map> repoToGroupMap = config.getRepositoryToGroupMap();
-        if ( repoToGroupMap != null )
-        {
-            if ( repoToGroupMap.containsKey( repository.getId() ) )
-            {
-                List repoGroups = repoToGroupMap.get( repository.getId() );
-                for ( String repoGroup : repoGroups )
-                {
-                    // copy to prevent UnsupportedOperationException
-                    RepositoryGroupConfiguration repositoryGroupConfiguration =
-                        config.findRepositoryGroupById( repoGroup );
-                    List repos = new ArrayList( repositoryGroupConfiguration.getRepositories() );
-                    config.removeRepositoryGroup( repositoryGroupConfiguration );
-                    repos.remove( repository.getId() );
-                    repositoryGroupConfiguration.setRepositories( repos );
-                    config.addRepositoryGroup( repositoryGroupConfiguration );
-                }
-            }
-        }
-
-        try
-        {
-            removeRepositoryRoles( repository );
-        }
-        catch ( RoleManagerException e )
-        {
-            throw new RepositoryAdminException(
-                "fail to remove repository roles for repository " + repository.getId() + " : " + e.getMessage(), e );
-        }
-
-        saveConfiguration( config );
-
-        return Boolean.TRUE;
-    }
-
-
-    public Boolean updateManagedRepository( ManagedRepository managedRepository, boolean needStageRepo,
-                                            AuditInformation auditInformation, boolean resetStats )
-        throws RepositoryAdminException
-    {
-
-        log.debug( "updateManagedConfiguration repo {} needStage {} resetStats {} ",
-                   Arrays.asList( managedRepository, needStageRepo, resetStats ).toArray() );
-
-        // Ensure that the fields are valid.
-
-        getRepositoryCommonValidator().basicValidation( managedRepository, true );
-
-        Configuration configuration = getArchivaConfiguration().getConfiguration();
-
-        ManagedRepositoryConfiguration toremove = configuration.findManagedRepositoryById( managedRepository.getId() );
-
-        if ( toremove != null )
-        {
-            configuration.removeManagedRepository( toremove );
-        }
-
-        ManagedRepositoryConfiguration stagingRepository = getStageRepoConfig( toremove );
-
-        // TODO remove content from old if path has changed !!!!!
-
-        if ( stagingRepository != null )
-        {
-            configuration.removeManagedRepository( stagingRepository );
-        }
-
-        ManagedRepositoryConfiguration managedRepositoryConfiguration =
-            addManagedRepository( managedRepository.getId(), managedRepository.getLayout(), managedRepository.getName(),
-                                  managedRepository.getLocation(), managedRepository.isBlockRedeployments(),
-                                  managedRepository.isReleases(), managedRepository.isSnapshots(), needStageRepo,
-                                  managedRepository.getCronExpression(), managedRepository.getIndexDirectory(),
-                                  managedRepository.getDaysOlder(), managedRepository.getRetentionCount(),
-                                  managedRepository.isDeleteReleasedSnapshots(), auditInformation,
-                                  getArchivaConfiguration().getConfiguration() );
-
-        // Save the repository configuration.
-        RepositorySession repositorySession = getRepositorySessionFactory().createSession();
-
-        try
-        {
-            triggerAuditEvent( managedRepositoryConfiguration.getId(), null, AuditEvent.MODIFY_MANAGED_REPO,
-                               auditInformation );
-
-            saveConfiguration( this.getArchivaConfiguration().getConfiguration() );
-            if ( resetStats )
-            {
-                log.debug( "call repositoryStatisticsManager.deleteStatistics" );
-                getRepositoryStatisticsManager().deleteStatistics( repositorySession.getRepository(),
-                                                                   managedRepositoryConfiguration.getId() );
-                repositorySession.save();
-            }
-
-        }
-        catch ( MetadataRepositoryException e )
-        {
-            throw new RepositoryAdminException( e.getMessage(), e );
-        }
-        finally
-        {
-            repositorySession.close();
-        }
-
-        return true;
-    }
-
-    //--------------------------
-    // utils methods
-    //--------------------------
-
-
-    protected void addRepository( ManagedRepositoryConfiguration repository, Configuration configuration )
-        throws RepositoryAdminException, IOException
-    {
-        // Normalize the path
-        File file = new File( repository.getLocation() );
-        repository.setLocation( file.getCanonicalPath() );
-        if ( !file.exists() )
-        {
-            file.mkdirs();
-        }
-        if ( !file.exists() || !file.isDirectory() )
-        {
-            throw new RepositoryAdminException(
-                "Unable to add repository - no write access, can not create the root directory: " + file );
-        }
-
-        configuration.addManagedRepository( repository );
-    }
-
-    private ManagedRepositoryConfiguration getStageRepoConfig( ManagedRepositoryConfiguration repository )
-    {
-        ManagedRepositoryConfiguration stagingRepository = new ManagedRepositoryConfiguration();
-        stagingRepository.setId( repository.getId() + STAGE_REPO_ID_END );
-        stagingRepository.setLayout( repository.getLayout() );
-        stagingRepository.setName( repository.getName() + STAGE_REPO_ID_END );
-        stagingRepository.setBlockRedeployments( repository.isBlockRedeployments() );
-        stagingRepository.setDaysOlder( repository.getDaysOlder() );
-        stagingRepository.setDeleteReleasedSnapshots( repository.isDeleteReleasedSnapshots() );
-        stagingRepository.setIndexDir( repository.getIndexDir() );
-        String path = repository.getLocation();
-        int lastIndex = path.lastIndexOf( '/' );
-        stagingRepository.setLocation( path.substring( 0, lastIndex ) + "/" + stagingRepository.getId() );
-        stagingRepository.setRefreshCronExpression( repository.getRefreshCronExpression() );
-        stagingRepository.setReleases( repository.isReleases() );
-        stagingRepository.setRetentionCount( repository.getRetentionCount() );
-        stagingRepository.setScanned( repository.isScanned() );
-        stagingRepository.setSnapshots( repository.isSnapshots() );
-        return stagingRepository;
-    }
-
-    public Boolean scanRepository( String repositoryId, boolean fullScan )
-    {
-        if ( getRepositoryTaskScheduler().isProcessingRepositoryTask( repositoryId ) )
-        {
-            log.info( "scanning of repository with id {} already scheduled", repositoryId );
-        }
-        RepositoryTask task = new RepositoryTask();
-        task.setRepositoryId( repositoryId );
-        task.setScanAll( fullScan );
-        try
-        {
-            getRepositoryTaskScheduler().queueTask( task );
-        }
-        catch ( TaskQueueException e )
-        {
-            log.error( "failed to schedule scanning of repo with id {}", repositoryId, e );
-            return false;
-        }
-        return true;
-    }
-
-    protected void addRepositoryRoles( ManagedRepositoryConfiguration newRepository )
-        throws RoleManagerException
-    {
-        String repoId = newRepository.getId();
-
-        // TODO: double check these are configured on start up
-        // TODO: belongs in the business logic
-
-        if ( !getRoleManager().templatedRoleExists( ArchivaRoleConstants.TEMPLATE_REPOSITORY_OBSERVER, repoId ) )
-        {
-            getRoleManager().createTemplatedRole( ArchivaRoleConstants.TEMPLATE_REPOSITORY_OBSERVER, repoId );
-        }
-
-        if ( !getRoleManager().templatedRoleExists( ArchivaRoleConstants.TEMPLATE_REPOSITORY_MANAGER, repoId ) )
-        {
-            getRoleManager().createTemplatedRole( ArchivaRoleConstants.TEMPLATE_REPOSITORY_MANAGER, repoId );
-        }
-    }
-
-    protected void removeRepositoryRoles( ManagedRepositoryConfiguration existingRepository )
-        throws RoleManagerException
-    {
-        String repoId = existingRepository.getId();
-
-        if ( getRoleManager().templatedRoleExists( ArchivaRoleConstants.TEMPLATE_REPOSITORY_MANAGER, repoId ) )
-        {
-            getRoleManager().removeTemplatedRole( ArchivaRoleConstants.TEMPLATE_REPOSITORY_MANAGER, repoId );
-        }
-
-        if ( getRoleManager().templatedRoleExists( ArchivaRoleConstants.TEMPLATE_REPOSITORY_OBSERVER, repoId ) )
-        {
-            getRoleManager().removeTemplatedRole( ArchivaRoleConstants.TEMPLATE_REPOSITORY_OBSERVER, repoId );
-        }
-
-        log.debug( "removed user roles associated with repository {}", repoId );
-    }
-
-    //--------------------------
-    // setters/getters
-    //--------------------------
-
-
-    public RoleManager getRoleManager()
-    {
-        return roleManager;
-    }
-
-    public void setRoleManager( RoleManager roleManager )
-    {
-        this.roleManager = roleManager;
-    }
-
-    public RepositoryStatisticsManager getRepositoryStatisticsManager()
-    {
-        return repositoryStatisticsManager;
-    }
-
-    public void setRepositoryStatisticsManager( RepositoryStatisticsManager repositoryStatisticsManager )
-    {
-        this.repositoryStatisticsManager = repositoryStatisticsManager;
-    }
-
-    public RepositorySessionFactory getRepositorySessionFactory()
-    {
-        return repositorySessionFactory;
-    }
-
-    public void setRepositorySessionFactory( RepositorySessionFactory repositorySessionFactory )
-    {
-        this.repositorySessionFactory = repositorySessionFactory;
-    }
-
-
-    public RepositoryArchivaTaskScheduler getRepositoryTaskScheduler()
-    {
-        return repositoryTaskScheduler;
-    }
-
-    public void setRepositoryTaskScheduler( RepositoryArchivaTaskScheduler repositoryTaskScheduler )
-    {
-        this.repositoryTaskScheduler = repositoryTaskScheduler;
-    }
-}
diff --git a/archiva-modules/archiva-base/archiva-repository-admin/src/main/java/org/apache/archiva/admin/repository/managed/ManagedRepository.java b/archiva-modules/archiva-base/archiva-repository-admin/src/main/java/org/apache/archiva/admin/repository/managed/ManagedRepository.java
deleted file mode 100644
index a47d109cd..000000000
--- a/archiva-modules/archiva-base/archiva-repository-admin/src/main/java/org/apache/archiva/admin/repository/managed/ManagedRepository.java
+++ /dev/null
@@ -1,232 +0,0 @@
-package org.apache.archiva.admin.repository.managed;
-
-/*
- * 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.repository.AbstractRepository;
-
-import java.io.Serializable;
-
-/**
- * @author Olivier Lamy
- * @since 1.4
- */
-public class ManagedRepository
-    extends AbstractRepository
-    implements Serializable
-{
-
-    private String location;
-
-    private boolean snapshots = false;
-
-    private boolean releases = true;
-
-    private boolean blockRedeployments = false;
-
-    /**
-     * default model value
-     */
-    private String cronExpression = "0 0 * * * ?";
-
-
-    /**
-     * not need when creating the repo : only available when reading
-     */
-    private ManagedRepository stagingRepository;
-
-    private boolean scanned = true;
-
-    private String indexDirectory;
-
-    /**
-     * default model value
-     */
-    private int daysOlder = 100;
-
-    /**
-     * default model value
-     */
-    private int retentionCount = 2;
-
-    private boolean deleteReleasedSnapshots;
-
-    public ManagedRepository()
-    {
-        // no op
-    }
-
-    public ManagedRepository( String id, String name, String location, String layout, boolean snapshots,
-                              boolean releases, boolean blockRedeployments, String cronExpression, String indexDir,
-                              boolean scanned, int daysOlder, int retentionCount, boolean deleteReleasedSnapshots )
-    {
-        super(id, name, layout);
-
-        this.location = location;
-        this.snapshots = snapshots;
-        this.releases = releases;
-        this.blockRedeployments = blockRedeployments;
-        this.cronExpression = cronExpression;
-        this.indexDirectory = indexDir;
-        this.scanned = scanned;
-        this.daysOlder = daysOlder;
-        this.retentionCount = retentionCount;
-        this.deleteReleasedSnapshots = deleteReleasedSnapshots;
-    }
-
-    public String getLocation()
-    {
-        return this.location;
-    }
-
-
-    public boolean isReleases()
-    {
-        return this.releases;
-    }
-
-    /**
-     * Get null
-     */
-    public boolean isSnapshots()
-    {
-        return this.snapshots;
-    }
-
-
-    public void setReleases( boolean releases )
-    {
-        this.releases = releases;
-    }
-
-    public void setSnapshots( boolean snapshots )
-    {
-        this.snapshots = snapshots;
-    }
-
-    public void setLocation( String location )
-    {
-        this.location = location;
-    }
-
-    public boolean isBlockRedeployments()
-    {
-        return blockRedeployments;
-    }
-
-    public void setBlockRedeployments( boolean blockRedeployments )
-    {
-        this.blockRedeployments = blockRedeployments;
-    }
-
-    public String getCronExpression()
-    {
-        return cronExpression;
-    }
-
-    public void setCronExpression( String cronExpression )
-    {
-        this.cronExpression = cronExpression;
-    }
-
-    public ManagedRepository getStagingRepository()
-    {
-        return stagingRepository;
-    }
-
-
-    public void setStagingRepository( ManagedRepository stagingRepository )
-    {
-        this.stagingRepository = stagingRepository;
-    }
-
-    public boolean isScanned()
-    {
-        return scanned;
-    }
-
-    public void setScanned( boolean scanned )
-    {
-        this.scanned = scanned;
-    }
-
-    public String getIndexDirectory()
-    {
-        return indexDirectory;
-    }
-
-    public void setIndexDirectory( String indexDirectory )
-    {
-        this.indexDirectory = indexDirectory;
-    }
-
-    public int getDaysOlder()
-    {
-        return daysOlder;
-    }
-
-    public void setDaysOlder( int daysOlder )
-    {
-        this.daysOlder = daysOlder;
-    }
-
-    public int getRetentionCount()
-    {
-        return retentionCount;
-    }
-
-    public void setRetentionCount( int retentionCount )
-    {
-        this.retentionCount = retentionCount;
-    }
-
-    public boolean isDeleteReleasedSnapshots()
-    {
-        return deleteReleasedSnapshots;
-    }
-
-    public void setDeleteReleasedSnapshots( boolean deleteReleasedSnapshots )
-    {
-        this.deleteReleasedSnapshots = deleteReleasedSnapshots;
-    }
-
-
-    @Override
-    public String toString()
-    {
-        final StringBuilder sb = new StringBuilder();
-        sb.append( "ManagedRepository" );
-        sb.append( "{location='" ).append( location ).append( '\'' );
-        sb.append( ", snapshots=" ).append( snapshots );
-        sb.append( ", releases=" ).append( releases );
-        sb.append( ", blockRedeployments=" ).append( blockRedeployments );
-        sb.append( ", cronExpression='" ).append( cronExpression ).append( '\'' );
-        sb.append( ", stagingRepository=" ).append( stagingRepository );
-        sb.append( ", scanned=" ).append( scanned );
-        sb.append( ", indexDirectory='" ).append( indexDirectory ).append( '\'' );
-        sb.append( ", daysOlder=" ).append( daysOlder );
-        sb.append( ", retentionCount=" ).append( retentionCount );
-        sb.append( ", deleteReleasedSnapshots=" ).append( deleteReleasedSnapshots );
-        sb.append( '}' );
-        sb.append( super.toString() );
-        return sb.toString();
-    }
-
-
-}
\ No newline at end of file
diff --git a/archiva-modules/archiva-base/archiva-repository-admin/src/main/java/org/apache/archiva/admin/repository/managed/ManagedRepositoryAdmin.java b/archiva-modules/archiva-base/archiva-repository-admin/src/main/java/org/apache/archiva/admin/repository/managed/ManagedRepositoryAdmin.java
deleted file mode 100644
index 8f9e2cd6f..000000000
--- a/archiva-modules/archiva-base/archiva-repository-admin/src/main/java/org/apache/archiva/admin/repository/managed/ManagedRepositoryAdmin.java
+++ /dev/null
@@ -1,56 +0,0 @@
-package org.apache.archiva.admin.repository.managed;
-/*
- * 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.AuditInformation;
-import org.apache.archiva.admin.repository.RepositoryAdminException;
-
-import java.util.List;
-import java.util.Map;
-
-/**
- * @author Olivier Lamy
- * @since 1.4
- */
-public interface ManagedRepositoryAdmin
-{
-    List getManagedRepositories()
-        throws RepositoryAdminException;
-
-    Map getManagedRepositoriesAsMap()
-        throws RepositoryAdminException;
-
-    ManagedRepository getManagedRepository( String repositoryId )
-        throws RepositoryAdminException;
-
-    Boolean deleteManagedRepository( String repositoryId, AuditInformation auditInformation, boolean deleteContent )
-        throws RepositoryAdminException;
-
-    Boolean addManagedRepository( ManagedRepository managedRepository, boolean needStageRepo,
-                                  AuditInformation auditInformation )
-        throws RepositoryAdminException;
-
-
-    Boolean updateManagedRepository( ManagedRepository managedRepository, boolean needStageRepo,
-                                     AuditInformation auditInformation, boolean resetStats )
-        throws RepositoryAdminException;
-
-
-}
diff --git a/archiva-modules/archiva-base/archiva-repository-admin/src/main/java/org/apache/archiva/admin/repository/networkproxy/DefaultNetworkProxyAdmin.java b/archiva-modules/archiva-base/archiva-repository-admin/src/main/java/org/apache/archiva/admin/repository/networkproxy/DefaultNetworkProxyAdmin.java
deleted file mode 100644
index b2dcdd087..000000000
--- a/archiva-modules/archiva-base/archiva-repository-admin/src/main/java/org/apache/archiva/admin/repository/networkproxy/DefaultNetworkProxyAdmin.java
+++ /dev/null
@@ -1,143 +0,0 @@
-package org.apache.archiva.admin.repository.networkproxy;
-/*
- * 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 net.sf.beanlib.provider.replicator.BeanReplicator;
-import org.apache.archiva.admin.AuditInformation;
-import org.apache.archiva.admin.repository.AbstractRepositoryAdmin;
-import org.apache.archiva.admin.repository.RepositoryAdminException;
-import org.apache.archiva.audit.AuditEvent;
-import org.apache.commons.lang.StringUtils;
-import org.apache.maven.archiva.configuration.Configuration;
-import org.apache.maven.archiva.configuration.NetworkProxyConfiguration;
-import org.springframework.stereotype.Service;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * @author Olivier Lamy
- * @since 1.4
- */
-@Service( "networkProxyAdmin#default" )
-public class DefaultNetworkProxyAdmin
-    extends AbstractRepositoryAdmin
-    implements NetworkProxyAdmin
-{
-
-    public List getNetworkProxies()
-        throws RepositoryAdminException
-    {
-        List networkProxies = new ArrayList();
-        for ( NetworkProxyConfiguration networkProxyConfiguration : getArchivaConfiguration().getConfiguration().getNetworkProxies() )
-        {
-            networkProxies.add( getNetworkProxy( networkProxyConfiguration ) );
-        }
-        return networkProxies;
-    }
-
-    public NetworkProxy getNetworkProxy( String networkProxyId )
-        throws RepositoryAdminException
-    {
-        for ( NetworkProxy networkProxy : getNetworkProxies() )
-        {
-            if ( StringUtils.equals( networkProxyId, networkProxy.getId() ) )
-            {
-                return networkProxy;
-            }
-        }
-
-        return null;
-    }
-
-    public void addNetworkProxy( NetworkProxy networkProxy, AuditInformation auditInformation )
-        throws RepositoryAdminException
-    {
-        if ( networkProxy == null )
-        {
-            return;
-        }
-        if ( getNetworkProxy( networkProxy.getId() ) != null )
-        {
-            throw new RepositoryAdminException(
-                "cannot add NetworkProxy with id " + networkProxy.getId() + " already exist" );
-        }
-        Configuration configuration = getArchivaConfiguration().getConfiguration();
-        configuration.addNetworkProxy( getNetworkProxyConfiguration( networkProxy ) );
-
-        triggerAuditEvent( networkProxy.getId(), null, AuditEvent.ADD_NETWORK_PROXY, auditInformation );
-
-        saveConfiguration( configuration );
-    }
-
-    public void updateNetworkProxy( NetworkProxy networkProxy, AuditInformation auditInformation )
-        throws RepositoryAdminException
-    {
-        if ( networkProxy == null )
-        {
-            return;
-        }
-        if ( getNetworkProxy( networkProxy.getId() ) == null )
-        {
-            throw new RepositoryAdminException(
-                "cannot update NetworkProxy with id " + networkProxy.getId() + " as not exist" );
-        }
-        Configuration configuration = getArchivaConfiguration().getConfiguration();
-        NetworkProxyConfiguration networkProxyConfiguration = getNetworkProxyConfiguration( networkProxy );
-        configuration.removeNetworkProxy( networkProxyConfiguration );
-        configuration.addNetworkProxy( networkProxyConfiguration );
-
-        triggerAuditEvent( networkProxy.getId(), null, AuditEvent.MODIFY_NETWORK_PROXY, auditInformation );
-
-        saveConfiguration( configuration );
-    }
-
-    public void deleteNetworkProxy( String networkProxyId, AuditInformation auditInformation )
-        throws RepositoryAdminException
-    {
-
-        NetworkProxy networkProxy = getNetworkProxy( networkProxyId );
-        if ( networkProxy == null )
-        {
-            throw new RepositoryAdminException(
-                "cannot delete NetworkProxy with id " + networkProxyId + " as not exist" );
-        }
-        Configuration configuration = getArchivaConfiguration().getConfiguration();
-        NetworkProxyConfiguration networkProxyConfiguration = getNetworkProxyConfiguration( networkProxy );
-        configuration.removeNetworkProxy( networkProxyConfiguration );
-
-        triggerAuditEvent( networkProxy.getId(), null, AuditEvent.DELETE_NETWORK_PROXY, auditInformation );
-
-        saveConfiguration( configuration );
-    }
-
-    protected NetworkProxy getNetworkProxy( NetworkProxyConfiguration networkProxyConfiguration )
-    {
-        return networkProxyConfiguration == null
-            ? null
-            : new BeanReplicator().replicateBean( networkProxyConfiguration, NetworkProxy.class );
-    }
-
-    protected NetworkProxyConfiguration getNetworkProxyConfiguration( NetworkProxy networkProxy )
-    {
-        return networkProxy == null
-            ? null
-            : new BeanReplicator().replicateBean( networkProxy, NetworkProxyConfiguration.class );
-    }
-}
diff --git a/archiva-modules/archiva-base/archiva-repository-admin/src/main/java/org/apache/archiva/admin/repository/networkproxy/NetworkProxy.java b/archiva-modules/archiva-base/archiva-repository-admin/src/main/java/org/apache/archiva/admin/repository/networkproxy/NetworkProxy.java
deleted file mode 100644
index ec5250bf3..000000000
--- a/archiva-modules/archiva-base/archiva-repository-admin/src/main/java/org/apache/archiva/admin/repository/networkproxy/NetworkProxy.java
+++ /dev/null
@@ -1,177 +0,0 @@
-package org.apache.archiva.admin.repository.networkproxy;
-/*
- * 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.io.Serializable;
-
-/**
- * @author Olivier Lamy
- * @since 1.4
- */
-public class NetworkProxy
-    implements Serializable
-{
-    private String id;
-
-    /**
-     * The network protocol to use with this proxy: "http", "socks-4"
-     * .
-     */
-    private String protocol = "http";
-
-    /**
-     * The proxy host.
-     */
-    private String host;
-
-    /**
-     * The proxy port.
-     */
-    private int port = 8080;
-
-    /**
-     * The proxy user.
-     */
-    private String username;
-
-    /**
-     * The proxy password.
-     */
-    private String password;
-
-    public NetworkProxy()
-    {
-        // no op
-    }
-
-    public NetworkProxy( String id, String protocol, String host, int port, String username, String password )
-    {
-        this.id = id;
-        this.protocol = protocol;
-        this.host = host;
-        this.port = port;
-        this.username = username;
-        this.password = password;
-    }
-
-    public String getId()
-    {
-        return id;
-    }
-
-    public void setId( String id )
-    {
-        this.id = id;
-    }
-
-    public String getProtocol()
-    {
-        return protocol;
-    }
-
-    public void setProtocol( String protocol )
-    {
-        this.protocol = protocol;
-    }
-
-    public String getHost()
-    {
-        return host;
-    }
-
-    public void setHost( String host )
-    {
-        this.host = host;
-    }
-
-    public int getPort()
-    {
-        return port;
-    }
-
-    public void setPort( int port )
-    {
-        this.port = port;
-    }
-
-    public String getUsername()
-    {
-        return username;
-    }
-
-    public void setUsername( String username )
-    {
-        this.username = username;
-    }
-
-    public String getPassword()
-    {
-        return password;
-    }
-
-    public void setPassword( String password )
-    {
-        this.password = password;
-    }
-
-    @Override
-    public boolean equals( Object o )
-    {
-        if ( this == o )
-        {
-            return true;
-        }
-        if ( o == null || getClass() != o.getClass() )
-        {
-            return false;
-        }
-
-        NetworkProxy that = (NetworkProxy) o;
-
-        if ( id != null ? !id.equals( that.id ) : that.id != null )
-        {
-            return false;
-        }
-
-        return true;
-    }
-
-    @Override
-    public int hashCode()
-    {
-        int result = 17;
-        result = 37 * result + ( id != null ? id.hashCode() : 0 );
-        return result;
-    }
-
-    @Override
-    public String toString()
-    {
-        final StringBuilder sb = new StringBuilder();
-        sb.append( "NetworkProxy" );
-        sb.append( "{id='" ).append( id ).append( '\'' );
-        sb.append( ", protocol='" ).append( protocol ).append( '\'' );
-        sb.append( ", host='" ).append( host ).append( '\'' );
-        sb.append( ", port=" ).append( port );
-        sb.append( ", username='" ).append( username ).append( '\'' );
-        sb.append( ", password='" ).append( password ).append( '\'' );
-        sb.append( '}' );
-        return sb.toString();
-    }
-}
diff --git a/archiva-modules/archiva-base/archiva-repository-admin/src/main/java/org/apache/archiva/admin/repository/networkproxy/NetworkProxyAdmin.java b/archiva-modules/archiva-base/archiva-repository-admin/src/main/java/org/apache/archiva/admin/repository/networkproxy/NetworkProxyAdmin.java
deleted file mode 100644
index e8c0a0113..000000000
--- a/archiva-modules/archiva-base/archiva-repository-admin/src/main/java/org/apache/archiva/admin/repository/networkproxy/NetworkProxyAdmin.java
+++ /dev/null
@@ -1,46 +0,0 @@
-package org.apache.archiva.admin.repository.networkproxy;
-/*
- * 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.AuditInformation;
-import org.apache.archiva.admin.repository.RepositoryAdminException;
-
-import java.util.List;
-
-/**
- * @author Olivier Lamy
- * @since 1.4
- */
-public interface NetworkProxyAdmin
-{
-    List getNetworkProxies()
-        throws RepositoryAdminException;
-
-    NetworkProxy getNetworkProxy( String networkProxyId )
-        throws RepositoryAdminException;
-
-    void addNetworkProxy( NetworkProxy networkProxy, AuditInformation auditInformation )
-        throws RepositoryAdminException;
-
-    void updateNetworkProxy( NetworkProxy networkProxy, AuditInformation auditInformation )
-        throws RepositoryAdminException;
-
-    void deleteNetworkProxy( String networkProxyId, AuditInformation auditInformation )
-        throws RepositoryAdminException;
-}
diff --git a/archiva-modules/archiva-base/archiva-repository-admin/src/main/java/org/apache/archiva/admin/repository/proxyconnector/DefaultProxyConnectorAdmin.java b/archiva-modules/archiva-base/archiva-repository-admin/src/main/java/org/apache/archiva/admin/repository/proxyconnector/DefaultProxyConnectorAdmin.java
deleted file mode 100644
index 7b77cfd3c..000000000
--- a/archiva-modules/archiva-base/archiva-repository-admin/src/main/java/org/apache/archiva/admin/repository/proxyconnector/DefaultProxyConnectorAdmin.java
+++ /dev/null
@@ -1,251 +0,0 @@
-package org.apache.archiva.admin.repository.proxyconnector;
-/*
- * 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 net.sf.beanlib.provider.replicator.BeanReplicator;
-import org.apache.archiva.admin.AuditInformation;
-import org.apache.archiva.admin.repository.AbstractRepositoryAdmin;
-import org.apache.archiva.admin.repository.RepositoryAdminException;
-import org.apache.archiva.admin.repository.managed.ManagedRepositoryAdmin;
-import org.apache.archiva.admin.repository.remote.RemoteRepositoryAdmin;
-import org.apache.archiva.audit.AuditEvent;
-import org.apache.commons.collections.CollectionUtils;
-import org.apache.commons.lang.StringUtils;
-import org.apache.maven.archiva.configuration.Configuration;
-import org.apache.maven.archiva.configuration.ProxyConnectorConfiguration;
-import org.apache.maven.archiva.configuration.functors.ProxyConnectorSelectionPredicate;
-import org.springframework.stereotype.Service;
-
-import javax.inject.Inject;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-/**
- * @author Olivier Lamy
- * @since 1.4
- */
-@Service( "proxyConnectorAdmin#default" )
-public class DefaultProxyConnectorAdmin
-    extends AbstractRepositoryAdmin
-    implements ProxyConnectorAdmin
-{
-
-    @Inject
-    private ManagedRepositoryAdmin managedRepositoryAdmin;
-
-    @Inject
-    private RemoteRepositoryAdmin remoteRepositoryAdmin;
-
-    public List getProxyConnectors()
-        throws RepositoryAdminException
-    {
-        List proxyConnectorConfigurations =
-            getArchivaConfiguration().getConfiguration().getProxyConnectors();
-        List proxyConnectors = new ArrayList( proxyConnectorConfigurations.size() );
-        for ( ProxyConnectorConfiguration configuration : proxyConnectorConfigurations )
-        {
-            proxyConnectors.add( getProxyConnector( configuration ) );
-        }
-
-        return proxyConnectors;
-    }
-
-    public ProxyConnector getProxyConnector( String sourceRepoId, String targetRepoId )
-        throws RepositoryAdminException
-    {
-        for ( ProxyConnector proxyConnector : getProxyConnectors() )
-        {
-            if ( StringUtils.equals( sourceRepoId, proxyConnector.getSourceRepoId() ) && StringUtils.equals(
-                targetRepoId, proxyConnector.getTargetRepoId() ) )
-            {
-                return proxyConnector;
-            }
-        }
-        return null;
-    }
-
-    public Boolean addProxyConnector( ProxyConnector proxyConnector, AuditInformation auditInformation )
-        throws RepositoryAdminException
-    {
-        if ( getProxyConnector( proxyConnector.getSourceRepoId(), proxyConnector.getTargetRepoId() ) != null )
-        {
-            throw new RepositoryAdminException(
-                "Unable to add proxy connector, as one already exists with source repository id ["
-                    + proxyConnector.getSourceRepoId() + "] and target repository id ["
-                    + proxyConnector.getTargetRepoId() + "]." );
-        }
-
-        validateProxyConnector( proxyConnector );
-
-        proxyConnector.setBlackListPatterns( unescapePatterns( proxyConnector.getBlackListPatterns() ) );
-        proxyConnector.setWhiteListPatterns( unescapePatterns( proxyConnector.getWhiteListPatterns() ) );
-
-        Configuration configuration = getArchivaConfiguration().getConfiguration();
-
-        ProxyConnectorConfiguration proxyConnectorConfiguration = getProxyConnectorConfiguration( proxyConnector );
-        configuration.addProxyConnector( proxyConnectorConfiguration );
-        saveConfiguration( configuration );
-        triggerAuditEvent( proxyConnector.getSourceRepoId() + "-" + proxyConnector.getTargetRepoId(), null,
-                           AuditEvent.ADD_PROXY_CONNECTOR, auditInformation );
-        return Boolean.TRUE;
-
-    }
-
-    public Boolean deleteProxyConnector( ProxyConnector proxyConnector, AuditInformation auditInformation )
-        throws RepositoryAdminException
-    {
-        Configuration configuration = getArchivaConfiguration().getConfiguration();
-        ProxyConnectorConfiguration proxyConnectorConfiguration =
-            findProxyConnector( proxyConnector.getSourceRepoId(), proxyConnector.getTargetRepoId(), configuration );
-        if ( proxyConnectorConfiguration == null )
-        {
-            throw new RepositoryAdminException(
-                "unable to find ProxyConnector with source " + proxyConnector.getSourceRepoId() + " and target "
-                    + proxyConnector.getTargetRepoId() );
-        }
-        configuration.removeProxyConnector( proxyConnectorConfiguration );
-        saveConfiguration( configuration );
-        triggerAuditEvent( proxyConnector.getSourceRepoId() + "-" + proxyConnector.getTargetRepoId(), null,
-                           AuditEvent.DELETE_PROXY_CONNECTOR, auditInformation );
-        return Boolean.TRUE;
-    }
-
-    public Boolean updateProxyConnector( ProxyConnector proxyConnector, AuditInformation auditInformation )
-        throws RepositoryAdminException
-    {
-        Configuration configuration = getArchivaConfiguration().getConfiguration();
-        ProxyConnectorConfiguration proxyConnectorConfiguration =
-            findProxyConnector( proxyConnector.getSourceRepoId(), proxyConnector.getTargetRepoId(), configuration );
-        configuration.removeProxyConnector( proxyConnectorConfiguration );
-        configuration.addProxyConnector( getProxyConnectorConfiguration( proxyConnector ) );
-        triggerAuditEvent( proxyConnector.getSourceRepoId() + "-" + proxyConnector.getTargetRepoId(), null,
-                           AuditEvent.MODIFY_PROXY_CONNECTOR, auditInformation );
-        return Boolean.TRUE;
-    }
-
-    protected List unescapePatterns( List patterns )
-    {
-        List rawPatterns = new ArrayList();
-        if ( patterns != null )
-        {
-            for ( String pattern : patterns )
-            {
-                rawPatterns.add( StringUtils.replace( pattern, "\\\\", "\\" ) );
-            }
-        }
-
-        return rawPatterns;
-    }
-
-    public Map> getProxyConnectorAsMap()
-        throws RepositoryAdminException
-    {
-        Map> proxyConnectorMap = new HashMap>();
-
-        Iterator it = getProxyConnectors().iterator();
-        while ( it.hasNext() )
-        {
-            ProxyConnector proxyConfig = it.next();
-            String key = proxyConfig.getSourceRepoId();
-
-            List connectors = proxyConnectorMap.get( key );
-            if ( connectors == null )
-            {
-                connectors = new ArrayList();
-                proxyConnectorMap.put( key, connectors );
-            }
-
-            connectors.add( proxyConfig );
-
-            Collections.sort( connectors, ProxyConnectorOrderComparator.getInstance() );
-        }
-
-        return proxyConnectorMap;
-    }
-
-    private ProxyConnectorConfiguration findProxyConnector( String sourceId, String targetId,
-                                                            Configuration configuration )
-    {
-        if ( StringUtils.isBlank( sourceId ) )
-        {
-            return null;
-        }
-
-        if ( StringUtils.isBlank( targetId ) )
-        {
-            return null;
-        }
-
-        ProxyConnectorSelectionPredicate selectedProxy = new ProxyConnectorSelectionPredicate( sourceId, targetId );
-        return (ProxyConnectorConfiguration) CollectionUtils.find( configuration.getProxyConnectors(), selectedProxy );
-    }
-
-    protected ProxyConnectorConfiguration getProxyConnectorConfiguration( ProxyConnector proxyConnector )
-    {
-        /*
-        ProxyConnectorConfiguration proxyConnectorConfiguration = new ProxyConnectorConfiguration();
-        proxyConnectorConfiguration.setOrder( proxyConnector.getOrder() );
-        proxyConnectorConfiguration.setBlackListPatterns(
-            new ArrayList( proxyConnector.getBlackListPatterns() ) );
-        proxyConnectorConfiguration.setWhiteListPatterns(
-            new ArrayList( proxyConnector.getWhiteListPatterns() ) );
-        proxyConnectorConfiguration.setDisabled( proxyConnector.isDisabled() );
-        proxyConnectorConfiguration.setPolicies( new HashMap( proxyConnector.getPolicies() ) );
-        proxyConnectorConfiguration.setProperties( new HashMap( proxyConnector.getProperties() ) );
-        proxyConnectorConfiguration.setProxyId( proxyConnector.getProxyId() );
-        proxyConnectorConfiguration.setSourceRepoId( proxyConnector.getSourceRepoId() );
-        proxyConnectorConfiguration.setTargetRepoId( proxyConnector.getTargetRepoId() );
-        return proxyConnectorConfiguration;*/
-
-        return proxyConnector == null
-            ? null
-            : new BeanReplicator().replicateBean( proxyConnector, ProxyConnectorConfiguration.class );
-    }
-
-    protected ProxyConnector getProxyConnector( ProxyConnectorConfiguration proxyConnectorConfiguration )
-    {
-        return proxyConnectorConfiguration == null
-            ? null
-            : new BeanReplicator().replicateBean( proxyConnectorConfiguration, ProxyConnector.class );
-    }
-
-    protected void validateProxyConnector( ProxyConnector proxyConnector )
-        throws RepositoryAdminException
-    {
-        // validate source a Managed target a Remote
-        if ( managedRepositoryAdmin.getManagedRepository( proxyConnector.getSourceRepoId() ) == null )
-        {
-            throw new RepositoryAdminException(
-                "non valid ProxyConnector sourceRepo with id " + proxyConnector.getSourceRepoId()
-                    + " is not a ManagedRepository" );
-        }
-        if ( remoteRepositoryAdmin.getRemoteRepository( proxyConnector.getTargetRepoId() ) == null )
-        {
-            throw new RepositoryAdminException(
-                "non valid ProxyConnector sourceRepo with id " + proxyConnector.getTargetRepoId()
-                    + " is not a RemoteRepository" );
-        }
-
-        // FIXME validate NetworkProxyConfiguration too when available
-    }
-}
diff --git a/archiva-modules/archiva-base/archiva-repository-admin/src/main/java/org/apache/archiva/admin/repository/proxyconnector/ProxyConnector.java b/archiva-modules/archiva-base/archiva-repository-admin/src/main/java/org/apache/archiva/admin/repository/proxyconnector/ProxyConnector.java
deleted file mode 100644
index 67a767216..000000000
--- a/archiva-modules/archiva-base/archiva-repository-admin/src/main/java/org/apache/archiva/admin/repository/proxyconnector/ProxyConnector.java
+++ /dev/null
@@ -1,116 +0,0 @@
-package org.apache.archiva.admin.repository.proxyconnector;
-/*
- * 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.repository.AbstractRepositoryConnector;
-
-import java.io.Serializable;
-
-/**
- * @author Olivier Lamy
- * @since 1.4
- */
-public class ProxyConnector
-    extends AbstractRepositoryConnector
-    implements Serializable
-{
-    /**
-     * The order id for UNORDERED
-     */
-    public static final int UNORDERED = 0;
-
-    /**
-     * The policy key {@link #getPolicies()} for error handling.
-     * See {@link org.apache.maven.archiva.policies.DownloadErrorPolicy}
-     * for details on potential values to this policy key.
-     */
-    public static final String POLICY_PROPAGATE_ERRORS = "propagate-errors";
-
-    /**
-     * The policy key {@link #getPolicies()} for error handling when an artifact is present.
-     * See {@link org.apache.maven.archiva.policies.DownloadErrorPolicy}
-     * for details on potential values to this policy key.
-     */
-    public static final String POLICY_PROPAGATE_ERRORS_ON_UPDATE = "propagate-errors-on-update";
-
-    /**
-     * The policy key {@link #getPolicies()} for snapshot handling.
-     * See {@link org.apache.maven.archiva.policies.SnapshotsPolicy}
-     * for details on potential values to this policy key.
-     */
-    public static final String POLICY_SNAPSHOTS = "snapshots";
-
-    /**
-     * The policy key {@link #getPolicies()} for releases handling.
-     * See {@link org.apache.maven.archiva.policies.ReleasesPolicy}
-     * for details on potential values to this policy key.
-     */
-    public static final String POLICY_RELEASES = "releases";
-
-    /**
-     * The policy key {@link #getPolicies()} for checksum handling.
-     * See {@link org.apache.maven.archiva.policies.ChecksumPolicy}
-     * for details on potential values to this policy key.
-     */
-    public static final String POLICY_CHECKSUM = "checksum";
-
-    /**
-     * The policy key {@link #getPolicies()} for cache-failures handling.
-     * See {@link org.apache.maven.archiva.policies.CachedFailuresPolicy}
-     * for details on potential values to this policy key.
-     */
-    public static final String POLICY_CACHE_FAILURES = "cache-failures";
-
-    /**
-     *
-     * The order of the proxy connectors. (0 means no order specified)
-     *           .
-     */
-    private int order = 0;
-
-    /**
-     * Get the order of the proxy connectors. (0 means no order specified)
-     * @return int
-     */
-    public int getOrder()
-    {
-        return this.order;
-    }
-
-
-    /**
-     * Set the order of the proxy connectors. (0 means no order specified)
-     * @param order
-     */
-    public void setOrder( int order )
-    {
-        this.order = order;
-    }
-
-    @Override
-    public String toString()
-    {
-        final StringBuilder sb = new StringBuilder();
-        sb.append( "ProxyConnector" );
-        sb.append( "{order=" ).append( order );
-        sb.append( '}' );
-        sb.append( super.toString() );
-        return sb.toString();
-    }
-}
diff --git a/archiva-modules/archiva-base/archiva-repository-admin/src/main/java/org/apache/archiva/admin/repository/proxyconnector/ProxyConnectorAdmin.java b/archiva-modules/archiva-base/archiva-repository-admin/src/main/java/org/apache/archiva/admin/repository/proxyconnector/ProxyConnectorAdmin.java
deleted file mode 100644
index cfb549b2a..000000000
--- a/archiva-modules/archiva-base/archiva-repository-admin/src/main/java/org/apache/archiva/admin/repository/proxyconnector/ProxyConnectorAdmin.java
+++ /dev/null
@@ -1,61 +0,0 @@
-package org.apache.archiva.admin.repository.proxyconnector;
-/*
- * 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.AuditInformation;
-import org.apache.archiva.admin.repository.RepositoryAdminException;
-
-import java.util.List;
-import java.util.Map;
-
-/**
- * No update method for changing source and target here as id is : sourceRepoId and targetRepoId, use delete then add.
- *
- * @author Olivier Lamy
- * @since 1.4
- */
-public interface ProxyConnectorAdmin
-{
-    List getProxyConnectors()
-        throws RepositoryAdminException;
-
-    ProxyConnector getProxyConnector( String sourceRepoId, String targetRepoId )
-        throws RepositoryAdminException;
-
-    Boolean addProxyConnector( ProxyConnector proxyConnector, AuditInformation auditInformation )
-        throws RepositoryAdminException;
-
-    Boolean deleteProxyConnector( ProxyConnector proxyConnector, AuditInformation auditInformation )
-        throws RepositoryAdminException;
-
-    /**
-     * only for enabled/disable or changing bean values except target/source
-     * @param proxyConnector
-     * @param auditInformation
-     * @return
-     * @throws RepositoryAdminException
-     */
-    Boolean updateProxyConnector( ProxyConnector proxyConnector, AuditInformation auditInformation )
-            throws RepositoryAdminException;
-
-
-    Map> getProxyConnectorAsMap()
-        throws RepositoryAdminException;
-
-}
diff --git a/archiva-modules/archiva-base/archiva-repository-admin/src/main/java/org/apache/archiva/admin/repository/proxyconnector/ProxyConnectorOrderComparator.java b/archiva-modules/archiva-base/archiva-repository-admin/src/main/java/org/apache/archiva/admin/repository/proxyconnector/ProxyConnectorOrderComparator.java
deleted file mode 100644
index 3f8b0d05b..000000000
--- a/archiva-modules/archiva-base/archiva-repository-admin/src/main/java/org/apache/archiva/admin/repository/proxyconnector/ProxyConnectorOrderComparator.java
+++ /dev/null
@@ -1,68 +0,0 @@
-package org.apache.archiva.admin.repository.proxyconnector;
-/*
- * 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.Comparator;
-
-/**
- * @author Olivier Lamy
- * @since 1.4
- */
-public class ProxyConnectorOrderComparator
-    implements Comparator
-{
-    private static ProxyConnectorOrderComparator INSTANCE = new ProxyConnectorOrderComparator();
-
-    public int compare( ProxyConnector o1, ProxyConnector o2 )
-    {
-        if ( o1 == null && o2 == null )
-        {
-            return 0;
-        }
-
-        // Ensure null goes to end of list.
-        if ( o1 == null && o2 != null )
-        {
-            return 1;
-        }
-
-        if ( o1 != null && o2 == null )
-        {
-            return -1;
-        }
-
-        // Ensure 0 (unordered) goes to end of list.
-        if ( o1.getOrder() == 0 && o2.getOrder() != 0 )
-        {
-            return 1;
-        }
-
-        if ( o1.getOrder() != 0 && o2.getOrder() == 0 )
-        {
-            return -1;
-        }
-
-        return o1.getOrder() - o2.getOrder();
-    }
-
-    public static ProxyConnectorOrderComparator getInstance()
-    {
-        return INSTANCE;
-    }
-}
diff --git a/archiva-modules/archiva-base/archiva-repository-admin/src/main/java/org/apache/archiva/admin/repository/proxyconnector/ProxyConnectorSelectionPredicate.java b/archiva-modules/archiva-base/archiva-repository-admin/src/main/java/org/apache/archiva/admin/repository/proxyconnector/ProxyConnectorSelectionPredicate.java
deleted file mode 100644
index 01983b71d..000000000
--- a/archiva-modules/archiva-base/archiva-repository-admin/src/main/java/org/apache/archiva/admin/repository/proxyconnector/ProxyConnectorSelectionPredicate.java
+++ /dev/null
@@ -1,54 +0,0 @@
-package org.apache.archiva.admin.repository.proxyconnector;
-/*
- * 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.collections.Predicate;
-import org.apache.commons.lang.StringUtils;
-
-/**
- * @author Olivier Lamy
- * @since 1.4
- */
-public class ProxyConnectorSelectionPredicate
-    implements Predicate
-{
-    private String sourceId;
-
-    private String targetId;
-
-    public ProxyConnectorSelectionPredicate( String sourceId, String targetId )
-    {
-        this.sourceId = sourceId;
-        this.targetId = targetId;
-    }
-
-    public boolean evaluate( Object object )
-    {
-        boolean satisfies = false;
-
-        if ( object instanceof ProxyConnector )
-        {
-            ProxyConnector connector = (ProxyConnector) object;
-            return ( StringUtils.equals( sourceId, connector.getSourceRepoId() ) && StringUtils.equals( targetId,
-                                                                                                        connector.getTargetRepoId() ) );
-        }
-
-        return satisfies;
-    }
-}
diff --git a/archiva-modules/archiva-base/archiva-repository-admin/src/main/java/org/apache/archiva/admin/repository/remote/DefaultRemoteRepositoryAdmin.java b/archiva-modules/archiva-base/archiva-repository-admin/src/main/java/org/apache/archiva/admin/repository/remote/DefaultRemoteRepositoryAdmin.java
deleted file mode 100644
index a2c83a473..000000000
--- a/archiva-modules/archiva-base/archiva-repository-admin/src/main/java/org/apache/archiva/admin/repository/remote/DefaultRemoteRepositoryAdmin.java
+++ /dev/null
@@ -1,190 +0,0 @@
-package org.apache.archiva.admin.repository.remote;
-/*
- * 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.AuditInformation;
-import org.apache.archiva.admin.repository.AbstractRepositoryAdmin;
-import org.apache.archiva.admin.repository.RepositoryAdminException;
-import org.apache.archiva.audit.AuditEvent;
-import org.apache.commons.lang.StringUtils;
-import org.apache.maven.archiva.configuration.Configuration;
-import org.apache.maven.archiva.configuration.ProxyConnectorConfiguration;
-import org.apache.maven.archiva.configuration.RemoteRepositoryConfiguration;
-import org.springframework.stereotype.Service;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-/**
- * @author Olivier Lamy
- * @since 1.4
- */
-@Service( "remoteRepositoryAdmin#default" )
-public class DefaultRemoteRepositoryAdmin
-    extends AbstractRepositoryAdmin
-    implements RemoteRepositoryAdmin
-{
-
-
-    public List getRemoteRepositories()
-        throws RepositoryAdminException
-    {
-        List remoteRepositories = new ArrayList();
-        for ( RemoteRepositoryConfiguration repositoryConfiguration : getArchivaConfiguration().getConfiguration().getRemoteRepositories() )
-        {
-            remoteRepositories.add(
-                new RemoteRepository( repositoryConfiguration.getId(), repositoryConfiguration.getName(),
-                                      repositoryConfiguration.getUrl(), repositoryConfiguration.getLayout(),
-                                      repositoryConfiguration.getUsername(), repositoryConfiguration.getPassword(),
-                                      repositoryConfiguration.getTimeout() ) );
-        }
-        return remoteRepositories;
-    }
-
-    public RemoteRepository getRemoteRepository( String repositoryId )
-        throws RepositoryAdminException
-    {
-        for ( RemoteRepository remoteRepository : getRemoteRepositories() )
-        {
-            if ( StringUtils.equals( repositoryId, remoteRepository.getId() ) )
-            {
-                return remoteRepository;
-            }
-        }
-        return null;
-    }
-
-    public Boolean addRemoteRepository( RemoteRepository remoteRepository, AuditInformation auditInformation )
-        throws RepositoryAdminException
-    {
-        triggerAuditEvent( remoteRepository.getId(), null, AuditEvent.ADD_REMOTE_REPO, auditInformation );
-        getRepositoryCommonValidator().basicValidation( remoteRepository, false );
-
-        //TODO we can validate it's a good uri/url
-        if ( StringUtils.isEmpty( remoteRepository.getUrl() ) )
-        {
-            throw new RepositoryAdminException( "url cannot be null" );
-        }
-
-        //MRM-752 - url needs trimming
-        remoteRepository.setUrl( StringUtils.trim( remoteRepository.getUrl() ) );
-
-        RemoteRepositoryConfiguration remoteRepositoryConfiguration =
-            getRemoteRepositoryConfiguration( remoteRepository );
-
-        Configuration configuration = getArchivaConfiguration().getConfiguration();
-        configuration.addRemoteRepository( remoteRepositoryConfiguration );
-        saveConfiguration( configuration );
-
-        return Boolean.TRUE;
-    }
-
-    public Boolean deleteRemoteRepository( String repositoryId, AuditInformation auditInformation )
-        throws RepositoryAdminException
-    {
-
-        triggerAuditEvent( repositoryId, null, AuditEvent.DELETE_REMOTE_REPO, auditInformation );
-
-        Configuration configuration = getArchivaConfiguration().getConfiguration();
-
-        RemoteRepositoryConfiguration remoteRepositoryConfiguration =
-            configuration.getRemoteRepositoriesAsMap().get( repositoryId );
-        if ( remoteRepositoryConfiguration == null )
-        {
-            throw new RepositoryAdminException(
-                "remoteRepository with id " + repositoryId + " not exist cannot remove it" );
-        }
-
-        configuration.removeRemoteRepository( remoteRepositoryConfiguration );
-
-        // TODO use ProxyConnectorAdmin interface ?
-        // [MRM-520] Proxy Connectors are not deleted with the deletion of a Repository.
-        List proxyConnectors =
-            new ArrayList( configuration.getProxyConnectors() );
-        for ( ProxyConnectorConfiguration proxyConnector : proxyConnectors )
-        {
-            if ( StringUtils.equals( proxyConnector.getTargetRepoId(), repositoryId ) )
-            {
-                configuration.removeProxyConnector( proxyConnector );
-            }
-        }
-
-        saveConfiguration( configuration );
-
-        return Boolean.TRUE;
-    }
-
-    public Boolean updateRemoteRepository( RemoteRepository remoteRepository, AuditInformation auditInformation )
-        throws RepositoryAdminException
-    {
-
-        String repositoryId = remoteRepository.getId();
-
-        triggerAuditEvent( repositoryId, null, AuditEvent.MODIFY_REMOTE_REPO, auditInformation );
-
-        // update means : remove and add
-
-        Configuration configuration = getArchivaConfiguration().getConfiguration();
-
-        RemoteRepositoryConfiguration remoteRepositoryConfiguration =
-            configuration.getRemoteRepositoriesAsMap().get( repositoryId );
-        if ( remoteRepositoryConfiguration == null )
-        {
-            throw new RepositoryAdminException(
-                "remoteRepository with id " + repositoryId + " not exist cannot remove it" );
-        }
-
-        configuration.removeRemoteRepository( remoteRepositoryConfiguration );
-
-        remoteRepositoryConfiguration = getRemoteRepositoryConfiguration( remoteRepository );
-        configuration.addRemoteRepository( remoteRepositoryConfiguration );
-        saveConfiguration( configuration );
-
-        return Boolean.TRUE;
-    }
-
-    public Map getRemoteRepositoriesAsMap()
-        throws RepositoryAdminException
-    {
-        java.util.Map map = new HashMap();
-
-        for ( RemoteRepository repo : getRemoteRepositories() )
-        {
-            map.put( repo.getId(), repo );
-        }
-
-        return map;
-    }
-
-    private RemoteRepositoryConfiguration getRemoteRepositoryConfiguration( RemoteRepository remoteRepository )
-    {
-        RemoteRepositoryConfiguration remoteRepositoryConfiguration = new RemoteRepositoryConfiguration();
-        remoteRepositoryConfiguration.setId( remoteRepository.getId() );
-        remoteRepositoryConfiguration.setPassword( remoteRepository.getPassword() );
-        remoteRepositoryConfiguration.setTimeout( remoteRepository.getTimeout() );
-        remoteRepositoryConfiguration.setUrl( remoteRepository.getUrl() );
-        remoteRepositoryConfiguration.setUsername( remoteRepository.getUserName() );
-        remoteRepositoryConfiguration.setLayout( remoteRepository.getLayout() );
-        remoteRepositoryConfiguration.setName( remoteRepository.getName() );
-        return remoteRepositoryConfiguration;
-    }
-
-}
diff --git a/archiva-modules/archiva-base/archiva-repository-admin/src/main/java/org/apache/archiva/admin/repository/remote/RemoteRepository.java b/archiva-modules/archiva-base/archiva-repository-admin/src/main/java/org/apache/archiva/admin/repository/remote/RemoteRepository.java
deleted file mode 100644
index db9f965d7..000000000
--- a/archiva-modules/archiva-base/archiva-repository-admin/src/main/java/org/apache/archiva/admin/repository/remote/RemoteRepository.java
+++ /dev/null
@@ -1,119 +0,0 @@
-package org.apache.archiva.admin.repository.remote;
-
-/*
- * 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.repository.AbstractRepository;
-
-import java.io.Serializable;
-
-/**
- * @author Olivier Lamy
- * @since 1.4
- */
-public class RemoteRepository
-    extends AbstractRepository
-    implements Serializable
-{
-
-    private String url;
-
-    private String userName;
-
-    private String password;
-
-    private int timeout = 60;
-
-    public RemoteRepository()
-    {
-        // no op
-    }
-
-    public RemoteRepository( String id, String name, String url, String layout )
-    {
-        super( id, name, layout );
-        this.url = url;
-    }
-
-    public RemoteRepository( String id, String name, String url, String layout, String userName, String password,
-                             int timeOut )
-    {
-        super( id, name, layout );
-        this.url = url;
-        this.userName = userName;
-        this.password = password;
-        this.timeout = timeOut;
-    }
-
-    public String getUrl()
-    {
-        return url;
-    }
-
-    public void setUrl( String url )
-    {
-        this.url = url;
-    }
-
-    public String getUserName()
-    {
-        return userName;
-    }
-
-    public void setUserName( String userName )
-    {
-        this.userName = userName;
-    }
-
-    public String getPassword()
-    {
-        return password;
-    }
-
-    public void setPassword( String password )
-    {
-        this.password = password;
-    }
-
-    public int getTimeout()
-    {
-        return timeout;
-    }
-
-    public void setTimeout( int timeout )
-    {
-        this.timeout = timeout;
-    }
-
-    @Override
-    public String toString()
-    {
-        final StringBuilder sb = new StringBuilder();
-        sb.append( "RemoteRepository" );
-        sb.append( "{url='" ).append( url ).append( '\'' );
-        sb.append( ", userName='" ).append( userName ).append( '\'' );
-        sb.append( ", password='" ).append( password ).append( '\'' );
-        sb.append( ", timeout=" ).append( timeout );
-        sb.append( '}' );
-        sb.append( super.toString() );
-        return sb.toString();
-    }
-
-
-}
\ No newline at end of file
diff --git a/archiva-modules/archiva-base/archiva-repository-admin/src/main/java/org/apache/archiva/admin/repository/remote/RemoteRepositoryAdmin.java b/archiva-modules/archiva-base/archiva-repository-admin/src/main/java/org/apache/archiva/admin/repository/remote/RemoteRepositoryAdmin.java
deleted file mode 100644
index 15218ba8d..000000000
--- a/archiva-modules/archiva-base/archiva-repository-admin/src/main/java/org/apache/archiva/admin/repository/remote/RemoteRepositoryAdmin.java
+++ /dev/null
@@ -1,51 +0,0 @@
-package org.apache.archiva.admin.repository.remote;
-/*
- * 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.AuditInformation;
-import org.apache.archiva.admin.repository.RepositoryAdminException;
-
-import java.util.List;
-import java.util.Map;
-
-/**
- * @author Olivier Lamy
- * @since 1.4
- */
-public interface RemoteRepositoryAdmin
-{
-    List getRemoteRepositories()
-        throws RepositoryAdminException;
-
-    RemoteRepository getRemoteRepository( String repositoryId )
-        throws RepositoryAdminException;
-
-    Boolean deleteRemoteRepository( String repositoryId, AuditInformation auditInformation )
-        throws RepositoryAdminException;
-
-    Boolean addRemoteRepository( RemoteRepository remoteRepository, AuditInformation auditInformation )
-        throws RepositoryAdminException;
-
-    Boolean updateRemoteRepository( RemoteRepository remoteRepository, AuditInformation auditInformation )
-        throws RepositoryAdminException;
-
-    Map getRemoteRepositoriesAsMap()
-        throws RepositoryAdminException;
-}
diff --git a/archiva-modules/archiva-base/archiva-repository-admin/src/main/java/org/apache/archiva/admin/repository/utils/RepositoryComparator.java b/archiva-modules/archiva-base/archiva-repository-admin/src/main/java/org/apache/archiva/admin/repository/utils/RepositoryComparator.java
deleted file mode 100644
index f9b93697a..000000000
--- a/archiva-modules/archiva-base/archiva-repository-admin/src/main/java/org/apache/archiva/admin/repository/utils/RepositoryComparator.java
+++ /dev/null
@@ -1,51 +0,0 @@
-package org.apache.archiva.admin.repository.utils;
-/*
- * 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.repository.AbstractRepository;
-
-import java.util.Comparator;
-
-/**
- * @author Olivier Lamy
- * @since 1.4
- */
-public class RepositoryComparator
-    implements Comparator
-{
-    public int compare( AbstractRepository o1, AbstractRepository o2 )
-    {
-        if ( o1 == null && o2 == null )
-        {
-            return 0;
-        }
-
-        if ( o1 == null )
-        {
-            return -1;
-        }
-
-        if ( o2 == null )
-        {
-            return 1;
-        }
-
-        return o1.getId().compareToIgnoreCase( o2.getId() );
-    }
-}
diff --git a/archiva-modules/archiva-base/archiva-repository-admin/src/main/resources/META-INF/spring-context.xml b/archiva-modules/archiva-base/archiva-repository-admin/src/main/resources/META-INF/spring-context.xml
deleted file mode 100644
index 3a9866691..000000000
--- a/archiva-modules/archiva-base/archiva-repository-admin/src/main/resources/META-INF/spring-context.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-
-
-
-
-
-
-  
-  
-
-
-
-
\ No newline at end of file
diff --git a/archiva-modules/archiva-base/archiva-repository-admin/src/test/java/org/apache/archiva/admin/mock/MockAuditListener.java b/archiva-modules/archiva-base/archiva-repository-admin/src/test/java/org/apache/archiva/admin/mock/MockAuditListener.java
deleted file mode 100644
index 42387a64d..000000000
--- a/archiva-modules/archiva-base/archiva-repository-admin/src/test/java/org/apache/archiva/admin/mock/MockAuditListener.java
+++ /dev/null
@@ -1,52 +0,0 @@
-package org.apache.archiva.admin.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.audit.AuditEvent;
-import org.apache.archiva.audit.AuditListener;
-import org.springframework.stereotype.Service;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * @author Olivier Lamy
- */
-@Service( "auditListener#mock" )
-public class MockAuditListener
-    implements AuditListener
-{
-
-    private List auditEvents = new ArrayList();
-
-    public void auditEvent( AuditEvent event )
-    {
-        auditEvents.add( event );
-    }
-
-    public List getAuditEvents()
-    {
-        return auditEvents;
-    }
-
-    public void clearEvents()
-    {
-        auditEvents.clear();
-    }
-}
diff --git a/archiva-modules/archiva-base/archiva-repository-admin/src/test/java/org/apache/archiva/admin/repository/AbstractRepositoryAdminTest.java b/archiva-modules/archiva-base/archiva-repository-admin/src/test/java/org/apache/archiva/admin/repository/AbstractRepositoryAdminTest.java
deleted file mode 100644
index 0533faa37..000000000
--- a/archiva-modules/archiva-base/archiva-repository-admin/src/test/java/org/apache/archiva/admin/repository/AbstractRepositoryAdminTest.java
+++ /dev/null
@@ -1,140 +0,0 @@
-package org.apache.archiva.admin.repository;
-/*
- * 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 junit.framework.TestCase;
-import org.apache.archiva.admin.AuditInformation;
-import org.apache.archiva.admin.mock.MockAuditListener;
-import org.apache.archiva.admin.repository.managed.ManagedRepository;
-import org.apache.archiva.admin.repository.managed.ManagedRepositoryAdmin;
-import org.apache.archiva.admin.repository.proxyconnector.ProxyConnectorAdmin;
-import org.apache.archiva.admin.repository.remote.RemoteRepository;
-import org.apache.archiva.admin.repository.remote.RemoteRepositoryAdmin;
-import org.apache.commons.io.FileUtils;
-import org.apache.commons.lang.StringUtils;
-import org.codehaus.plexus.redback.role.RoleManager;
-import org.codehaus.plexus.redback.users.User;
-import org.codehaus.plexus.redback.users.memory.SimpleUser;
-import org.junit.runner.RunWith;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.test.context.ContextConfiguration;
-import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
-
-import javax.inject.Inject;
-import java.io.File;
-import java.util.List;
-
-/**
- * @author Olivier Lamy
- */
-@RunWith( SpringJUnit4ClassRunner.class )
-@ContextConfiguration( locations = { "classpath*:/META-INF/spring-context.xml", "classpath:/spring-context.xml" } )
-public abstract class AbstractRepositoryAdminTest
-    extends TestCase
-{
-    protected Logger log = LoggerFactory.getLogger( getClass() );
-
-    public static final String APPSERVER_BASE_PATH = System.getProperty( "appserver.base" );
-
-    @Inject
-    protected MockAuditListener mockAuditListener;
-
-    @Inject
-    protected RoleManager roleManager;
-
-    @Inject
-    protected RemoteRepositoryAdmin remoteRepositoryAdmin;
-
-    @Inject
-    protected ManagedRepositoryAdmin managedRepositoryAdmin;
-
-    @Inject
-    protected ProxyConnectorAdmin proxyConnectorAdmin;
-
-    protected AuditInformation getFakeAuditInformation()
-    {
-        AuditInformation auditInformation = new AuditInformation( getFakeUser(), "archiva-localhost" );
-        return auditInformation;
-    }
-
-    protected User getFakeUser()
-    {
-        SimpleUser user = new SimpleUser()
-        {
-            @Override
-            public Object getPrincipal()
-            {
-                return "root";
-            }
-
-        };
-
-        user.setUsername( "root" );
-        user.setFullName( "The top user" );
-        return user;
-    }
-
-    protected ManagedRepository getTestManagedRepository( String repoId, String repoLocation )
-    {
-        return new ManagedRepository( repoId, "test repo", repoLocation, "default", false, true, true, "0 0 * * * ?",
-                                      repoLocation + "/.index", false, 1, 2, true );
-    }
-
-    protected File clearRepoLocation( String path )
-        throws Exception
-    {
-        File repoDir = new File( path );
-        if ( repoDir.exists() )
-        {
-            FileUtils.deleteDirectory( repoDir );
-        }
-        assertFalse( repoDir.exists() );
-        return repoDir;
-    }
-
-    protected ManagedRepository findManagedRepoById( List repos, String id )
-    {
-        for ( ManagedRepository repo : repos )
-        {
-            if ( StringUtils.equals( id, repo.getId() ) )
-            {
-                return repo;
-            }
-        }
-        return null;
-    }
-
-    protected RemoteRepository getRemoteRepository()
-    {
-        return getRemoteRepository( "foo" );
-    }
-
-    protected RemoteRepository getRemoteRepository(String id)
-    {
-        RemoteRepository remoteRepository = new RemoteRepository();
-        remoteRepository.setUrl( "http://foo.com/maven-it-rocks" );
-        remoteRepository.setTimeout( 10 );
-        remoteRepository.setName( "maven foo" );
-        remoteRepository.setUserName( "foo-name" );
-        remoteRepository.setPassword( "toto" );
-        remoteRepository.setId( id );
-        return remoteRepository;
-    }
-}
diff --git a/archiva-modules/archiva-base/archiva-repository-admin/src/test/java/org/apache/archiva/admin/repository/admin/ArchivaAdministrationTest.java b/archiva-modules/archiva-base/archiva-repository-admin/src/test/java/org/apache/archiva/admin/repository/admin/ArchivaAdministrationTest.java
deleted file mode 100644
index c51c12664..000000000
--- a/archiva-modules/archiva-base/archiva-repository-admin/src/test/java/org/apache/archiva/admin/repository/admin/ArchivaAdministrationTest.java
+++ /dev/null
@@ -1,190 +0,0 @@
-package org.apache.archiva.admin.repository.admin;
-/*
- * 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.repository.AbstractRepositoryAdminTest;
-import org.apache.archiva.admin.repository.RepositoryAdminException;
-import org.apache.archiva.audit.AuditEvent;
-import org.junit.Test;
-
-import javax.inject.Inject;
-import java.util.Arrays;
-
-/**
- * @author Olivier Lamy
- */
-public class ArchivaAdministrationTest
-    extends AbstractRepositoryAdminTest
-{
-    @Inject
-    ArchivaAdministration archivaAdministration;
-
-
-    @Test
-    public void getAllLegacyPaths()
-        throws Exception
-    {
-        assertNotNull( archivaAdministration.getLegacyArtifactPaths() );
-        assertFalse( archivaAdministration.getLegacyArtifactPaths().isEmpty() );
-        assertEquals( 1, archivaAdministration.getLegacyArtifactPaths().size() );
-        log.info( "all legacy paths {}", archivaAdministration.getLegacyArtifactPaths() );
-    }
-
-    public void addAndDeleteLegacyPath()
-        throws Exception
-    {
-        int initialSize = archivaAdministration.getLegacyArtifactPaths().size();
-
-        LegacyArtifactPath legacyArtifactPath = new LegacyArtifactPath( "foo", "bar" );
-        archivaAdministration.addLegacyArtifactPath( legacyArtifactPath, getFakeAuditInformation() );
-
-        assertTrue( archivaAdministration.getLegacyArtifactPaths().contains( new LegacyArtifactPath( "foo", "bar" ) ) );
-        assertEquals( initialSize + 1, archivaAdministration.getLegacyArtifactPaths().size() );
-
-        archivaAdministration.deleteLegacyArtifactPath( legacyArtifactPath.getPath(), getFakeAuditInformation() );
-
-        assertFalse(
-            archivaAdministration.getLegacyArtifactPaths().contains( new LegacyArtifactPath( "foo", "bar" ) ) );
-        assertEquals( initialSize, archivaAdministration.getLegacyArtifactPaths().size() );
-        mockAuditListener.clearEvents();
-    }
-
-    @Test
-    public void addAndUpdateAndDeleteFileType()
-        throws RepositoryAdminException
-    {
-        int initialSize = archivaAdministration.getFileTypes().size();
-
-        FileType fileType = new FileType();
-        fileType.setId( "foo" );
-        fileType.setPatterns( Arrays.asList( "bar", "toto" ) );
-
-        archivaAdministration.addFileType( fileType, getFakeAuditInformation() );
-
-        assertEquals( initialSize + 1, archivaAdministration.getFileTypes().size() );
-
-        archivaAdministration.addFileTypePattern( "foo", "zorro", getFakeAuditInformation() );
-
-        assertEquals( initialSize + 1, archivaAdministration.getFileTypes().size() );
-
-        assertEquals( 3, archivaAdministration.getFileType( "foo" ).getPatterns().size() );
-
-        assertTrue( archivaAdministration.getFileType( "foo" ).getPatterns().contains( "bar" ) );
-        assertTrue( archivaAdministration.getFileType( "foo" ).getPatterns().contains( "toto" ) );
-        assertTrue( archivaAdministration.getFileType( "foo" ).getPatterns().contains( "zorro" ) );
-
-        archivaAdministration.removeFileTypePattern( "foo", "zorro", getFakeAuditInformation() );
-
-        assertEquals( initialSize + 1, archivaAdministration.getFileTypes().size() );
-
-        assertEquals( 2, archivaAdministration.getFileType( "foo" ).getPatterns().size() );
-
-        assertTrue( archivaAdministration.getFileType( "foo" ).getPatterns().contains( "bar" ) );
-        assertTrue( archivaAdministration.getFileType( "foo" ).getPatterns().contains( "toto" ) );
-        assertFalse( archivaAdministration.getFileType( "foo" ).getPatterns().contains( "zorro" ) );
-
-        archivaAdministration.removeFileType( "foo", getFakeAuditInformation() );
-
-        assertEquals( initialSize, archivaAdministration.getFileTypes().size() );
-        assertNull( archivaAdministration.getFileType( "foo" ) );
-        mockAuditListener.clearEvents();
-    }
-
-    @Test
-    public void knownContentConsumersTest()
-        throws Exception
-    {
-        int initialSize = archivaAdministration.getKnownContentConsumers().size();
-
-        archivaAdministration.addKnownContentConsumer( "foo", getFakeAuditInformation() );
-
-        assertEquals( initialSize + 1, archivaAdministration.getKnownContentConsumers().size() );
-        assertTrue( archivaAdministration.getKnownContentConsumers().contains( "foo" ) );
-
-        // ensure we don't add it twice as it's an ArrayList as storage
-        archivaAdministration.addKnownContentConsumer( "foo", getFakeAuditInformation() );
-
-        assertEquals( initialSize + 1, archivaAdministration.getKnownContentConsumers().size() );
-        assertTrue( archivaAdministration.getKnownContentConsumers().contains( "foo" ) );
-
-        archivaAdministration.removeKnownContentConsumer( "foo", getFakeAuditInformation() );
-
-        assertEquals( initialSize, archivaAdministration.getKnownContentConsumers().size() );
-        assertFalse( archivaAdministration.getKnownContentConsumers().contains( "foo" ) );
-
-        assertEquals( 2, mockAuditListener.getAuditEvents().size() );
-        assertEquals( AuditEvent.ENABLE_REPO_CONSUMER, mockAuditListener.getAuditEvents().get( 0 ).getAction() );
-        assertEquals( AuditEvent.DISABLE_REPO_CONSUMER, mockAuditListener.getAuditEvents().get( 1 ).getAction() );
-
-        mockAuditListener.clearEvents();
-
-    }
-
-    @Test
-    public void invalidContentConsumersTest()
-        throws Exception
-    {
-        int initialSize = archivaAdministration.getInvalidContentConsumers().size();
-
-        archivaAdministration.addInvalidContentConsumer( "foo", getFakeAuditInformation() );
-
-        assertEquals( initialSize + 1, archivaAdministration.getInvalidContentConsumers().size() );
-        assertTrue( archivaAdministration.getInvalidContentConsumers().contains( "foo" ) );
-
-        // ensure we don't add it twice as it's an ArrayList as storage
-        archivaAdministration.addInvalidContentConsumer( "foo", getFakeAuditInformation() );
-
-        assertEquals( initialSize + 1, archivaAdministration.getInvalidContentConsumers().size() );
-        assertTrue( archivaAdministration.getInvalidContentConsumers().contains( "foo" ) );
-
-        archivaAdministration.removeInvalidContentConsumer( "foo", getFakeAuditInformation() );
-
-        assertEquals( initialSize, archivaAdministration.getInvalidContentConsumers().size() );
-        assertFalse( archivaAdministration.getInvalidContentConsumers().contains( "foo" ) );
-
-        assertEquals( 2, mockAuditListener.getAuditEvents().size() );
-        assertEquals( AuditEvent.ENABLE_REPO_CONSUMER, mockAuditListener.getAuditEvents().get( 0 ).getAction() );
-        assertEquals( AuditEvent.DISABLE_REPO_CONSUMER, mockAuditListener.getAuditEvents().get( 1 ).getAction() );
-
-        mockAuditListener.clearEvents();
-
-    }
-
-
-    public void organisationInfoUpdate()
-        throws Exception
-    {
-        OrganisationInformation organisationInformation = archivaAdministration.getOrganisationInformation();
-        assertNull( organisationInformation );
-
-        organisationInformation = new OrganisationInformation();
-        organisationInformation.setLogoLocation( "http://foo.com/bar.png" );
-        organisationInformation.setName( "foo org" );
-        organisationInformation.setUrl( "http:/foo.com" );
-
-        archivaAdministration.setOrganisationInformation( organisationInformation );
-
-        organisationInformation = archivaAdministration.getOrganisationInformation();
-        assertNotNull( organisationInformation );
-        assertEquals( "http://foo.com/bar.png", organisationInformation.getLogoLocation() );
-        assertEquals( "foo org", organisationInformation.getName() );
-        assertEquals( "http://foo.com", organisationInformation.getUrl() );
-
-    }
-}
diff --git a/archiva-modules/archiva-base/archiva-repository-admin/src/test/java/org/apache/archiva/admin/repository/group/RepositoryGroupAdminTest.java b/archiva-modules/archiva-base/archiva-repository-admin/src/test/java/org/apache/archiva/admin/repository/group/RepositoryGroupAdminTest.java
deleted file mode 100644
index 7079a9caa..000000000
--- a/archiva-modules/archiva-base/archiva-repository-admin/src/test/java/org/apache/archiva/admin/repository/group/RepositoryGroupAdminTest.java
+++ /dev/null
@@ -1,200 +0,0 @@
-package org.apache.archiva.admin.repository.group;
-/*
- * 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.repository.AbstractRepositoryAdminTest;
-import org.apache.archiva.admin.repository.managed.ManagedRepository;
-import org.apache.archiva.audit.AuditEvent;
-import org.junit.Test;
-
-import javax.inject.Inject;
-import java.io.File;
-import java.util.Arrays;
-
-/**
- * @author Olivier Lamy
- */
-public class RepositoryGroupAdminTest
-    extends AbstractRepositoryAdminTest
-{
-    @Inject
-    RepositoryGroupAdmin repositoryGroupAdmin;
-
-    @Test
-    public void addAndDeleteGroup()
-        throws Exception
-    {
-        try
-        {
-            ManagedRepository managedRepositoryOne =
-                getTestManagedRepository( "test-new-one", APPSERVER_BASE_PATH + File.separator + "test-new-one" );
-
-            ManagedRepository managedRepositoryTwo =
-                getTestManagedRepository( "test-new-two", APPSERVER_BASE_PATH + File.separator + "test-new-two" );
-
-            managedRepositoryAdmin.addManagedRepository( managedRepositoryOne, false, getFakeAuditInformation() );
-
-            managedRepositoryAdmin.addManagedRepository( managedRepositoryTwo, false, getFakeAuditInformation() );
-
-            RepositoryGroup repositoryGroup =
-                new RepositoryGroup( "repo-group-one", Arrays.asList( "test-new-one", "test-new-two" ) );
-
-            mockAuditListener.clearEvents();
-
-            repositoryGroupAdmin.addRepositoryGroup( repositoryGroup, getFakeAuditInformation() );
-
-            assertEquals( 1, repositoryGroupAdmin.getRepositoriesGroups().size() );
-            assertEquals( "repo-group-one", repositoryGroupAdmin.getRepositoriesGroups().get( 0 ).getId() );
-            assertEquals( 2, repositoryGroupAdmin.getRepositoriesGroups().get( 0 ).getRepositories().size() );
-            assertEquals( Arrays.asList( "test-new-one", "test-new-two" ),
-                          repositoryGroupAdmin.getRepositoriesGroups().get( 0 ).getRepositories() );
-
-            repositoryGroupAdmin.deleteRepositoryGroup( "repo-group-one", getFakeAuditInformation() );
-
-            assertEquals( 0, repositoryGroupAdmin.getRepositoriesGroups().size() );
-
-            assertEquals( 2, mockAuditListener.getAuditEvents().size() );
-
-            assertEquals( AuditEvent.ADD_REPO_GROUP, mockAuditListener.getAuditEvents().get( 0 ).getAction() );
-            assertEquals( AuditEvent.DELETE_REPO_GROUP, mockAuditListener.getAuditEvents().get( 1 ).getAction() );
-        }
-        finally
-        {
-            mockAuditListener.clearEvents();
-            managedRepositoryAdmin.deleteManagedRepository( "test-new-one", getFakeAuditInformation(), true );
-            managedRepositoryAdmin.deleteManagedRepository( "test-new-two", getFakeAuditInformation(), true );
-        }
-    }
-
-    @Test
-    public void addAndUpdateAndDeleteGroup()
-        throws Exception
-    {
-        try
-        {
-            ManagedRepository managedRepositoryOne =
-                getTestManagedRepository( "test-new-one", APPSERVER_BASE_PATH + File.separator + "test-new-one" );
-
-            ManagedRepository managedRepositoryTwo =
-                getTestManagedRepository( "test-new-two", APPSERVER_BASE_PATH + File.separator + "test-new-two" );
-
-            managedRepositoryAdmin.addManagedRepository( managedRepositoryOne, false, getFakeAuditInformation() );
-
-            managedRepositoryAdmin.addManagedRepository( managedRepositoryTwo, false, getFakeAuditInformation() );
-
-            RepositoryGroup repositoryGroup = new RepositoryGroup( "repo-group-one", Arrays.asList( "test-new-one" ) );
-
-            mockAuditListener.clearEvents();
-
-            repositoryGroupAdmin.addRepositoryGroup( repositoryGroup, getFakeAuditInformation() );
-
-            assertEquals( 1, repositoryGroupAdmin.getRepositoriesGroups().size() );
-            assertEquals( "repo-group-one", repositoryGroupAdmin.getRepositoriesGroups().get( 0 ).getId() );
-            assertEquals( 1, repositoryGroupAdmin.getRepositoriesGroups().get( 0 ).getRepositories().size() );
-            assertEquals( Arrays.asList( "test-new-one" ),
-                          repositoryGroupAdmin.getRepositoriesGroups().get( 0 ).getRepositories() );
-
-            repositoryGroup = repositoryGroupAdmin.getRepositoryGroup( "repo-group-one" );
-            assertNotNull( repositoryGroup );
-
-            repositoryGroup.addRepository( managedRepositoryTwo.getId() );
-
-            repositoryGroupAdmin.updateRepositoryGroup( repositoryGroup, getFakeAuditInformation() );
-
-            assertEquals( 1, repositoryGroupAdmin.getRepositoriesGroups().size() );
-            assertEquals( "repo-group-one", repositoryGroupAdmin.getRepositoriesGroups().get( 0 ).getId() );
-            assertEquals( 2, repositoryGroupAdmin.getRepositoriesGroups().get( 0 ).getRepositories().size() );
-            assertEquals( Arrays.asList( "test-new-one", "test-new-two" ),
-                          repositoryGroupAdmin.getRepositoriesGroups().get( 0 ).getRepositories() );
-
-            repositoryGroupAdmin.deleteRepositoryGroup( "repo-group-one", getFakeAuditInformation() );
-
-            assertEquals( 0, repositoryGroupAdmin.getRepositoriesGroups().size() );
-
-            assertEquals( 3, mockAuditListener.getAuditEvents().size() );
-
-            assertEquals( AuditEvent.ADD_REPO_GROUP, mockAuditListener.getAuditEvents().get( 0 ).getAction() );
-            assertEquals( AuditEvent.MODIFY_REPO_GROUP, mockAuditListener.getAuditEvents().get( 1 ).getAction() );
-            assertEquals( AuditEvent.DELETE_REPO_GROUP, mockAuditListener.getAuditEvents().get( 2 ).getAction() );
-        }
-        finally
-        {
-            mockAuditListener.clearEvents();
-            managedRepositoryAdmin.deleteManagedRepository( "test-new-one", getFakeAuditInformation(), true );
-            managedRepositoryAdmin.deleteManagedRepository( "test-new-two", getFakeAuditInformation(), true );
-        }
-    }
-
-
-    @Test
-    public void addAndDeleteGroupWithRemowingManagedRepo()
-        throws Exception
-    {
-        try
-        {
-            ManagedRepository managedRepositoryOne =
-                getTestManagedRepository( "test-new-one", APPSERVER_BASE_PATH + File.separator + "test-new-one" );
-
-            ManagedRepository managedRepositoryTwo =
-                getTestManagedRepository( "test-new-two", APPSERVER_BASE_PATH + File.separator + "test-new-two" );
-
-            managedRepositoryAdmin.addManagedRepository( managedRepositoryOne, false, getFakeAuditInformation() );
-
-            managedRepositoryAdmin.addManagedRepository( managedRepositoryTwo, false, getFakeAuditInformation() );
-
-            RepositoryGroup repositoryGroup =
-                new RepositoryGroup( "repo-group-one", Arrays.asList( "test-new-one", "test-new-two" ) );
-
-            mockAuditListener.clearEvents();
-
-            repositoryGroupAdmin.addRepositoryGroup( repositoryGroup, getFakeAuditInformation() );
-
-            assertEquals( 1, repositoryGroupAdmin.getRepositoriesGroups().size() );
-            assertEquals( "repo-group-one", repositoryGroupAdmin.getRepositoriesGroups().get( 0 ).getId() );
-            assertEquals( 2, repositoryGroupAdmin.getRepositoriesGroups().get( 0 ).getRepositories().size() );
-            assertEquals( Arrays.asList( "test-new-one", "test-new-two" ),
-                          repositoryGroupAdmin.getRepositoriesGroups().get( 0 ).getRepositories() );
-
-            // deleting a managed repo to validate repogroup correctly updated !
-            managedRepositoryAdmin.deleteManagedRepository( "test-new-one", getFakeAuditInformation(), true );
-
-            assertEquals( 1, repositoryGroupAdmin.getRepositoriesGroups().size() );
-            assertEquals( "repo-group-one", repositoryGroupAdmin.getRepositoriesGroups().get( 0 ).getId() );
-            assertEquals( 1, repositoryGroupAdmin.getRepositoriesGroups().get( 0 ).getRepositories().size() );
-            assertEquals( Arrays.asList( "test-new-two" ),
-                          repositoryGroupAdmin.getRepositoriesGroups().get( 0 ).getRepositories() );
-
-            repositoryGroupAdmin.deleteRepositoryGroup( "repo-group-one", getFakeAuditInformation() );
-
-            assertEquals( 0, repositoryGroupAdmin.getRepositoriesGroups().size() );
-
-            assertEquals( 3, mockAuditListener.getAuditEvents().size() );
-
-            assertEquals( AuditEvent.ADD_REPO_GROUP, mockAuditListener.getAuditEvents().get( 0 ).getAction() );
-            assertEquals( AuditEvent.DELETE_MANAGED_REPO, mockAuditListener.getAuditEvents().get( 1 ).getAction() );
-            assertEquals( AuditEvent.DELETE_REPO_GROUP, mockAuditListener.getAuditEvents().get( 2 ).getAction() );
-        }
-        finally
-        {
-            mockAuditListener.clearEvents();
-
-            managedRepositoryAdmin.deleteManagedRepository( "test-new-two", getFakeAuditInformation(), true );
-        }
-    }
-}
diff --git a/archiva-modules/archiva-base/archiva-repository-admin/src/test/java/org/apache/archiva/admin/repository/managed/ManagedRepositoryAdminTest.java b/archiva-modules/archiva-base/archiva-repository-admin/src/test/java/org/apache/archiva/admin/repository/managed/ManagedRepositoryAdminTest.java
deleted file mode 100644
index 66dd71b5d..000000000
--- a/archiva-modules/archiva-base/archiva-repository-admin/src/test/java/org/apache/archiva/admin/repository/managed/ManagedRepositoryAdminTest.java
+++ /dev/null
@@ -1,379 +0,0 @@
-package org.apache.archiva.admin.repository.managed;
-/*
- * 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.repository.AbstractRepositoryAdminTest;
-import org.apache.archiva.audit.AuditEvent;
-import org.apache.archiva.security.common.ArchivaRoleConstants;
-import org.apache.commons.io.FileUtils;
-import org.apache.commons.lang.StringUtils;
-import org.junit.Test;
-
-import java.io.File;
-import java.util.List;
-
-/**
- * @author Olivier Lamy
- */
-public class ManagedRepositoryAdminTest
-    extends AbstractRepositoryAdminTest
-{
-    public static final String STAGE_REPO_ID_END = DefaultManagedRepositoryAdmin.STAGE_REPO_ID_END;
-
-    @Test
-    public void getAllManagedRepos()
-        throws Exception
-    {
-        mockAuditListener.clearEvents();
-        List repos = managedRepositoryAdmin.getManagedRepositories();
-        assertNotNull( repos );
-        assertTrue( repos.size() > 0 );
-        log.info( "repos " + repos );
-
-        // check default internal
-        ManagedRepository internal = findManagedRepoById( repos, "internal" );
-        assertNotNull( internal );
-        assertTrue( internal.isReleases() );
-        assertFalse( internal.isSnapshots() );
-        mockAuditListener.clearEvents();
-    }
-
-    @Test
-    public void getById()
-        throws Exception
-    {
-        mockAuditListener.clearEvents();
-        ManagedRepository repo = managedRepositoryAdmin.getManagedRepository( "internal" );
-        assertNotNull( repo );
-        mockAuditListener.clearEvents();
-    }
-
-    @Test
-    public void addDeleteManagedRepo()
-        throws Exception
-    {
-        mockAuditListener.clearEvents();
-
-        String repoId = "test-new-one";
-
-        String repoLocation = APPSERVER_BASE_PATH + File.separator + repoId;
-
-        File repoDir = clearRepoLocation( repoLocation );
-
-        List repos = managedRepositoryAdmin.getManagedRepositories();
-        assertNotNull( repos );
-        int initialSize = repos.size();
-        assertTrue( initialSize > 0 );
-
-        ManagedRepository repo = new ManagedRepository();
-        repo.setId( repoId );
-        repo.setName( "test repo" );
-        repo.setLocation( repoLocation );
-        repo.setCronExpression( "0 0 * * * ?" );
-        managedRepositoryAdmin.addManagedRepository( repo, false, getFakeAuditInformation() );
-        repos = managedRepositoryAdmin.getManagedRepositories();
-        assertNotNull( repos );
-        assertEquals( initialSize + 1, repos.size() );
-
-        assertNotNull( managedRepositoryAdmin.getManagedRepository( repoId ) );
-
-        assertTemplateRoleExists( repoId );
-
-        managedRepositoryAdmin.deleteManagedRepository( repoId, getFakeAuditInformation(), false );
-
-        // deleteContents false
-        assertTrue( repoDir.exists() );
-
-        repos = managedRepositoryAdmin.getManagedRepositories();
-        assertNotNull( repos );
-        assertEquals( initialSize, repos.size() );
-
-        assertTemplateRoleNotExists( repoId );
-
-        assertEquals( 2, mockAuditListener.getAuditEvents().size() );
-
-        assertAuditListenerCallAddAndDelete();
-
-        mockAuditListener.clearEvents();
-    }
-
-    @Test
-    public void updateDeleteManagedRepo()
-        throws Exception
-    {
-        String repoId = "test-new-one";
-
-        String repoLocation = APPSERVER_BASE_PATH + File.separator + "new-path";
-
-        File repoDir = clearRepoLocation( repoLocation );
-
-        mockAuditListener.clearEvents();
-        List repos = managedRepositoryAdmin.getManagedRepositories();
-        assertNotNull( repos );
-        int initialSize = repos.size();
-        assertTrue( initialSize > 0 );
-
-        ManagedRepository repo = new ManagedRepository();
-        repo.setId( repoId );
-        repo.setName( "test repo" );
-        repo.setLocation( repoLocation );
-        repo.setCronExpression( "0 0 * * * ?" );
-        managedRepositoryAdmin.addManagedRepository( repo, false, getFakeAuditInformation() );
-
-        assertTemplateRoleExists( repoId );
-
-        repos = managedRepositoryAdmin.getManagedRepositories();
-        assertNotNull( repos );
-        assertEquals( initialSize + 1, repos.size() );
-
-        String newName = "test repo update";
-
-        repo.setName( newName );
-
-        repo.setLocation( repoLocation );
-        repo.setCronExpression( "0 0 * * * ?" );
-
-        managedRepositoryAdmin.updateManagedRepository( repo, false, getFakeAuditInformation(), false );
-
-        repo = managedRepositoryAdmin.getManagedRepository( repoId );
-        assertNotNull( repo );
-        assertEquals( newName, repo.getName() );
-        assertEquals( new File( repoLocation ).getCanonicalPath(), new File( repo.getLocation() ).getCanonicalPath() );
-        assertTrue( new File( repoLocation ).exists() );
-
-        assertTemplateRoleExists( repoId );
-
-        managedRepositoryAdmin.deleteManagedRepository( repo.getId(), getFakeAuditInformation(), false );
-
-        // check deleteContents false
-        assertTrue( repoDir.exists() );
-
-        assertTemplateRoleNotExists( repoId );
-
-        assertAuditListenerCallAndUpdateAddAndDelete( false );
-
-        mockAuditListener.clearEvents();
-
-    }
-
-
-    @Test
-    public void addDeleteManagedRepoWithStaged()
-        throws Exception
-    {
-
-        String repoId = "test-new-one";
-        String repoLocation = APPSERVER_BASE_PATH + File.separator + repoId;
-
-        File repoDir = clearRepoLocation( repoLocation );
-
-        mockAuditListener.clearEvents();
-        List repos = managedRepositoryAdmin.getManagedRepositories();
-        assertNotNull( repos );
-        int initialSize = repos.size();
-        assertTrue( initialSize > 0 );
-
-        ManagedRepository repo = new ManagedRepository();
-        repo.setId( repoId );
-        repo.setName( "test repo" );
-        repo.setLocation( repoLocation );
-        repo.setCronExpression( "0 0 * * * ?" );
-        managedRepositoryAdmin.addManagedRepository( repo, true, getFakeAuditInformation() );
-        repos = managedRepositoryAdmin.getManagedRepositories();
-        assertNotNull( repos );
-        assertEquals( initialSize + 2, repos.size() );
-
-        assertNotNull( managedRepositoryAdmin.getManagedRepository( repoId ) );
-
-        assertTemplateRoleExists( repoId );
-
-        assertTrue( repoDir.exists() );
-
-        assertNotNull( managedRepositoryAdmin.getManagedRepository( repoId + STAGE_REPO_ID_END ) );
-
-        assertTemplateRoleExists( repoId + STAGE_REPO_ID_END );
-
-        assertTrue( new File( repoLocation + STAGE_REPO_ID_END ).exists() );
-
-        managedRepositoryAdmin.deleteManagedRepository( repoId, getFakeAuditInformation(), true );
-
-        assertFalse( repoDir.exists() );
-
-        assertFalse( new File( repoLocation + STAGE_REPO_ID_END ).exists() );
-
-        assertTemplateRoleNotExists( repoId + STAGE_REPO_ID_END );
-
-        repos = managedRepositoryAdmin.getManagedRepositories();
-        assertNotNull( repos );
-        assertEquals( initialSize, repos.size() );
-
-        assertTemplateRoleNotExists( repoId );
-
-        assertTemplateRoleNotExists( repoId + STAGE_REPO_ID_END );
-
-        mockAuditListener.clearEvents();
-
-    }
-
-    @Test
-    public void updateDeleteManagedRepoWithStagedRepo()
-        throws Exception
-    {
-        String repoId = "test-new-one";
-
-        String repoLocation = APPSERVER_BASE_PATH + File.separator + "new-path";
-
-        String stageRepoLocation = APPSERVER_BASE_PATH + File.separator + repoId;
-
-        File repoDir = clearRepoLocation( repoLocation );
-
-        mockAuditListener.clearEvents();
-        List repos = managedRepositoryAdmin.getManagedRepositories();
-        assertNotNull( repos );
-        int initialSize = repos.size();
-        assertTrue( initialSize > 0 );
-
-        ManagedRepository repo = getTestManagedRepository( repoId, repoLocation );
-
-        managedRepositoryAdmin.addManagedRepository( repo, false, getFakeAuditInformation() );
-
-        assertTemplateRoleExists( repoId );
-
-        assertFalse( new File( repoLocation + STAGE_REPO_ID_END ).exists() );
-
-        assertTemplateRoleNotExists( repoId + STAGE_REPO_ID_END );
-
-        repos = managedRepositoryAdmin.getManagedRepositories();
-        assertNotNull( repos );
-        assertEquals( initialSize + 1, repos.size() );
-
-        repo = managedRepositoryAdmin.getManagedRepository( repoId );
-
-        assertEquals( getTestManagedRepository( repoId, repoLocation ).getIndexDirectory(), repo.getIndexDirectory() );
-
-        String newName = "test repo update";
-
-        repo.setName( newName );
-
-        repo.setLocation( repoLocation );
-
-        managedRepositoryAdmin.updateManagedRepository( repo, true, getFakeAuditInformation(), false );
-
-        repo = managedRepositoryAdmin.getManagedRepository( repoId );
-        assertNotNull( repo );
-        assertEquals( newName, repo.getName() );
-        assertEquals( new File( repoLocation ).getCanonicalPath(), new File( repo.getLocation() ).getCanonicalPath() );
-        assertTrue( new File( repoLocation ).exists() );
-        assertEquals( getTestManagedRepository( repoId, repoLocation ).getCronExpression(), repo.getCronExpression() );
-        assertEquals( getTestManagedRepository( repoId, repoLocation ).getLayout(), repo.getLayout() );
-        assertEquals( getTestManagedRepository( repoId, repoLocation ).getId(), repo.getId() );
-        assertEquals( getTestManagedRepository( repoId, repoLocation ).getIndexDirectory(), repo.getIndexDirectory() );
-
-        assertEquals( getTestManagedRepository( repoId, repoLocation ).getDaysOlder(), repo.getDaysOlder() );
-        assertEquals( getTestManagedRepository( repoId, repoLocation ).getRetentionCount(), repo.getRetentionCount() );
-        assertEquals( getTestManagedRepository( repoId, repoLocation ).isDeleteReleasedSnapshots(),
-                      repo.isDeleteReleasedSnapshots() );
-
-        assertTemplateRoleExists( repoId );
-
-        assertTrue( new File( stageRepoLocation + STAGE_REPO_ID_END ).exists() );
-
-        assertTemplateRoleExists( repoId + STAGE_REPO_ID_END );
-
-        managedRepositoryAdmin.deleteManagedRepository( repo.getId(), getFakeAuditInformation(), false );
-
-        // check deleteContents false
-        assertTrue( repoDir.exists() );
-
-        assertTemplateRoleNotExists( repoId );
-
-        assertTrue( new File( stageRepoLocation + STAGE_REPO_ID_END ).exists() );
-
-        assertTemplateRoleNotExists( repoId + STAGE_REPO_ID_END );
-
-        assertAuditListenerCallAndUpdateAddAndDelete( true );
-
-        mockAuditListener.clearEvents();
-
-    }
-
-    //----------------------------------
-    // utility methods
-    //----------------------------------
-
-    private void assertTemplateRoleExists( String repoId )
-        throws Exception
-    {
-        assertTrue( roleManager.templatedRoleExists( ArchivaRoleConstants.TEMPLATE_REPOSITORY_OBSERVER, repoId ) );
-        assertTrue( roleManager.templatedRoleExists( ArchivaRoleConstants.TEMPLATE_REPOSITORY_MANAGER, repoId ) );
-    }
-
-
-    private void assertTemplateRoleNotExists( String repoId )
-        throws Exception
-    {
-        assertFalse( roleManager.templatedRoleExists( ArchivaRoleConstants.TEMPLATE_REPOSITORY_OBSERVER, repoId ) );
-        assertFalse( roleManager.templatedRoleExists( ArchivaRoleConstants.TEMPLATE_REPOSITORY_MANAGER, repoId ) );
-    }
-
-    private void assertAuditListenerCallAddAndDelete()
-    {
-        assertEquals( 2, mockAuditListener.getAuditEvents().size() );
-
-        assertEquals( AuditEvent.ADD_MANAGED_REPO, mockAuditListener.getAuditEvents().get( 0 ).getAction() );
-        assertEquals( "root", mockAuditListener.getAuditEvents().get( 0 ).getUserId() );
-        assertEquals( "archiva-localhost", mockAuditListener.getAuditEvents().get( 0 ).getRemoteIP() );
-
-        assertEquals( AuditEvent.DELETE_MANAGED_REPO, mockAuditListener.getAuditEvents().get( 1 ).getAction() );
-        assertEquals( "root", mockAuditListener.getAuditEvents().get( 0 ).getUserId() );
-    }
-
-    private void assertAuditListenerCallAndUpdateAddAndDelete( boolean stageNeeded )
-    {
-        if ( stageNeeded )
-        {
-            assertEquals( "not 4 audit events " + mockAuditListener.getAuditEvents(), 4,
-                          mockAuditListener.getAuditEvents().size() );
-        }
-        else
-        {
-            assertEquals( "not 3 audit events " + mockAuditListener.getAuditEvents(), 3,
-                          mockAuditListener.getAuditEvents().size() );
-        }
-        assertEquals( AuditEvent.ADD_MANAGED_REPO, mockAuditListener.getAuditEvents().get( 0 ).getAction() );
-        assertEquals( "root", mockAuditListener.getAuditEvents().get( 0 ).getUserId() );
-        assertEquals( "archiva-localhost", mockAuditListener.getAuditEvents().get( 0 ).getRemoteIP() );
-
-        if ( stageNeeded )
-        {
-            assertEquals( AuditEvent.ADD_MANAGED_REPO, mockAuditListener.getAuditEvents().get( 1 ).getAction() );
-            assertEquals( AuditEvent.MODIFY_MANAGED_REPO, mockAuditListener.getAuditEvents().get( 2 ).getAction() );
-            assertEquals( AuditEvent.DELETE_MANAGED_REPO, mockAuditListener.getAuditEvents().get( 3 ).getAction() );
-        }
-        else
-        {
-            assertEquals( AuditEvent.MODIFY_MANAGED_REPO, mockAuditListener.getAuditEvents().get( 1 ).getAction() );
-            assertEquals( AuditEvent.DELETE_MANAGED_REPO, mockAuditListener.getAuditEvents().get( 2 ).getAction() );
-        }
-
-    }
-
-
-
-}
diff --git a/archiva-modules/archiva-base/archiva-repository-admin/src/test/java/org/apache/archiva/admin/repository/networkproxy/NetworkProxyAdminTest.java b/archiva-modules/archiva-base/archiva-repository-admin/src/test/java/org/apache/archiva/admin/repository/networkproxy/NetworkProxyAdminTest.java
deleted file mode 100644
index 840ba19c7..000000000
--- a/archiva-modules/archiva-base/archiva-repository-admin/src/test/java/org/apache/archiva/admin/repository/networkproxy/NetworkProxyAdminTest.java
+++ /dev/null
@@ -1,142 +0,0 @@
-package org.apache.archiva.admin.repository.networkproxy;
-/*
- * 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.repository.AbstractRepositoryAdminTest;
-import org.apache.archiva.audit.AuditEvent;
-import org.junit.Test;
-
-import javax.inject.Inject;
-
-/**
- * @author Olivier Lamy
- */
-public class NetworkProxyAdminTest
-    extends AbstractRepositoryAdminTest
-{
-
-    @Inject
-    private NetworkProxyAdmin networkProxyAdmin;
-
-    @Test
-    public void getAllEmpty()
-        throws Exception
-    {
-        assertNotNull( networkProxyAdmin.getNetworkProxies() );
-    }
-
-    @Test
-    public void addAndDelete()
-        throws Exception
-    {
-        mockAuditListener.clearEvents();
-        int initialSize = networkProxyAdmin.getNetworkProxies().size();
-        NetworkProxy networkProxy = getNetworkProxyTest( "foo" );
-
-        networkProxyAdmin.addNetworkProxy( networkProxy, getFakeAuditInformation() );
-
-        assertEquals( initialSize + 1, networkProxyAdmin.getNetworkProxies().size() );
-
-        networkProxy = networkProxyAdmin.getNetworkProxy( "foo" );
-
-        assertNotNull( networkProxy );
-        assertEquals( getNetworkProxyTest( "foo" ).getId(), networkProxy.getId() );
-        assertEquals( getNetworkProxyTest( "foo" ).getHost(), networkProxy.getHost() );
-        assertEquals( getNetworkProxyTest( "foo" ).getPassword(), networkProxy.getPassword() );
-        assertEquals( getNetworkProxyTest( "foo" ).getPort(), networkProxy.getPort() );
-        assertEquals( getNetworkProxyTest( "foo" ).getUsername(), networkProxy.getUsername() );
-        assertEquals( getNetworkProxyTest( "foo" ).getProtocol(), networkProxy.getProtocol() );
-
-        networkProxyAdmin.deleteNetworkProxy( "foo", getFakeAuditInformation() );
-
-        assertNull( networkProxyAdmin.getNetworkProxy( "foo" ) );
-
-        assertEquals( 2, mockAuditListener.getAuditEvents().size() );
-
-        assertEquals( AuditEvent.ADD_NETWORK_PROXY, mockAuditListener.getAuditEvents().get( 0 ).getAction() );
-        assertEquals( AuditEvent.DELETE_NETWORK_PROXY, mockAuditListener.getAuditEvents().get( 1 ).getAction() );
-
-        mockAuditListener.clearEvents();
-    }
-
-    @Test
-    public void addAndUpdateAndDelete()
-        throws Exception
-    {
-        mockAuditListener.clearEvents();
-        int initialSize = networkProxyAdmin.getNetworkProxies().size();
-        NetworkProxy networkProxy = getNetworkProxyTest( "foo" );
-
-        networkProxyAdmin.addNetworkProxy( networkProxy, getFakeAuditInformation() );
-
-        assertEquals( initialSize + 1, networkProxyAdmin.getNetworkProxies().size() );
-
-        networkProxy = networkProxyAdmin.getNetworkProxy( "foo" );
-
-        assertNotNull( networkProxy );
-        assertEquals( getNetworkProxyTest( "foo" ).getId(), networkProxy.getId() );
-        assertEquals( getNetworkProxyTest( "foo" ).getHost(), networkProxy.getHost() );
-        assertEquals( getNetworkProxyTest( "foo" ).getPassword(), networkProxy.getPassword() );
-        assertEquals( getNetworkProxyTest( "foo" ).getPort(), networkProxy.getPort() );
-        assertEquals( getNetworkProxyTest( "foo" ).getUsername(), networkProxy.getUsername() );
-        assertEquals( getNetworkProxyTest( "foo" ).getProtocol(), networkProxy.getProtocol() );
-
-        networkProxy.setHost( "https://toto.com" );
-        networkProxy.setPassword( "newpasswd" );
-        networkProxy.setPort( 9191 );
-        networkProxy.setProtocol( "http" );
-        networkProxy.setUsername( "newusername" );
-
-        networkProxyAdmin.updateNetworkProxy( networkProxy, getFakeAuditInformation() );
-
-        NetworkProxy updatedNetworkProxy = networkProxyAdmin.getNetworkProxy( "foo" );
-
-        assertNotNull( updatedNetworkProxy );
-        assertEquals( networkProxy.getId(), updatedNetworkProxy.getId() );
-        assertEquals( networkProxy.getHost(), updatedNetworkProxy.getHost() );
-        assertEquals( networkProxy.getPassword(), updatedNetworkProxy.getPassword() );
-        assertEquals( networkProxy.getPort(), updatedNetworkProxy.getPort() );
-        assertEquals( networkProxy.getUsername(), updatedNetworkProxy.getUsername() );
-        assertEquals( networkProxy.getProtocol(), updatedNetworkProxy.getProtocol() );
-
-        networkProxyAdmin.deleteNetworkProxy( "foo", getFakeAuditInformation() );
-
-        assertEquals( 3, mockAuditListener.getAuditEvents().size() );
-
-        assertEquals( AuditEvent.ADD_NETWORK_PROXY, mockAuditListener.getAuditEvents().get( 0 ).getAction() );
-        assertEquals( AuditEvent.MODIFY_NETWORK_PROXY, mockAuditListener.getAuditEvents().get( 1 ).getAction() );
-        assertEquals( AuditEvent.DELETE_NETWORK_PROXY, mockAuditListener.getAuditEvents().get( 2 ).getAction() );
-
-        mockAuditListener.clearEvents();
-    }
-
-
-    protected NetworkProxy getNetworkProxyTest( String id )
-    {
-        NetworkProxy networkProxy = new NetworkProxy();
-        networkProxy.setId( "foo" );
-        networkProxy.setHost( "http://foo.com" );
-        networkProxy.setPassword( "passwd" );
-        networkProxy.setPort( 9090 );
-        networkProxy.setUsername( "root" );
-        networkProxy.setProtocol( "https" );
-        return networkProxy;
-    }
-
-}
diff --git a/archiva-modules/archiva-base/archiva-repository-admin/src/test/java/org/apache/archiva/admin/repository/proxyconnector/ProxyConnectorAdminTest.java b/archiva-modules/archiva-base/archiva-repository-admin/src/test/java/org/apache/archiva/admin/repository/proxyconnector/ProxyConnectorAdminTest.java
deleted file mode 100644
index 8b1eaafa6..000000000
--- a/archiva-modules/archiva-base/archiva-repository-admin/src/test/java/org/apache/archiva/admin/repository/proxyconnector/ProxyConnectorAdminTest.java
+++ /dev/null
@@ -1,165 +0,0 @@
-package org.apache.archiva.admin.repository.proxyconnector;
-/*
- * 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.repository.AbstractRepositoryAdminTest;
-import org.apache.archiva.admin.repository.remote.RemoteRepository;
-import org.apache.archiva.audit.AuditEvent;
-import org.junit.Test;
-
-import java.util.Arrays;
-
-/**
- * @author Olivier Lamy
- */
-public class ProxyConnectorAdminTest
-    extends AbstractRepositoryAdminTest
-{
-
-    @Test
-    public void addAndDelete()
-        throws Exception
-    {
-        mockAuditListener.clearEvents();
-        assertEquals( "not proxyConnectors 2 " + proxyConnectorAdmin.getProxyConnectors(), 2,
-                      proxyConnectorAdmin.getProxyConnectors().size() );
-        assertFalse( proxyConnectorAdmin.getProxyConnectors().isEmpty() );
-        ProxyConnector proxyConnector = new ProxyConnector();
-        proxyConnector.setSourceRepoId( "snapshots" );
-        proxyConnector.setTargetRepoId( "central" );
-        proxyConnectorAdmin.addProxyConnector( proxyConnector, getFakeAuditInformation() );
-
-        assertFalse( proxyConnectorAdmin.getProxyConnectors().isEmpty() );
-        assertEquals( 3, proxyConnectorAdmin.getProxyConnectors().size() );
-
-        assertNotNull( proxyConnectorAdmin.getProxyConnector( "snapshots", "central" ) );
-
-        proxyConnectorAdmin.deleteProxyConnector( proxyConnector, getFakeAuditInformation() );
-
-        assertEquals( 2, proxyConnectorAdmin.getProxyConnectors().size() );
-        assertFalse( proxyConnectorAdmin.getProxyConnectors().isEmpty() );
-
-        assertEquals( 2, mockAuditListener.getAuditEvents().size() );
-
-        assertEquals( AuditEvent.ADD_PROXY_CONNECTOR, mockAuditListener.getAuditEvents().get( 0 ).getAction() );
-        assertEquals( "root", mockAuditListener.getAuditEvents().get( 0 ).getUserId() );
-        assertEquals( "archiva-localhost", mockAuditListener.getAuditEvents().get( 0 ).getRemoteIP() );
-
-        assertEquals( AuditEvent.DELETE_PROXY_CONNECTOR, mockAuditListener.getAuditEvents().get( 1 ).getAction() );
-        assertEquals( "root", mockAuditListener.getAuditEvents().get( 1 ).getUserId() );
-
-        assertNull( proxyConnectorAdmin.getProxyConnector( "snapshots", "central" ) );
-
-        mockAuditListener.clearEvents();
-    }
-
-    @Test
-    public void addAndUpdateAndDelete()
-        throws Exception
-    {
-        mockAuditListener.clearEvents();
-        RemoteRepository remoteRepository = getRemoteRepository( "test-new-one" );
-
-        remoteRepositoryAdmin.addRemoteRepository( remoteRepository, getFakeAuditInformation() );
-
-        assertEquals( "not proxyConnectors 2 " + proxyConnectorAdmin.getProxyConnectors(), 2,
-                      proxyConnectorAdmin.getProxyConnectors().size() );
-        assertFalse( proxyConnectorAdmin.getProxyConnectors().isEmpty() );
-        ProxyConnector proxyConnector = new ProxyConnector();
-        proxyConnector.setSourceRepoId( "snapshots" );
-        proxyConnector.setTargetRepoId( "central" );
-        proxyConnector.setWhiteListPatterns( Arrays.asList( "foo", "bar" ) );
-        proxyConnectorAdmin.addProxyConnector( proxyConnector, getFakeAuditInformation() );
-
-        assertFalse( proxyConnectorAdmin.getProxyConnectors().isEmpty() );
-        assertEquals( 3, proxyConnectorAdmin.getProxyConnectors().size() );
-
-        assertNotNull( proxyConnectorAdmin.getProxyConnector( "snapshots", "central" ) );
-        assertEquals( Arrays.asList( "foo", "bar" ),
-                      proxyConnectorAdmin.getProxyConnector( "snapshots", "central" ).getWhiteListPatterns() );
-
-        proxyConnectorAdmin.deleteProxyConnector( proxyConnector, getFakeAuditInformation() );
-
-        proxyConnector.setTargetRepoId( remoteRepository.getId() );
-        proxyConnectorAdmin.addProxyConnector( proxyConnector, getFakeAuditInformation() );
-
-        assertNull( proxyConnectorAdmin.getProxyConnector( "snapshots", "central" ) );
-        assertNotNull( remoteRepository.getId(),
-                       proxyConnectorAdmin.getProxyConnector( "snapshots", remoteRepository.getId() ) );
-
-        proxyConnectorAdmin.deleteProxyConnector( proxyConnector, getFakeAuditInformation() );
-
-        assertNull( proxyConnectorAdmin.getProxyConnector( "snapshots", "central" ) );
-
-        assertEquals( 2, proxyConnectorAdmin.getProxyConnectors().size() );
-        assertFalse( proxyConnectorAdmin.getProxyConnectors().isEmpty() );
-
-        assertEquals( 5, mockAuditListener.getAuditEvents().size() );
-
-        assertEquals( AuditEvent.ADD_REMOTE_REPO, mockAuditListener.getAuditEvents().get( 0 ).getAction() );
-
-        assertEquals( AuditEvent.ADD_PROXY_CONNECTOR, mockAuditListener.getAuditEvents().get( 1 ).getAction() );
-        assertEquals( "root", mockAuditListener.getAuditEvents().get( 2 ).getUserId() );
-        assertEquals( "archiva-localhost", mockAuditListener.getAuditEvents().get( 2 ).getRemoteIP() );
-
-        assertEquals( AuditEvent.DELETE_PROXY_CONNECTOR, mockAuditListener.getAuditEvents().get( 2 ).getAction() );
-
-        assertEquals( AuditEvent.ADD_PROXY_CONNECTOR, mockAuditListener.getAuditEvents().get( 3 ).getAction() );
-
-        assertEquals( AuditEvent.DELETE_PROXY_CONNECTOR, mockAuditListener.getAuditEvents().get( 4 ).getAction() );
-        assertEquals( "root", mockAuditListener.getAuditEvents().get( 4 ).getUserId() );
-
-        remoteRepositoryAdmin.deleteRemoteRepository( remoteRepository.getId(), getFakeAuditInformation() );
-        mockAuditListener.clearEvents();
-    }
-
-    @Test
-    public void findProxyConnector()
-        throws Exception
-    {
-        ProxyConnector proxyConnector = proxyConnectorAdmin.getProxyConnector( "internal", "central" );
-        assertNotNull( proxyConnector );
-    }
-
-    @Test
-    public void updateProxyConnector()
-        throws Exception
-    {
-        mockAuditListener.clearEvents();
-        ProxyConnector proxyConnector = proxyConnectorAdmin.getProxyConnector( "internal", "central" );
-        assertNotNull( proxyConnector );
-        proxyConnector.setDisabled( false );
-        proxyConnectorAdmin.updateProxyConnector( proxyConnector, getFakeAuditInformation() );
-        proxyConnector = proxyConnectorAdmin.getProxyConnector( "internal", "central" );
-        assertFalse( proxyConnector.isDisabled() );
-
-        proxyConnector.setDisabled( true );
-        proxyConnectorAdmin.updateProxyConnector( proxyConnector, getFakeAuditInformation() );
-        proxyConnector = proxyConnectorAdmin.getProxyConnector( "internal", "central" );
-        assertTrue( proxyConnector.isDisabled() );
-
-        proxyConnector.setOrder( 4 );
-        proxyConnectorAdmin.updateProxyConnector( proxyConnector, getFakeAuditInformation() );
-        proxyConnector = proxyConnectorAdmin.getProxyConnector( "internal", "central" );
-        assertEquals( 4, proxyConnector.getOrder() );
-        mockAuditListener.clearEvents();
-
-    }
-
-}
diff --git a/archiva-modules/archiva-base/archiva-repository-admin/src/test/java/org/apache/archiva/admin/repository/remote/RemoteRepositoryAdminTest.java b/archiva-modules/archiva-base/archiva-repository-admin/src/test/java/org/apache/archiva/admin/repository/remote/RemoteRepositoryAdminTest.java
deleted file mode 100644
index 85f8ef723..000000000
--- a/archiva-modules/archiva-base/archiva-repository-admin/src/test/java/org/apache/archiva/admin/repository/remote/RemoteRepositoryAdminTest.java
+++ /dev/null
@@ -1,153 +0,0 @@
-package org.apache.archiva.admin.repository.remote;
-/*
- * 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.repository.AbstractRepositoryAdminTest;
-import org.apache.archiva.audit.AuditEvent;
-import org.junit.Test;
-
-import java.util.List;
-
-/**
- * @author Olivier Lamy
- */
-public class RemoteRepositoryAdminTest
-    extends AbstractRepositoryAdminTest
-{
-
-    @Test
-    public void getAll()
-        throws Exception
-    {
-        List remoteRepositories = remoteRepositoryAdmin.getRemoteRepositories();
-        assertNotNull( remoteRepositories );
-        assertTrue( remoteRepositories.size() > 0 );
-        log.info( "remote " + remoteRepositories );
-    }
-
-    @Test
-    public void getById()
-        throws Exception
-    {
-        RemoteRepository central = remoteRepositoryAdmin.getRemoteRepository( "central" );
-        assertNotNull( central );
-        assertEquals( "http://repo1.maven.org/maven2", central.getUrl() );
-        assertEquals( 60, central.getTimeout() );
-        assertNull( central.getUserName() );
-        assertNull( central.getPassword() );
-    }
-
-    @Test
-    public void addAndDelete()
-        throws Exception
-    {
-        mockAuditListener.clearEvents();
-        int initialSize = remoteRepositoryAdmin.getRemoteRepositories().size();
-
-        RemoteRepository remoteRepository = getRemoteRepository();
-
-        remoteRepositoryAdmin.addRemoteRepository( remoteRepository, getFakeAuditInformation() );
-
-        assertEquals( initialSize + 1, remoteRepositoryAdmin.getRemoteRepositories().size() );
-
-        RemoteRepository repo = remoteRepositoryAdmin.getRemoteRepository( "foo" );
-        assertNotNull( repo );
-        assertEquals( getRemoteRepository().getPassword(), repo.getPassword() );
-        assertEquals( getRemoteRepository().getUrl(), repo.getUrl() );
-        assertEquals( getRemoteRepository().getUserName(), repo.getUserName() );
-        assertEquals( getRemoteRepository().getName(), repo.getName() );
-        assertEquals( getRemoteRepository().getTimeout(), repo.getTimeout() );
-
-        remoteRepositoryAdmin.deleteRemoteRepository( "foo", getFakeAuditInformation() );
-
-        assertEquals( initialSize, remoteRepositoryAdmin.getRemoteRepositories().size() );
-
-        repo = remoteRepositoryAdmin.getRemoteRepository( "foo" );
-        assertNull( repo );
-
-        assertEquals( 2, mockAuditListener.getAuditEvents().size() );
-
-        assertEquals( AuditEvent.ADD_REMOTE_REPO, mockAuditListener.getAuditEvents().get( 0 ).getAction() );
-        assertEquals( "root", mockAuditListener.getAuditEvents().get( 0 ).getUserId() );
-        assertEquals( "archiva-localhost", mockAuditListener.getAuditEvents().get( 0 ).getRemoteIP() );
-
-        assertEquals( AuditEvent.DELETE_REMOTE_REPO, mockAuditListener.getAuditEvents().get( 1 ).getAction() );
-        assertEquals( "root", mockAuditListener.getAuditEvents().get( 1 ).getUserId() );
-
-    }
-
-
-    @Test
-    public void addAndUpdateAndDelete()
-        throws Exception
-    {
-        mockAuditListener.clearEvents();
-        int initialSize = remoteRepositoryAdmin.getRemoteRepositories().size();
-
-        RemoteRepository remoteRepository = getRemoteRepository();
-
-        remoteRepositoryAdmin.addRemoteRepository( remoteRepository, getFakeAuditInformation() );
-
-        assertEquals( initialSize + 1, remoteRepositoryAdmin.getRemoteRepositories().size() );
-
-        RemoteRepository repo = remoteRepositoryAdmin.getRemoteRepository( "foo" );
-        assertNotNull( repo );
-        assertEquals( getRemoteRepository().getPassword(), repo.getPassword() );
-        assertEquals( getRemoteRepository().getUrl(), repo.getUrl() );
-        assertEquals( getRemoteRepository().getUserName(), repo.getUserName() );
-        assertEquals( getRemoteRepository().getName(), repo.getName() );
-        assertEquals( getRemoteRepository().getTimeout(), repo.getTimeout() );
-
-        repo.setUserName( "foo-name-changed" );
-        repo.setPassword( "titi" );
-        repo.setUrl( "http://foo.com/maven-really-rocks" );
-
-        remoteRepositoryAdmin.updateRemoteRepository( repo, getFakeAuditInformation() );
-
-        repo = remoteRepositoryAdmin.getRemoteRepository( "foo" );
-
-        assertEquals( "foo-name-changed", repo.getUserName() );
-        assertEquals( "titi", repo.getPassword() );
-        assertEquals( "http://foo.com/maven-really-rocks", repo.getUrl() );
-
-        remoteRepositoryAdmin.deleteRemoteRepository( "foo", getFakeAuditInformation() );
-
-        assertEquals( initialSize, remoteRepositoryAdmin.getRemoteRepositories().size() );
-
-        repo = remoteRepositoryAdmin.getRemoteRepository( "foo" );
-        assertNull( repo );
-
-        assertEquals( 3, mockAuditListener.getAuditEvents().size() );
-
-        assertEquals( AuditEvent.ADD_REMOTE_REPO, mockAuditListener.getAuditEvents().get( 0 ).getAction() );
-        assertEquals( "root", mockAuditListener.getAuditEvents().get( 0 ).getUserId() );
-        assertEquals( "archiva-localhost", mockAuditListener.getAuditEvents().get( 0 ).getRemoteIP() );
-
-        assertEquals( AuditEvent.MODIFY_REMOTE_REPO, mockAuditListener.getAuditEvents().get( 1 ).getAction() );
-        assertEquals( "root", mockAuditListener.getAuditEvents().get( 1 ).getUserId() );
-        assertEquals( "archiva-localhost", mockAuditListener.getAuditEvents().get( 1 ).getRemoteIP() );
-
-        assertEquals( AuditEvent.DELETE_REMOTE_REPO, mockAuditListener.getAuditEvents().get( 2 ).getAction() );
-        assertEquals( "root", mockAuditListener.getAuditEvents().get( 2 ).getUserId() );
-
-    }
-
-
-
-}
diff --git a/archiva-modules/archiva-base/archiva-repository-admin/src/test/resources/META-INF/redback/redback-core.xml b/archiva-modules/archiva-base/archiva-repository-admin/src/test/resources/META-INF/redback/redback-core.xml
deleted file mode 100644
index ecc1de8fb..000000000
--- a/archiva-modules/archiva-base/archiva-repository-admin/src/test/resources/META-INF/redback/redback-core.xml
+++ /dev/null
@@ -1,213 +0,0 @@
-
-    1.0.0
-    
-        
-          System
-          Roles that apply system-wide, across all of the applications
-        1.0.0
-        
-            
-                global
-                *
-                true
-                global resource implies full access for authorization
-            
-            
-                username
-                ${username}
-                true
-                replaced with the username of the principal at authorization check time
-            
-        
-        
-            
-                configuration-edit
-                configuration-edit
-                edit configuration
-                true
-            
-            
-                user-management-user-create
-                user-management-user-create
-                create user
-                true
-            
-            
-                user-management-user-edit
-                user-management-user-edit
-                edit user
-                true
-            
-            
-                user-management-user-role
-                user-management-user-role
-                user roles
-                true
-            
-            
-                user-management-user-delete
-                user-management-user-delete
-                delete user
-                true
-            
-            
-                user-management-user-list
-                user-management-user-list
-                list users
-                true
-            
-            
-                user-management-role-grant
-                user-management-role-grant
-                grant role
-                true
-            
-            
-                user-management-role-drop
-                user-management-role-drop
-                drop role
-                true
-            
-            
-                user-management-rbac-admin
-                user-management-rbac-admin
-                administer rbac
-                true
-            
-            
-                guest-access
-                guest-access
-                access guest
-                true
-            
-            
-                user-management-manage-data
-                user-management-manage-data
-                manage data
-                true
-                        
-        
-        
-            
-                system-administrator
-                System Administrator
-                true
-                true
-                
-                    
-                        edit-redback-configuration
-                        Edit Redback Configuration
-                        configuration-edit
-                        global
-                        true
-                    
-                    
-                        manage-rbac-setup
-                        User RBAC Management
-                        user-management-rbac-admin
-                        global
-                        true
-                    
-                    
-                        manage-rbac-data
-                        RBAC Manage Data
-                        user-management-manage-data
-                        global
-                        true
-                                        
-                
-                
-                    user-administrator
-                
-            
-            
-                user-administrator
-                User Administrator
-                true
-                true
-                
-                    
-                        drop-roles-for-anyone
-                        Drop Roles for Anyone
-                        user-management-role-drop
-                        global
-                        true
-                    
-                    
-                        grant-roles-for-anyone
-                        Grant Roles for Anyone
-                        user-management-role-grant
-                        global
-                        true
-                    
-                    
-                        user-create
-                        Create Users
-                        user-management-user-create
-                        global
-                        true
-                    
-                    
-                        user-delete
-                        Delete Users
-                        user-management-user-delete
-                        global
-                        true
-                    
-                    
-                        user-edit
-                        Edit Users
-                        user-management-user-edit
-                        global
-                        true
-                    
-                    
-                        access-users-roles
-                        Access Users Roles
-                        user-management-user-role
-                        global
-                        true
-                    
-                    
-                        access-user-list
-                        Access User List
-                        user-management-user-list
-                        global
-                        true
-                    
-                
-            
-            
-                registered-user
-                Registered User
-                true
-                true
-                
-                    
-                        edit-user-by-username
-                        Edit User Data by Username
-                        user-management-user-edit
-                        username
-                        true
-                    
-                
-            
-            
-                guest
-                Guest
-                true
-                true
-                
-                    
-                        guest-permission
-                        Guest Permission
-                        guest-access
-                        global
-                        true
-                    
-                
-            
-        
-        
-    
-
\ No newline at end of file
diff --git a/archiva-modules/archiva-base/archiva-repository-admin/src/test/resources/log4j.xml b/archiva-modules/archiva-base/archiva-repository-admin/src/test/resources/log4j.xml
deleted file mode 100644
index 9b1a6585b..000000000
--- a/archiva-modules/archiva-base/archiva-repository-admin/src/test/resources/log4j.xml
+++ /dev/null
@@ -1,49 +0,0 @@
-
-
-
-
-
-
-
-  
-    
-      
-    
-  
-
-
-
-  
-    
-  
-  
-    
-  
-
-  
-    
-  
-
-  
-    
-    
-  
-
-
diff --git a/archiva-modules/archiva-base/archiva-repository-admin/src/test/resources/spring-context.xml b/archiva-modules/archiva-base/archiva-repository-admin/src/test/resources/spring-context.xml
deleted file mode 100644
index a18703d6d..000000000
--- a/archiva-modules/archiva-base/archiva-repository-admin/src/test/resources/spring-context.xml
+++ /dev/null
@@ -1,59 +0,0 @@
-
-
-
-
-
-  
-  
-
-  
-    
-      
-        scheduler1
-        org.quartz.simpl.SimpleThreadPool
-        2
-        4
-        org.quartz.simpl.RAMJobStore
-      
-    
-  
-
-  
-    
-      
-        
-          
-          
-        
-        ]]>
-      
-    
-  
-
-
\ No newline at end of file
diff --git a/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/ManagedRepositoryContent.java b/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/ManagedRepositoryContent.java
index de2da68ca..c8c01410e 100644
--- a/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/ManagedRepositoryContent.java
+++ b/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/ManagedRepositoryContent.java
@@ -19,7 +19,7 @@ package org.apache.maven.archiva.repository;
  * under the License.
  */
 
-import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration;
+import org.apache.archiva.admin.model.managed.ManagedRepository;
 import org.apache.maven.archiva.model.ArchivaArtifact;
 import org.apache.maven.archiva.model.ArtifactReference;
 import org.apache.maven.archiva.model.ProjectReference;
@@ -30,7 +30,7 @@ import java.io.File;
 import java.util.Set;
 
 /**
- * ManagedRepositoryContent interface for interacting with a managed repository in an abstract way, 
+ * ManagedRepositoryContent interface for interacting with a managed repository in an abstract way,
  * without the need for processing based on filesystem paths, or working with the database.
  *
  * @version $Id$
@@ -40,9 +40,9 @@ public interface ManagedRepositoryContent
     /**
      * Delete from the managed repository all files / directories associated with the
      * provided version reference.
-     * 
+     *
      * @param reference the version reference to delete.
-     * @throws ContentNotFoundException 
+     * @throws ContentNotFoundException
      */
     void deleteVersion( VersionedReference reference )
         throws ContentNotFoundException;
@@ -51,11 +51,11 @@ public interface ManagedRepositoryContent
      * 

* Convenience method to get the repository id. *

- * + *

*

* Equivalent to calling .getRepository().getId() *

- * + * * @return the repository id. */ String getId(); @@ -63,18 +63,18 @@ public interface ManagedRepositoryContent /** *

* Gather up the list of related artifacts to the ArtifactReference provided. - * This typically inclues the pom files, and those things with + * This typically inclues the pom files, and those things with * classifiers (such as doc, source code, test libs, etc...) *

- * + *

*

* NOTE: Some layouts (such as maven 1 "legacy") are not compatible with this query. - *

- * + *

+ * * @param reference the reference to work off of. * @return the set of ArtifactReferences for related artifacts. * @throws ContentNotFoundException if the initial artifact reference does not exist within the repository. - * @throws LayoutException + * @throws LayoutException */ Set getRelatedArtifacts( ArtifactReference reference ) throws ContentNotFoundException; @@ -83,11 +83,11 @@ public interface ManagedRepositoryContent *

* Convenience method to get the repository (on disk) root directory. *

- * + *

*

* Equivalent to calling .getRepository().getLocation() *

- * + * * @return the repository (on disk) root directory. */ String getRepoRoot(); @@ -95,19 +95,19 @@ public interface ManagedRepositoryContent /** * Get the repository configuration associated with this * repository content. - * + * * @return the repository that is associated with this repository content. */ - ManagedRepositoryConfiguration getRepository(); + ManagedRepository getRepository(); /** * Given a specific {@link ProjectReference}, return the list of available versions for * that project reference. - * + * * @param reference the project reference to work off of. * @return the list of versions found for that project reference. * @throws ContentNotFoundException if the project reference does nto exist within the repository. - * @throws LayoutException + * @throws LayoutException */ Set getVersions( ProjectReference reference ) throws ContentNotFoundException, LayoutException; @@ -117,50 +117,50 @@ public interface ManagedRepositoryContent * Given a specific {@link VersionedReference}, return the list of available versions for that * versioned reference. *

- * + *

*

* NOTE: This is really only useful when working with SNAPSHOTs. *

- * + * * @param reference the versioned reference to work off of. * @return the set of versions found. * @throws ContentNotFoundException if the versioned reference does not exist within the repository. - * @throws LayoutException + * @throws LayoutException */ - public Set getVersions( VersionedReference reference ) + Set getVersions( VersionedReference reference ) throws ContentNotFoundException; /** * Determines if the artifact referenced exists in the repository. - * + * * @param reference the artifact reference to check for. * @return true if the artifact referenced exists. */ - public boolean hasContent( ArtifactReference reference ); + boolean hasContent( ArtifactReference reference ); /** * Determines if the project referenced exists in the repository. - * + * * @param reference the project reference to check for. * @return true it the project referenced exists. */ - public boolean hasContent( ProjectReference reference ); + boolean hasContent( ProjectReference reference ); /** * Determines if the version reference exists in the repository. - * + * * @param reference the version reference to check for. * @return true if the version referenced exists. */ - public boolean hasContent( VersionedReference reference ); + boolean hasContent( VersionedReference reference ); /** * Set the repository configuration to associate with this * repository content. - * + * * @param repo the repository to associate with this repository content. */ - public void setRepository( ManagedRepositoryConfiguration repo ); + void setRepository( ManagedRepository repo ); /** * Given a repository relative path to a filename, return the {@link VersionedReference} object suitable for the path. @@ -170,7 +170,7 @@ public interface ManagedRepositoryContent * a {@link ArtifactReference}) * @throws LayoutException if there was a problem converting the path to an artifact. */ - public ArtifactReference toArtifactReference( String path ) + ArtifactReference toArtifactReference( String path ) throws LayoutException; /** @@ -179,33 +179,33 @@ public interface ManagedRepositoryContent * @param reference the artifact reference to use. * @return the relative path to the artifact. */ - public File toFile( ArtifactReference reference ); - + File toFile( ArtifactReference reference ); + /** * Given an {@link ArchivaArtifact}, return the file reference to the artifact. * * @param reference the archiva artifact to use. * @return the relative path to the artifact. */ - public File toFile( ArchivaArtifact reference ); + File toFile( ArchivaArtifact reference ); /** * Given a {@link ProjectReference}, return the path to the metadata for - * the project. - * + * the project. + * * @param reference the reference to use. * @return the path to the metadata file, or null if no metadata is appropriate. */ - public String toMetadataPath( ProjectReference reference ); + String toMetadataPath( ProjectReference reference ); /** * Given a {@link VersionedReference}, return the path to the metadata for - * the specific version of the project. - * + * the specific version of the project. + * * @param reference the reference to use. * @return the path to the metadata file, or null if no metadata is appropriate. */ - public String toMetadataPath( VersionedReference reference ); + String toMetadataPath( VersionedReference reference ); /** * Given an {@link ArtifactReference}, return the relative path to the artifact. @@ -213,13 +213,13 @@ public interface ManagedRepositoryContent * @param reference the artifact reference to use. * @return the relative path to the artifact. */ - public String toPath( ArtifactReference reference ); - + String toPath( ArtifactReference reference ); + /** * Given an {@link ArchivaArtifact}, return the relative path to the artifact. * * @param reference the archiva artifact to use. * @return the relative path to the artifact. */ - public String toPath( ArchivaArtifact reference ); + String toPath( ArchivaArtifact reference ); } diff --git a/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/RemoteRepositoryContent.java b/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/RemoteRepositoryContent.java index 0da4dd846..68d731819 100644 --- a/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/RemoteRepositoryContent.java +++ b/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/RemoteRepositoryContent.java @@ -19,6 +19,7 @@ package org.apache.maven.archiva.repository; * under the License. */ +import org.apache.archiva.admin.model.remote.RemoteRepository; import org.apache.maven.archiva.configuration.RemoteRepositoryConfiguration; import org.apache.maven.archiva.model.ArtifactReference; import org.apache.maven.archiva.model.RepositoryURL; @@ -51,7 +52,7 @@ public interface RemoteRepositoryContent * * @return the repository that is associated with this repository content. */ - RemoteRepositoryConfiguration getRepository(); + RemoteRepository getRepository(); /** *

@@ -72,7 +73,7 @@ public interface RemoteRepositoryContent * * @param repo the repository to associate with this repository content. */ - void setRepository( RemoteRepositoryConfiguration repo ); + void setRepository( RemoteRepository repo ); /** * Given a repository relative path to a filename, return the {@link VersionedReference} object suitable for the path. diff --git a/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/RepositoryContentFactory.java b/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/RepositoryContentFactory.java index af79060b6..dfbb7b23c 100644 --- a/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/RepositoryContentFactory.java +++ b/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/RepositoryContentFactory.java @@ -19,10 +19,13 @@ package org.apache.maven.archiva.repository; * under the License. */ +import org.apache.archiva.admin.model.RepositoryAdminException; +import org.apache.archiva.admin.model.managed.ManagedRepository; +import org.apache.archiva.admin.model.managed.ManagedRepositoryAdmin; +import org.apache.archiva.admin.model.remote.RemoteRepository; +import org.apache.archiva.admin.model.remote.RemoteRepositoryAdmin; import org.apache.maven.archiva.configuration.ArchivaConfiguration; import org.apache.maven.archiva.configuration.ConfigurationNames; -import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration; -import org.apache.maven.archiva.configuration.RemoteRepositoryConfiguration; import org.codehaus.plexus.registry.Registry; import org.codehaus.plexus.registry.RegistryListener; import org.springframework.context.ApplicationContext; @@ -48,6 +51,12 @@ public class RepositoryContentFactory @Inject private ArchivaConfiguration archivaConfiguration; + @Inject + private ManagedRepositoryAdmin managedRepositoryAdmin; + + @Inject + private RemoteRepositoryAdmin remoteRepositoryAdmin; + @Inject private ApplicationContext applicationContext; @@ -73,51 +82,65 @@ public class RepositoryContentFactory public ManagedRepositoryContent getManagedRepositoryContent( String repoId ) throws RepositoryNotFoundException, RepositoryException { - ManagedRepositoryContent repo = managedContentMap.get( repoId ); - - if ( repo != null ) + try { + ManagedRepositoryContent repo = managedContentMap.get( repoId ); + + if ( repo != null ) + { + return repo; + } + + ManagedRepository repoConfig = managedRepositoryAdmin.getManagedRepository( repoId ); + if ( repoConfig == null ) + { + throw new RepositoryNotFoundException( + "Unable to find managed repository configuration for id:" + repoId ); + } + + repo = applicationContext.getBean( "managedRepositoryContent#" + repoConfig.getLayout(), + ManagedRepositoryContent.class ); + repo.setRepository( repoConfig ); + managedContentMap.put( repoId, repo ); + return repo; } - - ManagedRepositoryConfiguration repoConfig = - archivaConfiguration.getConfiguration().findManagedRepositoryById( repoId ); - if ( repoConfig == null ) + catch ( RepositoryAdminException e ) { - throw new RepositoryNotFoundException( "Unable to find managed repository configuration for id:" + repoId ); + throw new RepositoryException( e.getMessage(), e ); } - - repo = applicationContext.getBean( "managedRepositoryContent#" + repoConfig.getLayout(), - ManagedRepositoryContent.class ); - repo.setRepository( repoConfig ); - managedContentMap.put( repoId, repo ); - - return repo; } public RemoteRepositoryContent getRemoteRepositoryContent( String repoId ) throws RepositoryNotFoundException, RepositoryException { - RemoteRepositoryContent repo = remoteContentMap.get( repoId ); - - if ( repo != null ) + try { + RemoteRepositoryContent repo = remoteContentMap.get( repoId ); + + if ( repo != null ) + { + return repo; + } + + RemoteRepository repoConfig = remoteRepositoryAdmin.getRemoteRepository( repoId ); + if ( repoConfig == null ) + { + throw new RepositoryNotFoundException( + "Unable to find remote repository configuration for id:" + repoId ); + } + + repo = applicationContext.getBean( "remoteRepositoryContent#" + repoConfig.getLayout(), + RemoteRepositoryContent.class ); + repo.setRepository( repoConfig ); + remoteContentMap.put( repoId, repo ); + return repo; } - - RemoteRepositoryConfiguration repoConfig = - archivaConfiguration.getConfiguration().findRemoteRepositoryById( repoId ); - if ( repoConfig == null ) + catch ( RepositoryAdminException e ) { - throw new RepositoryNotFoundException( "Unable to find remote repository configuration for id:" + repoId ); + throw new RepositoryException( e.getMessage(), e ); } - - repo = applicationContext.getBean( "remoteRepositoryContent#" + repoConfig.getLayout(), - RemoteRepositoryContent.class ); - repo.setRepository( repoConfig ); - remoteContentMap.put( repoId, repo ); - - return repo; } diff --git a/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/ManagedDefaultRepositoryContent.java b/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/ManagedDefaultRepositoryContent.java index df0005be6..2634d0e21 100644 --- a/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/ManagedDefaultRepositoryContent.java +++ b/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/ManagedDefaultRepositoryContent.java @@ -19,6 +19,7 @@ package org.apache.maven.archiva.repository.content; * under the License. */ +import org.apache.archiva.admin.model.managed.ManagedRepository; import org.apache.archiva.metadata.repository.storage.maven2.DefaultArtifactMappingProvider; import org.apache.commons.io.FileUtils; import org.apache.maven.archiva.common.utils.PathUtil; @@ -57,7 +58,7 @@ public class ManagedDefaultRepositoryContent @Named(value = "fileTypes" ) private FileTypes filetypes; - private ManagedRepositoryConfiguration repository; + private ManagedRepository repository; public ManagedDefaultRepositoryContent() { @@ -148,7 +149,7 @@ public class ManagedDefaultRepositoryContent return repository.getLocation(); } - public ManagedRepositoryConfiguration getRepository() + public ManagedRepository getRepository() { return repository; } @@ -316,7 +317,7 @@ public class ManagedDefaultRepositoryContent } } - public void setRepository( ManagedRepositoryConfiguration repository ) + public void setRepository( ManagedRepository repository ) { this.repository = repository; } diff --git a/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/ManagedLegacyRepositoryContent.java b/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/ManagedLegacyRepositoryContent.java index 45b5d77aa..c4aefc146 100644 --- a/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/ManagedLegacyRepositoryContent.java +++ b/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/ManagedLegacyRepositoryContent.java @@ -19,6 +19,7 @@ package org.apache.maven.archiva.repository.content; * under the License. */ +import org.apache.archiva.admin.model.managed.ManagedRepository; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.lang.StringUtils; import org.apache.maven.archiva.common.utils.PathUtil; @@ -58,7 +59,7 @@ public class ManagedLegacyRepositoryContent @Inject private FileTypes filetypes; - private ManagedRepositoryConfiguration repository; + private ManagedRepository repository; public void deleteVersion( VersionedReference reference ) throws ContentNotFoundException @@ -198,7 +199,7 @@ public class ManagedLegacyRepositoryContent return repository.getLocation(); } - public ManagedRepositoryConfiguration getRepository() + public ManagedRepository getRepository() { return repository; } @@ -315,7 +316,7 @@ public class ManagedLegacyRepositoryContent } } - public void setRepository( ManagedRepositoryConfiguration repository ) + public void setRepository( ManagedRepository repository ) { this.repository = repository; } diff --git a/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/RemoteDefaultRepositoryContent.java b/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/RemoteDefaultRepositoryContent.java index 886b0415a..f0644325c 100644 --- a/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/RemoteDefaultRepositoryContent.java +++ b/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/RemoteDefaultRepositoryContent.java @@ -19,6 +19,7 @@ package org.apache.maven.archiva.repository.content; * under the License. */ +import org.apache.archiva.admin.model.remote.RemoteRepository; import org.apache.maven.archiva.configuration.RemoteRepositoryConfiguration; import org.apache.maven.archiva.model.ArtifactReference; import org.apache.maven.archiva.model.RepositoryURL; @@ -38,14 +39,14 @@ public class RemoteDefaultRepositoryContent extends AbstractDefaultRepositoryContent implements RemoteRepositoryContent { - private RemoteRepositoryConfiguration repository; + private RemoteRepository repository; public String getId() { return repository.getId(); } - public RemoteRepositoryConfiguration getRepository() + public RemoteRepository getRepository() { return repository; } @@ -55,7 +56,7 @@ public class RemoteDefaultRepositoryContent return new RepositoryURL( repository.getUrl() ); } - public void setRepository( RemoteRepositoryConfiguration repository ) + public void setRepository( RemoteRepository repository ) { this.repository = repository; } diff --git a/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/RemoteLegacyRepositoryContent.java b/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/RemoteLegacyRepositoryContent.java index f6d946885..f9d80992a 100644 --- a/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/RemoteLegacyRepositoryContent.java +++ b/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/RemoteLegacyRepositoryContent.java @@ -19,6 +19,7 @@ package org.apache.maven.archiva.repository.content; * under the License. */ +import org.apache.archiva.admin.model.remote.RemoteRepository; import org.apache.maven.archiva.configuration.RemoteRepositoryConfiguration; import org.apache.maven.archiva.model.ArtifactReference; import org.apache.maven.archiva.model.RepositoryURL; @@ -39,14 +40,14 @@ public class RemoteLegacyRepositoryContent extends AbstractLegacyRepositoryContent implements RemoteRepositoryContent { - private RemoteRepositoryConfiguration repository; + private RemoteRepository repository; public String getId() { return repository.getId(); } - public RemoteRepositoryConfiguration getRepository() + public RemoteRepository getRepository() { return repository; } @@ -56,7 +57,7 @@ public class RemoteLegacyRepositoryContent return new RepositoryURL( repository.getUrl() ); } - public void setRepository( RemoteRepositoryConfiguration repository ) + public void setRepository( RemoteRepository repository ) { this.repository = repository; } diff --git a/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/AbstractRepositoryLayerTestCase.java b/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/AbstractRepositoryLayerTestCase.java index faa427564..f72078c34 100644 --- a/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/AbstractRepositoryLayerTestCase.java +++ b/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/AbstractRepositoryLayerTestCase.java @@ -19,6 +19,8 @@ package org.apache.maven.archiva.repository; * under the License. */ +import org.apache.archiva.admin.model.managed.ManagedRepository; +import org.apache.archiva.admin.model.remote.RemoteRepository; import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration; import org.apache.maven.archiva.configuration.RemoteRepositoryConfiguration; import org.junit.Rule; @@ -46,18 +48,18 @@ public abstract class AbstractRepositoryLayerTestCase @Inject protected ApplicationContext applicationContext; - protected ManagedRepositoryConfiguration createRepository( String id, String name, File location ) + protected ManagedRepository createRepository( String id, String name, File location ) { - ManagedRepositoryConfiguration repo = new ManagedRepositoryConfiguration(); + ManagedRepository repo = new ManagedRepository(); repo.setId( id ); repo.setName( name ); repo.setLocation( location.getAbsolutePath() ); return repo; } - protected RemoteRepositoryConfiguration createRemoteRepository( String id, String name, String url ) + protected RemoteRepository createRemoteRepository( String id, String name, String url ) { - RemoteRepositoryConfiguration repo = new RemoteRepositoryConfiguration(); + RemoteRepository repo = new RemoteRepository(); repo.setId( id ); repo.setName( name ); repo.setUrl( url ); @@ -68,7 +70,7 @@ public abstract class AbstractRepositoryLayerTestCase String layout ) throws Exception { - ManagedRepositoryConfiguration repo = new ManagedRepositoryConfiguration(); + ManagedRepository repo = new ManagedRepository(); repo.setId( id ); repo.setName( name ); repo.setLocation( location.getAbsolutePath() ); @@ -84,7 +86,7 @@ public abstract class AbstractRepositoryLayerTestCase protected RemoteRepositoryContent createRemoteRepositoryContent( String id, String name, String url, String layout ) throws Exception { - RemoteRepositoryConfiguration repo = new RemoteRepositoryConfiguration(); + RemoteRepository repo = new RemoteRepository(); repo.setId( id ); repo.setName( name ); repo.setUrl( url ); diff --git a/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/ManagedDefaultRepositoryContentTest.java b/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/ManagedDefaultRepositoryContentTest.java index 0198271e9..89232d9d5 100644 --- a/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/ManagedDefaultRepositoryContentTest.java +++ b/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/ManagedDefaultRepositoryContentTest.java @@ -19,6 +19,7 @@ package org.apache.maven.archiva.repository.content; * under the License. */ +import org.apache.archiva.admin.model.managed.ManagedRepository; import org.apache.maven.archiva.common.utils.VersionComparator; import org.apache.maven.archiva.configuration.ArchivaConfiguration; import org.apache.maven.archiva.configuration.FileType; @@ -67,7 +68,7 @@ public class ManagedDefaultRepositoryContentTest { File repoDir = new File( "src/test/repositories/default-repository" ); - ManagedRepositoryConfiguration repository = createRepository( "testRepo", "Unit Test Repo", repoDir ); + ManagedRepository repository = createRepository( "testRepo", "Unit Test Repo", repoDir ); FileType fileType = diff --git a/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/ManagedLegacyRepositoryContentTest.java b/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/ManagedLegacyRepositoryContentTest.java index 833902f62..f5a1d19ff 100644 --- a/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/ManagedLegacyRepositoryContentTest.java +++ b/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/ManagedLegacyRepositoryContentTest.java @@ -19,6 +19,7 @@ package org.apache.maven.archiva.repository.content; * under the License. */ +import org.apache.archiva.admin.model.managed.ManagedRepository; import org.apache.maven.archiva.common.utils.VersionComparator; import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration; import org.apache.maven.archiva.model.ArtifactReference; @@ -57,7 +58,7 @@ public class ManagedLegacyRepositoryContentTest { File repoDir = new File( "src/test/repositories/legacy-repository" ); - ManagedRepositoryConfiguration repository = createRepository( "testRepo", "Unit Test Repo", repoDir ); + ManagedRepository repository = createRepository( "testRepo", "Unit Test Repo", repoDir ); repository.setLayout( "legacy" ); //repoContent = (ManagedRepositoryContent) lookup( ManagedRepositoryContent.class, "legacy" ); diff --git a/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/RemoteDefaultRepositoryContentTest.java b/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/RemoteDefaultRepositoryContentTest.java index 938dd5c5c..65b63129c 100644 --- a/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/RemoteDefaultRepositoryContentTest.java +++ b/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/RemoteDefaultRepositoryContentTest.java @@ -19,6 +19,7 @@ package org.apache.maven.archiva.repository.content; * under the License. */ +import org.apache.archiva.admin.model.remote.RemoteRepository; import org.apache.maven.archiva.configuration.RemoteRepositoryConfiguration; import org.apache.maven.archiva.model.ArtifactReference; import org.apache.maven.archiva.repository.RemoteRepositoryContent; @@ -43,7 +44,7 @@ public class RemoteDefaultRepositoryContentTest public void setUp() throws Exception { - RemoteRepositoryConfiguration repository = createRemoteRepository( "testRemoteRepo", "Unit Test Remote Repo", + RemoteRepository repository = createRemoteRepository( "testRemoteRepo", "Unit Test Remote Repo", "http://repo1.maven.org/maven2/" ); //repoContent = (RemoteRepositoryContent) lookup( RemoteRepositoryContent.class, "default" ); diff --git a/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/RemoteLegacyRepositoryContentTest.java b/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/RemoteLegacyRepositoryContentTest.java index b0bb6e6a9..8fa46f081 100644 --- a/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/RemoteLegacyRepositoryContentTest.java +++ b/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/RemoteLegacyRepositoryContentTest.java @@ -19,6 +19,7 @@ package org.apache.maven.archiva.repository.content; * under the License. */ +import org.apache.archiva.admin.model.remote.RemoteRepository; import org.apache.maven.archiva.configuration.RemoteRepositoryConfiguration; import org.apache.maven.archiva.model.ArtifactReference; import org.apache.maven.archiva.repository.RemoteRepositoryContent; @@ -44,7 +45,7 @@ public class RemoteLegacyRepositoryContentTest public void setUp() throws Exception { - RemoteRepositoryConfiguration repository = + RemoteRepository repository = createRemoteRepository( "testRemoteLegacyRepo", "Unit Test Remote Legacy Repo", "http://repo1.maven.org/maven/" ); repository.setLayout( "legacy" ); diff --git a/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/metadata/MetadataToolsTest.java b/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/metadata/MetadataToolsTest.java index ccc340ca8..62d0b7f5c 100644 --- a/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/metadata/MetadataToolsTest.java +++ b/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/metadata/MetadataToolsTest.java @@ -19,6 +19,7 @@ package org.apache.maven.archiva.repository.metadata; * under the License. */ +import org.apache.archiva.admin.model.managed.ManagedRepository; import org.apache.commons.io.FileUtils; import org.apache.commons.lang.StringUtils; import org.apache.maven.archiva.common.utils.VersionComparator; @@ -355,7 +356,7 @@ public class MetadataToolsTest reference.setArtifactId( artifactId ); reference.setVersion( version ); - ManagedRepositoryConfiguration repo = + ManagedRepository repo = createRepository( "test-repo", "Test Repository: " + name.getMethodName(), repoRootDir ); ManagedRepositoryContent repoContent = applicationContext.getBean( "managedRepositoryContent#default", ManagedRepositoryContent.class ); @@ -583,7 +584,7 @@ public class MetadataToolsTest repoRoot.mkdirs(); - ManagedRepositoryConfiguration repoConfig = + ManagedRepository repoConfig = createRepository( "test-repo", "Test Repository: " + name.getMethodName(), repoRoot ); ManagedRepositoryContent repoContent = diff --git a/archiva-modules/archiva-base/archiva-repository-scanner/pom.xml b/archiva-modules/archiva-base/archiva-repository-scanner/pom.xml index a4d547391..92f024a79 100644 --- a/archiva-modules/archiva-base/archiva-repository-scanner/pom.xml +++ b/archiva-modules/archiva-base/archiva-repository-scanner/pom.xml @@ -34,7 +34,7 @@ org.apache.archiva - archiva-configuration + archiva-repository-admin-api org.springframework @@ -45,6 +45,13 @@ slf4j-simple test + + org.apache.archiva + archiva-configuration + + org.springframework spring-test diff --git a/archiva-modules/archiva-base/archiva-repository-scanner/src/main/java/org/apache/archiva/repository/scanner/DefaultRepositoryScanner.java b/archiva-modules/archiva-base/archiva-repository-scanner/src/main/java/org/apache/archiva/repository/scanner/DefaultRepositoryScanner.java index 6185efe91..c7f950f39 100644 --- a/archiva-modules/archiva-base/archiva-repository-scanner/src/main/java/org/apache/archiva/repository/scanner/DefaultRepositoryScanner.java +++ b/archiva-modules/archiva-base/archiva-repository-scanner/src/main/java/org/apache/archiva/repository/scanner/DefaultRepositoryScanner.java @@ -19,28 +19,29 @@ package org.apache.archiva.repository.scanner; * under the License. */ +import org.apache.archiva.admin.model.RepositoryAdminException; +import org.apache.archiva.admin.model.managed.ManagedRepository; import org.apache.commons.collections.CollectionUtils; import org.apache.maven.archiva.configuration.FileTypes; -import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration; import org.apache.maven.archiva.consumers.InvalidRepositoryContentConsumer; import org.apache.maven.archiva.consumers.KnownRepositoryContentConsumer; import org.apache.maven.archiva.consumers.RepositoryContentConsumer; import org.codehaus.plexus.util.DirectoryWalker; import org.springframework.stereotype.Service; +import javax.inject.Inject; import java.io.File; import java.util.ArrayList; import java.util.LinkedHashSet; import java.util.List; import java.util.Set; -import javax.inject.Inject; /** * DefaultRepositoryScanner * * @version $Id$ */ -@Service("repositoryScanner#default") +@Service( "repositoryScanner#default" ) public class DefaultRepositoryScanner implements RepositoryScanner { @@ -58,17 +59,24 @@ public class DefaultRepositoryScanner private Set inProgressScans = new LinkedHashSet(); - public RepositoryScanStatistics scan( ManagedRepositoryConfiguration repository, long changesSince ) + public RepositoryScanStatistics scan( ManagedRepository repository, long changesSince ) throws RepositoryScannerException { - List knownContentConsumers = consumerUtil.getSelectedKnownConsumers(); - List invalidContentConsumers = consumerUtil.getSelectedInvalidConsumers(); - List ignoredPatterns = filetypes.getFileTypePatterns( FileTypes.IGNORED ); + try + { + List knownContentConsumers = consumerUtil.getSelectedKnownConsumers(); + List invalidContentConsumers = consumerUtil.getSelectedInvalidConsumers(); + List ignoredPatterns = filetypes.getFileTypePatterns( FileTypes.IGNORED ); - return scan( repository, knownContentConsumers, invalidContentConsumers, ignoredPatterns, changesSince ); + return scan( repository, knownContentConsumers, invalidContentConsumers, ignoredPatterns, changesSince ); + } + catch ( RepositoryAdminException e ) + { + throw new RepositoryScannerException( e.getMessage(), e ); + } } - public RepositoryScanStatistics scan( ManagedRepositoryConfiguration repository, + public RepositoryScanStatistics scan( ManagedRepository repository, List knownContentConsumers, List invalidContentConsumers, List ignoredContentPatterns, long changesSince ) @@ -85,14 +93,14 @@ public class DefaultRepositoryScanner //create the repo if not existing to have an empty stats if ( !repositoryBase.exists() && !repositoryBase.mkdirs() ) { - throw new UnsupportedOperationException( "Unable to scan a repository, directory " - + repositoryBase.getPath() + " does not exist." ); + throw new UnsupportedOperationException( + "Unable to scan a repository, directory " + repositoryBase.getPath() + " does not exist." ); } if ( !repositoryBase.isDirectory() ) { - throw new UnsupportedOperationException( "Unable to scan a repository, path " - + repositoryBase.getPath() + " is not a directory." ); + throw new UnsupportedOperationException( + "Unable to scan a repository, path " + repositoryBase.getPath() + " is not a directory." ); } // Setup Includes / Excludes. @@ -117,8 +125,8 @@ public class DefaultRepositoryScanner dirWalker.setExcludes( allExcludes ); // Setup the Scan Instance - RepositoryScannerInstance scannerInstance = new RepositoryScannerInstance( repository, knownContentConsumers, - invalidContentConsumers, changesSince ); + RepositoryScannerInstance scannerInstance = + new RepositoryScannerInstance( repository, knownContentConsumers, invalidContentConsumers, changesSince ); inProgressScans.add( scannerInstance ); diff --git a/archiva-modules/archiva-base/archiva-repository-scanner/src/main/java/org/apache/archiva/repository/scanner/RepositoryContentConsumers.java b/archiva-modules/archiva-base/archiva-repository-scanner/src/main/java/org/apache/archiva/repository/scanner/RepositoryContentConsumers.java index 666ff0045..c95209ebd 100644 --- a/archiva-modules/archiva-base/archiva-repository-scanner/src/main/java/org/apache/archiva/repository/scanner/RepositoryContentConsumers.java +++ b/archiva-modules/archiva-base/archiva-repository-scanner/src/main/java/org/apache/archiva/repository/scanner/RepositoryContentConsumers.java @@ -19,6 +19,9 @@ package org.apache.archiva.repository.scanner; * under the License. */ +import org.apache.archiva.admin.model.RepositoryAdminException; +import org.apache.archiva.admin.model.admin.ArchivaAdministration; +import org.apache.archiva.admin.model.managed.ManagedRepository; import org.apache.archiva.repository.scanner.functors.ConsumerProcessFileClosure; import org.apache.archiva.repository.scanner.functors.TriggerBeginScanClosure; import org.apache.archiva.repository.scanner.functors.TriggerScanCompletedClosure; @@ -26,16 +29,15 @@ import org.apache.commons.collections.Closure; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.functors.IfClosure; import org.apache.maven.archiva.common.utils.BaseFile; -import org.apache.maven.archiva.configuration.ArchivaConfiguration; -import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration; -import org.apache.maven.archiva.configuration.RepositoryScanningConfiguration; import org.apache.maven.archiva.consumers.InvalidRepositoryContentConsumer; import org.apache.maven.archiva.consumers.KnownRepositoryContentConsumer; import org.apache.maven.archiva.consumers.functors.ConsumerWantsFilePredicate; import org.springframework.beans.BeansException; import org.springframework.context.ApplicationContext; import org.springframework.context.ApplicationContextAware; +import org.springframework.stereotype.Service; +import javax.inject.Inject; import java.io.File; import java.util.ArrayList; import java.util.Date; @@ -48,20 +50,24 @@ import java.util.Map; * * @version $Id$ */ +@Service("repositoryContentConsumers") public class RepositoryContentConsumers implements ApplicationContextAware { + + @Inject private ApplicationContext applicationContext; - private ArchivaConfiguration archivaConfiguration; + private ArchivaAdministration archivaAdministration; private List selectedKnownConsumers; private List selectedInvalidConsumers; - public RepositoryContentConsumers( ArchivaConfiguration archivaConfiguration ) + @Inject + public RepositoryContentConsumers( ArchivaAdministration archivaAdministration ) { - this.archivaConfiguration = archivaConfiguration; + this.archivaAdministration = archivaAdministration; } public void setApplicationContext( ApplicationContext applicationContext ) @@ -84,9 +90,9 @@ public class RepositoryContentConsumers * @return the list of consumer ids that have been selected by the configuration. */ public List getSelectedKnownConsumerIds() + throws RepositoryAdminException { - RepositoryScanningConfiguration scanning = archivaConfiguration.getConfiguration().getRepositoryScanning(); - return scanning.getKnownContentConsumers(); + return archivaAdministration.getKnownContentConsumers(); } /** @@ -103,9 +109,9 @@ public class RepositoryContentConsumers * @return the list of consumer ids that have been selected by the configuration. */ public List getSelectedInvalidConsumerIds() + throws RepositoryAdminException { - RepositoryScanningConfiguration scanning = archivaConfiguration.getConfiguration().getRepositoryScanning(); - return scanning.getInvalidContentConsumers(); + return archivaAdministration.getInvalidContentConsumers(); } /** @@ -115,6 +121,7 @@ public class RepositoryContentConsumers * @return the map of String ids to {@link KnownRepositoryContentConsumer} objects. */ public Map getSelectedKnownConsumersMap() + throws RepositoryAdminException { Map consumerMap = new HashMap(); @@ -133,6 +140,7 @@ public class RepositoryContentConsumers * @return the map of String ids to {@link InvalidRepositoryContentConsumer} objects. */ public Map getSelectedInvalidConsumersMap() + throws RepositoryAdminException { Map consumerMap = new HashMap(); @@ -153,6 +161,7 @@ public class RepositoryContentConsumers * by the active configuration. */ public synchronized List getSelectedKnownConsumers() + throws RepositoryAdminException { if ( selectedKnownConsumers == null ) { @@ -180,6 +189,7 @@ public class RepositoryContentConsumers * by the active configuration. */ public synchronized List getSelectedInvalidConsumers() + throws RepositoryAdminException { if ( selectedInvalidConsumers == null ) { @@ -236,8 +246,8 @@ public class RepositoryContentConsumers * @param localFile the local file to execute the consumers against. * @param updateRelatedArtifacts TODO */ - public void executeConsumers( ManagedRepositoryConfiguration repository, File localFile, - boolean updateRelatedArtifacts ) + public void executeConsumers( ManagedRepository repository, File localFile, boolean updateRelatedArtifacts ) + throws RepositoryAdminException { // Run the repository consumers try @@ -316,8 +326,8 @@ public class RepositoryContentConsumers return new Date( System.currentTimeMillis() ); } - public void setArchivaConfiguration( ArchivaConfiguration archivaConfiguration ) + public void setArchivaAdministration( ArchivaAdministration archivaAdministration ) { - this.archivaConfiguration = archivaConfiguration; + this.archivaAdministration = archivaAdministration; } } diff --git a/archiva-modules/archiva-base/archiva-repository-scanner/src/main/java/org/apache/archiva/repository/scanner/RepositoryScanStatistics.java b/archiva-modules/archiva-base/archiva-repository-scanner/src/main/java/org/apache/archiva/repository/scanner/RepositoryScanStatistics.java index e6fa22d7b..f7511b7da 100644 --- a/archiva-modules/archiva-base/archiva-repository-scanner/src/main/java/org/apache/archiva/repository/scanner/RepositoryScanStatistics.java +++ b/archiva-modules/archiva-base/archiva-repository-scanner/src/main/java/org/apache/archiva/repository/scanner/RepositoryScanStatistics.java @@ -23,6 +23,7 @@ import java.text.SimpleDateFormat; import java.util.List; import java.util.Map; +import org.apache.archiva.admin.model.managed.ManagedRepository; import org.apache.commons.collections.CollectionUtils; import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration; @@ -114,7 +115,7 @@ public class RepositoryScanStatistics invalidConsumers = consumers; } - public String toDump( ManagedRepositoryConfiguration repo ) + public String toDump( ManagedRepository repo ) { StringBuffer buf = new StringBuffer(); diff --git a/archiva-modules/archiva-base/archiva-repository-scanner/src/main/java/org/apache/archiva/repository/scanner/RepositoryScanner.java b/archiva-modules/archiva-base/archiva-repository-scanner/src/main/java/org/apache/archiva/repository/scanner/RepositoryScanner.java index 2ebbc443d..064826a14 100644 --- a/archiva-modules/archiva-base/archiva-repository-scanner/src/main/java/org/apache/archiva/repository/scanner/RepositoryScanner.java +++ b/archiva-modules/archiva-base/archiva-repository-scanner/src/main/java/org/apache/archiva/repository/scanner/RepositoryScanner.java @@ -19,23 +19,22 @@ package org.apache.archiva.repository.scanner; * under the License. */ -import java.util.Collection; -import java.util.List; -import java.util.Set; - -import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration; +import org.apache.archiva.admin.model.managed.ManagedRepository; import org.apache.maven.archiva.consumers.InvalidRepositoryContentConsumer; import org.apache.maven.archiva.consumers.KnownRepositoryContentConsumer; +import java.util.List; +import java.util.Set; + /** - * RepositoryScanner + * RepositoryScanner * * @version $Id$ */ public interface RepositoryScanner { /** - * The value to pass to {@link #scan(ManagedRepositoryConfiguration, long)} to have the scan + * The value to pass to {@link #scan(ManagedRepository, long)} to have the scan * operate in a fresh fashion, with no check on changes based on timestamp. */ public static final long FRESH_SCAN = 0; @@ -44,68 +43,56 @@ public interface RepositoryScanner *

* Typical Ignorable Content patterns. *

- * + *

*

* NOTE: Do not use for normal webapp or task driven repository scanning. *

- * + *

*

* These patterns are only valid for archiva-cli and archiva-converter use. *

*/ - public static final String[] IGNORABLE_CONTENT = { - "bin/**", - "reports/**", - ".index", - ".reports/**", - ".maven/**", - "**/.svn/**", - "**/*snapshot-version", - "*/website/**", - "*/licences/**", - "**/.htaccess", - "**/*.html", - "**/*.txt", - "**/README*", - "**/CHANGELOG*", - "**/KEYS*" }; + public static final String[] IGNORABLE_CONTENT = + { "bin/**", "reports/**", ".index", ".reports/**", ".maven/**", "**/.svn/**", "**/*snapshot-version", + "*/website/**", "*/licences/**", "**/.htaccess", "**/*.html", "**/*.txt", "**/README*", "**/CHANGELOG*", + "**/KEYS*" }; /** * Scan the repository for content changes. - * + *

* Internally, this will use the as-configured known and invalid consumer lists. - * - * @param repository the repository to change. + * + * @param repository the repository to change. * @param changesSince the timestamp to use as a threshold on what is considered new or changed. * (To have all content be taken into consideration regardless of timestamp, - * use the {@link #FRESH_SCAN} constant) + * use the {@link #FRESH_SCAN} constant) * @return the statistics for this scan. * @throws RepositoryScannerException if there was a fundamental problem with getting the discoverer started. */ - public RepositoryScanStatistics scan( ManagedRepositoryConfiguration repository, long changesSince ) + RepositoryScanStatistics scan( ManagedRepository repository, long changesSince ) throws RepositoryScannerException; /** * Scan the repository for content changes. - * + *

* Internally, this will use the as-configured known and invalid consumer lists. - * - * @param repository the repository to change. - * @param knownContentConsumers the list of consumers that follow the {@link KnownRepositoryContentConsumer} - * interface that should be used for this scan. - * @param invalidContentConsumers the list of consumers that follow the {@link InvalidRepositoryContentConsumer} - * interface that should be used for this scan. - * @param ignoredContentPatterns list of patterns that should be ignored and not sent to any consumer. - * @param changesSince the timestamp to use as a threshold on what is considered new or changed. - * (To have all content be taken into consideration regardless of timestamp, - * use the {@link #FRESH_SCAN} constant) + * + * @param repository the repository to change. + * @param knownContentConsumers the list of consumers that follow the {@link KnownRepositoryContentConsumer} + * interface that should be used for this scan. + * @param invalidContentConsumers the list of consumers that follow the {@link InvalidRepositoryContentConsumer} + * interface that should be used for this scan. + * @param ignoredContentPatterns list of patterns that should be ignored and not sent to any consumer. + * @param changesSince the timestamp to use as a threshold on what is considered new or changed. + * (To have all content be taken into consideration regardless of timestamp, + * use the {@link #FRESH_SCAN} constant) * @return the statistics for this scan. * @throws RepositoryScannerException if there was a fundamental problem with getting the discoverer started. */ - public RepositoryScanStatistics scan( ManagedRepositoryConfiguration repository, - List knownContentConsumers, - List invalidContentConsumers, - List ignoredContentPatterns, long changesSince ) + RepositoryScanStatistics scan( ManagedRepository repository, + List knownContentConsumers, + List invalidContentConsumers, + List ignoredContentPatterns, long changesSince ) throws RepositoryScannerException; Set getInProgressScans(); diff --git a/archiva-modules/archiva-base/archiva-repository-scanner/src/main/java/org/apache/archiva/repository/scanner/RepositoryScannerInstance.java b/archiva-modules/archiva-base/archiva-repository-scanner/src/main/java/org/apache/archiva/repository/scanner/RepositoryScannerInstance.java index f027c2266..c75a99912 100644 --- a/archiva-modules/archiva-base/archiva-repository-scanner/src/main/java/org/apache/archiva/repository/scanner/RepositoryScannerInstance.java +++ b/archiva-modules/archiva-base/archiva-repository-scanner/src/main/java/org/apache/archiva/repository/scanner/RepositoryScannerInstance.java @@ -19,12 +19,7 @@ package org.apache.archiva.repository.scanner; * under the License. */ -import java.io.File; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - +import org.apache.archiva.admin.model.managed.ManagedRepository; import org.apache.archiva.repository.scanner.functors.ConsumerProcessFileClosure; import org.apache.archiva.repository.scanner.functors.TriggerBeginScanClosure; import org.apache.archiva.repository.scanner.functors.TriggerScanCompletedClosure; @@ -33,13 +28,18 @@ import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.functors.IfClosure; import org.apache.commons.lang.SystemUtils; import org.apache.maven.archiva.common.utils.BaseFile; -import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration; import org.apache.maven.archiva.consumers.InvalidRepositoryContentConsumer; import org.apache.maven.archiva.consumers.KnownRepositoryContentConsumer; import org.apache.maven.archiva.consumers.functors.ConsumerWantsFilePredicate; import org.codehaus.plexus.util.DirectoryWalkListener; import org.slf4j.Logger; import org.slf4j.LoggerFactory; + +import java.io.File; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; /** * RepositoryScannerInstance * @@ -60,7 +60,7 @@ public class RepositoryScannerInstance */ private List invalidConsumers; - private ManagedRepositoryConfiguration repository; + private ManagedRepository repository; private RepositoryScanStatistics stats; @@ -74,7 +74,7 @@ public class RepositoryScannerInstance private Map consumerCounts; - public RepositoryScannerInstance( ManagedRepositoryConfiguration repository, + public RepositoryScannerInstance( ManagedRepository repository, List knownConsumerList, List invalidConsumerList ) { @@ -106,7 +106,7 @@ public class RepositoryScannerInstance } } - public RepositoryScannerInstance( ManagedRepositoryConfiguration repository, + public RepositoryScannerInstance( ManagedRepository repository, List knownContentConsumers, List invalidContentConsumers, long changesSince ) { @@ -187,7 +187,7 @@ public class RepositoryScannerInstance log.debug( "Repository Scanner: {}", message ); } - public ManagedRepositoryConfiguration getRepository() + public ManagedRepository getRepository() { return repository; } diff --git a/archiva-modules/archiva-base/archiva-repository-scanner/src/main/java/org/apache/archiva/repository/scanner/functors/TriggerBeginScanClosure.java b/archiva-modules/archiva-base/archiva-repository-scanner/src/main/java/org/apache/archiva/repository/scanner/functors/TriggerBeginScanClosure.java index 2976637b8..507ccb61b 100644 --- a/archiva-modules/archiva-base/archiva-repository-scanner/src/main/java/org/apache/archiva/repository/scanner/functors/TriggerBeginScanClosure.java +++ b/archiva-modules/archiva-base/archiva-repository-scanner/src/main/java/org/apache/archiva/repository/scanner/functors/TriggerBeginScanClosure.java @@ -19,15 +19,15 @@ package org.apache.archiva.repository.scanner.functors; * under the License. */ -import java.util.Date; - +import org.apache.archiva.admin.model.managed.ManagedRepository; import org.apache.commons.collections.Closure; -import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration; import org.apache.maven.archiva.consumers.ConsumerException; import org.apache.maven.archiva.consumers.RepositoryContentConsumer; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.util.Date; + /** * TriggerBeginScanClosure * @@ -38,24 +38,24 @@ public class TriggerBeginScanClosure { private Logger log = LoggerFactory.getLogger( TriggerBeginScanClosure.class ); - private ManagedRepositoryConfiguration repository; + private ManagedRepository repository; private Date whenGathered; private boolean executeOnEntireRepo = true; - public TriggerBeginScanClosure( ManagedRepositoryConfiguration repository ) + public TriggerBeginScanClosure( ManagedRepository repository ) { this.repository = repository; } - public TriggerBeginScanClosure( ManagedRepositoryConfiguration repository, Date whenGathered ) + public TriggerBeginScanClosure( ManagedRepository repository, Date whenGathered ) { this( repository ); this.whenGathered = whenGathered; } - public TriggerBeginScanClosure( ManagedRepositoryConfiguration repository, Date whenGathered, boolean executeOnEntireRepo ) + public TriggerBeginScanClosure( ManagedRepository repository, Date whenGathered, boolean executeOnEntireRepo ) { this( repository, whenGathered ); this.executeOnEntireRepo = executeOnEntireRepo; diff --git a/archiva-modules/archiva-base/archiva-repository-scanner/src/main/java/org/apache/archiva/repository/scanner/functors/TriggerScanCompletedClosure.java b/archiva-modules/archiva-base/archiva-repository-scanner/src/main/java/org/apache/archiva/repository/scanner/functors/TriggerScanCompletedClosure.java index 5d2330a98..9cbfb7400 100644 --- a/archiva-modules/archiva-base/archiva-repository-scanner/src/main/java/org/apache/archiva/repository/scanner/functors/TriggerScanCompletedClosure.java +++ b/archiva-modules/archiva-base/archiva-repository-scanner/src/main/java/org/apache/archiva/repository/scanner/functors/TriggerScanCompletedClosure.java @@ -19,8 +19,8 @@ package org.apache.archiva.repository.scanner.functors; * under the License. */ +import org.apache.archiva.admin.model.managed.ManagedRepository; import org.apache.commons.collections.Closure; -import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration; import org.apache.maven.archiva.consumers.RepositoryContentConsumer; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -33,16 +33,16 @@ public class TriggerScanCompletedClosure { private Logger log = LoggerFactory.getLogger( TriggerScanCompletedClosure.class ); - private final ManagedRepositoryConfiguration repository; + private final ManagedRepository repository; private boolean executeOnEntireRepo = true; - public TriggerScanCompletedClosure( ManagedRepositoryConfiguration repository ) + public TriggerScanCompletedClosure( ManagedRepository repository ) { this.repository = repository; } - public TriggerScanCompletedClosure( ManagedRepositoryConfiguration repository, boolean executeOnEntireRepo ) + public TriggerScanCompletedClosure( ManagedRepository repository, boolean executeOnEntireRepo ) { this( repository ); this.executeOnEntireRepo = executeOnEntireRepo; diff --git a/archiva-modules/archiva-base/archiva-repository-scanner/src/main/resources/META-INF/spring-context.xml b/archiva-modules/archiva-base/archiva-repository-scanner/src/main/resources/META-INF/spring-context.xml index 867eb1a27..c5e39b8e0 100644 --- a/archiva-modules/archiva-base/archiva-repository-scanner/src/main/resources/META-INF/spring-context.xml +++ b/archiva-modules/archiva-base/archiva-repository-scanner/src/main/resources/META-INF/spring-context.xml @@ -31,9 +31,4 @@ - - - - - diff --git a/archiva-modules/archiva-base/archiva-repository-scanner/src/test/java/org/apache/archiva/repository/scanner/ArchivaAdministrationStub.java b/archiva-modules/archiva-base/archiva-repository-scanner/src/test/java/org/apache/archiva/repository/scanner/ArchivaAdministrationStub.java new file mode 100644 index 000000000..a64c72693 --- /dev/null +++ b/archiva-modules/archiva-base/archiva-repository-scanner/src/test/java/org/apache/archiva/repository/scanner/ArchivaAdministrationStub.java @@ -0,0 +1,166 @@ +package org.apache.archiva.repository.scanner; +/* + * 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.admin.ArchivaAdministration; +import org.apache.archiva.admin.model.admin.FileType; +import org.apache.archiva.admin.model.admin.LegacyArtifactPath; +import org.apache.archiva.admin.model.admin.OrganisationInformation; +import org.apache.maven.archiva.configuration.ArchivaConfiguration; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * @author Olivier Lamy + */ +@Service +public class ArchivaAdministrationStub + implements ArchivaAdministration +{ + + private ArchivaConfiguration archivaConfiguration; + + public ArchivaAdministrationStub() + { + // no op + } + + + public ArchivaAdministrationStub( ArchivaConfiguration archivaConfiguration ) + { + this.archivaConfiguration = archivaConfiguration; + } + + public List getLegacyArtifactPaths() + throws RepositoryAdminException + { + return null; + } + + public void addLegacyArtifactPath( LegacyArtifactPath legacyArtifactPath, AuditInformation auditInformation ) + throws RepositoryAdminException + { + + } + + public void deleteLegacyArtifactPath( String path, AuditInformation auditInformation ) + throws RepositoryAdminException + { + + } + + public void addFileTypePattern( String fileTypeId, String pattern, AuditInformation auditInformation ) + throws RepositoryAdminException + { + + } + + public void removeFileTypePattern( String fileTypeId, String pattern, AuditInformation auditInformation ) + throws RepositoryAdminException + { + + } + + public List getFileTypes() + throws RepositoryAdminException + { + return null; + } + + public FileType getFileType( String fileTypeId ) + throws RepositoryAdminException + { + return null; + } + + public void addFileType( FileType fileType, AuditInformation auditInformation ) + throws RepositoryAdminException + { + + } + + public void removeFileType( String fileTypeId, AuditInformation auditInformation ) + throws RepositoryAdminException + { + + } + + public void addKnownContentConsumer( String knownContentConsumer, AuditInformation auditInformation ) + throws RepositoryAdminException + { + + } + + public void setKnownContentConsumers( List knownContentConsumers, AuditInformation auditInformation ) + throws RepositoryAdminException + { + + } + + public List getKnownContentConsumers() + throws RepositoryAdminException + { + return archivaConfiguration.getConfiguration().getRepositoryScanning().getKnownContentConsumers(); + } + + public void removeKnownContentConsumer( String knownContentConsumer, AuditInformation auditInformation ) + throws RepositoryAdminException + { + + } + + public void addInvalidContentConsumer( String invalidContentConsumer, AuditInformation auditInformation ) + throws RepositoryAdminException + { + + } + + public void setInvalidContentConsumers( List invalidContentConsumers, AuditInformation auditInformation ) + throws RepositoryAdminException + { + + } + + public List getInvalidContentConsumers() + throws RepositoryAdminException + { + return archivaConfiguration.getConfiguration().getRepositoryScanning().getInvalidContentConsumers(); + } + + public void removeInvalidContentConsumer( String invalidContentConsumer, AuditInformation auditInformation ) + throws RepositoryAdminException + { + + } + + public OrganisationInformation getOrganisationInformation() + throws RepositoryAdminException + { + return null; + } + + public void setOrganisationInformation( OrganisationInformation organisationInformation ) + throws RepositoryAdminException + { + + } +} diff --git a/archiva-modules/archiva-base/archiva-repository-scanner/src/test/java/org/apache/archiva/repository/scanner/InvalidScanConsumer.java b/archiva-modules/archiva-base/archiva-repository-scanner/src/test/java/org/apache/archiva/repository/scanner/InvalidScanConsumer.java index 472848d44..91fdb1930 100644 --- a/archiva-modules/archiva-base/archiva-repository-scanner/src/test/java/org/apache/archiva/repository/scanner/InvalidScanConsumer.java +++ b/archiva-modules/archiva-base/archiva-repository-scanner/src/test/java/org/apache/archiva/repository/scanner/InvalidScanConsumer.java @@ -19,14 +19,14 @@ package org.apache.archiva.repository.scanner; * under the License. */ -import java.util.Date; -import java.util.List; - -import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration; +import org.apache.archiva.admin.model.managed.ManagedRepository; import org.apache.maven.archiva.consumers.AbstractMonitoredConsumer; import org.apache.maven.archiva.consumers.ConsumerException; import org.apache.maven.archiva.consumers.InvalidRepositoryContentConsumer; +import java.util.Date; +import java.util.List; + /** * InvalidScanConsumer * @@ -43,13 +43,13 @@ public class InvalidScanConsumer private int processCount = 0; - public void beginScan( ManagedRepositoryConfiguration repository, Date whenGathered ) + public void beginScan( ManagedRepository repository, Date whenGathered ) throws ConsumerException { /* do nothing */ } - public void beginScan( ManagedRepositoryConfiguration repository, Date whenGathered, boolean executeOnEntireRepo ) + public void beginScan( ManagedRepository repository, Date whenGathered, boolean executeOnEntireRepo ) throws ConsumerException { beginScan( repository, whenGathered ); diff --git a/archiva-modules/archiva-base/archiva-repository-scanner/src/test/java/org/apache/archiva/repository/scanner/KnownScanConsumer.java b/archiva-modules/archiva-base/archiva-repository-scanner/src/test/java/org/apache/archiva/repository/scanner/KnownScanConsumer.java index a2cd92901..e3d98af35 100644 --- a/archiva-modules/archiva-base/archiva-repository-scanner/src/test/java/org/apache/archiva/repository/scanner/KnownScanConsumer.java +++ b/archiva-modules/archiva-base/archiva-repository-scanner/src/test/java/org/apache/archiva/repository/scanner/KnownScanConsumer.java @@ -19,16 +19,16 @@ package org.apache.archiva.repository.scanner; * under the License. */ +import org.apache.archiva.admin.model.managed.ManagedRepository; +import org.apache.maven.archiva.consumers.AbstractMonitoredConsumer; +import org.apache.maven.archiva.consumers.ConsumerException; +import org.apache.maven.archiva.consumers.KnownRepositoryContentConsumer; + import java.util.ArrayList; import java.util.Arrays; import java.util.Date; import java.util.List; -import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration; -import org.apache.maven.archiva.consumers.AbstractMonitoredConsumer; -import org.apache.maven.archiva.consumers.ConsumerException; -import org.apache.maven.archiva.consumers.KnownRepositoryContentConsumer; - /** * ScanConsumer * @@ -70,13 +70,13 @@ public class KnownScanConsumer return "Scan Consumer (for testing)"; } - public void beginScan( ManagedRepositoryConfiguration repository, Date whenGathered ) + public void beginScan( ManagedRepository repository, Date whenGathered ) throws ConsumerException { /* do nothing */ } - public void beginScan( ManagedRepositoryConfiguration repository, Date whenGathered, boolean executeOnEntireRepo ) + public void beginScan( ManagedRepository repository, Date whenGathered, boolean executeOnEntireRepo ) throws ConsumerException { beginScan( repository, whenGathered ); diff --git a/archiva-modules/archiva-base/archiva-repository-scanner/src/test/java/org/apache/archiva/repository/scanner/RepositoryContentConsumersStub.java b/archiva-modules/archiva-base/archiva-repository-scanner/src/test/java/org/apache/archiva/repository/scanner/RepositoryContentConsumersStub.java index bd47bce23..4b17fe6f8 100644 --- a/archiva-modules/archiva-base/archiva-repository-scanner/src/test/java/org/apache/archiva/repository/scanner/RepositoryContentConsumersStub.java +++ b/archiva-modules/archiva-base/archiva-repository-scanner/src/test/java/org/apache/archiva/repository/scanner/RepositoryContentConsumersStub.java @@ -19,16 +19,16 @@ package org.apache.archiva.repository.scanner; * under the License. */ -import java.util.Date; +import org.apache.archiva.admin.model.admin.ArchivaAdministration; -import org.apache.maven.archiva.configuration.ArchivaConfiguration; +import java.util.Date; public class RepositoryContentConsumersStub extends RepositoryContentConsumers { - public RepositoryContentConsumersStub(ArchivaConfiguration archivaConfiguration) + public RepositoryContentConsumersStub( ArchivaAdministration archivaAdministration ) { - super(archivaConfiguration); + super( archivaAdministration ); } @Override @@ -36,7 +36,7 @@ public class RepositoryContentConsumersStub { Date startTimeForTest = new Date( System.currentTimeMillis() ); startTimeForTest.setTime( 12345678 ); - + return startTimeForTest; } } diff --git a/archiva-modules/archiva-base/archiva-repository-scanner/src/test/java/org/apache/archiva/repository/scanner/RepositoryContentConsumersTest.java b/archiva-modules/archiva-base/archiva-repository-scanner/src/test/java/org/apache/archiva/repository/scanner/RepositoryContentConsumersTest.java index 4684618b4..81e5ba946 100644 --- a/archiva-modules/archiva-base/archiva-repository-scanner/src/test/java/org/apache/archiva/repository/scanner/RepositoryContentConsumersTest.java +++ b/archiva-modules/archiva-base/archiva-repository-scanner/src/test/java/org/apache/archiva/repository/scanner/RepositoryContentConsumersTest.java @@ -20,10 +20,10 @@ package org.apache.archiva.repository.scanner; */ import junit.framework.TestCase; +import org.apache.archiva.admin.model.managed.ManagedRepository; +import org.apache.archiva.admin.model.remote.RemoteRepository; import org.apache.commons.lang.SystemUtils; import org.apache.maven.archiva.configuration.ArchivaConfiguration; -import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration; -import org.apache.maven.archiva.configuration.RemoteRepositoryConfiguration; import org.apache.maven.archiva.consumers.InvalidRepositoryContentConsumer; import org.apache.maven.archiva.consumers.KnownRepositoryContentConsumer; import org.easymock.MockControl; @@ -67,18 +67,18 @@ public class RepositoryContentConsumersTest @Inject ApplicationContext applicationContext; - protected ManagedRepositoryConfiguration createRepository( String id, String name, File location ) + protected ManagedRepository createRepository( String id, String name, File location ) { - ManagedRepositoryConfiguration repo = new ManagedRepositoryConfiguration(); + ManagedRepository repo = new ManagedRepository(); repo.setId( id ); repo.setName( name ); repo.setLocation( location.getAbsolutePath() ); return repo; } - protected RemoteRepositoryConfiguration createRemoteRepository( String id, String name, String url ) + protected RemoteRepository createRemoteRepository( String id, String name, String url ) { - RemoteRepositoryConfiguration repo = new RemoteRepositoryConfiguration(); + RemoteRepository repo = new RemoteRepository(); repo.setId( id ); repo.setName( name ); repo.setUrl( url ); @@ -89,10 +89,13 @@ public class RepositoryContentConsumersTest throws Exception { + ArchivaConfiguration configuration = applicationContext.getBean( "archivaConfiguration#test-conf", ArchivaConfiguration.class ); - RepositoryContentConsumers consumerUtilStub = new RepositoryContentConsumersStub( configuration ); + ArchivaAdministrationStub administrationStub = new ArchivaAdministrationStub( configuration ); + + RepositoryContentConsumers consumerUtilStub = new RepositoryContentConsumersStub( administrationStub ); RepositoryContentConsumers consumerUtil = (RepositoryContentConsumers) applicationContext.getBean( "repositoryContentConsumers#test", @@ -103,7 +106,7 @@ public class RepositoryContentConsumersTest consumerUtilStub.setApplicationContext( context ); consumerUtilStub.setSelectedInvalidConsumers( consumerUtil.getSelectedInvalidConsumers() ); consumerUtilStub.setSelectedKnownConsumers( consumerUtil.getSelectedKnownConsumers() ); - consumerUtilStub.setArchivaConfiguration( configuration ); + consumerUtilStub.setArchivaAdministration( administrationStub ); assertNotNull( "RepositoryContentConsumers should not be null.", consumerUtilStub ); @@ -264,7 +267,7 @@ public class RepositoryContentConsumersTest consumers.setSelectedInvalidConsumers( Collections.singletonList( selectedInvalidConsumer ) ); - ManagedRepositoryConfiguration repo = createRepository( "id", "name", new File( "target/test-repo" ) ); + ManagedRepository repo = createRepository( "id", "name", new File( "target/test-repo" ) ); File testFile = new File( "target/test-repo/path/to/test-file.txt" ); Date startTime = new Date( System.currentTimeMillis() ); diff --git a/archiva-modules/archiva-base/archiva-repository-scanner/src/test/java/org/apache/archiva/repository/scanner/RepositoryScannerTest.java b/archiva-modules/archiva-base/archiva-repository-scanner/src/test/java/org/apache/archiva/repository/scanner/RepositoryScannerTest.java index 709128e60..d68988a9b 100644 --- a/archiva-modules/archiva-base/archiva-repository-scanner/src/test/java/org/apache/archiva/repository/scanner/RepositoryScannerTest.java +++ b/archiva-modules/archiva-base/archiva-repository-scanner/src/test/java/org/apache/archiva/repository/scanner/RepositoryScannerTest.java @@ -20,6 +20,8 @@ package org.apache.archiva.repository.scanner; */ import junit.framework.TestCase; +import org.apache.archiva.admin.model.managed.ManagedRepository; +import org.apache.archiva.admin.model.remote.RemoteRepository; import org.apache.commons.io.FileUtils; import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration; import org.apache.maven.archiva.configuration.RemoteRepositoryConfiguration; @@ -56,18 +58,18 @@ public class RepositoryScannerTest @Inject ApplicationContext applicationContext; - protected ManagedRepositoryConfiguration createRepository( String id, String name, File location ) + protected ManagedRepository createRepository( String id, String name, File location ) { - ManagedRepositoryConfiguration repo = new ManagedRepositoryConfiguration(); + ManagedRepository repo = new ManagedRepository(); repo.setId( id ); repo.setName( name ); repo.setLocation( location.getAbsolutePath() ); return repo; } - protected RemoteRepositoryConfiguration createRemoteRepository( String id, String name, String url ) + protected RemoteRepository createRemoteRepository( String id, String name, String url ) { - RemoteRepositoryConfiguration repo = new RemoteRepositoryConfiguration(); + RemoteRepository repo = new RemoteRepository(); repo.setId( id ); repo.setName( name ); repo.setUrl( url ); @@ -77,7 +79,7 @@ public class RepositoryScannerTest private static final String[] ARTIFACT_PATTERNS = new String[]{ "**/*.jar", "**/*.pom", "**/*.rar", "**/*.zip", "**/*.war", "**/*.tar.gz" }; - private ManagedRepositoryConfiguration createDefaultRepository() + private ManagedRepository createDefaultRepository() { File repoDir = new File( "src/test/repositories/default-repository" ); @@ -86,7 +88,7 @@ public class RepositoryScannerTest return createRepository( "testDefaultRepo", "Test Default Repository", repoDir ); } - private ManagedRepositoryConfiguration createSimpleRepository() + private ManagedRepository createSimpleRepository() throws IOException, ParseException { File srcDir = new File( "src/test/repositories/simple-repository" ); @@ -114,13 +116,13 @@ public class RepositoryScannerTest return fmt.parse( timestamp ).getTime(); } - private ManagedRepositoryConfiguration createLegacyRepository() + private ManagedRepository createLegacyRepository() { File repoDir = new File( "src/test/repositories/legacy-repository" ); assertTrue( "Legacy Test Repository should exist.", repoDir.exists() && repoDir.isDirectory() ); - ManagedRepositoryConfiguration repo = createRepository( "testLegacyRepo", "Test Legacy Repository", repoDir ); + ManagedRepository repo = createRepository( "testLegacyRepo", "Test Legacy Repository", repoDir ); repo.setLayout( "legacy" ); return repo; @@ -152,7 +154,7 @@ public class RepositoryScannerTest public void testTimestampRepositoryScanner() throws Exception { - ManagedRepositoryConfiguration repository = createSimpleRepository(); + ManagedRepository repository = createSimpleRepository(); List knownConsumers = new ArrayList(); KnownScanConsumer consumer = new KnownScanConsumer(); @@ -179,7 +181,7 @@ public class RepositoryScannerTest public void testTimestampRepositoryScannerFreshScan() throws Exception { - ManagedRepositoryConfiguration repository = createSimpleRepository(); + ManagedRepository repository = createSimpleRepository(); List knownConsumers = new ArrayList(); KnownScanConsumer consumer = new KnownScanConsumer(); @@ -205,7 +207,7 @@ public class RepositoryScannerTest public void testTimestampRepositoryScannerProcessUnmodified() throws Exception { - ManagedRepositoryConfiguration repository = createSimpleRepository(); + ManagedRepository repository = createSimpleRepository(); List knownConsumers = new ArrayList(); KnownScanConsumer consumer = new KnownScanConsumer(); @@ -232,7 +234,7 @@ public class RepositoryScannerTest public void testDefaultRepositoryScanner() throws Exception { - ManagedRepositoryConfiguration repository = createDefaultRepository(); + ManagedRepository repository = createDefaultRepository(); List knownConsumers = new ArrayList(); KnownScanConsumer consumer = new KnownScanConsumer(); @@ -293,7 +295,7 @@ public class RepositoryScannerTest actualArtifactPaths.add( "org/apache/testgroup/discovery/1.0/discovery-1.0.pom" ); actualArtifactPaths.add( "javax/sql/jdbc/2.0/jdbc-2.0.jar" ); - ManagedRepositoryConfiguration repository = createDefaultRepository(); + ManagedRepository repository = createDefaultRepository(); List knownConsumers = new ArrayList(); KnownScanConsumer consumer = new KnownScanConsumer(); @@ -330,7 +332,7 @@ public class RepositoryScannerTest actualMetadataPaths.add( "javax/sql/maven-metadata-repository.xml" ); actualMetadataPaths.add( "javax/maven-metadata.xml" ); - ManagedRepositoryConfiguration repository = createDefaultRepository(); + ManagedRepository repository = createDefaultRepository(); List knownConsumers = new ArrayList(); KnownScanConsumer knownConsumer = new KnownScanConsumer(); @@ -367,7 +369,7 @@ public class RepositoryScannerTest actualProjectPaths.add( "org/apache/maven/samplejar/1.0/samplejar-1.0.pom" ); actualProjectPaths.add( "org/apache/testgroup/discovery/1.0/discovery-1.0.pom" ); - ManagedRepositoryConfiguration repository = createDefaultRepository(); + ManagedRepository repository = createDefaultRepository(); List knownConsumers = new ArrayList(); KnownScanConsumer consumer = new KnownScanConsumer(); @@ -408,7 +410,7 @@ public class RepositoryScannerTest actualArtifactPaths.add( "org.apache.maven.update/jars/test-not-updated-1.0.jar" ); actualArtifactPaths.add( "org.apache.maven.update/jars/test-updated-1.0.jar" ); - ManagedRepositoryConfiguration repository = createLegacyRepository(); + ManagedRepository repository = createLegacyRepository(); List knownConsumers = new ArrayList(); KnownScanConsumer consumer = new KnownScanConsumer(); diff --git a/archiva-modules/archiva-base/archiva-repository-scanner/src/test/java/org/apache/archiva/repository/scanner/SampleKnownConsumer.java b/archiva-modules/archiva-base/archiva-repository-scanner/src/test/java/org/apache/archiva/repository/scanner/SampleKnownConsumer.java index e61bcf2e8..b9603693d 100644 --- a/archiva-modules/archiva-base/archiva-repository-scanner/src/test/java/org/apache/archiva/repository/scanner/SampleKnownConsumer.java +++ b/archiva-modules/archiva-base/archiva-repository-scanner/src/test/java/org/apache/archiva/repository/scanner/SampleKnownConsumer.java @@ -19,14 +19,14 @@ package org.apache.archiva.repository.scanner; * under the License. */ -import java.util.Date; -import java.util.List; - -import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration; +import org.apache.archiva.admin.model.managed.ManagedRepository; import org.apache.maven.archiva.consumers.AbstractMonitoredConsumer; import org.apache.maven.archiva.consumers.ConsumerException; import org.apache.maven.archiva.consumers.KnownRepositoryContentConsumer; +import java.util.Date; +import java.util.List; + /** * SampleKnownConsumer * @@ -41,13 +41,13 @@ public class SampleKnownConsumer */ private String id = "unset-id"; - public void beginScan( ManagedRepositoryConfiguration repository, Date whenGathered ) + public void beginScan( ManagedRepository repository, Date whenGathered ) throws ConsumerException { /* nothing to do */ } - public void beginScan( ManagedRepositoryConfiguration repository, Date whenGathered, boolean executeOnEntireRepo ) + public void beginScan( ManagedRepository repository, Date whenGathered, boolean executeOnEntireRepo ) throws ConsumerException { beginScan( repository, whenGathered ); diff --git a/archiva-modules/archiva-base/archiva-repository-scanner/src/test/resources/spring-context.xml b/archiva-modules/archiva-base/archiva-repository-scanner/src/test/resources/spring-context.xml index 69c2d2875..b62fb28ef 100644 --- a/archiva-modules/archiva-base/archiva-repository-scanner/src/test/resources/spring-context.xml +++ b/archiva-modules/archiva-base/archiva-repository-scanner/src/test/resources/spring-context.xml @@ -31,6 +31,10 @@ + + + + @@ -84,7 +88,7 @@ - + diff --git a/archiva-modules/archiva-scheduler/archiva-scheduler-api/pom.xml b/archiva-modules/archiva-scheduler/archiva-scheduler-api/pom.xml index a74cadd9e..b1ab5039b 100644 --- a/archiva-modules/archiva-scheduler/archiva-scheduler-api/pom.xml +++ b/archiva-modules/archiva-scheduler/archiva-scheduler-api/pom.xml @@ -28,6 +28,10 @@ archiva-scheduler-api Archiva Scheduler :: API + + org.apache.archiva + archiva-repository-admin-api + org.codehaus.redback.components spring-taskqueue diff --git a/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/pom.xml b/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/pom.xml index 1f36de795..6bd9b7804 100644 --- a/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/pom.xml +++ b/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/pom.xml @@ -32,6 +32,10 @@ org.apache.archiva archiva-scheduler-api + + org.apache.archiva + archiva-repository-admin-api + org.apache.archiva archiva-configuration diff --git a/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/main/java/org/apache/archiva/scheduler/indexing/ArchivaIndexingTaskExecutor.java b/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/main/java/org/apache/archiva/scheduler/indexing/ArchivaIndexingTaskExecutor.java index 527fa8bce..2477c7898 100644 --- a/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/main/java/org/apache/archiva/scheduler/indexing/ArchivaIndexingTaskExecutor.java +++ b/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/main/java/org/apache/archiva/scheduler/indexing/ArchivaIndexingTaskExecutor.java @@ -20,6 +20,7 @@ package org.apache.archiva.scheduler.indexing; * under the License. */ +import org.apache.archiva.admin.model.managed.ManagedRepository; import org.apache.archiva.common.plexusbridge.MavenIndexerUtils; import org.apache.archiva.common.plexusbridge.PlexusSisuBridge; import org.apache.archiva.common.plexusbridge.PlexusSisuBridgeException; @@ -104,7 +105,7 @@ public class ArchivaIndexingTaskExecutor { ArtifactIndexingTask indexingTask = (ArtifactIndexingTask) task; - ManagedRepositoryConfiguration repository = indexingTask.getRepository(); + ManagedRepository repository = indexingTask.getRepository(); IndexingContext context = indexingTask.getContext(); if ( ArtifactIndexingTask.Action.FINISH.equals( indexingTask.getAction() ) @@ -231,7 +232,7 @@ public class ArchivaIndexingTaskExecutor } } - private void finishIndexingTask( ArtifactIndexingTask indexingTask, ManagedRepositoryConfiguration repository, + private void finishIndexingTask( ArtifactIndexingTask indexingTask, ManagedRepository repository, IndexingContext context ) throws TaskExecutionException { diff --git a/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/main/java/org/apache/archiva/scheduler/indexing/ArtifactIndexingTask.java b/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/main/java/org/apache/archiva/scheduler/indexing/ArtifactIndexingTask.java index 8302f89a7..c39650af6 100644 --- a/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/main/java/org/apache/archiva/scheduler/indexing/ArtifactIndexingTask.java +++ b/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/main/java/org/apache/archiva/scheduler/indexing/ArtifactIndexingTask.java @@ -19,7 +19,7 @@ package org.apache.archiva.scheduler.indexing; * under the License. */ -import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration; +import org.apache.archiva.admin.model.managed.ManagedRepository; import org.apache.maven.index.NexusIndexer; import org.apache.maven.index.context.IndexCreator; import org.apache.maven.index.context.IndexingContext; @@ -41,7 +41,7 @@ public class ArtifactIndexingTask FINISH } - private final ManagedRepositoryConfiguration repository; + private final ManagedRepository repository; private final File resourceFile; @@ -56,7 +56,7 @@ public class ArtifactIndexingTask */ private boolean onlyUpdate = false; - public ArtifactIndexingTask( ManagedRepositoryConfiguration repository, File resourceFile, Action action, + public ArtifactIndexingTask( ManagedRepository repository, File resourceFile, Action action, IndexingContext context ) { this.repository = repository; @@ -65,14 +65,14 @@ public class ArtifactIndexingTask this.context = context; } - public ArtifactIndexingTask( ManagedRepositoryConfiguration repository, File resourceFile, Action action, + public ArtifactIndexingTask( ManagedRepository repository, File resourceFile, Action action, IndexingContext context, boolean executeOnEntireRepo ) { this( repository, resourceFile, action, context ); this.executeOnEntireRepo = executeOnEntireRepo; } - public ArtifactIndexingTask( ManagedRepositoryConfiguration repository, File resourceFile, Action action, + public ArtifactIndexingTask( ManagedRepository repository, File resourceFile, Action action, IndexingContext context, boolean executeOnEntireRepo, boolean onlyUpdate ) { this( repository, resourceFile, action, context, executeOnEntireRepo ); @@ -104,7 +104,7 @@ public class ArtifactIndexingTask return action; } - public ManagedRepositoryConfiguration getRepository() + public ManagedRepository getRepository() { return repository; } @@ -190,17 +190,17 @@ public class ArtifactIndexingTask * @throws IOException * @throws UnsupportedExistingLuceneIndexException */ - public static IndexingContext createContext( ManagedRepositoryConfiguration repository, NexusIndexer indexer, + public static IndexingContext createContext( ManagedRepository repository, NexusIndexer indexer, List indexCreators ) throws IOException, UnsupportedExistingLuceneIndexException { - String indexDir = repository.getIndexDir(); + String indexDir = repository.getIndexDirectory(); File managedRepository = new File( repository.getLocation() ); File indexDirectory = null; if ( indexDir != null && !"".equals( indexDir ) ) { - indexDirectory = new File( repository.getIndexDir() ); + indexDirectory = new File( repository.getIndexDirectory() ); } else { diff --git a/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/test/java/org/apache/archiva/scheduler/indexing/ArchivaIndexingTaskExecutorTest.java b/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/test/java/org/apache/archiva/scheduler/indexing/ArchivaIndexingTaskExecutorTest.java index 3b8da8e5d..86e164ab9 100644 --- a/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/test/java/org/apache/archiva/scheduler/indexing/ArchivaIndexingTaskExecutorTest.java +++ b/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/test/java/org/apache/archiva/scheduler/indexing/ArchivaIndexingTaskExecutorTest.java @@ -20,6 +20,7 @@ package org.apache.archiva.scheduler.indexing; */ import junit.framework.TestCase; +import org.apache.archiva.admin.model.managed.ManagedRepository; import org.apache.archiva.common.plexusbridge.MavenIndexerUtils; import org.apache.archiva.common.plexusbridge.PlexusSisuBridge; import org.apache.commons.io.FileUtils; @@ -67,9 +68,7 @@ public class ArchivaIndexingTaskExecutorTest @Inject private ArchivaIndexingTaskExecutor indexingExecutor; - private ManagedRepositoryConfiguration repositoryConfig; - - private Configuration configuration; + private ManagedRepository repositoryConfig; private NexusIndexer indexer; @@ -85,7 +84,7 @@ public class ArchivaIndexingTaskExecutorTest { super.setUp(); - repositoryConfig = new ManagedRepositoryConfiguration(); + repositoryConfig = new ManagedRepository(); repositoryConfig.setId( "test-repo" ); repositoryConfig.setLocation( "target/test-classes/test-repo" ); repositoryConfig.setLayout( "default" ); @@ -94,9 +93,6 @@ public class ArchivaIndexingTaskExecutorTest repositoryConfig.setSnapshots( false ); repositoryConfig.setReleases( true ); - configuration = new Configuration(); - configuration.addManagedRepository( repositoryConfig ); - indexer = plexusSisuBridge.lookup( NexusIndexer.class ); ArtifactIndexingTask.createContext( repositoryConfig, indexer, mavenIndexerUtils.getAllIndexCreators() ); diff --git a/archiva-modules/archiva-scheduler/archiva-scheduler-repository/src/main/java/org/apache/archiva/scheduler/repository/ArchivaRepositoryScanningTaskExecutor.java b/archiva-modules/archiva-scheduler/archiva-scheduler-repository/src/main/java/org/apache/archiva/scheduler/repository/ArchivaRepositoryScanningTaskExecutor.java index a8a7a4c37..e7dc7901f 100644 --- a/archiva-modules/archiva-scheduler/archiva-scheduler-repository/src/main/java/org/apache/archiva/scheduler/repository/ArchivaRepositoryScanningTaskExecutor.java +++ b/archiva-modules/archiva-scheduler/archiva-scheduler-repository/src/main/java/org/apache/archiva/scheduler/repository/ArchivaRepositoryScanningTaskExecutor.java @@ -19,6 +19,9 @@ package org.apache.archiva.scheduler.repository; * under the License. */ +import org.apache.archiva.admin.model.RepositoryAdminException; +import org.apache.archiva.admin.model.managed.ManagedRepository; +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; @@ -30,8 +33,6 @@ import org.apache.archiva.repository.scanner.RepositoryScanStatistics; import org.apache.archiva.repository.scanner.RepositoryScanner; import org.apache.archiva.repository.scanner.RepositoryScannerException; import org.apache.commons.lang.StringUtils; -import org.apache.maven.archiva.configuration.ArchivaConfiguration; -import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration; import org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable; import org.codehaus.plexus.personality.plexus.lifecycle.phase.InitializationException; import org.codehaus.plexus.taskqueue.Task; @@ -39,12 +40,10 @@ import org.codehaus.plexus.taskqueue.execution.TaskExecutionException; import org.codehaus.plexus.taskqueue.execution.TaskExecutor; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import org.springframework.scheduling.TaskScheduler; import org.springframework.stereotype.Service; import javax.annotation.PostConstruct; import javax.inject.Inject; -import javax.inject.Named; import java.util.Date; /** @@ -52,7 +51,7 @@ import java.util.Date; * * @version $Id$ */ -@Service("taskExecutor#repository-scanning") +@Service( "taskExecutor#repository-scanning" ) public class ArchivaRepositoryScanningTaskExecutor implements TaskExecutor, Initializable { @@ -62,13 +61,10 @@ public class ArchivaRepositoryScanningTaskExecutor * */ @Inject - @Named(value="archivaConfiguration#default") - private ArchivaConfiguration archivaConfiguration; + private ManagedRepositoryAdmin managedRepositoryAdmin; /** * The repository scanner component. - * - * */ @Inject private RepositoryScanner repoScanner; @@ -89,7 +85,6 @@ public class ArchivaRepositoryScanningTaskExecutor /** * TODO: may be different implementations - * */ @Inject private RepositorySessionFactory repositorySessionFactory; @@ -105,102 +100,109 @@ public class ArchivaRepositoryScanningTaskExecutor public void executeTask( Task task ) throws TaskExecutionException { - - // TODO: replace this whole class with the prescribed content scanning service/action - // - scan repository for artifacts that do not have corresponding metadata or have been updated and - // send events for each - // - scan metadata for artifacts that have been removed and send events for each - // - scan metadata for missing plugin data - // - store information so that it can restart upon failure (publish event on the server recovery - // queue, remove it on successful completion) - - this.task = task; - - RepositoryTask repoTask = (RepositoryTask) task; - - String repoId = repoTask.getRepositoryId(); - if ( StringUtils.isBlank( repoId ) ) + try { - throw new TaskExecutionException( "Unable to execute RepositoryTask with blank repository Id." ); - } + // TODO: replace this whole class with the prescribed content scanning service/action + // - scan repository for artifacts that do not have corresponding metadata or have been updated and + // send events for each + // - scan metadata for artifacts that have been removed and send events for each + // - scan metadata for missing plugin data + // - store information so that it can restart upon failure (publish event on the server recovery + // queue, remove it on successful completion) - ManagedRepositoryConfiguration arepo = archivaConfiguration.getConfiguration().findManagedRepositoryById( - repoId ); + this.task = task; - // execute consumers on resource file if set - if ( repoTask.getResourceFile() != null ) - { - log.debug( "Executing task from queue with job name: {}", repoTask ); - consumers.executeConsumers( arepo, repoTask.getResourceFile(), repoTask.isUpdateRelatedArtifacts() ); - } - else - { - log.info( "Executing task from queue with job name: {}", repoTask ); + RepositoryTask repoTask = (RepositoryTask) task; - // otherwise, execute consumers on whole repository - if ( arepo == null ) + String repoId = repoTask.getRepositoryId(); + if ( StringUtils.isBlank( repoId ) ) { - throw new TaskExecutionException( - "Unable to execute RepositoryTask with invalid repository id: " + repoId ); + throw new TaskExecutionException( "Unable to execute RepositoryTask with blank repository Id." ); } - long sinceWhen = RepositoryScanner.FRESH_SCAN; - long previousFileCount = 0; + ManagedRepository arepo = managedRepositoryAdmin.getManagedRepository( repoId ); - RepositorySession repositorySession = repositorySessionFactory.createSession(); - MetadataRepository metadataRepository = repositorySession.getRepository(); - try + // execute consumers on resource file if set + if ( repoTask.getResourceFile() != null ) + { + log.debug( "Executing task from queue with job name: {}", repoTask ); + consumers.executeConsumers( arepo, repoTask.getResourceFile(), repoTask.isUpdateRelatedArtifacts() ); + } + else { - if ( !repoTask.isScanAll() ) + log.info( "Executing task from queue with job name: {}", repoTask ); + + // otherwise, execute consumers on whole repository + if ( arepo == null ) { - RepositoryStatistics previousStats = repositoryStatisticsManager.getLastStatistics( - metadataRepository, repoId ); - if ( previousStats != null ) - { - sinceWhen = previousStats.getScanStartTime().getTime(); - previousFileCount = previousStats.getTotalFileCount(); - } + throw new TaskExecutionException( + "Unable to execute RepositoryTask with invalid repository id: " + repoId ); } - RepositoryScanStatistics stats; + long sinceWhen = RepositoryScanner.FRESH_SCAN; + long previousFileCount = 0; + + RepositorySession repositorySession = repositorySessionFactory.createSession(); + MetadataRepository metadataRepository = repositorySession.getRepository(); try { - stats = repoScanner.scan( arepo, sinceWhen ); - } - catch ( RepositoryScannerException e ) - { - throw new TaskExecutionException( "Repository error when executing repository job.", e ); - } + if ( !repoTask.isScanAll() ) + { + RepositoryStatistics previousStats = + repositoryStatisticsManager.getLastStatistics( metadataRepository, repoId ); + if ( previousStats != null ) + { + sinceWhen = previousStats.getScanStartTime().getTime(); + previousFileCount = previousStats.getTotalFileCount(); + } + } + + RepositoryScanStatistics stats; + try + { + stats = repoScanner.scan( arepo, sinceWhen ); + } + catch ( RepositoryScannerException e ) + { + throw new TaskExecutionException( "Repository error when executing repository job.", e ); + } - log.info( "Finished first scan: " + stats.toDump( arepo ) ); + log.info( "Finished first scan: {}", stats.toDump( arepo ) ); - // further statistics will be populated by the following method - Date endTime = new Date( stats.getWhenGathered().getTime() + stats.getDuration() ); + // further statistics will be populated by the following method + Date endTime = new Date( stats.getWhenGathered().getTime() + stats.getDuration() ); - log.info( "Gathering repository statistics" ); + log.info( "Gathering repository statistics" ); - repositoryStatisticsManager.addStatisticsAfterScan( metadataRepository, repoId, stats.getWhenGathered(), - endTime, stats.getTotalFileCount(), - stats.getTotalFileCount() - previousFileCount ); - repositorySession.save(); - } - catch ( MetadataRepositoryException e ) - { - throw new TaskExecutionException( "Unable to store updated statistics: " + e.getMessage(), e ); - } - finally - { - repositorySession.close(); - } + repositoryStatisticsManager.addStatisticsAfterScan( metadataRepository, repoId, + stats.getWhenGathered(), endTime, + stats.getTotalFileCount(), + stats.getTotalFileCount() - previousFileCount ); + repositorySession.save(); + } + catch ( MetadataRepositoryException e ) + { + throw new TaskExecutionException( "Unable to store updated statistics: " + e.getMessage(), e ); + } + finally + { + repositorySession.close(); + } // log.info( "Scanning for removed repository content" ); // metadataRepository.findAllProjects(); - // FIXME: do something + // FIXME: do something - log.info( "Finished repository task: {}", repoTask ); + log.info( "Finished repository task: {}", repoTask ); - this.task = null; + this.task = null; + } + } + catch ( RepositoryAdminException e ) + { + log.error( e.getMessage(), e ); + throw new TaskExecutionException( e.getMessage(), e ); } } @@ -209,16 +211,6 @@ public class ArchivaRepositoryScanningTaskExecutor return task; } - public ArchivaConfiguration getArchivaConfiguration() - { - return archivaConfiguration; - } - - public void setArchivaConfiguration( ArchivaConfiguration archivaConfiguration ) - { - this.archivaConfiguration = archivaConfiguration; - } - public RepositoryScanner getRepoScanner() { return repoScanner; @@ -258,4 +250,14 @@ 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/MockArchivaAdministration.java b/archiva-modules/archiva-scheduler/archiva-scheduler-repository/src/test/java/org/apache/archiva/mock/MockArchivaAdministration.java new file mode 100644 index 000000000..9065f9e4c --- /dev/null +++ b/archiva-modules/archiva-scheduler/archiva-scheduler-repository/src/test/java/org/apache/archiva/mock/MockArchivaAdministration.java @@ -0,0 +1,166 @@ +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.admin.ArchivaAdministration; +import org.apache.archiva.admin.model.admin.FileType; +import org.apache.archiva.admin.model.admin.LegacyArtifactPath; +import org.apache.archiva.admin.model.admin.OrganisationInformation; +import org.apache.maven.archiva.configuration.ArchivaConfiguration; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; + +/** + * @author Olivier Lamy + */ +public class MockArchivaAdministration + implements ArchivaAdministration +{ + private ArchivaConfiguration archivaConfiguration; + + public List getLegacyArtifactPaths() + throws RepositoryAdminException + { + return null; //To change body of implemented methods use File | Settings | File Templates. + } + + public void addLegacyArtifactPath( LegacyArtifactPath legacyArtifactPath, AuditInformation auditInformation ) + throws RepositoryAdminException + { + //To change body of implemented methods use File | Settings | File Templates. + } + + public void deleteLegacyArtifactPath( String path, AuditInformation auditInformation ) + throws RepositoryAdminException + { + //To change body of implemented methods use File | Settings | File Templates. + } + + public void addFileTypePattern( String fileTypeId, String pattern, AuditInformation auditInformation ) + throws RepositoryAdminException + { + //To change body of implemented methods use File | Settings | File Templates. + } + + public void removeFileTypePattern( String fileTypeId, String pattern, AuditInformation auditInformation ) + throws RepositoryAdminException + { + //To change body of implemented methods use File | Settings | File Templates. + } + + public List getFileTypes() + throws RepositoryAdminException + { + return null; //To change body of implemented methods use File | Settings | File Templates. + } + + public FileType getFileType( String fileTypeId ) + throws RepositoryAdminException + { + return null; //To change body of implemented methods use File | Settings | File Templates. + } + + public void addFileType( FileType fileType, AuditInformation auditInformation ) + throws RepositoryAdminException + { + //To change body of implemented methods use File | Settings | File Templates. + } + + public void removeFileType( String fileTypeId, AuditInformation auditInformation ) + throws RepositoryAdminException + { + //To change body of implemented methods use File | Settings | File Templates. + } + + public void addKnownContentConsumer( String knownContentConsumer, AuditInformation auditInformation ) + throws RepositoryAdminException + { + //To change body of implemented methods use File | Settings | File Templates. + } + + public void setKnownContentConsumers( List knownContentConsumers, AuditInformation auditInformation ) + throws RepositoryAdminException + { + //To change body of implemented methods use File | Settings | File Templates. + } + + public List getKnownContentConsumers() + throws RepositoryAdminException + { + return new ArrayList( + getArchivaConfiguration().getConfiguration().getRepositoryScanning().getKnownContentConsumers() ); + } + + public void removeKnownContentConsumer( String knownContentConsumer, AuditInformation auditInformation ) + throws RepositoryAdminException + { + //To change body of implemented methods use File | Settings | File Templates. + } + + public void addInvalidContentConsumer( String invalidContentConsumer, AuditInformation auditInformation ) + throws RepositoryAdminException + { + //To change body of implemented methods use File | Settings | File Templates. + } + + public void setInvalidContentConsumers( List invalidContentConsumers, AuditInformation auditInformation ) + throws RepositoryAdminException + { + //To change body of implemented methods use File | Settings | File Templates. + } + + public List getInvalidContentConsumers() + throws RepositoryAdminException + { + return new ArrayList( + getArchivaConfiguration().getConfiguration().getRepositoryScanning().getInvalidContentConsumers() ); + } + + public void removeInvalidContentConsumer( String invalidContentConsumer, AuditInformation auditInformation ) + throws RepositoryAdminException + { + //To change body of implemented methods use File | Settings | File Templates. + } + + public OrganisationInformation getOrganisationInformation() + throws RepositoryAdminException + { + return null; //To change body of implemented methods use File | Settings | File Templates. + } + + public void setOrganisationInformation( OrganisationInformation organisationInformation ) + throws RepositoryAdminException + { + //To change body of implemented methods use File | Settings | File Templates. + } + + public ArchivaConfiguration getArchivaConfiguration() + { + return archivaConfiguration; + } + + public void setArchivaConfiguration( ArchivaConfiguration archivaConfiguration ) + { + this.archivaConfiguration = archivaConfiguration; + } +} 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 new file mode 100644 index 000000000..d516aa61a --- /dev/null +++ b/archiva-modules/archiva-scheduler/archiva-scheduler-repository/src/test/java/org/apache/archiva/mock/MockManagedRepositoryAdmin.java @@ -0,0 +1,116 @@ +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.managed.ManagedRepository; +import org.apache.archiva.admin.model.managed.ManagedRepositoryAdmin; +import org.apache.commons.lang.StringUtils; +import org.apache.maven.archiva.configuration.ArchivaConfiguration; +import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +/** + * @author Olivier Lamy + */ +public class MockManagedRepositoryAdmin + implements ManagedRepositoryAdmin +{ + private ArchivaConfiguration archivaConfiguration; + + public List getManagedRepositories() + throws RepositoryAdminException + { + List managedRepoConfigs = + getArchivaConfiguration().getConfiguration().getManagedRepositories(); + + List managedRepos = new ArrayList( managedRepoConfigs.size() ); + + for ( ManagedRepositoryConfiguration repoConfig : managedRepoConfigs ) + { + // TODO add staging repo information back too + ManagedRepository repo = + new ManagedRepository( repoConfig.getId(), repoConfig.getName(), repoConfig.getLocation(), + repoConfig.getLayout(), repoConfig.isSnapshots(), repoConfig.isReleases(), + repoConfig.isBlockRedeployments(), repoConfig.getRefreshCronExpression(), + repoConfig.getIndexDir(), repoConfig.isScanned(), repoConfig.getDaysOlder(), + repoConfig.getRetentionCount(), repoConfig.isDeleteReleasedSnapshots() ); + + managedRepos.add( repo ); + } + + return managedRepos; + } + + public Map getManagedRepositoriesAsMap() + throws RepositoryAdminException + { + return null; + } + + public ManagedRepository getManagedRepository( String repositoryId ) + throws RepositoryAdminException + { + List repos = getManagedRepositories(); + for ( ManagedRepository repo : repos ) + { + if ( StringUtils.equals( repo.getId(), repositoryId ) ) + { + return repo; + } + } + return null; + } + + public Boolean deleteManagedRepository( String repositoryId, AuditInformation auditInformation, + boolean deleteContent ) + throws RepositoryAdminException + { + return null; + } + + public Boolean addManagedRepository( ManagedRepository managedRepository, boolean needStageRepo, + AuditInformation auditInformation ) + throws RepositoryAdminException + { + return null; + } + + 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; + } +} diff --git a/archiva-modules/archiva-scheduler/archiva-scheduler-repository/src/test/java/org/apache/archiva/mock/MockRemoteRepositoryAdmin.java b/archiva-modules/archiva-scheduler/archiva-scheduler-repository/src/test/java/org/apache/archiva/mock/MockRemoteRepositoryAdmin.java new file mode 100644 index 000000000..0c842f3b4 --- /dev/null +++ b/archiva-modules/archiva-scheduler/archiva-scheduler-repository/src/test/java/org/apache/archiva/mock/MockRemoteRepositoryAdmin.java @@ -0,0 +1,84 @@ +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.remote.RemoteRepository; +import org.apache.archiva.admin.model.remote.RemoteRepositoryAdmin; +import org.apache.maven.archiva.configuration.ArchivaConfiguration; +import org.springframework.stereotype.Service; + +import java.util.List; +import java.util.Map; + +/** + * @author Olivier Lamy + */ +public class MockRemoteRepositoryAdmin + implements RemoteRepositoryAdmin +{ + private ArchivaConfiguration archivaConfiguration; + + public List getRemoteRepositories() + throws RepositoryAdminException + { + return null; //To change body of implemented methods use File | Settings | File Templates. + } + + public RemoteRepository getRemoteRepository( String repositoryId ) + throws RepositoryAdminException + { + return null; //To change body of implemented methods use File | Settings | File Templates. + } + + public Boolean deleteRemoteRepository( String repositoryId, AuditInformation auditInformation ) + throws RepositoryAdminException + { + return null; //To change body of implemented methods use File | Settings | File Templates. + } + + public Boolean addRemoteRepository( RemoteRepository remoteRepository, AuditInformation auditInformation ) + throws RepositoryAdminException + { + return null; //To change body of implemented methods use File | Settings | File Templates. + } + + public Boolean updateRemoteRepository( RemoteRepository remoteRepository, AuditInformation auditInformation ) + throws RepositoryAdminException + { + return null; //To change body of implemented methods use File | Settings | File Templates. + } + + public Map getRemoteRepositoriesAsMap() + throws RepositoryAdminException + { + return null; //To change body of implemented methods use File | Settings | File Templates. + } + + public ArchivaConfiguration getArchivaConfiguration() + { + return archivaConfiguration; + } + + public void setArchivaConfiguration( ArchivaConfiguration archivaConfiguration ) + { + this.archivaConfiguration = archivaConfiguration; + } +} diff --git a/archiva-modules/archiva-scheduler/archiva-scheduler-repository/src/test/java/org/apache/archiva/scheduler/repository/TestConsumer.java b/archiva-modules/archiva-scheduler/archiva-scheduler-repository/src/test/java/org/apache/archiva/scheduler/repository/TestConsumer.java index 681b3827d..37356aa48 100644 --- a/archiva-modules/archiva-scheduler/archiva-scheduler-repository/src/test/java/org/apache/archiva/scheduler/repository/TestConsumer.java +++ b/archiva-modules/archiva-scheduler/archiva-scheduler-repository/src/test/java/org/apache/archiva/scheduler/repository/TestConsumer.java @@ -19,7 +19,7 @@ package org.apache.archiva.scheduler.repository; * under the License. */ -import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration; +import org.apache.archiva.admin.model.managed.ManagedRepository; import org.apache.maven.archiva.consumers.AbstractMonitoredConsumer; import org.apache.maven.archiva.consumers.ConsumerException; import org.apache.maven.archiva.consumers.KnownRepositoryContentConsumer; @@ -31,7 +31,6 @@ import org.apache.maven.archiva.repository.layout.LayoutException; import org.springframework.stereotype.Service; import javax.inject.Inject; -import javax.inject.Named; import java.util.Collection; import java.util.Collections; import java.util.Date; @@ -76,7 +75,7 @@ public class TestConsumer return null; } - public void beginScan( ManagedRepositoryConfiguration repository, Date whenGathered ) + public void beginScan( ManagedRepository repository, Date whenGathered ) throws ConsumerException { consumed.clear(); @@ -91,7 +90,7 @@ public class TestConsumer } } - public void beginScan( ManagedRepositoryConfiguration repository, Date whenGathered, boolean executeOnEntireRepo ) + public void beginScan( ManagedRepository repository, Date whenGathered, boolean executeOnEntireRepo ) throws ConsumerException { beginScan( repository, whenGathered ); diff --git a/archiva-modules/archiva-scheduler/archiva-scheduler-repository/src/test/resources/spring-context.xml b/archiva-modules/archiva-scheduler/archiva-scheduler-repository/src/test/resources/spring-context.xml index 8b0a94cb7..9074757aa 100755 --- a/archiva-modules/archiva-scheduler/archiva-scheduler-repository/src/test/resources/spring-context.xml +++ b/archiva-modules/archiva-scheduler/archiva-scheduler-repository/src/test/resources/spring-context.xml @@ -30,10 +30,22 @@ - + + + + + + + + + + + + + diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/model/Artifact.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/model/Artifact.java index a98585291..e24666d92 100644 --- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/model/Artifact.java +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/model/Artifact.java @@ -36,7 +36,36 @@ public class Artifact private String type; - //private Date whenGathered; + private String url; + + /** + * contains osgi metadata Bundle-Version if available + * + * @since 1.4 + */ + private String bundleVersion; + + /** + * contains osgi metadata Bundle-SymbolicName if available + * + * @since 1.4 + */ + private String bundleSymbolicName; + + /** + * contains osgi metadata Export-Package if available + * + * @since 1.4 + */ + private String bundleExportPackage; + + /** + * contains osgi metadata Export-Service if available + * + * @since 1.4 + */ + private String bundleExportService; + public Artifact() { diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/model/ManagedRepository.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/model/ManagedRepository.java index 57a9917cc..85d903a28 100644 --- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/model/ManagedRepository.java +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/model/ManagedRepository.java @@ -45,10 +45,13 @@ public class ManagedRepository private boolean stageRepoNeeded; - private String cronExpression; + // default value + private String cronExpression = "0 0 * * * ?"; private boolean resetStats; + private boolean scanned =false; + public ManagedRepository() { // no op @@ -173,6 +176,16 @@ public class ManagedRepository this.resetStats = resetStats; } + public boolean isScanned() + { + return scanned; + } + + public void setScanned( boolean scanned ) + { + this.scanned = scanned; + } + public int hashCode() { int result = 17; @@ -205,14 +218,15 @@ public class ManagedRepository sb.append( "ManagedRepository" ); sb.append( "{id='" ).append( id ).append( '\'' ); sb.append( ", name='" ).append( name ).append( '\'' ); - sb.append( ", location='" ).append( location ).append( '\'' ); sb.append( ", layout='" ).append( layout ).append( '\'' ); + sb.append( ", location='" ).append( location ).append( '\'' ); sb.append( ", snapshots=" ).append( snapshots ); sb.append( ", releases=" ).append( releases ); sb.append( ", blockRedeployments=" ).append( blockRedeployments ); sb.append( ", stageRepoNeeded=" ).append( stageRepoNeeded ); sb.append( ", cronExpression='" ).append( cronExpression ).append( '\'' ); sb.append( ", resetStats=" ).append( resetStats ); + sb.append( ", scanned=" ).append( scanned ); sb.append( '}' ); return sb.toString(); } diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/pom.xml b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/pom.xml index 0f19a4681..0055e3f77 100644 --- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/pom.xml +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/pom.xml @@ -39,7 +39,7 @@ org.apache.archiva - archiva-repository-admin + archiva-repository-admin-api org.apache.archiva @@ -54,6 +54,10 @@ org.apache.archiva archiva-scheduler-repository + + org.apache.archiva + archiva-indexer + org.codehaus.redback redback-authorization-api @@ -212,6 +216,12 @@ test + + org.apache.archiva + archiva-repository-admin-default + test + + @@ -234,6 +244,7 @@ ${project.build.outputDirectory} ${basedir}/target/appserver-base + ${basedir}/target/ diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/AbstractRestService.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/AbstractRestService.java index 469f1e0c5..dc968434a 100644 --- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/AbstractRestService.java +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/AbstractRestService.java @@ -18,7 +18,7 @@ package org.apache.archiva.rest.services; * under the License. */ -import org.apache.archiva.admin.AuditInformation; +import org.apache.archiva.admin.model.AuditInformation; import org.apache.archiva.audit.AuditListener; import org.codehaus.plexus.redback.users.User; import org.codehaus.redback.rest.services.RedbackAuthenticationThreadLocal; diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultArchivaAdministrationService.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultArchivaAdministrationService.java index 522779395..c95ccbd7f 100644 --- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultArchivaAdministrationService.java +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultArchivaAdministrationService.java @@ -19,8 +19,8 @@ package org.apache.archiva.rest.services; */ import net.sf.beanlib.provider.replicator.BeanReplicator; -import org.apache.archiva.admin.repository.RepositoryAdminException; -import org.apache.archiva.admin.repository.admin.ArchivaAdministration; +import org.apache.archiva.admin.model.RepositoryAdminException; +import org.apache.archiva.admin.model.admin.ArchivaAdministration; import org.apache.archiva.rest.api.model.FileType; import org.apache.archiva.rest.api.model.LegacyArtifactPath; import org.apache.archiva.rest.api.model.OrganisationInformation; @@ -51,7 +51,7 @@ public class DefaultArchivaAdministrationService try { List legacyArtifactPaths = new ArrayList(); - for ( org.apache.archiva.admin.repository.admin.LegacyArtifactPath legacyArtifactPath : archivaAdministration.getLegacyArtifactPaths() ) + for ( org.apache.archiva.admin.model.admin.LegacyArtifactPath legacyArtifactPath : archivaAdministration.getLegacyArtifactPaths() ) { legacyArtifactPaths.add( new BeanReplicator().replicateBean( legacyArtifactPath, LegacyArtifactPath.class ) ); @@ -70,7 +70,7 @@ public class DefaultArchivaAdministrationService try { archivaAdministration.addLegacyArtifactPath( new BeanReplicator().replicateBean( legacyArtifactPath, - org.apache.archiva.admin.repository.admin.LegacyArtifactPath.class ), + org.apache.archiva.admin.model.admin.LegacyArtifactPath.class ), getAuditInformation() ); } catch ( RepositoryAdminException e ) @@ -127,8 +127,7 @@ public class DefaultArchivaAdministrationService { try { - org.apache.archiva.admin.repository.admin.FileType fileType = - archivaAdministration.getFileType( fileTypeId ); + org.apache.archiva.admin.model.admin.FileType fileType = archivaAdministration.getFileType( fileTypeId ); if ( fileType == null ) { return null; @@ -146,9 +145,9 @@ public class DefaultArchivaAdministrationService { try { - archivaAdministration.addFileType( new BeanReplicator().replicateBean( fileType, - org.apache.archiva.admin.repository.admin.FileType.class ), - getAuditInformation() ); + archivaAdministration.addFileType( + new BeanReplicator().replicateBean( fileType, org.apache.archiva.admin.model.admin.FileType.class ), + getAuditInformation() ); } catch ( RepositoryAdminException e ) { @@ -257,14 +256,13 @@ public class DefaultArchivaAdministrationService { try { - List modelfileTypes = - archivaAdministration.getFileTypes(); + List modelfileTypes = archivaAdministration.getFileTypes(); if ( modelfileTypes == null || modelfileTypes.isEmpty() ) { return Collections.emptyList(); } List fileTypes = new ArrayList( modelfileTypes.size() ); - for ( org.apache.archiva.admin.repository.admin.FileType fileType : modelfileTypes ) + for ( org.apache.archiva.admin.model.admin.FileType fileType : modelfileTypes ) { fileTypes.add( new BeanReplicator().replicateBean( fileType, FileType.class ) ); } @@ -307,7 +305,7 @@ public class DefaultArchivaAdministrationService { try { - org.apache.archiva.admin.repository.admin.OrganisationInformation organisationInformation = + org.apache.archiva.admin.model.admin.OrganisationInformation organisationInformation = archivaAdministration.getOrganisationInformation(); return organisationInformation == null @@ -333,7 +331,7 @@ public class DefaultArchivaAdministrationService { archivaAdministration.setOrganisationInformation( new BeanReplicator().replicateBean( organisationInformation, - org.apache.archiva.admin.repository.admin.OrganisationInformation.class ) ); + org.apache.archiva.admin.model.admin.OrganisationInformation.class ) ); } } catch ( RepositoryAdminException e ) diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultManagedRepositoriesService.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultManagedRepositoriesService.java index f473abc58..f2fa197d4 100644 --- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultManagedRepositoriesService.java +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultManagedRepositoriesService.java @@ -18,8 +18,8 @@ package org.apache.archiva.rest.services; * under the License. */ -import org.apache.archiva.admin.repository.RepositoryAdminException; -import org.apache.archiva.admin.repository.managed.ManagedRepositoryAdmin; +import org.apache.archiva.admin.model.RepositoryAdminException; +import org.apache.archiva.admin.model.managed.ManagedRepositoryAdmin; import org.apache.archiva.rest.api.model.ManagedRepository; import org.apache.archiva.rest.api.services.ArchivaRestServiceException; import org.apache.archiva.rest.api.services.ManagedRepositoriesService; @@ -48,12 +48,12 @@ public class DefaultManagedRepositoriesService { try { - List repos = + List repos = managedRepositoryAdmin.getManagedRepositories(); List managedRepos = new ArrayList( repos.size() ); - for ( org.apache.archiva.admin.repository.managed.ManagedRepository repoConfig : repos ) + for ( org.apache.archiva.admin.model.managed.ManagedRepository repoConfig : repos ) { // TODO staging repo too ManagedRepository repo = @@ -96,8 +96,8 @@ public class DefaultManagedRepositoriesService public Boolean addManagedRepository( ManagedRepository managedRepository ) throws Exception { - org.apache.archiva.admin.repository.managed.ManagedRepository repo = - new org.apache.archiva.admin.repository.managed.ManagedRepository(); + org.apache.archiva.admin.model.managed.ManagedRepository repo = + new org.apache.archiva.admin.model.managed.ManagedRepository(); repo.setLocation( managedRepository.getLocation() ); repo.setBlockRedeployments( managedRepository.isBlockRedeployments() ); repo.setCronExpression( managedRepository.getCronExpression() ); @@ -114,8 +114,8 @@ public class DefaultManagedRepositoriesService public Boolean updateManagedRepository( ManagedRepository managedRepository ) throws Exception { - org.apache.archiva.admin.repository.managed.ManagedRepository repo = - new org.apache.archiva.admin.repository.managed.ManagedRepository(); + org.apache.archiva.admin.model.managed.ManagedRepository repo = + new org.apache.archiva.admin.model.managed.ManagedRepository(); repo.setLocation( managedRepository.getLocation() ); repo.setBlockRedeployments( managedRepository.isBlockRedeployments() ); repo.setCronExpression( managedRepository.getCronExpression() ); diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultNetworkProxyService.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultNetworkProxyService.java index 5e23c9ff0..011dda6dc 100644 --- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultNetworkProxyService.java +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultNetworkProxyService.java @@ -19,8 +19,8 @@ package org.apache.archiva.rest.services; */ import net.sf.beanlib.provider.replicator.BeanReplicator; -import org.apache.archiva.admin.repository.RepositoryAdminException; -import org.apache.archiva.admin.repository.networkproxy.NetworkProxyAdmin; +import org.apache.archiva.admin.model.RepositoryAdminException; +import org.apache.archiva.admin.model.networkproxy.NetworkProxyAdmin; import org.apache.archiva.rest.api.model.NetworkProxy; import org.apache.archiva.rest.api.services.ArchivaRestServiceException; import org.apache.archiva.rest.api.services.NetworkProxyService; @@ -47,7 +47,7 @@ public class DefaultNetworkProxyService try { List networkProxies = new ArrayList(); - for ( org.apache.archiva.admin.repository.networkproxy.NetworkProxy networkProxy : networkProxyAdmin.getNetworkProxies() ) + for ( org.apache.archiva.admin.model.networkproxy.NetworkProxy networkProxy : networkProxyAdmin.getNetworkProxies() ) { networkProxies.add( new BeanReplicator().replicateBean( networkProxy, NetworkProxy.class ) ); } @@ -64,7 +64,7 @@ public class DefaultNetworkProxyService { try { - org.apache.archiva.admin.repository.networkproxy.NetworkProxy networkProxy = + org.apache.archiva.admin.model.networkproxy.NetworkProxy networkProxy = networkProxyAdmin.getNetworkProxy( networkProxyId ); return networkProxy == null ? null : new BeanReplicator().replicateBean( networkProxy, NetworkProxy.class ); } @@ -84,7 +84,7 @@ public class DefaultNetworkProxyService return; } getNetworkProxyAdmin().addNetworkProxy( new BeanReplicator().replicateBean( networkProxy, - org.apache.archiva.admin.repository.networkproxy.NetworkProxy.class ), + org.apache.archiva.admin.model.networkproxy.NetworkProxy.class ), getAuditInformation() ); } catch ( RepositoryAdminException e ) @@ -103,7 +103,7 @@ public class DefaultNetworkProxyService try { getNetworkProxyAdmin().updateNetworkProxy( new BeanReplicator().replicateBean( networkProxy, - org.apache.archiva.admin.repository.networkproxy.NetworkProxy.class ), + org.apache.archiva.admin.model.networkproxy.NetworkProxy.class ), getAuditInformation() ); } catch ( RepositoryAdminException e ) diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultProxyConnectorService.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultProxyConnectorService.java index 24087aa06..30e2ab8ae 100644 --- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultProxyConnectorService.java +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultProxyConnectorService.java @@ -19,8 +19,8 @@ package org.apache.archiva.rest.services; */ import net.sf.beanlib.provider.replicator.BeanReplicator; -import org.apache.archiva.admin.repository.RepositoryAdminException; -import org.apache.archiva.admin.repository.proxyconnector.ProxyConnectorAdmin; +import org.apache.archiva.admin.model.RepositoryAdminException; +import org.apache.archiva.admin.model.proxyconnector.ProxyConnectorAdmin; import org.apache.archiva.rest.api.model.ProxyConnector; import org.apache.archiva.rest.api.services.ArchivaRestServiceException; import org.apache.archiva.rest.api.services.ProxyConnectorService; @@ -47,7 +47,7 @@ public class DefaultProxyConnectorService try { List proxyConnectors = new ArrayList(); - for ( org.apache.archiva.admin.repository.proxyconnector.ProxyConnector proxyConnector : proxyConnectorAdmin.getProxyConnectors() ) + for ( org.apache.archiva.admin.model.proxyconnector.ProxyConnector proxyConnector : proxyConnectorAdmin.getProxyConnectors() ) { proxyConnectors.add( new BeanReplicator().replicateBean( proxyConnector, ProxyConnector.class ) ); } @@ -64,7 +64,7 @@ public class DefaultProxyConnectorService { try { - org.apache.archiva.admin.repository.proxyconnector.ProxyConnector proxyConnector = + org.apache.archiva.admin.model.proxyconnector.ProxyConnector proxyConnector = proxyConnectorAdmin.getProxyConnector( sourceRepoId, targetRepoId ); return proxyConnector == null ? null @@ -86,7 +86,7 @@ public class DefaultProxyConnectorService try { return proxyConnectorAdmin.addProxyConnector( new BeanReplicator().replicateBean( proxyConnector, - org.apache.archiva.admin.repository.proxyconnector.ProxyConnector.class ), + org.apache.archiva.admin.model.proxyconnector.ProxyConnector.class ), getAuditInformation() ); } catch ( RepositoryAdminException e ) @@ -105,7 +105,7 @@ public class DefaultProxyConnectorService try { return proxyConnectorAdmin.deleteProxyConnector( new BeanReplicator().replicateBean( proxyConnector, - org.apache.archiva.admin.repository.proxyconnector.ProxyConnector.class ), + org.apache.archiva.admin.model.proxyconnector.ProxyConnector.class ), getAuditInformation() ); } catch ( RepositoryAdminException e ) @@ -124,7 +124,7 @@ public class DefaultProxyConnectorService try { return proxyConnectorAdmin.updateProxyConnector( new BeanReplicator().replicateBean( proxyConnector, - org.apache.archiva.admin.repository.proxyconnector.ProxyConnector.class ), + org.apache.archiva.admin.model.proxyconnector.ProxyConnector.class ), getAuditInformation() ); } catch ( RepositoryAdminException e ) diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultRemoteRepositoriesService.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultRemoteRepositoriesService.java index 9f3eeeb8d..9dbd068eb 100644 --- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultRemoteRepositoriesService.java +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultRemoteRepositoriesService.java @@ -18,8 +18,8 @@ package org.apache.archiva.rest.services; * under the License. */ -import org.apache.archiva.admin.repository.RepositoryAdminException; -import org.apache.archiva.admin.repository.remote.RemoteRepositoryAdmin; +import org.apache.archiva.admin.model.RepositoryAdminException; +import org.apache.archiva.admin.model.remote.RemoteRepositoryAdmin; import org.apache.archiva.rest.api.model.RemoteRepository; import org.apache.archiva.rest.api.services.ArchivaRestServiceException; import org.apache.archiva.rest.api.services.RemoteRepositoriesService; @@ -49,7 +49,7 @@ public class DefaultRemoteRepositoriesService try { List remoteRepositories = new ArrayList(); - for ( org.apache.archiva.admin.repository.remote.RemoteRepository remoteRepository : remoteRepositoryAdmin.getRemoteRepositories() ) + for ( org.apache.archiva.admin.model.remote.RemoteRepository remoteRepository : remoteRepositoryAdmin.getRemoteRepositories() ) { RemoteRepository repo = new RemoteRepository( remoteRepository.getId(), remoteRepository.getName(), remoteRepository.getUrl(), remoteRepository.getLayout(), @@ -100,15 +100,15 @@ public class DefaultRemoteRepositoriesService getAuditInformation() ); } - private org.apache.archiva.admin.repository.remote.RemoteRepository getModelRemoteRepository( + private org.apache.archiva.admin.model.remote.RemoteRepository getModelRemoteRepository( RemoteRepository remoteRepository ) { - return new org.apache.archiva.admin.repository.remote.RemoteRepository( remoteRepository.getId(), - remoteRepository.getName(), - remoteRepository.getUrl(), - remoteRepository.getLayout(), - remoteRepository.getUserName(), - remoteRepository.getPassword(), - remoteRepository.getTimeOut() ); + return new org.apache.archiva.admin.model.remote.RemoteRepository( remoteRepository.getId(), + remoteRepository.getName(), + remoteRepository.getUrl(), + remoteRepository.getLayout(), + remoteRepository.getUserName(), + remoteRepository.getPassword(), + remoteRepository.getTimeOut() ); } } diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultRepositoriesService.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultRepositoriesService.java index 26048fcff..2475ff809 100644 --- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultRepositoriesService.java +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultRepositoriesService.java @@ -19,14 +19,10 @@ package org.apache.archiva.rest.services; * under the License. */ -import org.apache.archiva.admin.repository.managed.ManagedRepositoryAdmin; -import org.apache.archiva.metadata.repository.RepositorySessionFactory; -import org.apache.archiva.metadata.repository.stats.RepositoryStatisticsManager; import org.apache.archiva.rest.api.services.RepositoriesService; import org.apache.archiva.scheduler.repository.RepositoryArchivaTaskScheduler; import org.apache.archiva.scheduler.repository.RepositoryTask; import org.codehaus.plexus.redback.role.RoleManager; -import org.codehaus.plexus.registry.Registry; import org.codehaus.plexus.taskqueue.TaskQueueException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultRepositoryGroupService.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultRepositoryGroupService.java index e68bdd1a8..c52a20bc6 100644 --- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultRepositoryGroupService.java +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultRepositoryGroupService.java @@ -18,8 +18,8 @@ package org.apache.archiva.rest.services; * under the License. */ -import org.apache.archiva.admin.repository.RepositoryAdminException; -import org.apache.archiva.admin.repository.group.RepositoryGroupAdmin; +import org.apache.archiva.admin.model.RepositoryAdminException; +import org.apache.archiva.admin.model.group.RepositoryGroupAdmin; import org.apache.archiva.rest.api.model.RepositoryGroup; import org.apache.archiva.rest.api.services.ArchivaRestServiceException; import org.apache.archiva.rest.api.services.RepositoryGroupService; @@ -48,7 +48,7 @@ public class DefaultRepositoryGroupService try { List repositoriesGroups = new ArrayList(); - for ( org.apache.archiva.admin.repository.group.RepositoryGroup repoGroup : repositoryGroupAdmin.getRepositoriesGroups() ) + for ( org.apache.archiva.admin.model.group.RepositoryGroup repoGroup : repositoryGroupAdmin.getRepositoriesGroups() ) { repositoriesGroups.add( new RepositoryGroup( repoGroup.getId(), new ArrayList( repoGroup.getRepositories() ) ) ); @@ -80,7 +80,7 @@ public class DefaultRepositoryGroupService try { return repositoryGroupAdmin.addRepositoryGroup( - new org.apache.archiva.admin.repository.group.RepositoryGroup( repoGroup.getId(), new ArrayList( + new org.apache.archiva.admin.model.group.RepositoryGroup( repoGroup.getId(), new ArrayList( repoGroup.getRepositories() ) ), getAuditInformation() ); } catch ( RepositoryAdminException e ) @@ -95,7 +95,7 @@ public class DefaultRepositoryGroupService try { return repositoryGroupAdmin.updateRepositoryGroup( - new org.apache.archiva.admin.repository.group.RepositoryGroup( repoGroup.getId(), new ArrayList( + new org.apache.archiva.admin.model.group.RepositoryGroup( repoGroup.getId(), new ArrayList( repoGroup.getRepositories() ) ), getAuditInformation() ); } catch ( RepositoryAdminException e ) diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultSearchService.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultSearchService.java new file mode 100644 index 000000000..a4d8cbfc8 --- /dev/null +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultSearchService.java @@ -0,0 +1,164 @@ +package org.apache.archiva.rest.services; +/* + * 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 net.sf.beanlib.provider.replicator.BeanReplicator; +import org.apache.archiva.indexer.search.RepositorySearch; +import org.apache.archiva.indexer.search.RepositorySearchException; +import org.apache.archiva.indexer.search.SearchResultHit; +import org.apache.archiva.indexer.search.SearchResultLimits; +import org.apache.archiva.indexer.search.SearchResults; +import org.apache.archiva.rest.api.model.Artifact; +import org.apache.archiva.rest.api.model.Dependency; +import org.apache.archiva.rest.api.services.ArchivaRestServiceException; +import org.apache.archiva.rest.api.services.SearchService; +import org.apache.archiva.security.AccessDeniedException; +import org.apache.archiva.security.ArchivaSecurityException; +import org.apache.archiva.security.PrincipalNotFoundException; +import org.apache.archiva.security.UserRepositories; +import org.apache.commons.lang.StringUtils; +import org.codehaus.plexus.redback.users.UserManager; +import org.codehaus.redback.rest.services.RedbackAuthenticationThreadLocal; +import org.codehaus.redback.rest.services.RedbackRequestInformation; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Service; + +import javax.inject.Inject; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +/** + * @author Olivier Lamy + */ +@Service( "searchService#rest" ) +public class DefaultSearchService + implements SearchService +{ + + private Logger log = LoggerFactory.getLogger( getClass() ); + + @Inject + private RepositorySearch repositorySearch; + + @Inject + private UserRepositories userRepositories; + + public List quickSearch( String queryString ) + throws ArchivaRestServiceException + { + if ( StringUtils.isBlank( queryString ) ) + { + return Collections.emptyList(); + } + + SearchResultLimits limits = new SearchResultLimits( 0 ); + List observableRepoIds = getObservableRepos(); + try + { + SearchResults searchResults = + repositorySearch.search( getPrincipal(), getObservableRepos(), queryString, limits, + Collections.emptyList() ); + return getArtifacts( searchResults ); + } + catch ( RepositorySearchException e ) + { + log.error( e.getMessage(), e ); + throw new ArchivaRestServiceException( e.getMessage() ); + } + } + + public List getArtifactByChecksum( String checksum ) + throws ArchivaRestServiceException + { + return null; //To change body of implemented methods use File | Settings | File Templates. + } + + public List getArtifactVersions( String groupId, String artifactId ) + throws ArchivaRestServiceException + { + return null; //To change body of implemented methods use File | Settings | File Templates. + } + + public List getDependencies( String groupId, String artifactId, String version ) + throws ArchivaRestServiceException + { + return null; //To change body of implemented methods use File | Settings | File Templates. + } + + + protected List getObservableRepos() + { + try + { + List ids = userRepositories.getObservableRepositoryIds( getPrincipal() ); + return ids == null ? Collections.emptyList() : ids; + } + catch ( PrincipalNotFoundException e ) + { + log.warn( e.getMessage(), e ); + } + catch ( AccessDeniedException e ) + { + log.warn( e.getMessage(), e ); + } + catch ( ArchivaSecurityException e ) + { + log.warn( e.getMessage(), e ); + } + return Collections.emptyList(); + } + + protected String getPrincipal() + { + RedbackRequestInformation redbackRequestInformation = RedbackAuthenticationThreadLocal.get(); + + return redbackRequestInformation == null + ? UserManager.GUEST_USERNAME + : ( redbackRequestInformation.getUser() == null + ? UserManager.GUEST_USERNAME + : redbackRequestInformation.getUser().getUsername() ); + } + + protected List getArtifacts( SearchResults searchResults ) + { + if ( searchResults == null || searchResults.isEmpty() ) + { + return Collections.emptyList(); + } + List artifacts = new ArrayList( searchResults.getReturnedHitsCount() ); + for ( SearchResultHit searchResultHit : searchResults.getHits() ) + { + Artifact artifact = new BeanReplicator().replicateBean( searchResultHit, Artifact.class ); + artifacts.add( artifact ); + // duplicate Artifact one per available version + if ( searchResultHit.getVersions().size() > 1 ) + { + for ( String version : searchResultHit.getVersions() ) + { + Artifact versionned = new BeanReplicator().replicateBean( searchResultHit, Artifact.class ); + versionned.setVersion( version ); + artifacts.add( versionned ); + } + } + } + return artifacts; + } +} diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/resources/META-INF/spring-context.xml b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/resources/META-INF/spring-context.xml index 9dbc8e677..af17b5ae3 100644 --- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/resources/META-INF/spring-context.xml +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/resources/META-INF/spring-context.xml @@ -35,9 +35,9 @@ --> - + + base-package="org.apache.archiva.rest.services"/> @@ -56,12 +56,13 @@ + - + \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/AbstractArchivaRestTest.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/AbstractArchivaRestTest.java index 79a3e8223..39fa6ae76 100644 --- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/AbstractArchivaRestTest.java +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/AbstractArchivaRestTest.java @@ -28,6 +28,7 @@ import org.apache.archiva.rest.api.services.ProxyConnectorService; import org.apache.archiva.rest.api.services.RemoteRepositoriesService; import org.apache.archiva.rest.api.services.RepositoriesService; import org.apache.archiva.rest.api.services.RepositoryGroupService; +import org.apache.archiva.rest.api.services.SearchService; import org.apache.cxf.jaxrs.client.JAXRSClientFactory; import org.apache.cxf.jaxrs.client.WebClient; import org.apache.maven.archiva.common.utils.FileUtil; @@ -52,15 +53,36 @@ public abstract class AbstractArchivaRestTest protected RepositoriesService getRepositoriesService() { - return JAXRSClientFactory.create( "http://localhost:" + port + "/services/archivaServices/", - RepositoriesService.class ); + return getRepositoriesService( null ); + } + + protected RepositoriesService getRepositoriesService( String authzHeader ) + { + RepositoriesService service = + JAXRSClientFactory.create( "http://localhost:" + port + "/services/archivaServices/", + RepositoriesService.class ); + + if ( authzHeader != null ) + { + WebClient.client( service ).header( "Authorization", authzHeader ); + } + WebClient.getConfig( service ).getHttpConduit().getClient().setReceiveTimeout( 100000000 ); + return service; } - protected ManagedRepositoriesService getManagedRepositoriesService() + protected ManagedRepositoriesService getManagedRepositoriesService( String authzHeader ) { - return JAXRSClientFactory.create( "http://localhost:" + port + "/services/archivaServices/", - ManagedRepositoriesService.class ); + ManagedRepositoriesService service = + JAXRSClientFactory.create( "http://localhost:" + port + "/services/archivaServices/", + ManagedRepositoriesService.class ); + + if ( authzHeader != null ) + { + WebClient.client( service ).header( "Authorization", authzHeader ); + } + WebClient.getConfig( service ).getHttpConduit().getClient().setReceiveTimeout( 100000000 ); + return service; } @@ -117,6 +139,20 @@ public abstract class AbstractArchivaRestTest return service; } + protected SearchService getSearchService( String authzHeader ) + { + SearchService service = + JAXRSClientFactory.create( "http://localhost:" + port + "/services/archivaServices/", SearchService.class ); + + if ( authzHeader != null ) + { + WebClient.client( service ).header( "Authorization", authzHeader ); + } + WebClient.getConfig( service ).getHttpConduit().getClient().setReceiveTimeout( 100000000 ); + return service; + + } + protected ManagedRepository getTestManagedRepository() { String location = new File( FileUtil.getBasedir(), "target/test-repo" ).getAbsolutePath(); diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/ManagedRepositoriesServiceTest.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/ManagedRepositoriesServiceTest.java index c88570687..c7acbc736 100644 --- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/ManagedRepositoriesServiceTest.java +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/ManagedRepositoriesServiceTest.java @@ -21,12 +21,8 @@ package org.apache.archiva.rest.services; import org.apache.archiva.rest.api.model.ManagedRepository; import org.apache.archiva.rest.api.services.ManagedRepositoriesService; -import org.apache.cxf.jaxrs.client.WebClient; -import org.apache.maven.archiva.common.utils.FileUtil; import org.junit.Test; -import java.io.File; - /** * @author Olivier Lamy */ @@ -39,9 +35,8 @@ public class ManagedRepositoriesServiceTest public void addManagedRepo() throws Exception { - ManagedRepositoriesService service = getManagedRepositoriesService(); - WebClient.client( service ).header( "Authorization", authorizationHeader ); - WebClient.getConfig( service ).getHttpConduit().getClient().setReceiveTimeout( 300000 ); + ManagedRepositoriesService service = getManagedRepositoriesService( authorizationHeader ); + ManagedRepository repo = getTestManagedRepository(); if ( service.getManagedRepository( repo.getId() ) != null ) { @@ -59,9 +54,8 @@ public class ManagedRepositoriesServiceTest public void updateManagedRepo() throws Exception { - ManagedRepositoriesService service = getManagedRepositoriesService(); - WebClient.client( service ).header( "Authorization", authorizationHeader ); - WebClient.getConfig( service ).getHttpConduit().getClient().setReceiveTimeout( 300000 ); + ManagedRepositoriesService service = getManagedRepositoriesService( authorizationHeader ); + ManagedRepository repo = getTestManagedRepository(); if ( service.getManagedRepository( repo.getId() ) != null ) { @@ -81,13 +75,10 @@ public class ManagedRepositoriesServiceTest assertNotNull( repo ); assertEquals( "toto", repo.getName() ); - service.deleteManagedRepository( repo.getId(), true ); assertNull( service.getManagedRepository( repo.getId() ) ); } - - } diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/RepositoriesServiceTest.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/RepositoriesServiceTest.java index a9b14cd89..faa417cc7 100644 --- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/RepositoriesServiceTest.java +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/RepositoriesServiceTest.java @@ -60,8 +60,8 @@ public class RepositoriesServiceTest WebClient.client( service ).header( "Authorization", authorizationHeader ); WebClient.getConfig( service ).getHttpConduit().getClient().setReceiveTimeout( 300000 ); - ManagedRepositoriesService managedRepositoriesService = getManagedRepositoriesService(); - WebClient.client( managedRepositoriesService ).header( "Authorization", authorizationHeader ); + ManagedRepositoriesService managedRepositoriesService = getManagedRepositoriesService( authorizationHeader ); + WebClient.getConfig( managedRepositoriesService ).getHttpConduit().getClient().setReceiveTimeout( 300000 ); String repoId = managedRepositoriesService.getManagedRepositories().get( 0 ).getId(); diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/RepositoryGroupServiceTest.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/RepositoryGroupServiceTest.java index f048da826..96a02654c 100644 --- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/RepositoryGroupServiceTest.java +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/RepositoryGroupServiceTest.java @@ -43,8 +43,8 @@ public class RepositoryGroupServiceTest assertTrue( service.getRepositoriesGroups().isEmpty() ); - ManagedRepositoriesService managedRepositoriesService = getManagedRepositoriesService(); - WebClient.client( managedRepositoriesService ).header( "Authorization", authorizationHeader ); + ManagedRepositoriesService managedRepositoriesService = getManagedRepositoriesService( authorizationHeader ); + WebClient.getConfig( service ).getHttpConduit().getClient().setReceiveTimeout( 300000 ); ManagedRepository managedRepository = getTestManagedRepository(); diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/SearchServiceTest.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/SearchServiceTest.java new file mode 100644 index 000000000..857abf5e3 --- /dev/null +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/SearchServiceTest.java @@ -0,0 +1,105 @@ +package org.apache.archiva.rest.services; +/* + * 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.rest.api.model.Artifact; +import org.apache.archiva.rest.api.model.ManagedRepository; +import org.apache.archiva.rest.api.services.ManagedRepositoriesService; +import org.apache.archiva.rest.api.services.SearchService; +import org.apache.commons.io.FileUtils; +import org.junit.Test; + +import java.io.File; +import java.util.List; + +/** + * @author Olivier Lamy + */ +public class SearchServiceTest + extends AbstractArchivaRestTest +{ + @Test + public void quickSearchOnArtifactId() + throws Exception + { + + // olamy temporary disabled due to huge refactoring + if (true) + { + return; + } + + String testRepoId = "test-repo"; + // force guest user creation if not exists + if ( getUserService( authorizationHeader ).getGuestUser() == null ) + { + assertNotNull( getUserService( authorizationHeader ).createGuestUser() ); + } + + File targetRepo = new File( System.getProperty( "targetDir", "./target" ), "test-repo" ); + + if ( targetRepo.exists() ) + { + FileUtils.deleteDirectory( targetRepo ); + } + + File sourceRepo = new File( "src/test/repo-with-osgi" ); + + FileUtils.copyDirectory( sourceRepo, targetRepo ); + + ManagedRepository managedRepository = new ManagedRepository(); + managedRepository.setId( testRepoId ); + managedRepository.setName( "test repo" ); + managedRepository.setCronExpression( "* * * * * ?" ); + + managedRepository.setLocation( targetRepo.getPath() ); + + ManagedRepositoriesService service = getManagedRepositoriesService( authorizationHeader ); + service.addManagedRepository( managedRepository ); + + getRepositoriesService( authorizationHeader ).scanRepository( testRepoId, true ); + + while ( getRepositoriesService( authorizationHeader ).alreadyScanning( testRepoId ) ) + { + Thread.sleep( 1000 ); + } + + SearchService searchService = getSearchService( authorizationHeader ); + + List artifacts = searchService.quickSearch( "commons-logging" ); + + assertNotNull( artifacts ); + assertTrue( " empty results for commons-logging search", artifacts.size() > 0 ); + log.info( "artifacts for commons-logginf search {}", artifacts ); + + deleteTestRepo( testRepoId ); + } + + private void deleteTestRepo( String id ) + throws Exception + { + if ( getManagedRepositoriesService( authorizationHeader ).getManagedRepository( id ) != null ) + { + getManagedRepositoriesService( authorizationHeader ).deleteManagedRepository( id, true ); + } + } + +} + + diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-cli/commons-cli/1.0/commons-cli-1.0-sources.jar b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-cli/commons-cli/1.0/commons-cli-1.0-sources.jar new file mode 100644 index 000000000..8f67432bb Binary files /dev/null and b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-cli/commons-cli/1.0/commons-cli-1.0-sources.jar differ diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-cli/commons-cli/1.0/commons-cli-1.0-sources.jar.sha1 b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-cli/commons-cli/1.0/commons-cli-1.0-sources.jar.sha1 new file mode 100644 index 000000000..eebab12aa --- /dev/null +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-cli/commons-cli/1.0/commons-cli-1.0-sources.jar.sha1 @@ -0,0 +1 @@ +fc9b2f6fb941aadf5ea34f68c983b0e6bfbf2ca7 \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-cli/commons-cli/1.0/commons-cli-1.0.jar b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-cli/commons-cli/1.0/commons-cli-1.0.jar new file mode 100644 index 000000000..22a004e14 Binary files /dev/null and b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-cli/commons-cli/1.0/commons-cli-1.0.jar differ diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-cli/commons-cli/1.0/commons-cli-1.0.jar.sha1 b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-cli/commons-cli/1.0/commons-cli-1.0.jar.sha1 new file mode 100644 index 000000000..c22c98b0e --- /dev/null +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-cli/commons-cli/1.0/commons-cli-1.0.jar.sha1 @@ -0,0 +1 @@ +6dac9733315224fc562f6268df58e92d65fd0137 \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-cli/commons-cli/1.0/commons-cli-1.0.pom b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-cli/commons-cli/1.0/commons-cli-1.0.pom new file mode 100644 index 000000000..cfc5a04d7 --- /dev/null +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-cli/commons-cli/1.0/commons-cli-1.0.pom @@ -0,0 +1,76 @@ + + 4.0.0 + commons-cli + commons-cli + CLI + 1.0 + Commons CLI provides a simple API for working with the command line arguments and options. + 2002 + + + jstrachan + James Strachan + jstrachan@apache.org + SpiritSoft, Inc. + + + bob + bob mcwhirter + bob@werken.com + Werken + + + jkeyes + John Keyes + jbjk@mac.com + integral Source + + + + + Berin Loritsch + bloritsch@apache.org + + helped in the Avalon CLI merge + + + + Peter Maddocks + peter_maddocks@hp.com + Hewlett-Packard + + supplied patch + + + + + + + maven-surefire-plugin + + + **/*Test*.java + + + + + + + + commons-logging + commons-logging + 1.0 + + + commons-lang + commons-lang + 1.0 + + + junit + junit + 3.7 + test + + + \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-cli/commons-cli/1.0/commons-cli-1.0.pom.sha1 b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-cli/commons-cli/1.0/commons-cli-1.0.pom.sha1 new file mode 100644 index 000000000..1d926c9ab --- /dev/null +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-cli/commons-cli/1.0/commons-cli-1.0.pom.sha1 @@ -0,0 +1 @@ +bc51fd74ed7c8ccf75b3abc84b3613d6ba60eb89 /home/projects/maven/repository-staging/to-ibiblio/maven2/commons-cli/commons-cli/1.0/commons-cli-1.0.pom diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.1/commons-logging-1.0.1-javadoc.jar b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.1/commons-logging-1.0.1-javadoc.jar new file mode 100644 index 000000000..77ca3a939 Binary files /dev/null and b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.1/commons-logging-1.0.1-javadoc.jar differ diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.1/commons-logging-1.0.1-javadoc.jar.md5 b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.1/commons-logging-1.0.1-javadoc.jar.md5 new file mode 100644 index 000000000..7cda458de --- /dev/null +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.1/commons-logging-1.0.1-javadoc.jar.md5 @@ -0,0 +1 @@ +c40f1b459fdf90848bfeef8b5856eba6 \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.1/commons-logging-1.0.1-javadoc.jar.sha1 b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.1/commons-logging-1.0.1-javadoc.jar.sha1 new file mode 100644 index 000000000..a92bb1c7d --- /dev/null +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.1/commons-logging-1.0.1-javadoc.jar.sha1 @@ -0,0 +1 @@ +098d85a82cd48a746e1304825ba70b8df25f4131 \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.1/commons-logging-1.0.1.jar b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.1/commons-logging-1.0.1.jar new file mode 100644 index 000000000..c64e88c4d Binary files /dev/null and b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.1/commons-logging-1.0.1.jar differ diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.1/commons-logging-1.0.1.jar.md5 b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.1/commons-logging-1.0.1.jar.md5 new file mode 100644 index 000000000..62bd72730 --- /dev/null +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.1/commons-logging-1.0.1.jar.md5 @@ -0,0 +1 @@ +e1b1720a761ca36eaa47e1c7d802e676 \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.1/commons-logging-1.0.1.jar.sha1 b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.1/commons-logging-1.0.1.jar.sha1 new file mode 100644 index 000000000..3724daf39 --- /dev/null +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.1/commons-logging-1.0.1.jar.sha1 @@ -0,0 +1 @@ +2e8405d4a28a0b359fbfb8855bde0fdeb0099858 \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.1/commons-logging-1.0.1.pom b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.1/commons-logging-1.0.1.pom new file mode 100644 index 000000000..956fcd33b --- /dev/null +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.1/commons-logging-1.0.1.pom @@ -0,0 +1,30 @@ + + 4.0.0 + commons-logging + commons-logging + Logging + 1.0.1 + Commons Logging + 2002 + + + + log4j + log4j + 1.1.3 + true + + + logkit + logkit + 1.0.1 + true + + + junit + junit + 3.7 + test + + + diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.1/commons-logging-1.0.1.pom.md5 b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.1/commons-logging-1.0.1.pom.md5 new file mode 100644 index 000000000..cdd2818d1 --- /dev/null +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.1/commons-logging-1.0.1.pom.md5 @@ -0,0 +1 @@ +17548178996d55e5f1561a6fd675616f /home/projects/maven/repository-staging/to-ibiblio/maven2/commons-logging/commons-logging/1.0.1/commons-logging-1.0.1.pom diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.1/commons-logging-1.0.1.pom.sha1 b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.1/commons-logging-1.0.1.pom.sha1 new file mode 100644 index 000000000..355c5ecd8 --- /dev/null +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.1/commons-logging-1.0.1.pom.sha1 @@ -0,0 +1 @@ +665b8439aad27af8b87fd3fefa11d901d851c9d5 /home/projects/maven/repository-staging/to-ibiblio/maven2/commons-logging/commons-logging/1.0.1/commons-logging-1.0.1.pom diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.1/maven-metadata.xml b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.1/maven-metadata.xml new file mode 100644 index 000000000..dbb6f0ad9 --- /dev/null +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.1/maven-metadata.xml @@ -0,0 +1,5 @@ + + commons-logging + commons-logging + 1.0.1 + \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.1/maven-metadata.xml.md5 b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.1/maven-metadata.xml.md5 new file mode 100644 index 000000000..91dc5e9b8 --- /dev/null +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.1/maven-metadata.xml.md5 @@ -0,0 +1 @@ +629e92df42c9735e1794689ea6e2f1e5 ./commons-logging/commons-logging/1.0.1/maven-metadata.xml diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.1/maven-metadata.xml.sha1 b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.1/maven-metadata.xml.sha1 new file mode 100644 index 000000000..ff58c9ba1 --- /dev/null +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.1/maven-metadata.xml.sha1 @@ -0,0 +1 @@ +e8e65fd3a18876a01e3f771015c3ad052ca01af5 /home/maven/repository-staging/to-ibiblio/maven2/commons-logging/commons-logging/1.0.1/maven-metadata.xml diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.2/commons-logging-1.0.2-javadoc.jar b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.2/commons-logging-1.0.2-javadoc.jar new file mode 100644 index 000000000..994637f8f Binary files /dev/null and b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.2/commons-logging-1.0.2-javadoc.jar differ diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.2/commons-logging-1.0.2-javadoc.jar.md5 b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.2/commons-logging-1.0.2-javadoc.jar.md5 new file mode 100644 index 000000000..06e29d85e --- /dev/null +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.2/commons-logging-1.0.2-javadoc.jar.md5 @@ -0,0 +1 @@ +23bc0c53b59b1689d3cbd97de42e0a74 \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.2/commons-logging-1.0.2-javadoc.jar.sha1 b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.2/commons-logging-1.0.2-javadoc.jar.sha1 new file mode 100644 index 000000000..a21af97ed --- /dev/null +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.2/commons-logging-1.0.2-javadoc.jar.sha1 @@ -0,0 +1 @@ +635c2d062a007ffc71a956d45a149f0896ffed8d \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.2/commons-logging-1.0.2.jar b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.2/commons-logging-1.0.2.jar new file mode 100644 index 000000000..aca1e4132 Binary files /dev/null and b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.2/commons-logging-1.0.2.jar differ diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.2/commons-logging-1.0.2.jar.md5 b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.2/commons-logging-1.0.2.jar.md5 new file mode 100644 index 000000000..03af6e34c --- /dev/null +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.2/commons-logging-1.0.2.jar.md5 @@ -0,0 +1 @@ +bdb6d37e652f164451ebd0cb10b7f645 \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.2/commons-logging-1.0.2.jar.sha1 b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.2/commons-logging-1.0.2.jar.sha1 new file mode 100644 index 000000000..6d343de40 --- /dev/null +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.2/commons-logging-1.0.2.jar.sha1 @@ -0,0 +1 @@ +37c659e57293656ebef1a247fc6ceb738ebdfc74 \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.2/commons-logging-1.0.2.pom b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.2/commons-logging-1.0.2.pom new file mode 100644 index 000000000..6a2cebba7 --- /dev/null +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.2/commons-logging-1.0.2.pom @@ -0,0 +1,30 @@ + + 4.0.0 + commons-logging + commons-logging + Logging + 1.0.2 + Commons Logging + 2002 + + + + log4j + log4j + 1.1.3 + true + + + logkit + logkit + 1.0.1 + true + + + junit + junit + 3.7 + test + + + diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.2/commons-logging-1.0.2.pom.md5 b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.2/commons-logging-1.0.2.pom.md5 new file mode 100644 index 000000000..93a58b66d --- /dev/null +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.2/commons-logging-1.0.2.pom.md5 @@ -0,0 +1 @@ +b7e001b135a56678ac81f21ac2469957 /home/projects/maven/repository-staging/to-ibiblio/maven2/commons-logging/commons-logging/1.0.2/commons-logging-1.0.2.pom diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.2/commons-logging-1.0.2.pom.sha1 b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.2/commons-logging-1.0.2.pom.sha1 new file mode 100644 index 000000000..906aa58a4 --- /dev/null +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.2/commons-logging-1.0.2.pom.sha1 @@ -0,0 +1 @@ +994768b3b18380239296871de3d732935d390c24 /home/projects/maven/repository-staging/to-ibiblio/maven2/commons-logging/commons-logging/1.0.2/commons-logging-1.0.2.pom diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.2/maven-metadata.xml b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.2/maven-metadata.xml new file mode 100644 index 000000000..3f42d4319 --- /dev/null +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.2/maven-metadata.xml @@ -0,0 +1,5 @@ + + commons-logging + commons-logging + 1.0.2 + \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.2/maven-metadata.xml.md5 b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.2/maven-metadata.xml.md5 new file mode 100644 index 000000000..9db476082 --- /dev/null +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.2/maven-metadata.xml.md5 @@ -0,0 +1 @@ +32d0d002721d3669f8d01970fb7d556c ./commons-logging/commons-logging/1.0.2/maven-metadata.xml diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.2/maven-metadata.xml.sha1 b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.2/maven-metadata.xml.sha1 new file mode 100644 index 000000000..a6ddbca08 --- /dev/null +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.2/maven-metadata.xml.sha1 @@ -0,0 +1 @@ +db4cb003a7eacd19b5eb9747a484f23209ea20fd /home/maven/repository-staging/to-ibiblio/maven2/commons-logging/commons-logging/1.0.2/maven-metadata.xml diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.3/commons-logging-1.0.3-javadoc.jar b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.3/commons-logging-1.0.3-javadoc.jar new file mode 100644 index 000000000..ce4d7ec40 Binary files /dev/null and b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.3/commons-logging-1.0.3-javadoc.jar differ diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.3/commons-logging-1.0.3-javadoc.jar.md5 b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.3/commons-logging-1.0.3-javadoc.jar.md5 new file mode 100644 index 000000000..ba413f3c9 --- /dev/null +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.3/commons-logging-1.0.3-javadoc.jar.md5 @@ -0,0 +1 @@ +852ef679e9998498e7d4ac6121c45316 \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.3/commons-logging-1.0.3-javadoc.jar.sha1 b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.3/commons-logging-1.0.3-javadoc.jar.sha1 new file mode 100644 index 000000000..b4a76d40a --- /dev/null +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.3/commons-logging-1.0.3-javadoc.jar.sha1 @@ -0,0 +1 @@ +d0773fcb73e98a977b54c70c289fe06e60d57643 \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.3/commons-logging-1.0.3.jar b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.3/commons-logging-1.0.3.jar new file mode 100644 index 000000000..b99c9375a Binary files /dev/null and b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.3/commons-logging-1.0.3.jar differ diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.3/commons-logging-1.0.3.jar.md5 b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.3/commons-logging-1.0.3.jar.md5 new file mode 100644 index 000000000..4b9f4d161 --- /dev/null +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.3/commons-logging-1.0.3.jar.md5 @@ -0,0 +1 @@ +5bc8bdd15b18018e84fd862993aaca42 \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.3/commons-logging-1.0.3.jar.sha1 b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.3/commons-logging-1.0.3.jar.sha1 new file mode 100644 index 000000000..9e50b2572 --- /dev/null +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.3/commons-logging-1.0.3.jar.sha1 @@ -0,0 +1 @@ +760c711c71588bc273d3e56d196d720a7678cd93 \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.3/commons-logging-1.0.3.pom b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.3/commons-logging-1.0.3.pom new file mode 100644 index 000000000..c46b27ffb --- /dev/null +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.3/commons-logging-1.0.3.pom @@ -0,0 +1,31 @@ + + 4.0.0 + commons-logging + commons-logging + Logging + 1.0.3 + Commons Logging + http://jakarta.apache.org/commons/logging/ + 2001 + + + + log4j + log4j + 1.2.6 + true + + + logkit + logkit + 1.0.1 + true + + + junit + junit + 3.7 + test + + + diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.3/commons-logging-1.0.3.pom.md5 b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.3/commons-logging-1.0.3.pom.md5 new file mode 100644 index 000000000..02d6c5f91 --- /dev/null +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.3/commons-logging-1.0.3.pom.md5 @@ -0,0 +1 @@ +881dca51df49b39efb7b81b05b31278d /home/projects/maven/repository-staging/to-ibiblio/maven2/commons-logging/commons-logging/1.0.3/commons-logging-1.0.3.pom diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.3/commons-logging-1.0.3.pom.sha1 b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.3/commons-logging-1.0.3.pom.sha1 new file mode 100644 index 000000000..c03effc78 --- /dev/null +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.3/commons-logging-1.0.3.pom.sha1 @@ -0,0 +1 @@ +b7de43bb310eb1dbfd00a34cec30500fa13cb577 /home/projects/maven/repository-staging/to-ibiblio/maven2/commons-logging/commons-logging/1.0.3/commons-logging-1.0.3.pom diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.3/maven-metadata.xml b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.3/maven-metadata.xml new file mode 100644 index 000000000..d733c03bb --- /dev/null +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.3/maven-metadata.xml @@ -0,0 +1,5 @@ + + commons-logging + commons-logging + 1.0.3 + \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.3/maven-metadata.xml.md5 b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.3/maven-metadata.xml.md5 new file mode 100644 index 000000000..425ad3e93 --- /dev/null +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.3/maven-metadata.xml.md5 @@ -0,0 +1 @@ +15cae318f3bfbde23028f26c8ba153aa ./commons-logging/commons-logging/1.0.3/maven-metadata.xml diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.3/maven-metadata.xml.sha1 b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.3/maven-metadata.xml.sha1 new file mode 100644 index 000000000..0557855d5 --- /dev/null +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.3/maven-metadata.xml.sha1 @@ -0,0 +1 @@ +7f4047267ed6d4679ee568460c2abea4fe8146b6 /home/maven/repository-staging/to-ibiblio/maven2/commons-logging/commons-logging/1.0.3/maven-metadata.xml diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.4/commons-logging-1.0.4-javadoc.jar b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.4/commons-logging-1.0.4-javadoc.jar new file mode 100644 index 000000000..efacb52ba Binary files /dev/null and b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.4/commons-logging-1.0.4-javadoc.jar differ diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.4/commons-logging-1.0.4-javadoc.jar.md5 b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.4/commons-logging-1.0.4-javadoc.jar.md5 new file mode 100644 index 000000000..1308a1a52 --- /dev/null +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.4/commons-logging-1.0.4-javadoc.jar.md5 @@ -0,0 +1 @@ +f0626403d6ba70cd8758d74a4d557a86 \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.4/commons-logging-1.0.4-javadoc.jar.sha1 b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.4/commons-logging-1.0.4-javadoc.jar.sha1 new file mode 100644 index 000000000..c9243b396 --- /dev/null +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.4/commons-logging-1.0.4-javadoc.jar.sha1 @@ -0,0 +1 @@ +e6ab582bb54e0eba076f314d98272457261501ee \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.4/commons-logging-1.0.4-sources.jar b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.4/commons-logging-1.0.4-sources.jar new file mode 100644 index 000000000..fc4bc9fcb Binary files /dev/null and b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.4/commons-logging-1.0.4-sources.jar differ diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.4/commons-logging-1.0.4-sources.jar.md5 b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.4/commons-logging-1.0.4-sources.jar.md5 new file mode 100644 index 000000000..75ba5707c --- /dev/null +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.4/commons-logging-1.0.4-sources.jar.md5 @@ -0,0 +1 @@ +0a95b57dbd6ac8fc8da869de59709477 commons-logging/commons-logging/1.0.4/commons-logging-1.0.4-sources.jar diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.4/commons-logging-1.0.4-sources.jar.sha1 b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.4/commons-logging-1.0.4-sources.jar.sha1 new file mode 100644 index 000000000..95635464e --- /dev/null +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.4/commons-logging-1.0.4-sources.jar.sha1 @@ -0,0 +1 @@ +08d3424a318e818f88568dfb3b55c58583364ba9 commons-logging/commons-logging/1.0.4/commons-logging-1.0.4-sources.jar diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.4/commons-logging-1.0.4.jar b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.4/commons-logging-1.0.4.jar new file mode 100644 index 000000000..b73a80fab Binary files /dev/null and b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.4/commons-logging-1.0.4.jar differ diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.4/commons-logging-1.0.4.jar.md5 b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.4/commons-logging-1.0.4.jar.md5 new file mode 100644 index 000000000..1156a2e99 --- /dev/null +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.4/commons-logging-1.0.4.jar.md5 @@ -0,0 +1 @@ +8a507817b28077e0478add944c64586a \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.4/commons-logging-1.0.4.jar.sha1 b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.4/commons-logging-1.0.4.jar.sha1 new file mode 100644 index 000000000..7e0a60e4f --- /dev/null +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.4/commons-logging-1.0.4.jar.sha1 @@ -0,0 +1 @@ +f029a2aefe2b3e1517573c580f948caac31b1056 \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.4/commons-logging-1.0.4.pom b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.4/commons-logging-1.0.4.pom new file mode 100644 index 000000000..7c1017dc2 --- /dev/null +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.4/commons-logging-1.0.4.pom @@ -0,0 +1,165 @@ + + 4.0.0 + commons-logging + commons-logging + Logging + 1.0.4 + Commons Logging is a thin adapter allowing configurable bridging to other, + well known logging systems. + http://jakarta.apache.org/commons/logging/ + + http://issues.apache.org/bugzilla/ + + + + + +

commons-dev@jakarta.apache.org
+ + + + + 2001 + + + Commons Dev List + commons-dev-subscribe@jakarta.apache.org + commons-dev-unsubscribe@jakarta.apache.org + http://nagoya.apache.org/eyebrowse/SummarizeList?listName=commons-dev@jakarta.apache.org + + + Commons User List + commons-user-subscribe@jakarta.apache.org + commons-user-unsubscribe@jakarta.apache.org + http://nagoya.apache.org/eyebrowse/SummarizeList?listName=commons-user@jakarta.apache.org + + + + + morgand + Morgan Delagrange + morgand at apache dot org + Apache + + Java Developer + + + + rwaldhoff + Rodney Waldhoff + rwaldhoff at apache org + Apache Software Foundation + + + craigmcc + Craig McClanahan + craigmcc at apache org + Apache Software Foundation + + + sanders + Scott Sanders + sanders at apache dot org + Apache Software Foundation + + + rdonkin + Robert Burrell Donkin + rdonkin at apache dot org + Apache Software Foundation + + + donaldp + Peter Donald + donaldp at apache dot org + + + + costin + Costin Manolache + costin at apache dot org + Apache Software Foundation + + + rsitze + Richard Sitze + rsitze at apache dot org + Apache Software Foundation + + + baliuka + Juozas Baliuka + baliuka@apache.org + + + Java Developer + + + + + + The Apache Software License, Version 2.0 + /LICENSE.txt + + + + scm:cvs:pserver:anoncvs@cvs.apache.org:/home/cvspublic:jakarta-commons/logging + http://cvs.apache.org/viewcvs/jakarta-commons/logging/ + + + The Apache Software Foundation + http://jakarta.apache.org + + + src/java + src/test + + + maven-surefire-plugin + + + **/AvalonLoggerTest.java + + + + + + + + log4j + log4j + 1.2.6 + true + + + logkit + logkit + 1.0.1 + true + + + junit + junit + 3.7 + test + + + avalon-framework + avalon-framework + 4.1.3 + true + + + + + default + Default Repository + file:///www/jakarta.apache.org/builds/jakarta-commons/logging/ + + + default + Default Site + scp://jakarta.apache.org//www/jakarta.apache.org/commons/logging/ + + + diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.4/commons-logging-1.0.4.pom.md5 b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.4/commons-logging-1.0.4.pom.md5 new file mode 100644 index 000000000..65216d827 --- /dev/null +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.4/commons-logging-1.0.4.pom.md5 @@ -0,0 +1 @@ +2794b156c9725ac6382c22663ae42124 /home/projects/maven/repository-staging/to-ibiblio/maven2/commons-logging/commons-logging/1.0.4/commons-logging-1.0.4.pom diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.4/commons-logging-1.0.4.pom.sha1 b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.4/commons-logging-1.0.4.pom.sha1 new file mode 100644 index 000000000..676ff7b23 --- /dev/null +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.4/commons-logging-1.0.4.pom.sha1 @@ -0,0 +1 @@ +7d32e7520b801cabc3dc704d2afe59d020d00c45 /home/projects/maven/repository-staging/to-ibiblio/maven2/commons-logging/commons-logging/1.0.4/commons-logging-1.0.4.pom diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.4/maven-metadata.xml b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.4/maven-metadata.xml new file mode 100644 index 000000000..536a7be8a --- /dev/null +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.4/maven-metadata.xml @@ -0,0 +1,5 @@ + + commons-logging + commons-logging + 1.0.4 + \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.4/maven-metadata.xml.md5 b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.4/maven-metadata.xml.md5 new file mode 100644 index 000000000..b0beda653 --- /dev/null +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.4/maven-metadata.xml.md5 @@ -0,0 +1 @@ +182e4358962671c46ee4242d9dad4013 ./commons-logging/commons-logging/1.0.4/maven-metadata.xml diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.4/maven-metadata.xml.sha1 b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.4/maven-metadata.xml.sha1 new file mode 100644 index 000000000..722baf944 --- /dev/null +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0.4/maven-metadata.xml.sha1 @@ -0,0 +1 @@ +5bb716617b7904d05e5563801f72ebcce96a161a /home/maven/repository-staging/to-ibiblio/maven2/commons-logging/commons-logging/1.0.4/maven-metadata.xml diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0/commons-logging-1.0-javadoc.jar b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0/commons-logging-1.0-javadoc.jar new file mode 100644 index 000000000..42b59d140 Binary files /dev/null and b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0/commons-logging-1.0-javadoc.jar differ diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0/commons-logging-1.0-javadoc.jar.md5 b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0/commons-logging-1.0-javadoc.jar.md5 new file mode 100644 index 000000000..ea8ffa075 --- /dev/null +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0/commons-logging-1.0-javadoc.jar.md5 @@ -0,0 +1 @@ +cd31f6e132e9076168247b5b62e7d4f2 \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0/commons-logging-1.0-javadoc.jar.sha1 b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0/commons-logging-1.0-javadoc.jar.sha1 new file mode 100644 index 000000000..461afce1a --- /dev/null +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0/commons-logging-1.0-javadoc.jar.sha1 @@ -0,0 +1 @@ +e3f9527e9e04311a8d411b93bc06930574070839 \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0/commons-logging-1.0.jar b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0/commons-logging-1.0.jar new file mode 100644 index 000000000..33232cd09 Binary files /dev/null and b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0/commons-logging-1.0.jar differ diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0/commons-logging-1.0.jar.md5 b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0/commons-logging-1.0.jar.md5 new file mode 100644 index 000000000..7c997d231 --- /dev/null +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0/commons-logging-1.0.jar.md5 @@ -0,0 +1 @@ +240b26992977c9ad119efb91cb21f8f8 \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0/commons-logging-1.0.jar.sha1 b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0/commons-logging-1.0.jar.sha1 new file mode 100644 index 000000000..58918b630 --- /dev/null +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0/commons-logging-1.0.jar.sha1 @@ -0,0 +1 @@ +f10838aa1add95b8cd26b8c9c07b2278c21e64b4 \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0/commons-logging-1.0.pom b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0/commons-logging-1.0.pom new file mode 100644 index 000000000..402a9df37 --- /dev/null +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0/commons-logging-1.0.pom @@ -0,0 +1,6 @@ + + 4.0.0 + commons-logging + commons-logging + 1.0 + diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0/commons-logging-1.0.pom.md5 b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0/commons-logging-1.0.pom.md5 new file mode 100644 index 000000000..acb67109d --- /dev/null +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0/commons-logging-1.0.pom.md5 @@ -0,0 +1 @@ +aa412f75c470cd28468a20bd4c811e7d /home/projects/maven/repository-staging/to-ibiblio/maven2/commons-logging/commons-logging/1.0/commons-logging-1.0.pom diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0/commons-logging-1.0.pom.sha1 b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0/commons-logging-1.0.pom.sha1 new file mode 100644 index 000000000..3c6069df1 --- /dev/null +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0/commons-logging-1.0.pom.sha1 @@ -0,0 +1 @@ +4f58df6cca7ad7b863e8186e5dc25a8ef502e374 /home/projects/maven/repository-staging/to-ibiblio/maven2/commons-logging/commons-logging/1.0/commons-logging-1.0.pom diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0/maven-metadata.xml b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0/maven-metadata.xml new file mode 100644 index 000000000..db699f58f --- /dev/null +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0/maven-metadata.xml @@ -0,0 +1,5 @@ + + commons-logging + commons-logging + 1.0 + \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0/maven-metadata.xml.md5 b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0/maven-metadata.xml.md5 new file mode 100644 index 000000000..f43d7b901 --- /dev/null +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0/maven-metadata.xml.md5 @@ -0,0 +1 @@ +d507f2c419364009f089592dfd9acea2 ./commons-logging/commons-logging/1.0/maven-metadata.xml diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0/maven-metadata.xml.sha1 b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0/maven-metadata.xml.sha1 new file mode 100644 index 000000000..a0ac3ddd9 --- /dev/null +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.0/maven-metadata.xml.sha1 @@ -0,0 +1 @@ +5fe9e6d013ddf2a2f9e2b21582024d4f8e2f7ca5 /home/maven/repository-staging/to-ibiblio/maven2/commons-logging/commons-logging/1.0/maven-metadata.xml diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.1/commons-logging-1.1-sources.jar b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.1/commons-logging-1.1-sources.jar new file mode 100644 index 000000000..1e036f176 Binary files /dev/null and b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.1/commons-logging-1.1-sources.jar differ diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.1/commons-logging-1.1-sources.jar.md5 b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.1/commons-logging-1.1-sources.jar.md5 new file mode 100644 index 000000000..b896085c0 --- /dev/null +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.1/commons-logging-1.1-sources.jar.md5 @@ -0,0 +1 @@ +6c6e00b54fdb9e3489554b49dface8ec /home/csanchez/repository-staging/to-ibiblio/maven2/commons-logging/commons-logging/1.1/commons-logging-1.1-sources.jar diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.1/commons-logging-1.1-sources.jar.sha1 b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.1/commons-logging-1.1-sources.jar.sha1 new file mode 100644 index 000000000..492569722 --- /dev/null +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.1/commons-logging-1.1-sources.jar.sha1 @@ -0,0 +1 @@ +5c2bd34c9a05067c72dcf08cd248630561a9c852 /home/csanchez/repository-staging/to-ibiblio/maven2/commons-logging/commons-logging/1.1/commons-logging-1.1-sources.jar diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.1/commons-logging-1.1.jar b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.1/commons-logging-1.1.jar new file mode 100644 index 000000000..2ff9bbd90 Binary files /dev/null and b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.1/commons-logging-1.1.jar differ diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.1/commons-logging-1.1.jar.md5 b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.1/commons-logging-1.1.jar.md5 new file mode 100644 index 000000000..42c7efb2f --- /dev/null +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.1/commons-logging-1.1.jar.md5 @@ -0,0 +1 @@ +6b62417e77b000a87de66ee3935edbf5 /home/csanchez/repository-staging/to-ibiblio/maven2/commons-logging/commons-logging/1.1/commons-logging-1.1.jar diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.1/commons-logging-1.1.jar.sha1 b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.1/commons-logging-1.1.jar.sha1 new file mode 100644 index 000000000..5a6ea7b12 --- /dev/null +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.1/commons-logging-1.1.jar.sha1 @@ -0,0 +1 @@ +ba24d5de831911b684c92cd289ed5ff826271824 /home/csanchez/repository-staging/to-ibiblio/maven2/commons-logging/commons-logging/1.1/commons-logging-1.1.jar diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.1/commons-logging-1.1.pom b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.1/commons-logging-1.1.pom new file mode 100644 index 000000000..b1ea16fe1 --- /dev/null +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.1/commons-logging-1.1.pom @@ -0,0 +1,191 @@ + + 4.0.0 + commons-logging + commons-logging + Logging + 1.1 + Commons Logging is a thin adapter allowing configurable bridging to other, + well known logging systems. + http://jakarta.apache.org/commons/${pom.artifactId.substring(8)}/ + + http://issues.apache.org/bugzilla/ + + + + + +
commons-dev@jakarta.apache.org
+
+
+
+
+ 2001 + + + Commons Dev List + commons-dev-subscribe@jakarta.apache.org + commons-dev-unsubscribe@jakarta.apache.org + http://mail-archives.apache.org/mod_mbox/jakarta-commons-dev/ + + + Commons User List + commons-user-subscribe@jakarta.apache.org + commons-user-unsubscribe@jakarta.apache.org + http://mail-archives.apache.org/mod_mbox/jakarta-commons-user/ + + + + + morgand + Morgan Delagrange + morgand at apache dot org + Apache + + Java Developer + + + + rwaldhoff + Rodney Waldhoff + rwaldhoff at apache org + Apache Software Foundation + + + craigmcc + Craig McClanahan + craigmcc at apache org + Apache Software Foundation + + + sanders + Scott Sanders + sanders at apache dot org + Apache Software Foundation + + + rdonkin + Robert Burrell Donkin + rdonkin at apache dot org + Apache Software Foundation + + + donaldp + Peter Donald + donaldp at apache dot org + + + + costin + Costin Manolache + costin at apache dot org + Apache Software Foundation + + + rsitze + Richard Sitze + rsitze at apache dot org + Apache Software Foundation + + + baliuka + Juozas Baliuka + baliuka@apache.org + + + Java Developer + + + + skitching + Simon Kitching + skitching@apache.org + Apache Software Foundation + + + dennisl + Dennis Lundberg + dennisl@apache.org + Apache Software Foundation + + + bstansberry + Brian Stansberry + + + + + The Apache Software License, Version 2.0 + /LICENSE.txt + + + + scm:svn:http://svn.apache.org/repos/asf/jakarta/commons/proper/${pom.artifactId.substring(8)}/trunk + http://svn.apache.org/repos/asf/jakarta/commons/proper/${pom.artifactId.substring(8)}/trunk + + + The Apache Software Foundation + http://jakarta.apache.org + + + src/java + src/test + + + maven-surefire-plugin + + + **/AvalonLoggerTest.java + + + + + maven-xdoc-plugin + 1.9.2 + + <strong>Site Only</strong> - v1.9.2 (minimum) + + + + + + + log4j + log4j + 1.2.12 + + + logkit + logkit + 1.0.1 + + + junit + junit + 3.8.1 + test + + + avalon-framework + avalon-framework + 4.1.3 + + + javax.servlet + servlet-api + 2.3 + + + + + default + Default Repository + file:///www/jakarta.apache.org/builds/jakarta-commons/${pom.artifactId.substring(8)}/ + + + default + Default Site + scp://cvs.apache.org//www/jakarta.apache.org/commons/${pom.artifactId.substring(8)}/ + + converted + +
\ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.1/commons-logging-1.1.pom.md5 b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.1/commons-logging-1.1.pom.md5 new file mode 100644 index 000000000..fc51c08b7 --- /dev/null +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.1/commons-logging-1.1.pom.md5 @@ -0,0 +1 @@ +219b31dbb491c609210577941a27a390 /home/csanchez/repository-staging/to-ibiblio/maven2/commons-logging/commons-logging/1.1/commons-logging-1.1.pom diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.1/commons-logging-1.1.pom.sha1 b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.1/commons-logging-1.1.pom.sha1 new file mode 100644 index 000000000..0b450ccc7 --- /dev/null +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.1/commons-logging-1.1.pom.sha1 @@ -0,0 +1 @@ +d80c5278c4f112aba0a6e987d7321676ce074a22 /home/csanchez/repository-staging/to-ibiblio/maven2/commons-logging/commons-logging/1.1/commons-logging-1.1.pom diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.1/maven-metadata.xml b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.1/maven-metadata.xml new file mode 100644 index 000000000..3a46a4fce --- /dev/null +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.1/maven-metadata.xml @@ -0,0 +1,5 @@ + + commons-logging + commons-logging + 1.1 + \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.1/maven-metadata.xml.md5 b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.1/maven-metadata.xml.md5 new file mode 100644 index 000000000..ecf3cf561 --- /dev/null +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.1/maven-metadata.xml.md5 @@ -0,0 +1 @@ +3da6bff52079500a1deb0b50b592f6cc ./commons-logging/commons-logging/1.1/maven-metadata.xml diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.1/maven-metadata.xml.sha1 b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.1/maven-metadata.xml.sha1 new file mode 100644 index 000000000..a16925ebb --- /dev/null +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/commons-logging/1.1/maven-metadata.xml.sha1 @@ -0,0 +1 @@ +0672ee0df7fb5db281603d0fd9328086b8b1a912 /home/maven/repository-staging/to-ibiblio/maven2/commons-logging/commons-logging/1.1/maven-metadata.xml diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/maven-metadata.xml b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/maven-metadata.xml new file mode 100644 index 000000000..6f725eace --- /dev/null +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/maven-metadata.xml @@ -0,0 +1,15 @@ + + commons-logging + commons-logging + 1.0 + + + 1.0 + 1.0.1 + 1.0.2 + 1.0.3 + 1.0.4 + 1.1 + + + diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/maven-metadata.xml.md5 b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/maven-metadata.xml.md5 new file mode 100644 index 000000000..303079faa --- /dev/null +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/maven-metadata.xml.md5 @@ -0,0 +1 @@ +57ae0a2f19db170eb6a012e255dfe329 /home/maven/repository-staging/to-ibiblio/maven2/commons-logging/commons-logging/maven-metadata.xml diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/maven-metadata.xml.sha1 b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/maven-metadata.xml.sha1 new file mode 100644 index 000000000..0a2ec8208 --- /dev/null +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/commons-logging/maven-metadata.xml.sha1 @@ -0,0 +1 @@ +fa606c3906d034dd7b98ebbf0a0655479a9dc956 /home/maven/repository-staging/to-ibiblio/maven2/commons-logging/commons-logging/maven-metadata.xml diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/org/apache/felix/org.apache.felix.bundlerepository/1.6.6/org.apache.felix.bundlerepository-1.6.6.jar b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/org/apache/felix/org.apache.felix.bundlerepository/1.6.6/org.apache.felix.bundlerepository-1.6.6.jar new file mode 100644 index 000000000..218330e3f Binary files /dev/null and b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/org/apache/felix/org.apache.felix.bundlerepository/1.6.6/org.apache.felix.bundlerepository-1.6.6.jar differ diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/org/apache/felix/org.apache.felix.bundlerepository/1.6.6/org.apache.felix.bundlerepository-1.6.6.pom b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/org/apache/felix/org.apache.felix.bundlerepository/1.6.6/org.apache.felix.bundlerepository-1.6.6.pom new file mode 100644 index 000000000..19831eefa --- /dev/null +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/org/apache/felix/org.apache.felix.bundlerepository/1.6.6/org.apache.felix.bundlerepository-1.6.6.pom @@ -0,0 +1,138 @@ + + + + org.apache.felix + felix-parent + 2.1 + ../pom/pom.xml + + 4.0.0 + bundle + Apache Felix Bundle Repository + Bundle repository service. + org.apache.felix.bundlerepository + 1.6.6 + + scm:svn:http://svn.apache.org/repos/asf/felix/releases/org.apache.felix.bundlerepository-1.6.6 + scm:svn:https://svn.apache.org/repos/asf/felix/releases/org.apache.felix.bundlerepository-1.6.6 + http://svn.apache.org/repos/asf/felix/releases/org.apache.felix.bundlerepository-1.6.6 + + + + ${project.groupId} + org.apache.felix.utils + 1.1.0 + true + + + ${project.groupId} + org.osgi.service.obr + 1.0.2 + true + + + ${project.groupId} + org.apache.felix.shell + 1.4.1 + true + + + net.sf.kxml + kxml2 + 2.3.0 + true + + + xmlpull + xmlpull + + + + + org.osgi + org.osgi.compendium + 4.0.0 + true + + + org.osgi + org.osgi.core + 4.1.0 + + + org.codehaus.woodstox + woodstox-core-asl + 4.0.7 + true + + + org.easymock + easymock + 2.4 + + + + + + org.apache.felix + maven-bundle-plugin + 2.3.4 + true + + + org.apache.felix.bundlerepository;version="2.0" + + org.kxml2.io, + org.xmlpull.v1, + org.apache.felix.bundlerepository.impl.*, + org.apache.felix.utils.* + + !javax.xml.parsers,!org.xml.sax,org.osgi.service.log;resolution:=optional,org.osgi.service.obr;resolution:=optional,javax.xml.stream;resolution:=optional,* + org.apache.felix.shell + ${project.artifactId}.impl.Activator + http://felix.apache.org/site/apache-felix-osgi-bundle-repository.html + http://felix.apache.org/site/downloads.cgi + http://felix.apache.org/site/downloads.cgi + ${project.artifactId} + The Apache Software Foundation + org.apache.felix.bundlerepository.RepositoryAdmin,org.osgi.service.obr.RepositoryAdmin + <_versionpolicy>[$(version;==;$(@)),$(version;+;$(@))) + META-INF/LICENSE=LICENSE,META-INF/LICENSE.kxml2=LICENSE.kxml2,META-INF/NOTICE=NOTICE,META-INF/DEPENDENCIES=DEPENDENCIES + + + + + org.apache.rat + apache-rat-plugin + + false + true + true + + doc/* + maven-eclipse.xml + .checkstyle + .externalToolBuilders/* + + + + + + diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/org/apache/karaf/features/org.apache.karaf.features.command/2.2.2/org.apache.karaf.features.command-2.2.2.jar b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/org/apache/karaf/features/org.apache.karaf.features.command/2.2.2/org.apache.karaf.features.command-2.2.2.jar new file mode 100644 index 000000000..e211324f3 Binary files /dev/null and b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/org/apache/karaf/features/org.apache.karaf.features.command/2.2.2/org.apache.karaf.features.command-2.2.2.jar differ diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/org/apache/karaf/features/org.apache.karaf.features.command/2.2.2/org.apache.karaf.features.command-2.2.2.pom b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/org/apache/karaf/features/org.apache.karaf.features.command/2.2.2/org.apache.karaf.features.command-2.2.2.pom new file mode 100644 index 000000000..67e206f63 --- /dev/null +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/org/apache/karaf/features/org.apache.karaf.features.command/2.2.2/org.apache.karaf.features.command-2.2.2.pom @@ -0,0 +1,5 @@ +#Generated by org.apache.felix.bundleplugin +#Thu Jun 30 15:25:37 NDT 2011 +version=2.2.2 +groupId=org.apache.karaf.features +artifactId=org.apache.karaf.features.command diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/org/apache/karaf/features/org.apache.karaf.features.core/2.2.1/org.apache.karaf.features.core-2.2.1.jar b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/org/apache/karaf/features/org.apache.karaf.features.core/2.2.1/org.apache.karaf.features.core-2.2.1.jar new file mode 100644 index 000000000..a6c5b3556 Binary files /dev/null and b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/org/apache/karaf/features/org.apache.karaf.features.core/2.2.1/org.apache.karaf.features.core-2.2.1.jar differ diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/org/apache/karaf/features/org.apache.karaf.features.core/2.2.1/org.apache.karaf.features.core-2.2.1.pom b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/org/apache/karaf/features/org.apache.karaf.features.core/2.2.1/org.apache.karaf.features.core-2.2.1.pom new file mode 100644 index 000000000..6cd219e47 --- /dev/null +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/org/apache/karaf/features/org.apache.karaf.features.core/2.2.1/org.apache.karaf.features.core-2.2.1.pom @@ -0,0 +1,137 @@ + + + + + + 4.0.0 + + + org.apache.karaf.features + features + 2.2.1 + + + org.apache.karaf.features.core + bundle + Apache Karaf :: Features :: Core + This bundle is the core implementation of the Karaf features support. + + + ${basedir}/../../etc/appended-resources + + + + + org.osgi + org.osgi.core + provided + + + + org.osgi + org.osgi.compendium + provided + + + + org.apache.felix + org.apache.felix.utils + provided + + + org.apache.felix + org.apache.felix.bundlerepository + + + + org.apache.karaf.shell + org.apache.karaf.shell.console + + + + org.apache.karaf.shell + org.apache.karaf.shell.obr + + + + org.springframework.osgi + spring-osgi-core + test + + + org.apache.servicemix.bundles + org.apache.servicemix.bundles.junit + test + + + org.easymock + easymock + test + + + org.slf4j + slf4j-jdk14 + test + + + + + + + ${project.basedir}/src/main/resources + + **/* + + + + ${project.basedir}/src/main/resources + true + + **/*.info + + + + + + org.apache.felix + maven-bundle-plugin + + + org.apache.karaf.features;version=${project.version} + + !org.apache.karaf.features, + javax.management, + javax.management.loading, + org.apache.felix.service.command, + org.apache.felix.gogo.commands, + org.apache.karaf.shell.console, + org.osgi.service.event*;resolution:=optional, + * + + + org.apache.karaf.features.internal, + org.apache.felix.utils.version, + org.apache.felix.utils.manifest + + + + + + + diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/org/apache/karaf/features/org.apache.karaf.features.core/2.2.2/org.apache.karaf.features.core-2.2.2.jar b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/org/apache/karaf/features/org.apache.karaf.features.core/2.2.2/org.apache.karaf.features.core-2.2.2.jar new file mode 100644 index 000000000..0e6bb50db Binary files /dev/null and b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/org/apache/karaf/features/org.apache.karaf.features.core/2.2.2/org.apache.karaf.features.core-2.2.2.jar differ diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/org/apache/karaf/features/org.apache.karaf.features.core/2.2.2/org.apache.karaf.features.core-2.2.2.pom b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/org/apache/karaf/features/org.apache.karaf.features.core/2.2.2/org.apache.karaf.features.core-2.2.2.pom new file mode 100644 index 000000000..e5782e9ec --- /dev/null +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/repo-with-osgi/org/apache/karaf/features/org.apache.karaf.features.core/2.2.2/org.apache.karaf.features.core-2.2.2.pom @@ -0,0 +1,137 @@ + + + + + + 4.0.0 + + + org.apache.karaf.features + features + 2.2.2 + + + org.apache.karaf.features.core + bundle + Apache Karaf :: Features :: Core + This bundle is the core implementation of the Karaf features support. + + + ${basedir}/../../etc/appended-resources + + + + + org.osgi + org.osgi.core + provided + + + + org.osgi + org.osgi.compendium + provided + + + + org.apache.felix + org.apache.felix.utils + provided + + + org.apache.felix + org.apache.felix.bundlerepository + + + + org.apache.karaf.shell + org.apache.karaf.shell.console + + + + org.apache.karaf.shell + org.apache.karaf.shell.obr + + + + org.springframework.osgi + spring-osgi-core + test + + + org.apache.servicemix.bundles + org.apache.servicemix.bundles.junit + test + + + org.easymock + easymock + test + + + org.slf4j + slf4j-jdk14 + test + + + + + + + ${project.basedir}/src/main/resources + + **/* + + + + ${project.basedir}/src/main/resources + true + + **/*.info + + + + + + org.apache.felix + maven-bundle-plugin + + + org.apache.karaf.features;version=${project.version} + + !org.apache.karaf.features, + javax.management, + javax.management.loading, + org.apache.felix.service.command, + org.apache.felix.gogo.commands, + org.apache.karaf.shell.console, + org.osgi.service.event*;resolution:=optional, + * + + + org.apache.karaf.features.internal, + org.apache.felix.utils.version, + org.apache.felix.utils.manifest + + + + + + + diff --git a/archiva-modules/archiva-web/archiva-webapp/pom.xml b/archiva-modules/archiva-web/archiva-webapp/pom.xml index 4108e25f7..40ed834f3 100644 --- a/archiva-modules/archiva-web/archiva-webapp/pom.xml +++ b/archiva-modules/archiva-web/archiva-webapp/pom.xml @@ -401,6 +401,17 @@ archiva-plexus-bridge + + org.apache.archiva + archiva-repository-admin-api + + + + + org.apache.archiva + archiva-repository-admin-default + + org.apache.archiva metadata-repository-api diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/archiva/web/tags/CopyPasteSnippetTag.java b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/archiva/web/tags/CopyPasteSnippetTag.java index bc8e863fc..72d064744 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/archiva/web/tags/CopyPasteSnippetTag.java +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/archiva/web/tags/CopyPasteSnippetTag.java @@ -19,7 +19,7 @@ package org.apache.archiva.web.tags; * under the License. */ -import org.apache.archiva.admin.repository.managed.ManagedRepository; +import org.apache.archiva.admin.model.managed.ManagedRepository; import org.apache.archiva.web.util.ContextUtils; import org.apache.commons.lang.StringEscapeUtils; import org.slf4j.Logger; diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/AbstractActionSupport.java b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/AbstractActionSupport.java index 78c5f851d..001b67b59 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/AbstractActionSupport.java +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/AbstractActionSupport.java @@ -21,13 +21,13 @@ package org.apache.maven.archiva.web.action; import com.opensymphony.xwork2.ActionContext; import com.opensymphony.xwork2.ActionSupport; -import org.apache.archiva.admin.AuditInformation; +import org.apache.archiva.admin.model.AuditInformation; import org.apache.archiva.audit.AuditEvent; import org.apache.archiva.audit.AuditListener; import org.apache.archiva.audit.Auditable; import org.apache.archiva.metadata.repository.RepositorySessionFactory; -import org.apache.commons.lang.StringUtils; import org.apache.archiva.security.ArchivaXworkUser; +import org.apache.commons.lang.StringUtils; import org.apache.struts2.ServletActionContext; import org.apache.struts2.interceptor.SessionAware; import org.codehaus.plexus.redback.users.User; diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/SearchAction.java b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/SearchAction.java index f9a65f572..837563bf5 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/SearchAction.java +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/SearchAction.java @@ -59,12 +59,11 @@ public class SearchAction /** * Query string. */ + private String q; // FIXME olamy WTF here?? private ArchivaConfiguration archivaConfiguration; - private String q; - /** * The Search Results. */ diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/appearance/AbstractAppearanceAction.java b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/appearance/AbstractAppearanceAction.java index c3feab958..9c4cbeee5 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/appearance/AbstractAppearanceAction.java +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/appearance/AbstractAppearanceAction.java @@ -20,8 +20,8 @@ package org.apache.maven.archiva.web.action.admin.appearance; */ import com.opensymphony.xwork2.Preparable; -import org.apache.archiva.admin.repository.admin.ArchivaAdministration; -import org.apache.archiva.admin.repository.admin.OrganisationInformation; +import org.apache.archiva.admin.model.admin.ArchivaAdministration; +import org.apache.archiva.admin.model.admin.OrganisationInformation; import org.apache.maven.archiva.web.action.AbstractActionSupport; import javax.inject.Inject; diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/appearance/EditOrganisationInfoAction.java b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/appearance/EditOrganisationInfoAction.java index 647cae7ae..27276a8a3 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/appearance/EditOrganisationInfoAction.java +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/appearance/EditOrganisationInfoAction.java @@ -20,8 +20,8 @@ package org.apache.maven.archiva.web.action.admin.appearance; */ import com.opensymphony.xwork2.Validateable; -import org.apache.archiva.admin.repository.RepositoryAdminException; -import org.apache.archiva.admin.repository.admin.OrganisationInformation; +import org.apache.archiva.admin.model.RepositoryAdminException; +import org.apache.archiva.admin.model.admin.OrganisationInformation; import org.apache.archiva.security.common.ArchivaRoleConstants; import org.apache.commons.lang.StringUtils; import org.codehaus.plexus.redback.rbac.Resource; diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/AbstractProxyConnectorAction.java b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/AbstractProxyConnectorAction.java index 45ea70928..a89bc1db9 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/AbstractProxyConnectorAction.java +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/AbstractProxyConnectorAction.java @@ -19,11 +19,11 @@ package org.apache.maven.archiva.web.action.admin.connectors.proxy; * under the License. */ -import org.apache.archiva.admin.repository.RepositoryAdminException; -import org.apache.archiva.admin.repository.managed.ManagedRepositoryAdmin; -import org.apache.archiva.admin.repository.proxyconnector.ProxyConnector; -import org.apache.archiva.admin.repository.proxyconnector.ProxyConnectorAdmin; -import org.apache.archiva.admin.repository.remote.RemoteRepositoryAdmin; +import org.apache.archiva.admin.model.RepositoryAdminException; +import org.apache.archiva.admin.model.managed.ManagedRepositoryAdmin; +import org.apache.archiva.admin.model.proxyconnector.ProxyConnector; +import org.apache.archiva.admin.model.proxyconnector.ProxyConnectorAdmin; +import org.apache.archiva.admin.model.remote.RemoteRepositoryAdmin; import org.apache.archiva.security.common.ArchivaRoleConstants; import org.apache.commons.lang.StringUtils; import org.apache.maven.archiva.web.action.AbstractActionSupport; diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/AbstractProxyConnectorFormAction.java b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/AbstractProxyConnectorFormAction.java index 6f92a879b..ad3d832be 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/AbstractProxyConnectorFormAction.java +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/AbstractProxyConnectorFormAction.java @@ -20,8 +20,8 @@ package org.apache.maven.archiva.web.action.admin.connectors.proxy; */ import com.opensymphony.xwork2.Preparable; -import org.apache.archiva.admin.repository.RepositoryAdminException; -import org.apache.archiva.admin.repository.proxyconnector.ProxyConnector; +import org.apache.archiva.admin.model.RepositoryAdminException; +import org.apache.archiva.admin.model.proxyconnector.ProxyConnector; import org.apache.commons.lang.StringUtils; import org.apache.maven.archiva.configuration.ArchivaConfiguration; import org.apache.maven.archiva.policies.DownloadErrorPolicy; diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/AddProxyConnectorAction.java b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/AddProxyConnectorAction.java index 40455de43..dc32b9cdf 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/AddProxyConnectorAction.java +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/AddProxyConnectorAction.java @@ -19,8 +19,8 @@ package org.apache.maven.archiva.web.action.admin.connectors.proxy; * under the License. */ -import org.apache.archiva.admin.repository.RepositoryAdminException; -import org.apache.archiva.admin.repository.proxyconnector.ProxyConnector; +import org.apache.archiva.admin.model.RepositoryAdminException; +import org.apache.archiva.admin.model.proxyconnector.ProxyConnector; import org.apache.commons.lang.StringUtils; import org.springframework.context.annotation.Scope; import org.springframework.stereotype.Controller; diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/DeleteProxyConnectorAction.java b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/DeleteProxyConnectorAction.java index 589892ebc..933ff0431 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/DeleteProxyConnectorAction.java +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/DeleteProxyConnectorAction.java @@ -19,8 +19,8 @@ package org.apache.maven.archiva.web.action.admin.connectors.proxy; * under the License. */ -import org.apache.archiva.admin.repository.RepositoryAdminException; -import org.apache.archiva.admin.repository.proxyconnector.ProxyConnector; +import org.apache.archiva.admin.model.RepositoryAdminException; +import org.apache.archiva.admin.model.proxyconnector.ProxyConnector; import org.springframework.context.annotation.Scope; import org.springframework.stereotype.Controller; diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/DisableProxyConnectorAction.java b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/DisableProxyConnectorAction.java index d8c214ca5..b719f0b1c 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/DisableProxyConnectorAction.java +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/DisableProxyConnectorAction.java @@ -1,7 +1,7 @@ package org.apache.maven.archiva.web.action.admin.connectors.proxy; -import org.apache.archiva.admin.repository.RepositoryAdminException; -import org.apache.archiva.admin.repository.proxyconnector.ProxyConnector; +import org.apache.archiva.admin.model.RepositoryAdminException; +import org.apache.archiva.admin.model.proxyconnector.ProxyConnector; import org.springframework.context.annotation.Scope; import org.springframework.stereotype.Controller; diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/EditProxyConnectorAction.java b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/EditProxyConnectorAction.java index 21f572520..3df4904be 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/EditProxyConnectorAction.java +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/EditProxyConnectorAction.java @@ -19,8 +19,8 @@ package org.apache.maven.archiva.web.action.admin.connectors.proxy; * under the License. */ -import org.apache.archiva.admin.repository.RepositoryAdminException; -import org.apache.archiva.admin.repository.proxyconnector.ProxyConnector; +import org.apache.archiva.admin.model.RepositoryAdminException; +import org.apache.archiva.admin.model.proxyconnector.ProxyConnector; import org.springframework.context.annotation.Scope; import org.springframework.stereotype.Controller; diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/EnableProxyConnectorAction.java b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/EnableProxyConnectorAction.java index c06597a3f..8d17d8d48 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/EnableProxyConnectorAction.java +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/EnableProxyConnectorAction.java @@ -1,7 +1,7 @@ package org.apache.maven.archiva.web.action.admin.connectors.proxy; -import org.apache.archiva.admin.repository.RepositoryAdminException; -import org.apache.archiva.admin.repository.proxyconnector.ProxyConnector; +import org.apache.archiva.admin.model.RepositoryAdminException; +import org.apache.archiva.admin.model.proxyconnector.ProxyConnector; import org.springframework.context.annotation.Scope; import org.springframework.stereotype.Controller; diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/ProxyConnectorsAction.java b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/ProxyConnectorsAction.java index 90c98ee63..50b8048d3 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/ProxyConnectorsAction.java +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/ProxyConnectorsAction.java @@ -20,9 +20,9 @@ package org.apache.maven.archiva.web.action.admin.connectors.proxy; */ import com.opensymphony.xwork2.Preparable; -import org.apache.archiva.admin.repository.AbstractRepository; -import org.apache.archiva.admin.repository.RepositoryAdminException; -import org.apache.archiva.admin.repository.proxyconnector.ProxyConnector; +import org.apache.archiva.admin.model.AbstractRepository; +import org.apache.archiva.admin.model.RepositoryAdminException; +import org.apache.archiva.admin.model.proxyconnector.ProxyConnector; import org.springframework.context.annotation.Scope; import org.springframework.stereotype.Controller; diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/SortProxyConnectorsAction.java b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/SortProxyConnectorsAction.java index d37894cb5..5ae02c838 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/SortProxyConnectorsAction.java +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/SortProxyConnectorsAction.java @@ -19,8 +19,8 @@ package org.apache.maven.archiva.web.action.admin.connectors.proxy; * under the License. */ -import org.apache.archiva.admin.repository.RepositoryAdminException; -import org.apache.archiva.admin.repository.proxyconnector.ProxyConnector; +import org.apache.archiva.admin.model.RepositoryAdminException; +import org.apache.archiva.admin.model.proxyconnector.ProxyConnector; import org.apache.commons.lang.StringUtils; import org.springframework.context.annotation.Scope; import org.springframework.stereotype.Controller; diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/legacy/AddLegacyArtifactPathAction.java b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/legacy/AddLegacyArtifactPathAction.java index 5986630c4..cdffc3b6b 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/legacy/AddLegacyArtifactPathAction.java +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/legacy/AddLegacyArtifactPathAction.java @@ -21,9 +21,9 @@ package org.apache.maven.archiva.web.action.admin.legacy; import com.opensymphony.xwork2.Preparable; import com.opensymphony.xwork2.Validateable; -import org.apache.archiva.admin.repository.RepositoryAdminException; -import org.apache.archiva.admin.repository.admin.ArchivaAdministration; -import org.apache.archiva.admin.repository.admin.LegacyArtifactPath; +import org.apache.archiva.admin.model.RepositoryAdminException; +import org.apache.archiva.admin.model.admin.ArchivaAdministration; +import org.apache.archiva.admin.model.admin.LegacyArtifactPath; import org.apache.commons.lang.StringUtils; import org.apache.maven.archiva.model.ArtifactReference; import org.apache.maven.archiva.repository.ManagedRepositoryContent; diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/legacy/DeleteLegacyArtifactPathAction.java b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/legacy/DeleteLegacyArtifactPathAction.java index 220d7b145..79f4abc63 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/legacy/DeleteLegacyArtifactPathAction.java +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/legacy/DeleteLegacyArtifactPathAction.java @@ -19,8 +19,8 @@ package org.apache.maven.archiva.web.action.admin.legacy; * under the License. */ -import org.apache.archiva.admin.repository.RepositoryAdminException; -import org.apache.archiva.admin.repository.admin.ArchivaAdministration; +import org.apache.archiva.admin.model.RepositoryAdminException; +import org.apache.archiva.admin.model.admin.ArchivaAdministration; import org.apache.maven.archiva.web.action.AbstractActionSupport; import org.springframework.context.annotation.Scope; import org.springframework.stereotype.Controller; diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/legacy/LegacyArtifactPathAction.java b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/legacy/LegacyArtifactPathAction.java index 1aadd0a6b..d4a4cdcb9 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/legacy/LegacyArtifactPathAction.java +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/legacy/LegacyArtifactPathAction.java @@ -20,9 +20,9 @@ package org.apache.maven.archiva.web.action.admin.legacy; */ import com.opensymphony.xwork2.Preparable; -import org.apache.archiva.admin.repository.RepositoryAdminException; -import org.apache.archiva.admin.repository.admin.ArchivaAdministration; -import org.apache.archiva.admin.repository.admin.LegacyArtifactPath; +import org.apache.archiva.admin.model.RepositoryAdminException; +import org.apache.archiva.admin.model.admin.ArchivaAdministration; +import org.apache.archiva.admin.model.admin.LegacyArtifactPath; import org.apache.archiva.security.common.ArchivaRoleConstants; import org.apache.archiva.web.util.ContextUtils; import org.apache.maven.archiva.web.action.AbstractActionSupport; diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/networkproxies/ConfigureNetworkProxyAction.java b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/networkproxies/ConfigureNetworkProxyAction.java index 9779a3c7d..8a6ad4be3 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/networkproxies/ConfigureNetworkProxyAction.java +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/networkproxies/ConfigureNetworkProxyAction.java @@ -21,9 +21,9 @@ package org.apache.maven.archiva.web.action.admin.networkproxies; import com.opensymphony.xwork2.Preparable; import com.opensymphony.xwork2.Validateable; -import org.apache.archiva.admin.repository.RepositoryAdminException; -import org.apache.archiva.admin.repository.networkproxy.NetworkProxy; -import org.apache.archiva.admin.repository.networkproxy.NetworkProxyAdmin; +import org.apache.archiva.admin.model.RepositoryAdminException; +import org.apache.archiva.admin.model.networkproxy.NetworkProxy; +import org.apache.archiva.admin.model.networkproxy.NetworkProxyAdmin; import org.apache.archiva.security.common.ArchivaRoleConstants; import org.apache.commons.lang.StringUtils; import org.apache.maven.archiva.web.action.AbstractActionSupport; diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/networkproxies/NetworkProxiesAction.java b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/networkproxies/NetworkProxiesAction.java index 1d73e032e..4a8365adc 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/networkproxies/NetworkProxiesAction.java +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/networkproxies/NetworkProxiesAction.java @@ -20,8 +20,8 @@ package org.apache.maven.archiva.web.action.admin.networkproxies; */ import com.opensymphony.xwork2.Preparable; -import org.apache.archiva.admin.repository.networkproxy.NetworkProxy; -import org.apache.archiva.admin.repository.networkproxy.NetworkProxyAdmin; +import org.apache.archiva.admin.model.networkproxy.NetworkProxy; +import org.apache.archiva.admin.model.networkproxy.NetworkProxyAdmin; import org.apache.archiva.security.common.ArchivaRoleConstants; import org.apache.maven.archiva.web.action.AbstractActionSupport; import org.codehaus.plexus.redback.rbac.Resource; diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/AbstractRemoteRepositoriesAction.java b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/AbstractRemoteRepositoriesAction.java index 08bbcfe37..197beae58 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/AbstractRemoteRepositoriesAction.java +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/AbstractRemoteRepositoriesAction.java @@ -1,6 +1,6 @@ package org.apache.maven.archiva.web.action.admin.repositories; -import org.apache.archiva.admin.repository.remote.RemoteRepositoryAdmin; +import org.apache.archiva.admin.model.remote.RemoteRepositoryAdmin; import javax.inject.Inject; diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/AbstractRepositoriesAdminAction.java b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/AbstractRepositoriesAdminAction.java index 5f8ffeab4..e2bc9f43b 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/AbstractRepositoriesAdminAction.java +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/AbstractRepositoriesAdminAction.java @@ -19,8 +19,8 @@ package org.apache.maven.archiva.web.action.admin.repositories; * under the License. */ +import org.apache.archiva.admin.model.managed.ManagedRepositoryAdmin; import org.apache.archiva.admin.repository.RepositoryCommonValidator; -import org.apache.archiva.admin.repository.managed.ManagedRepositoryAdmin; import org.apache.archiva.audit.Auditable; import org.apache.archiva.security.common.ArchivaRoleConstants; import org.apache.maven.archiva.configuration.ArchivaConfiguration; diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/AddManagedRepositoryAction.java b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/AddManagedRepositoryAction.java index 118cd45d4..24e9714f0 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/AddManagedRepositoryAction.java +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/AddManagedRepositoryAction.java @@ -21,8 +21,8 @@ package org.apache.maven.archiva.web.action.admin.repositories; import com.opensymphony.xwork2.Preparable; import com.opensymphony.xwork2.Validateable; -import org.apache.archiva.admin.repository.RepositoryAdminException; -import org.apache.archiva.admin.repository.managed.ManagedRepository; +import org.apache.archiva.admin.model.RepositoryAdminException; +import org.apache.archiva.admin.model.managed.ManagedRepository; import org.apache.commons.lang.StringUtils; import org.apache.maven.archiva.configuration.Configuration; import org.codehaus.redback.components.scheduler.CronExpressionValidator; diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/AddRemoteRepositoryAction.java b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/AddRemoteRepositoryAction.java index 606332674..4261dc028 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/AddRemoteRepositoryAction.java +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/AddRemoteRepositoryAction.java @@ -21,8 +21,8 @@ package org.apache.maven.archiva.web.action.admin.repositories; import com.opensymphony.xwork2.Preparable; import com.opensymphony.xwork2.Validateable; -import org.apache.archiva.admin.repository.RepositoryAdminException; -import org.apache.archiva.admin.repository.remote.RemoteRepository; +import org.apache.archiva.admin.model.RepositoryAdminException; +import org.apache.archiva.admin.model.remote.RemoteRepository; import org.apache.maven.archiva.configuration.Configuration; import org.springframework.context.annotation.Scope; import org.springframework.stereotype.Controller; diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/DeleteManagedRepositoryAction.java b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/DeleteManagedRepositoryAction.java index 9aee5081c..9b2113afb 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/DeleteManagedRepositoryAction.java +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/DeleteManagedRepositoryAction.java @@ -20,7 +20,8 @@ package org.apache.maven.archiva.web.action.admin.repositories; */ import com.opensymphony.xwork2.Preparable; -import org.apache.archiva.admin.repository.RepositoryAdminException; +import org.apache.archiva.admin.model.RepositoryAdminException; +import org.apache.archiva.admin.model.managed.ManagedRepository; import org.apache.commons.lang.StringUtils; import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration; import org.springframework.context.annotation.Scope; @@ -39,20 +40,19 @@ public class DeleteManagedRepositoryAction { - private ManagedRepositoryConfiguration repository; + private ManagedRepository repository; - private ManagedRepositoryConfiguration stagingRepository; + private ManagedRepository stagingRepository; private String repoid; - // FIXME olamy use ManagedRepositoryAdmin rather tha, directly archivaConfiguration public void prepare() + throws RepositoryAdminException { if ( StringUtils.isNotBlank( repoid ) ) { - this.repository = archivaConfiguration.getConfiguration().findManagedRepositoryById( repoid ); - this.stagingRepository = - archivaConfiguration.getConfiguration().findManagedRepositoryById( repoid + "-stage" ); + this.repository = getManagedRepositoryAdmin().getManagedRepository( repoid ); + this.stagingRepository = getManagedRepositoryAdmin().getManagedRepository( repoid + "-stage" ); } } @@ -79,7 +79,7 @@ public class DeleteManagedRepositoryAction private String deleteRepository( boolean deleteContents ) { - ManagedRepositoryConfiguration existingRepository = repository; + ManagedRepository existingRepository = repository; if ( existingRepository == null ) { addActionError( "A repository with that id does not exist" ); @@ -103,12 +103,12 @@ public class DeleteManagedRepositoryAction return result; } - public ManagedRepositoryConfiguration getRepository() + public ManagedRepository getRepository() { return repository; } - public void setRepository( ManagedRepositoryConfiguration repository ) + public void setRepository( ManagedRepository repository ) { this.repository = repository; } diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/DeleteRemoteRepositoryAction.java b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/DeleteRemoteRepositoryAction.java index a994bd5a8..eafe8181a 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/DeleteRemoteRepositoryAction.java +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/DeleteRemoteRepositoryAction.java @@ -20,8 +20,8 @@ package org.apache.maven.archiva.web.action.admin.repositories; */ import com.opensymphony.xwork2.Preparable; -import org.apache.archiva.admin.repository.RepositoryAdminException; -import org.apache.archiva.admin.repository.remote.RemoteRepository; +import org.apache.archiva.admin.model.RepositoryAdminException; +import org.apache.archiva.admin.model.remote.RemoteRepository; import org.apache.commons.lang.StringUtils; import org.springframework.context.annotation.Scope; import org.springframework.stereotype.Controller; diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/DeleteRepositoryGroupAction.java b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/DeleteRepositoryGroupAction.java index 541b77830..4f2f7c78a 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/DeleteRepositoryGroupAction.java +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/DeleteRepositoryGroupAction.java @@ -20,16 +20,18 @@ package org.apache.maven.archiva.web.action.admin.repositories; */ import com.opensymphony.xwork2.Preparable; -import org.apache.archiva.audit.AuditEvent; +import org.apache.archiva.admin.model.RepositoryAdminException; +import org.apache.archiva.admin.model.group.RepositoryGroup; +import org.apache.archiva.admin.model.group.RepositoryGroupAdmin; import org.apache.commons.lang.StringUtils; -import org.apache.maven.archiva.configuration.Configuration; import org.apache.maven.archiva.configuration.RepositoryGroupConfiguration; import org.springframework.context.annotation.Scope; import org.springframework.stereotype.Controller; +import javax.inject.Inject; + /** * DeleteRepositoryGroupAction - * */ @Controller( "deleteRepositoryGroupAction" ) @Scope( "prototype" ) @@ -37,15 +39,20 @@ public class DeleteRepositoryGroupAction extends AbstractRepositoriesAdminAction implements Preparable { - private RepositoryGroupConfiguration repositoryGroup; + private RepositoryGroup repositoryGroup; + + @Inject + private RepositoryGroupAdmin repositoryGroupAdmin; private String repoGroupId; public void prepare() + throws RepositoryAdminException { + if ( StringUtils.isNotBlank( repoGroupId ) ) { - this.repositoryGroup = archivaConfiguration.getConfiguration().findRepositoryGroupById( repoGroupId ); + this.repositoryGroup = repositoryGroupAdmin.getRepositoryGroup( repoGroupId ); } } @@ -62,26 +69,32 @@ public class DeleteRepositoryGroupAction public String delete() { - Configuration config = archivaConfiguration.getConfiguration(); - RepositoryGroupConfiguration group = config.findRepositoryGroupById( repoGroupId ); - if ( group == null ) + try { - addActionError( "A repository group with that id does not exist." ); + RepositoryGroup group = repositoryGroupAdmin.getRepositoryGroup( repoGroupId ); + if ( group == null ) + { + addActionError( "A repository group with that id does not exist." ); + return ERROR; + } + + repositoryGroupAdmin.deleteRepositoryGroup( repoGroupId, getAuditInformation() ); + return SUCCESS; + } + catch ( RepositoryAdminException e ) + { + addActionError( "error occured " + e.getMessage() ); return ERROR; } - - config.removeRepositoryGroup( group ); - triggerAuditEvent( AuditEvent.DELETE_REPO_GROUP + " " + repoGroupId ); - return saveConfiguration( config ); } - public RepositoryGroupConfiguration getRepositoryGroup() + public RepositoryGroup getRepositoryGroup() { return repositoryGroup; } - public void setRepositoryGroup( RepositoryGroupConfiguration repositoryGroup ) + public void setRepositoryGroup( RepositoryGroup repositoryGroup ) { this.repositoryGroup = repositoryGroup; } diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/EditManagedRepositoryAction.java b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/EditManagedRepositoryAction.java index a692d3f63..14732f956 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/EditManagedRepositoryAction.java +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/EditManagedRepositoryAction.java @@ -21,8 +21,8 @@ package org.apache.maven.archiva.web.action.admin.repositories; import com.opensymphony.xwork2.Preparable; import com.opensymphony.xwork2.Validateable; -import org.apache.archiva.admin.repository.RepositoryAdminException; -import org.apache.archiva.admin.repository.managed.ManagedRepository; +import org.apache.archiva.admin.model.RepositoryAdminException; +import org.apache.archiva.admin.model.managed.ManagedRepository; import org.apache.commons.lang.StringUtils; import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration; import org.codehaus.redback.components.scheduler.CronExpressionValidator; diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/EditRemoteRepositoryAction.java b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/EditRemoteRepositoryAction.java index 7e9cf00ac..49b8cfd12 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/EditRemoteRepositoryAction.java +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/EditRemoteRepositoryAction.java @@ -20,8 +20,8 @@ package org.apache.maven.archiva.web.action.admin.repositories; */ import com.opensymphony.xwork2.Preparable; -import org.apache.archiva.admin.repository.RepositoryAdminException; -import org.apache.archiva.admin.repository.remote.RemoteRepository; +import org.apache.archiva.admin.model.RepositoryAdminException; +import org.apache.archiva.admin.model.remote.RemoteRepository; import org.apache.commons.lang.StringUtils; import org.springframework.context.annotation.Scope; import org.springframework.stereotype.Controller; diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/RepositoriesAction.java b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/RepositoriesAction.java index d0bc90f22..a8af45def 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/RepositoriesAction.java +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/RepositoriesAction.java @@ -20,12 +20,12 @@ package org.apache.maven.archiva.web.action.admin.repositories; */ import com.opensymphony.xwork2.Preparable; -import org.apache.archiva.admin.repository.RepositoryAdminException; -import org.apache.archiva.admin.repository.group.RepositoryGroupAdmin; -import org.apache.archiva.admin.repository.managed.ManagedRepository; -import org.apache.archiva.admin.repository.managed.ManagedRepositoryAdmin; -import org.apache.archiva.admin.repository.remote.RemoteRepository; -import org.apache.archiva.admin.repository.remote.RemoteRepositoryAdmin; +import org.apache.archiva.admin.model.RepositoryAdminException; +import org.apache.archiva.admin.model.group.RepositoryGroupAdmin; +import org.apache.archiva.admin.model.managed.ManagedRepository; +import org.apache.archiva.admin.model.managed.ManagedRepositoryAdmin; +import org.apache.archiva.admin.model.remote.RemoteRepository; +import org.apache.archiva.admin.model.remote.RemoteRepositoryAdmin; import org.apache.archiva.admin.repository.utils.RepositoryComparator; import org.apache.archiva.metadata.repository.MetadataRepository; import org.apache.archiva.metadata.repository.MetadataRepositoryException; @@ -35,7 +35,6 @@ import org.apache.archiva.metadata.repository.stats.RepositoryStatisticsManager; import org.apache.archiva.security.common.ArchivaRoleConstants; import org.apache.archiva.web.util.ContextUtils; import org.apache.maven.archiva.configuration.ArchivaConfiguration; -import org.apache.maven.archiva.configuration.Configuration; import org.apache.maven.archiva.web.action.AbstractActionSupport; import org.apache.struts2.interceptor.ServletRequestAware; import org.codehaus.plexus.redback.rbac.Resource; @@ -65,9 +64,6 @@ public class RepositoriesAction implements SecureAction, ServletRequestAware, Preparable { - @Inject - private ArchivaConfiguration archivaConfiguration; - @Inject private ManagedRepositoryAdmin managedRepositoryAdmin; diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/RepositoryGroupsAction.java b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/RepositoryGroupsAction.java index 463ac6e8c..b92d8fb52 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/RepositoryGroupsAction.java +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/RepositoryGroupsAction.java @@ -20,10 +20,10 @@ package org.apache.maven.archiva.web.action.admin.repositories; */ import com.opensymphony.xwork2.Preparable; -import org.apache.archiva.admin.repository.RepositoryAdminException; -import org.apache.archiva.admin.repository.group.RepositoryGroup; -import org.apache.archiva.admin.repository.group.RepositoryGroupAdmin; -import org.apache.archiva.admin.repository.managed.ManagedRepository; +import org.apache.archiva.admin.model.RepositoryAdminException; +import org.apache.archiva.admin.model.group.RepositoryGroup; +import org.apache.archiva.admin.model.group.RepositoryGroupAdmin; +import org.apache.archiva.admin.model.managed.ManagedRepository; import org.apache.archiva.web.util.ContextUtils; import org.apache.struts2.interceptor.ServletRequestAware; import org.springframework.context.annotation.Scope; diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/SortRepositoriesAction.java b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/SortRepositoriesAction.java index 9139a9e35..1b15394d6 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/SortRepositoriesAction.java +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/SortRepositoriesAction.java @@ -29,13 +29,14 @@ import java.util.List; /** * SortRepositoriesAction - * + * FIXME remove access to archivaconfiguration */ @Controller( "sortRepositoriesAction" ) @Scope( "prototype" ) public class SortRepositoriesAction extends AbstractRepositoriesAdminAction { + private String repoGroupId; private String targetRepo; diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/scanning/RepositoryScanningAction.java b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/scanning/RepositoryScanningAction.java index c61810965..489ee3f5f 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/scanning/RepositoryScanningAction.java +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/scanning/RepositoryScanningAction.java @@ -21,9 +21,9 @@ package org.apache.maven.archiva.web.action.admin.scanning; import com.opensymphony.xwork2.Preparable; import com.opensymphony.xwork2.Validateable; -import org.apache.archiva.admin.repository.RepositoryAdminException; -import org.apache.archiva.admin.repository.admin.ArchivaAdministration; -import org.apache.archiva.admin.repository.admin.FileType; +import org.apache.archiva.admin.model.RepositoryAdminException; +import org.apache.archiva.admin.model.admin.ArchivaAdministration; +import org.apache.archiva.admin.model.admin.FileType; import org.apache.archiva.admin.repository.admin.FiletypeToMapClosure; import org.apache.archiva.audit.Auditable; import org.apache.archiva.repository.scanner.RepositoryContentConsumers; diff --git a/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/DeleteArtifactActionTest.java b/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/DeleteArtifactActionTest.java index 49635f30e..c13829d58 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/DeleteArtifactActionTest.java +++ b/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/DeleteArtifactActionTest.java @@ -19,6 +19,8 @@ package org.apache.maven.archiva.web.action; * under the License. */ +import net.sf.beanlib.provider.replicator.BeanReplicator; +import org.apache.archiva.admin.model.managed.ManagedRepository; import org.apache.archiva.metadata.model.ArtifactMetadata; import org.apache.archiva.metadata.repository.MetadataRepository; import org.apache.archiva.metadata.repository.RepositorySession; @@ -131,7 +133,9 @@ public class DeleteArtifactActionTest Configuration config = createConfiguration(); ManagedRepositoryContent repoContent = new ManagedDefaultRepositoryContent(); - repoContent.setRepository( config.findManagedRepositoryById( REPOSITORY_ID ) ); + repoContent.setRepository( + new BeanReplicator().replicateBean( config.findManagedRepositoryById( REPOSITORY_ID ), + ManagedRepository.class ) ); configurationControl.expectAndReturn( configuration.getConfiguration(), config ); repositoryFactoryControl.expectAndReturn( repositoryFactory.getManagedRepositoryContent( REPOSITORY_ID ), diff --git a/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/ShowArtifactActionTest.java b/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/ShowArtifactActionTest.java index 83cb871e5..9b7de4f40 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/ShowArtifactActionTest.java +++ b/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/ShowArtifactActionTest.java @@ -20,6 +20,8 @@ package org.apache.maven.archiva.web.action; */ import com.opensymphony.xwork2.Action; +import net.sf.beanlib.provider.replicator.BeanReplicator; +import org.apache.archiva.admin.model.managed.ManagedRepository; import org.apache.archiva.metadata.model.ArtifactMetadata; import org.apache.archiva.metadata.model.Dependency; import org.apache.archiva.metadata.model.MailingList; @@ -58,7 +60,7 @@ public class ShowArtifactActionTest private static final String TEST_SNAPSHOT_VERSION = "1.0-SNAPSHOT"; private static final String TEST_TS_SNAPSHOT_VERSION = "1.0-20091120.111111-1"; - + private static final String TEST_NAMESPACE = "namespace"; private static final String OTHER_TEST_REPO = "first-repo"; @@ -74,6 +76,44 @@ public class ShowArtifactActionTest private static final String TEST_TYPE = "jar"; + protected void setUp() + throws Exception + { + super.setUp(); + action = (ShowArtifactAction) getActionProxy( "/showArtifact.action" ).getAction(); + + metadataResolver = new TestMetadataResolver(); + MetadataRepository repo = mock( MetadataRepository.class ); + RepositorySession repositorySession = mock( RepositorySession.class ); + when( repositorySession.getResolver() ).thenReturn( metadataResolver ); + when( repositorySession.getRepository() ).thenReturn( repo ); + TestRepositorySessionFactory repositorySessionFactory = + applicationContext.getBean( "repositorySessionFactory#test", TestRepositorySessionFactory.class ); + repositorySessionFactory.setRepositorySession( repositorySession ); + + RepositoryContentFactory factory = mock( RepositoryContentFactory.class ); + + action.setRepositoryFactory( factory ); + + ManagedRepository config = new ManagedRepository(); + config.setId( TEST_REPO ); + config.setLocation( new File( "target/test-repo" ).getAbsolutePath() ); + + ManagedRepositoryContent content = new ManagedDefaultRepositoryContent(); + content.setRepository( config ); + when( factory.getManagedRepositoryContent( TEST_REPO ) ).thenReturn( content ); + + ArchivaConfiguration archivaConfig = mock( ArchivaConfiguration.class ); + + Configuration configuration = new Configuration(); + configuration.addManagedRepository( + new BeanReplicator().replicateBean( config, ManagedRepositoryConfiguration.class ) ); + when( archivaConfig.getConfiguration() ).thenReturn( configuration ); + + when( factory.getArchivaConfiguration() ).thenReturn( archivaConfig ); + + } + public void testInstantiation() { assertFalse( action == getActionProxy( "/showArtifact.action" ).getAction() ); @@ -293,49 +333,49 @@ public class ShowArtifactActionTest assertNull( action.getMailingLists() ); assertTrue( action.getArtifacts().isEmpty() ); } - + public void testMetadataHasRepositoryFacetProblem() { String errMsg = "Error in resolving artifact's parent POM file: Sample Parent POM not found"; - ProjectVersionMetadata metaData = createProjectModel(TEST_SNAPSHOT_VERSION); - metaData.addFacet( createRepositoryProblemFacet( TEST_REPO, errMsg, - TEST_GROUP_ID, TEST_SNAPSHOT_VERSION, TEST_NAMESPACE ) ); - - + ProjectVersionMetadata metaData = createProjectModel( TEST_SNAPSHOT_VERSION ); + metaData.addFacet( + createRepositoryProblemFacet( TEST_REPO, errMsg, TEST_GROUP_ID, TEST_SNAPSHOT_VERSION, TEST_NAMESPACE ) ); + metadataResolver.setProjectVersion( TEST_REPO, TEST_GROUP_ID, TEST_ARTIFACT_ID, metaData ); - + metadataResolver.setArtifacts( TEST_REPO, TEST_GROUP_ID, TEST_ARTIFACT_ID, TEST_SNAPSHOT_VERSION, - TEST_SNAPSHOT_ARTIFACTS ); + TEST_SNAPSHOT_ARTIFACTS ); action.setGroupId( TEST_GROUP_ID ); action.setArtifactId( TEST_ARTIFACT_ID ); action.setVersion( TEST_SNAPSHOT_VERSION ); String result = action.artifact(); - + assertEquals( Action.SUCCESS, result ); assertTrue( action.hasActionErrors() ); assertFalse( action.hasActionMessages() ); assertEquals( "Artifact metadata is incomplete: " + errMsg, action.getActionErrors().toArray()[0].toString() ); } - + public void testMetadataIncomplete() { - ProjectVersionMetadata metaData = createProjectModel(TEST_SNAPSHOT_VERSION); + ProjectVersionMetadata metaData = createProjectModel( TEST_SNAPSHOT_VERSION ); metaData.setIncomplete( true ); - + metadataResolver.setProjectVersion( TEST_REPO, TEST_GROUP_ID, TEST_ARTIFACT_ID, metaData ); - + metadataResolver.setArtifacts( TEST_REPO, TEST_GROUP_ID, TEST_ARTIFACT_ID, TEST_SNAPSHOT_VERSION, - TEST_SNAPSHOT_ARTIFACTS ); + TEST_SNAPSHOT_ARTIFACTS ); action.setGroupId( TEST_GROUP_ID ); action.setArtifactId( TEST_ARTIFACT_ID ); - action.setVersion( TEST_SNAPSHOT_VERSION );; + action.setVersion( TEST_SNAPSHOT_VERSION ); + ; String result = action.artifact(); - + assertEquals( Action.SUCCESS, result ); assertTrue( action.hasActionErrors() ); @@ -679,8 +719,9 @@ public class ShowArtifactActionTest assertTrue( action.getActionErrors().isEmpty() ); assertTrue( action.getActionMessages().isEmpty() ); } - - private RepositoryProblemFacet createRepositoryProblemFacet( String repoId, String errMsg, String projectId, String projectVersion, String namespace ) + + private RepositoryProblemFacet createRepositoryProblemFacet( String repoId, String errMsg, String projectId, + String projectVersion, String namespace ) { RepositoryProblemFacet repoProblemFacet = new RepositoryProblemFacet(); repoProblemFacet.setRepositoryId( repoId ); @@ -692,41 +733,4 @@ public class ShowArtifactActionTest repoProblemFacet.setNamespace( namespace ); return repoProblemFacet; } - - protected void setUp() - throws Exception - { - super.setUp(); - action = (ShowArtifactAction) getActionProxy( "/showArtifact.action" ).getAction(); - - metadataResolver = new TestMetadataResolver(); - MetadataRepository repo = mock( MetadataRepository.class ); - RepositorySession repositorySession = mock( RepositorySession.class ); - when( repositorySession.getResolver() ).thenReturn( metadataResolver ); - when( repositorySession.getRepository() ).thenReturn( repo ); - TestRepositorySessionFactory repositorySessionFactory = - applicationContext.getBean( "repositorySessionFactory#test", TestRepositorySessionFactory.class ); - repositorySessionFactory.setRepositorySession( repositorySession ); - - RepositoryContentFactory factory = mock( RepositoryContentFactory.class ); - - action.setRepositoryFactory( factory ); - - ManagedRepositoryConfiguration config = new ManagedRepositoryConfiguration(); - config.setId( TEST_REPO ); - config.setLocation( new File( "target/test-repo" ).getAbsolutePath() ); - - ManagedRepositoryContent content = new ManagedDefaultRepositoryContent(); - content.setRepository( config ); - when( factory.getManagedRepositoryContent( TEST_REPO ) ).thenReturn( content ); - - ArchivaConfiguration archivaConfig = mock( ArchivaConfiguration.class ); - - Configuration configuration = new Configuration(); - configuration.addManagedRepository( config ); - when( archivaConfig.getConfiguration() ).thenReturn( configuration ); - - when( factory.getArchivaConfiguration() ).thenReturn( archivaConfig ); - - } } diff --git a/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/UploadActionTest.java b/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/UploadActionTest.java index e9e80111f..e3c81ed7b 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/UploadActionTest.java +++ b/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/UploadActionTest.java @@ -20,6 +20,8 @@ package org.apache.maven.archiva.web.action; */ import com.opensymphony.xwork2.Action; +import net.sf.beanlib.provider.replicator.BeanReplicator; +import org.apache.archiva.admin.model.managed.ManagedRepository; import org.apache.archiva.audit.AuditEvent; import org.apache.archiva.audit.AuditListener; import org.apache.archiva.checksum.ChecksumAlgorithm; @@ -140,19 +142,22 @@ public class UploadActionTest private void assertAllArtifactsIncludingSupportArtifactsArePresent( String repoLocation, String artifact, String version ) { - assertTrue( new File( repoLocation, "/org/apache/archiva/artifact-upload/" + version + "/" + artifact + ".jar" ).exists() ); + assertTrue( new File( repoLocation, + "/org/apache/archiva/artifact-upload/" + version + "/" + artifact + ".jar" ).exists() ); assertTrue( new File( repoLocation, "/org/apache/archiva/artifact-upload/" + version + "/" + artifact + ".jar.sha1" ).exists() ); assertTrue( new File( repoLocation, "/org/apache/archiva/artifact-upload/" + version + "/" + artifact + ".jar.md5" ).exists() ); - assertTrue( new File( repoLocation, "/org/apache/archiva/artifact-upload/" + version + "/" + artifact + ".pom" ).exists() ); + assertTrue( new File( repoLocation, + "/org/apache/archiva/artifact-upload/" + version + "/" + artifact + ".pom" ).exists() ); assertTrue( new File( repoLocation, "/org/apache/archiva/artifact-upload/" + version + "/" + artifact + ".pom.sha1" ).exists() ); assertTrue( new File( repoLocation, "/org/apache/archiva/artifact-upload/" + version + "/" + artifact + ".pom.md5" ).exists() ); - assertTrue( new File( repoLocation, "/org/apache/archiva/artifact-upload/" + MetadataTools.MAVEN_METADATA ).exists() ); + assertTrue( + new File( repoLocation, "/org/apache/archiva/artifact-upload/" + MetadataTools.MAVEN_METADATA ).exists() ); assertTrue( new File( repoLocation, "/org/apache/archiva/artifact-upload/" + MetadataTools.MAVEN_METADATA + ".sha1" ).exists() ); assertTrue( new File( repoLocation, "/org/apache/archiva/artifact-upload/" + MetadataTools.MAVEN_METADATA @@ -162,40 +167,37 @@ public class UploadActionTest private void verifyVersionMetadataChecksums( String repoLocation, String version ) throws IOException { - ChecksummedFile checksum = - new ChecksummedFile( new File( repoLocation, "/org/apache/archiva/artifact-upload/" + version + "/" - + MetadataTools.MAVEN_METADATA ) ); + ChecksummedFile checksum = new ChecksummedFile( new File( repoLocation, + "/org/apache/archiva/artifact-upload/" + version + "/" + + MetadataTools.MAVEN_METADATA ) ); String sha1 = checksum.calculateChecksum( ChecksumAlgorithm.SHA1 ); String md5 = checksum.calculateChecksum( ChecksumAlgorithm.MD5 ); - String contents = - FileUtils.readFileToString( new File( repoLocation, "/org/apache/archiva/artifact-upload/" + version + "/" - + MetadataTools.MAVEN_METADATA + ".sha1" ) ); + String contents = FileUtils.readFileToString( new File( repoLocation, + "/org/apache/archiva/artifact-upload/" + version + "/" + + MetadataTools.MAVEN_METADATA + ".sha1" ) ); assertTrue( StringUtils.contains( contents, sha1 ) ); - contents = - FileUtils.readFileToString( new File( repoLocation, "/org/apache/archiva/artifact-upload/" + version + "/" - + MetadataTools.MAVEN_METADATA + ".md5" ) ); + contents = FileUtils.readFileToString( new File( repoLocation, + "/org/apache/archiva/artifact-upload/" + version + "/" + + MetadataTools.MAVEN_METADATA + ".md5" ) ); assertTrue( StringUtils.contains( contents, md5 ) ); } private void verifyProjectMetadataChecksums( String repoLocation ) throws IOException { - ChecksummedFile checksum = - new ChecksummedFile( new File( repoLocation, "/org/apache/archiva/artifact-upload/" - + MetadataTools.MAVEN_METADATA ) ); + ChecksummedFile checksum = new ChecksummedFile( + new File( repoLocation, "/org/apache/archiva/artifact-upload/" + MetadataTools.MAVEN_METADATA ) ); String sha1 = checksum.calculateChecksum( ChecksumAlgorithm.SHA1 ); String md5 = checksum.calculateChecksum( ChecksumAlgorithm.MD5 ); - String contents = - FileUtils.readFileToString( new File( repoLocation, "/org/apache/archiva/artifact-upload/" - + MetadataTools.MAVEN_METADATA + ".sha1" ) ); + String contents = FileUtils.readFileToString( + new File( repoLocation, "/org/apache/archiva/artifact-upload/" + MetadataTools.MAVEN_METADATA + ".sha1" ) ); assertTrue( StringUtils.contains( contents, sha1 ) ); - contents = - FileUtils.readFileToString( new File( repoLocation, "/org/apache/archiva/artifact-upload/" - + MetadataTools.MAVEN_METADATA + ".md5" ) ); + contents = FileUtils.readFileToString( + new File( repoLocation, "/org/apache/archiva/artifact-upload/" + MetadataTools.MAVEN_METADATA + ".md5" ) ); assertTrue( StringUtils.contains( contents, md5 ) ); } @@ -206,40 +208,34 @@ public class UploadActionTest String sha1; String md5; String contents; - checksum = - new ChecksummedFile( new File( repoLocation, "/org/apache/archiva/artifact-upload/" + version + "/" - + artifact + ".pom" ) ); + checksum = new ChecksummedFile( + new File( repoLocation, "/org/apache/archiva/artifact-upload/" + version + "/" + artifact + ".pom" ) ); sha1 = checksum.calculateChecksum( ChecksumAlgorithm.SHA1 ); md5 = checksum.calculateChecksum( ChecksumAlgorithm.MD5 ); - contents = - FileUtils.readFileToString( new File( repoLocation, "/org/apache/archiva/artifact-upload/" + version + "/" - + artifact + ".pom.sha1" ) ); + contents = FileUtils.readFileToString( + new File( repoLocation, "/org/apache/archiva/artifact-upload/" + version + "/" + artifact + ".pom.sha1" ) ); assertTrue( StringUtils.contains( contents, sha1 ) ); - contents = - FileUtils.readFileToString( new File( repoLocation, "/org/apache/archiva/artifact-upload/" + version + "/" - + artifact + ".pom.md5" ) ); + contents = FileUtils.readFileToString( + new File( repoLocation, "/org/apache/archiva/artifact-upload/" + version + "/" + artifact + ".pom.md5" ) ); assertTrue( StringUtils.contains( contents, md5 ) ); } private void verifyArtifactChecksums( String repoLocation, String artifact, String version ) throws IOException { - ChecksummedFile checksum = - new ChecksummedFile( new File( repoLocation, "/org/apache/archiva/artifact-upload/" + version + "/" - + artifact + ".jar" ) ); + ChecksummedFile checksum = new ChecksummedFile( + new File( repoLocation, "/org/apache/archiva/artifact-upload/" + version + "/" + artifact + ".jar" ) ); String sha1 = checksum.calculateChecksum( ChecksumAlgorithm.SHA1 ); String md5 = checksum.calculateChecksum( ChecksumAlgorithm.MD5 ); - String contents = - FileUtils.readFileToString( new File( repoLocation, "/org/apache/archiva/artifact-upload/" + version + "/" - + artifact + ".jar.sha1" ) ); + String contents = FileUtils.readFileToString( + new File( repoLocation, "/org/apache/archiva/artifact-upload/" + version + "/" + artifact + ".jar.sha1" ) ); assertTrue( StringUtils.contains( contents, sha1 ) ); - contents = - FileUtils.readFileToString( new File( repoLocation, "/org/apache/archiva/artifact-upload/" + version + "/" - + artifact + ".jar.md5" ) ); + contents = FileUtils.readFileToString( + new File( repoLocation, "/org/apache/archiva/artifact-upload/" + version + "/" + artifact + ".jar.md5" ) ); assertTrue( StringUtils.contains( contents, md5 ) ); } @@ -256,12 +252,12 @@ public class UploadActionTest { endIndex = artifactsList[index].indexOf( ".pom" ); } - + timestamp = artifactsList[index].substring( startIndex, endIndex ); return timestamp; } - + private MockControl mockAuditLogs( List resources ) { return mockAuditLogs( AuditEvent.UPLOAD_FILE, resources ); @@ -286,16 +282,17 @@ public class UploadActionTest uploadAction.setAuditListeners( Collections.singletonList( listener ) ); return control; } - + public void testArtifactUploadWithPomSuccessful() throws Exception { setUploadParameters( "1.0", null, new File( FileUtil.getBasedir(), "target/test-classes/upload-artifact-test/artifact-to-be-uploaded.jar" ), - new File( FileUtil.getBasedir(), "target/test-classes/upload-artifact-test/pom.xml" ), false ); + new File( FileUtil.getBasedir(), "target/test-classes/upload-artifact-test/pom.xml" ), + false ); ManagedRepositoryContent content = new ManagedDefaultRepositoryContent(); - content.setRepository( config.findManagedRepositoryById( REPOSITORY_ID ) ); + content.setRepository( getManagedRepository( config.findManagedRepositoryById( REPOSITORY_ID ) ) ); archivaConfigControl.expectAndReturn( archivaConfig.getConfiguration(), config ); repoFactoryControl.expectAndReturn( repoFactory.getManagedRepositoryContent( REPOSITORY_ID ), content ); @@ -327,10 +324,11 @@ public class UploadActionTest { setUploadParameters( "1.0", "tests", new File( FileUtil.getBasedir(), "target/test-classes/upload-artifact-test/artifact-to-be-uploaded.jar" ), - new File( FileUtil.getBasedir(), "target/test-classes/upload-artifact-test/pom.xml" ), false ); + new File( FileUtil.getBasedir(), "target/test-classes/upload-artifact-test/pom.xml" ), + false ); ManagedRepositoryContent content = new ManagedDefaultRepositoryContent(); - content.setRepository( config.findManagedRepositoryById( REPOSITORY_ID ) ); + content.setRepository( getManagedRepository( config.findManagedRepositoryById( REPOSITORY_ID ) ) ); archivaConfigControl.expectAndReturn( archivaConfig.getConfiguration(), config ); repoFactoryControl.expectAndReturn( repoFactory.getManagedRepositoryContent( REPOSITORY_ID ), content ); @@ -350,16 +348,22 @@ public class UploadActionTest control.verify(); String repoLocation = config.findManagedRepositoryById( REPOSITORY_ID ).getLocation(); - assertTrue( new File( repoLocation, "/org/apache/archiva/artifact-upload/1.0/artifact-upload-1.0-tests.jar" ).exists() ); + assertTrue( new File( repoLocation, + "/org/apache/archiva/artifact-upload/1.0/artifact-upload-1.0-tests.jar" ).exists() ); assertTrue( new File( repoLocation, "/org/apache/archiva/artifact-upload/1.0/artifact-upload-1.0-tests.jar.sha1" ).exists() ); - assertTrue( new File( repoLocation, "/org/apache/archiva/artifact-upload/1.0/artifact-upload-1.0-tests.jar.md5" ).exists() ); + assertTrue( new File( repoLocation, + "/org/apache/archiva/artifact-upload/1.0/artifact-upload-1.0-tests.jar.md5" ).exists() ); - assertTrue( new File( repoLocation, "/org/apache/archiva/artifact-upload/1.0/artifact-upload-1.0.pom" ).exists() ); - assertTrue( new File( repoLocation, "/org/apache/archiva/artifact-upload/1.0/artifact-upload-1.0.pom.sha1" ).exists() ); - assertTrue( new File( repoLocation, "/org/apache/archiva/artifact-upload/1.0/artifact-upload-1.0.pom.md5" ).exists() ); + assertTrue( + new File( repoLocation, "/org/apache/archiva/artifact-upload/1.0/artifact-upload-1.0.pom" ).exists() ); + assertTrue( + new File( repoLocation, "/org/apache/archiva/artifact-upload/1.0/artifact-upload-1.0.pom.sha1" ).exists() ); + assertTrue( + new File( repoLocation, "/org/apache/archiva/artifact-upload/1.0/artifact-upload-1.0.pom.md5" ).exists() ); - assertTrue( new File( repoLocation, "/org/apache/archiva/artifact-upload/" + MetadataTools.MAVEN_METADATA ).exists() ); + assertTrue( + new File( repoLocation, "/org/apache/archiva/artifact-upload/" + MetadataTools.MAVEN_METADATA ).exists() ); assertTrue( new File( repoLocation, "/org/apache/archiva/artifact-upload/" + MetadataTools.MAVEN_METADATA + ".sha1" ).exists() ); assertTrue( new File( repoLocation, "/org/apache/archiva/artifact-upload/" + MetadataTools.MAVEN_METADATA @@ -377,7 +381,7 @@ public class UploadActionTest null, true ); ManagedRepositoryContent content = new ManagedDefaultRepositoryContent(); - content.setRepository( config.findManagedRepositoryById( REPOSITORY_ID ) ); + content.setRepository( getManagedRepository( config.findManagedRepositoryById( REPOSITORY_ID ) ) ); archivaConfigControl.expectAndReturn( archivaConfig.getConfiguration(), config ); repoFactoryControl.expectAndReturn( repoFactory.getManagedRepositoryContent( REPOSITORY_ID ), content ); @@ -412,7 +416,7 @@ public class UploadActionTest null, false ); ManagedRepositoryContent content = new ManagedDefaultRepositoryContent(); - content.setRepository( config.findManagedRepositoryById( REPOSITORY_ID ) ); + content.setRepository( getManagedRepository( config.findManagedRepositoryById( REPOSITORY_ID ) ) ); archivaConfigControl.expectAndReturn( archivaConfig.getConfiguration(), config ); repoFactoryControl.expectAndReturn( repoFactory.getManagedRepositoryContent( REPOSITORY_ID ), content ); @@ -447,10 +451,10 @@ public class UploadActionTest assertTrue( new File( repoLocation, "/org/apache/archiva/artifact-upload/" + MetadataTools.MAVEN_METADATA ).exists() ); - assertTrue( new File( repoLocation, "/org/apache/archiva/artifact-upload/" + MetadataTools.MAVEN_METADATA + - ".sha1" ).exists() ); - assertTrue( new File( repoLocation, "/org/apache/archiva/artifact-upload/" + MetadataTools.MAVEN_METADATA + - ".md5" ).exists() ); + assertTrue( new File( repoLocation, "/org/apache/archiva/artifact-upload/" + MetadataTools.MAVEN_METADATA + + ".sha1" ).exists() ); + assertTrue( new File( repoLocation, "/org/apache/archiva/artifact-upload/" + MetadataTools.MAVEN_METADATA + + ".md5" ).exists() ); // verify checksums of jar file ChecksummedFile checksum = new ChecksummedFile( @@ -502,11 +506,14 @@ public class UploadActionTest repoFactoryControl.verify(); String repoLocation = config.findManagedRepositoryById( REPOSITORY_ID ).getLocation(); - assertFalse( new File( repoLocation, "/org/apache/archiva/artifact-upload/1.0/artifact-upload-1.0.jar" ).exists() ); + assertFalse( + new File( repoLocation, "/org/apache/archiva/artifact-upload/1.0/artifact-upload-1.0.jar" ).exists() ); - assertFalse( new File( repoLocation, "/org/apache/archiva/artifact-upload/1.0/artifact-upload-1.0.pom" ).exists() ); + assertFalse( + new File( repoLocation, "/org/apache/archiva/artifact-upload/1.0/artifact-upload-1.0.pom" ).exists() ); - assertFalse( new File( repoLocation, "/org/apache/archiva/artifact-upload/" + MetadataTools.MAVEN_METADATA ).exists() ); + assertFalse( + new File( repoLocation, "/org/apache/archiva/artifact-upload/" + MetadataTools.MAVEN_METADATA ).exists() ); } public void testArtifactUploadSnapshots() @@ -517,7 +524,7 @@ public class UploadActionTest null, true ); ManagedRepositoryContent content = new ManagedDefaultRepositoryContent(); - content.setRepository( config.findManagedRepositoryById( REPOSITORY_ID ) ); + content.setRepository( getManagedRepository( config.findManagedRepositoryById( REPOSITORY_ID ) ) ); archivaConfigControl.expectAndReturn( archivaConfig.getConfiguration(), config ); repoFactoryControl.expectAndReturn( repoFactory.getManagedRepositoryContent( REPOSITORY_ID ), content ); @@ -546,10 +553,12 @@ public class UploadActionTest assertEquals( 9, artifactsList.length ); assertTrue( new File( repoLocation, "/org/apache/archiva/artifact-upload/1.0-SNAPSHOT/" + MetadataTools.MAVEN_METADATA ).exists() ); - assertTrue( new File( repoLocation, "/org/apache/archiva/artifact-upload/1.0-SNAPSHOT/" - + MetadataTools.MAVEN_METADATA + ".sha1" ).exists() ); - assertTrue( new File( repoLocation, "/org/apache/archiva/artifact-upload/1.0-SNAPSHOT/" - + MetadataTools.MAVEN_METADATA + ".md5" ).exists() ); + assertTrue( new File( repoLocation, + "/org/apache/archiva/artifact-upload/1.0-SNAPSHOT/" + MetadataTools.MAVEN_METADATA + + ".sha1" ).exists() ); + assertTrue( new File( repoLocation, + "/org/apache/archiva/artifact-upload/1.0-SNAPSHOT/" + MetadataTools.MAVEN_METADATA + + ".md5" ).exists() ); int startIndex = "artifact-upload-1.0-".length(); String timestampPath = getTimestamp( artifactsList, startIndex, 0 ); @@ -562,8 +571,8 @@ public class UploadActionTest verifyVersionMetadataChecksums( repoLocation, "1.0-SNAPSHOT" ); // verify build number - File metadataFile = - new File( repoLocation, "/org/apache/archiva/artifact-upload/1.0-SNAPSHOT/" + MetadataTools.MAVEN_METADATA ); + File metadataFile = new File( repoLocation, "/org/apache/archiva/artifact-upload/1.0-SNAPSHOT/" + + MetadataTools.MAVEN_METADATA ); ArchivaRepositoryMetadata artifactMetadata = RepositoryMetadataReader.read( metadataFile ); SnapshotVersion snapshotVersion = artifactMetadata.getSnapshotVersion(); @@ -583,35 +592,34 @@ public class UploadActionTest // MRM-1353 // upload snapshot artifact again and check if build number was incremented - setUploadParameters( "1.0-SNAPSHOT", null, - new File( FileUtil.getBasedir(), - "target/test-classes/upload-artifact-test/artifact-to-be-uploaded.jar" ), null, - true ); + setUploadParameters( "1.0-SNAPSHOT", null, new File( FileUtil.getBasedir(), + "target/test-classes/upload-artifact-test/artifact-to-be-uploaded.jar" ), + null, true ); archivaConfigControl.expectAndReturn( archivaConfig.getConfiguration(), config ); repoFactoryControl.expectAndReturn( repoFactory.getManagedRepositoryContent( REPOSITORY_ID ), content ); - + archivaConfigControl.replay(); repoFactoryControl.replay(); - + fmt = new SimpleDateFormat( "yyyyMMdd.HHmmss" ); fmt.setTimeZone( TimeZone.getTimeZone( "UTC" ) ); timestamp = fmt.format( new Date() ); - + control = mockAuditLogs( Arrays.asList( - "org/apache/archiva/artifact-upload/1.0-SNAPSHOT/artifact-upload-1.0-" + timestamp + "-2.jar", - "org/apache/archiva/artifact-upload/1.0-SNAPSHOT/artifact-upload-1.0-" + timestamp + "-2.pom" ) ); - + "org/apache/archiva/artifact-upload/1.0-SNAPSHOT/artifact-upload-1.0-" + timestamp + "-2.jar", + "org/apache/archiva/artifact-upload/1.0-SNAPSHOT/artifact-upload-1.0-" + timestamp + "-2.pom" ) ); + returnString = uploadAction.doUpload(); assertEquals( Action.SUCCESS, returnString ); archivaConfigControl.verify(); repoFactoryControl.verify(); control.verify(); - + artifactsList = new File( repoLocation, "/org/apache/archiva/artifact-upload/1.0-SNAPSHOT/" ).list(); Arrays.sort( artifactsList ); - + assertEquals( 15, artifactsList.length ); timestampPath = getTimestamp( artifactsList, startIndex, 6 ); @@ -624,8 +632,8 @@ public class UploadActionTest verifyVersionMetadataChecksums( repoLocation, "1.0-SNAPSHOT" ); // verify build number set in metadata and in filename - metadataFile = - new File( repoLocation, "/org/apache/archiva/artifact-upload/1.0-SNAPSHOT/" + MetadataTools.MAVEN_METADATA ); + metadataFile = new File( repoLocation, + "/org/apache/archiva/artifact-upload/1.0-SNAPSHOT/" + MetadataTools.MAVEN_METADATA ); artifactMetadata = RepositoryMetadataReader.read( metadataFile ); snapshotVersion = artifactMetadata.getSnapshotVersion(); @@ -648,7 +656,7 @@ public class UploadActionTest ManagedRepositoryContent content = new ManagedDefaultRepositoryContent(); ManagedRepositoryConfiguration repoConfig = config.findManagedRepositoryById( REPOSITORY_ID ); repoConfig.setBlockRedeployments( false ); - content.setRepository( repoConfig ); + content.setRepository( getManagedRepository( repoConfig ) ); archivaConfigControl.expectAndReturn( archivaConfig.getConfiguration(), config ); repoFactoryControl.expectAndReturn( repoFactory.getManagedRepositoryContent( REPOSITORY_ID ), content ); @@ -712,7 +720,7 @@ public class UploadActionTest null, true ); ManagedRepositoryContent content = new ManagedDefaultRepositoryContent(); - content.setRepository( config.findManagedRepositoryById( REPOSITORY_ID ) ); + content.setRepository( getManagedRepository( config.findManagedRepositoryById( REPOSITORY_ID ) ) ); archivaConfigControl.expectAndReturn( archivaConfig.getConfiguration(), config, 2 ); repoFactoryControl.expectAndReturn( repoFactory.getManagedRepositoryContent( REPOSITORY_ID ), content, 2 ); @@ -754,7 +762,7 @@ public class UploadActionTest ManagedRepositoryContent content = new ManagedDefaultRepositoryContent(); ManagedRepositoryConfiguration repoConfig = config.findManagedRepositoryById( REPOSITORY_ID ); repoConfig.setBlockRedeployments( false ); - content.setRepository( repoConfig ); + content.setRepository( getManagedRepository( repoConfig ) ); archivaConfigControl.expectAndReturn( archivaConfig.getConfiguration(), config, 2 ); repoFactoryControl.expectAndReturn( repoFactory.getManagedRepositoryContent( REPOSITORY_ID ), content, 2 ); @@ -789,4 +797,9 @@ public class UploadActionTest verifyPomChecksums( repoLocation, "artifact-upload-1.0", "1.0" ); verifyProjectMetadataChecksums( repoLocation ); } + + ManagedRepository getManagedRepository( ManagedRepositoryConfiguration conf ) + { + return new BeanReplicator().replicateBean( conf, ManagedRepository.class ); + } } diff --git a/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/AddProxyConnectorActionTest.java b/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/AddProxyConnectorActionTest.java index e3b99dc32..dc9fa1741 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/AddProxyConnectorActionTest.java +++ b/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/AddProxyConnectorActionTest.java @@ -20,9 +20,9 @@ package org.apache.maven.archiva.web.action.admin.connectors.proxy; */ import com.opensymphony.xwork2.Action; +import org.apache.archiva.admin.model.proxyconnector.ProxyConnector; import org.apache.archiva.admin.repository.managed.DefaultManagedRepositoryAdmin; import org.apache.archiva.admin.repository.proxyconnector.DefaultProxyConnectorAdmin; -import org.apache.archiva.admin.repository.proxyconnector.ProxyConnector; import org.apache.archiva.admin.repository.remote.DefaultRemoteRepositoryAdmin; import org.apache.maven.archiva.configuration.ArchivaConfiguration; import org.apache.maven.archiva.configuration.Configuration; @@ -37,8 +37,8 @@ import org.apache.maven.archiva.policies.PropagateErrorsOnUpdateDownloadPolicy; import org.apache.maven.archiva.policies.ReleasesPolicy; import org.apache.maven.archiva.policies.SnapshotsPolicy; import org.apache.maven.archiva.web.action.AbstractWebworkTestCase; -import org.codehaus.redback.integration.interceptor.SecureActionBundle; import org.codehaus.plexus.registry.RegistryException; +import org.codehaus.redback.integration.interceptor.SecureActionBundle; import org.easymock.MockControl; import java.util.List; diff --git a/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/EditProxyConnectorActionTest.java b/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/EditProxyConnectorActionTest.java index 6562995ab..fdc42f105 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/EditProxyConnectorActionTest.java +++ b/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/EditProxyConnectorActionTest.java @@ -20,9 +20,9 @@ package org.apache.maven.archiva.web.action.admin.connectors.proxy; */ import com.opensymphony.xwork2.Action; +import org.apache.archiva.admin.model.proxyconnector.ProxyConnector; import org.apache.archiva.admin.repository.managed.DefaultManagedRepositoryAdmin; import org.apache.archiva.admin.repository.proxyconnector.DefaultProxyConnectorAdmin; -import org.apache.archiva.admin.repository.proxyconnector.ProxyConnector; import org.apache.archiva.admin.repository.remote.DefaultRemoteRepositoryAdmin; import org.apache.maven.archiva.configuration.ArchivaConfiguration; import org.apache.maven.archiva.configuration.Configuration; diff --git a/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/legacy/AddLegacyArtifactPathActionTest.java b/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/legacy/AddLegacyArtifactPathActionTest.java index 77b82513f..667c49a30 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/legacy/AddLegacyArtifactPathActionTest.java +++ b/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/legacy/AddLegacyArtifactPathActionTest.java @@ -21,7 +21,7 @@ package org.apache.maven.archiva.web.action.admin.legacy; import com.opensymphony.xwork2.validator.ActionValidatorManager; import junit.framework.TestCase; -import org.apache.archiva.admin.repository.admin.LegacyArtifactPath; +import org.apache.archiva.admin.model.admin.LegacyArtifactPath; import org.apache.archiva.web.validator.utils.ValidatorUtil; import org.apache.maven.archiva.web.action.admin.repositories.DefaultActionValidatorManagerFactory; diff --git a/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/networkproxies/ConfigureNetworkProxyActionTest.java b/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/networkproxies/ConfigureNetworkProxyActionTest.java index 8b1efe173..bd71d5547 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/networkproxies/ConfigureNetworkProxyActionTest.java +++ b/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/networkproxies/ConfigureNetworkProxyActionTest.java @@ -20,17 +20,16 @@ package org.apache.maven.archiva.web.action.admin.networkproxies; */ import com.opensymphony.xwork2.validator.ActionValidatorManager; +import junit.framework.TestCase; +import org.apache.archiva.admin.model.networkproxy.NetworkProxy; +import org.apache.archiva.web.validator.utils.ValidatorUtil; +import org.apache.maven.archiva.web.action.admin.repositories.DefaultActionValidatorManagerFactory; + import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; -import junit.framework.TestCase; -import org.apache.archiva.admin.repository.networkproxy.NetworkProxy; -import org.apache.maven.archiva.configuration.NetworkProxyConfiguration; -import org.apache.maven.archiva.web.action.admin.repositories.DefaultActionValidatorManagerFactory; -import org.apache.archiva.web.validator.utils.ValidatorUtil; - public class ConfigureNetworkProxyActionTest extends TestCase { private static final String EMPTY_STRING = ""; diff --git a/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/AbstractManagedRepositoryActionTest.java b/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/AbstractManagedRepositoryActionTest.java index 623eec185..39b2bf662 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/AbstractManagedRepositoryActionTest.java +++ b/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/AbstractManagedRepositoryActionTest.java @@ -20,8 +20,8 @@ package org.apache.maven.archiva.web.action.admin.repositories; */ import com.opensymphony.xwork2.validator.ActionValidatorManager; -import org.apache.archiva.admin.repository.managed.ManagedRepository; -import org.apache.archiva.admin.repository.managed.ManagedRepositoryAdmin; +import org.apache.archiva.admin.model.managed.ManagedRepository; +import org.apache.archiva.admin.model.managed.ManagedRepositoryAdmin; import org.apache.struts2.StrutsSpringTestCase; import java.io.File; diff --git a/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/AddManagedRepositoryActionTest.java b/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/AddManagedRepositoryActionTest.java index 0f753e871..e3bab24e6 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/AddManagedRepositoryActionTest.java +++ b/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/AddManagedRepositoryActionTest.java @@ -20,9 +20,9 @@ package org.apache.maven.archiva.web.action.admin.repositories; */ import com.opensymphony.xwork2.Action; +import org.apache.archiva.admin.model.managed.ManagedRepository; import org.apache.archiva.admin.repository.RepositoryCommonValidator; import org.apache.archiva.admin.repository.managed.DefaultManagedRepositoryAdmin; -import org.apache.archiva.admin.repository.managed.ManagedRepository; import org.apache.archiva.scheduler.repository.RepositoryArchivaTaskScheduler; import org.apache.archiva.scheduler.repository.RepositoryTask; import org.apache.archiva.security.ArchivaRoleConstants; diff --git a/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/AddRemoteRepositoryActionTest.java b/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/AddRemoteRepositoryActionTest.java index ec244ccb6..adf74c7f9 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/AddRemoteRepositoryActionTest.java +++ b/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/AddRemoteRepositoryActionTest.java @@ -20,8 +20,8 @@ package org.apache.maven.archiva.web.action.admin.repositories; */ import com.opensymphony.xwork2.Action; +import org.apache.archiva.admin.model.remote.RemoteRepository; import org.apache.archiva.admin.repository.remote.DefaultRemoteRepositoryAdmin; -import org.apache.archiva.admin.repository.remote.RemoteRepository; import org.apache.maven.archiva.configuration.ArchivaConfiguration; import org.apache.maven.archiva.configuration.Configuration; import org.apache.maven.archiva.web.action.AbstractActionTestCase; diff --git a/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/DeleteManagedRepositoryActionTest.java b/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/DeleteManagedRepositoryActionTest.java index 736073f1f..f47f44f0f 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/DeleteManagedRepositoryActionTest.java +++ b/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/DeleteManagedRepositoryActionTest.java @@ -20,14 +20,18 @@ package org.apache.maven.archiva.web.action.admin.repositories; */ import com.opensymphony.xwork2.Action; +import net.sf.beanlib.provider.replicator.BeanReplicator; +import org.apache.archiva.admin.model.RepositoryAdminException; +import org.apache.archiva.admin.model.managed.ManagedRepository; +import org.apache.archiva.admin.model.managed.ManagedRepositoryAdmin; import org.apache.archiva.admin.repository.managed.DefaultManagedRepositoryAdmin; -import org.apache.archiva.admin.repository.managed.ManagedRepositoryAdmin; import org.apache.archiva.audit.AuditEvent; import org.apache.archiva.audit.AuditListener; import org.apache.archiva.metadata.repository.MetadataRepository; import org.apache.archiva.metadata.repository.RepositorySession; import org.apache.archiva.metadata.repository.memory.TestRepositorySessionFactory; import org.apache.archiva.metadata.repository.stats.RepositoryStatisticsManager; +import org.apache.archiva.security.ArchivaRoleConstants; import org.apache.maven.archiva.configuration.ArchivaConfiguration; import org.apache.maven.archiva.configuration.Configuration; import org.apache.maven.archiva.configuration.IndeterminateConfigurationException; @@ -35,7 +39,6 @@ import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration; import org.apache.maven.archiva.configuration.ProxyConnectorConfiguration; import org.apache.maven.archiva.configuration.RemoteRepositoryConfiguration; import org.apache.maven.archiva.configuration.RepositoryGroupConfiguration; -import org.apache.archiva.security.ArchivaRoleConstants; import org.apache.maven.archiva.web.action.AbstractActionTestCase; import org.apache.maven.archiva.web.action.AuditEventArgumentsMatcher; import org.codehaus.plexus.redback.role.RoleManager; @@ -128,7 +131,7 @@ public class DeleteManagedRepositoryActionTest } public void testSecureActionBundle() - throws SecureActionException + throws SecureActionException, RepositoryAdminException { archivaConfiguration.getConfiguration(); archivaConfigurationControl.setReturnValue( new Configuration() ); @@ -173,7 +176,7 @@ public class DeleteManagedRepositoryActionTest public void testDeleteRepositoryConfirmation() throws Exception { - ManagedRepositoryConfiguration originalRepository = createRepository(); + ManagedRepository originalRepository = createRepository(); Configuration configuration = createConfigurationForEditing( originalRepository ); archivaConfiguration.getConfiguration(); @@ -189,7 +192,7 @@ public class DeleteManagedRepositoryActionTest action.prepare(); assertEquals( REPO_ID, action.getRepoid() ); - ManagedRepositoryConfiguration repository = action.getRepository(); + ManagedRepository repository = action.getRepository(); assertNotNull( repository ); assertRepositoryEquals( repository, createRepository() ); @@ -305,13 +308,13 @@ public class DeleteManagedRepositoryActionTest { repositoryStatisticsManagerControl.replay(); - ManagedRepositoryConfiguration originalRepository = createRepository(); + ManagedRepository originalRepository = createRepository(); Configuration configuration = prepDeletionTest( originalRepository, 3 ); String status = action.execute(); assertEquals( Action.SUCCESS, status ); - ManagedRepositoryConfiguration repository = action.getRepository(); + ManagedRepository repository = action.getRepository(); assertRepositoryEquals( repository, createRepository() ); assertEquals( Collections.singletonList( originalRepository ), configuration.getManagedRepositories() ); @@ -321,9 +324,8 @@ public class DeleteManagedRepositoryActionTest } - private Configuration prepDeletionTest( ManagedRepositoryConfiguration originalRepository, - int expectCountGetConfig ) - throws RegistryException, IndeterminateConfigurationException + private Configuration prepDeletionTest( ManagedRepository originalRepository, int expectCountGetConfig ) + throws RegistryException, IndeterminateConfigurationException, RepositoryAdminException { location.mkdirs(); @@ -347,7 +349,7 @@ public class DeleteManagedRepositoryActionTest action.prepare(); assertEquals( REPO_ID, action.getRepoid() ); - ManagedRepositoryConfiguration repository = action.getRepository(); + ManagedRepository repository = action.getRepository(); assertNotNull( repository ); assertRepositoryEquals( repository, createRepository() ); @@ -355,16 +357,15 @@ public class DeleteManagedRepositoryActionTest return configuration; } - private void assertRepositoryEquals( ManagedRepositoryConfiguration expectedRepository, - ManagedRepositoryConfiguration actualRepository ) + private void assertRepositoryEquals( ManagedRepository expectedRepository, ManagedRepository actualRepository ) { assertEquals( expectedRepository.getDaysOlder(), actualRepository.getDaysOlder() ); assertEquals( expectedRepository.getId(), actualRepository.getId() ); - assertEquals( expectedRepository.getIndexDir(), actualRepository.getIndexDir() ); + assertEquals( expectedRepository.getIndexDirectory(), actualRepository.getIndexDirectory() ); assertEquals( expectedRepository.getLayout(), actualRepository.getLayout() ); assertEquals( expectedRepository.getLocation(), actualRepository.getLocation() ); assertEquals( expectedRepository.getName(), actualRepository.getName() ); - assertEquals( expectedRepository.getRefreshCronExpression(), actualRepository.getRefreshCronExpression() ); + assertEquals( expectedRepository.getCronExpression(), actualRepository.getCronExpression() ); assertEquals( expectedRepository.getRetentionCount(), actualRepository.getRetentionCount() ); assertEquals( expectedRepository.isDeleteReleasedSnapshots(), actualRepository.isDeleteReleasedSnapshots() ); assertEquals( expectedRepository.isScanned(), actualRepository.isScanned() ); @@ -372,21 +373,22 @@ public class DeleteManagedRepositoryActionTest assertEquals( expectedRepository.isSnapshots(), actualRepository.isSnapshots() ); } - private Configuration createConfigurationForEditing( ManagedRepositoryConfiguration repositoryConfiguration ) + private Configuration createConfigurationForEditing( ManagedRepository repositoryConfiguration ) { Configuration configuration = new Configuration(); - configuration.addManagedRepository( repositoryConfiguration ); + configuration.addManagedRepository( + new BeanReplicator().replicateBean( repositoryConfiguration, ManagedRepositoryConfiguration.class ) ); return configuration; } - private ManagedRepositoryConfiguration createRepository() + private ManagedRepository createRepository() { - ManagedRepositoryConfiguration r = new ManagedRepositoryConfiguration(); + ManagedRepository r = new ManagedRepository(); r.setId( REPO_ID ); r.setName( "repo name" ); r.setLocation( location.getAbsolutePath() ); r.setLayout( "default" ); - r.setRefreshCronExpression( "* 0/5 * * * ?" ); + r.setCronExpression( "* 0/5 * * * ?" ); r.setDaysOlder( 0 ); r.setRetentionCount( 0 ); r.setReleases( true ); diff --git a/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/DeleteRemoteRepositoryActionTest.java b/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/DeleteRemoteRepositoryActionTest.java index 429be1242..8493e47ee 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/DeleteRemoteRepositoryActionTest.java +++ b/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/DeleteRemoteRepositoryActionTest.java @@ -20,9 +20,9 @@ package org.apache.maven.archiva.web.action.admin.repositories; */ import com.opensymphony.xwork2.Action; -import org.apache.archiva.admin.repository.RepositoryAdminException; +import org.apache.archiva.admin.model.RepositoryAdminException; +import org.apache.archiva.admin.model.remote.RemoteRepository; import org.apache.archiva.admin.repository.remote.DefaultRemoteRepositoryAdmin; -import org.apache.archiva.admin.repository.remote.RemoteRepository; import org.apache.maven.archiva.configuration.ArchivaConfiguration; import org.apache.maven.archiva.configuration.Configuration; import org.apache.maven.archiva.configuration.IndeterminateConfigurationException; diff --git a/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/DeleteRepositoryGroupActionTest.java b/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/DeleteRepositoryGroupActionTest.java index bcf3d58eb..239f25fc2 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/DeleteRepositoryGroupActionTest.java +++ b/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/DeleteRepositoryGroupActionTest.java @@ -20,6 +20,8 @@ package org.apache.maven.archiva.web.action.admin.repositories; */ import com.opensymphony.xwork2.Action; +import org.apache.archiva.admin.model.RepositoryAdminException; +import org.apache.archiva.admin.model.group.RepositoryGroup; import org.apache.maven.archiva.configuration.ArchivaConfiguration; import org.apache.maven.archiva.configuration.Configuration; import org.apache.maven.archiva.configuration.RepositoryGroupConfiguration; @@ -58,7 +60,7 @@ public class DeleteRepositoryGroupActionTest } public void testSecureActionBundle() - throws SecureActionException + throws SecureActionException, RepositoryAdminException { archivaConfiguration.getConfiguration(); archivaConfigurationControl.setReturnValue( new Configuration() ); @@ -84,7 +86,7 @@ public class DeleteRepositoryGroupActionTest action.prepare(); assertEquals( REPO_GROUP_ID, action.getRepoGroupId() ); - RepositoryGroupConfiguration repoGroup = action.getRepositoryGroup(); + RepositoryGroup repoGroup = action.getRepositoryGroup(); assertNotNull( repoGroup ); assertEquals( repoGroup.getId(), action.getRepoGroupId() ); assertEquals( Collections.singletonList( origRepoGroup ), configuration.getRepositoryGroups() ); @@ -104,7 +106,7 @@ public class DeleteRepositoryGroupActionTest action.prepare(); assertEquals( REPO_GROUP_ID, action.getRepoGroupId() ); - RepositoryGroupConfiguration repoGroup = action.getRepositoryGroup(); + RepositoryGroup repoGroup = action.getRepositoryGroup(); assertNotNull( repoGroup ); assertEquals( Collections.singletonList( repoGroup ), configuration.getRepositoryGroups() ); @@ -129,7 +131,7 @@ public class DeleteRepositoryGroupActionTest action.prepare(); assertEquals( REPO_GROUP_ID, action.getRepoGroupId() ); - RepositoryGroupConfiguration repoGroup = action.getRepositoryGroup(); + RepositoryGroup repoGroup = action.getRepositoryGroup(); assertNotNull( repoGroup ); String status = action.execute(); diff --git a/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/EditManagedRepositoryActionTest.java b/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/EditManagedRepositoryActionTest.java index bbad0454b..bda413032 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/EditManagedRepositoryActionTest.java +++ b/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/EditManagedRepositoryActionTest.java @@ -20,10 +20,10 @@ package org.apache.maven.archiva.web.action.admin.repositories; */ import com.opensymphony.xwork2.Action; -import org.apache.archiva.admin.repository.RepositoryAdminException; +import org.apache.archiva.admin.model.RepositoryAdminException; +import org.apache.archiva.admin.model.managed.ManagedRepository; import org.apache.archiva.admin.repository.RepositoryCommonValidator; import org.apache.archiva.admin.repository.managed.DefaultManagedRepositoryAdmin; -import org.apache.archiva.admin.repository.managed.ManagedRepository; import org.apache.archiva.audit.AuditListener; import org.apache.archiva.metadata.repository.MetadataRepository; import org.apache.archiva.metadata.repository.RepositorySession; @@ -31,12 +31,12 @@ import org.apache.archiva.metadata.repository.memory.TestRepositorySessionFactor import org.apache.archiva.metadata.repository.stats.RepositoryStatisticsManager; import org.apache.archiva.scheduler.repository.RepositoryArchivaTaskScheduler; import org.apache.archiva.scheduler.repository.RepositoryTask; +import org.apache.archiva.security.ArchivaRoleConstants; +import org.apache.archiva.web.validator.utils.ValidatorUtil; import org.apache.commons.io.FileUtils; import org.apache.maven.archiva.configuration.ArchivaConfiguration; import org.apache.maven.archiva.configuration.Configuration; import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration; -import org.apache.archiva.security.ArchivaRoleConstants; -import org.apache.archiva.web.validator.utils.ValidatorUtil; import org.codehaus.plexus.redback.role.RoleManager; import org.codehaus.plexus.registry.Registry; import org.codehaus.redback.integration.interceptor.SecureActionBundle; diff --git a/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/EditRemoteRepositoryActionTest.java b/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/EditRemoteRepositoryActionTest.java index 3d6ca0719..f89c14598 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/EditRemoteRepositoryActionTest.java +++ b/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/EditRemoteRepositoryActionTest.java @@ -20,9 +20,9 @@ package org.apache.maven.archiva.web.action.admin.repositories; */ import com.opensymphony.xwork2.Action; -import org.apache.archiva.admin.repository.RepositoryAdminException; +import org.apache.archiva.admin.model.RepositoryAdminException; +import org.apache.archiva.admin.model.remote.RemoteRepository; import org.apache.archiva.admin.repository.remote.DefaultRemoteRepositoryAdmin; -import org.apache.archiva.admin.repository.remote.RemoteRepository; import org.apache.maven.archiva.configuration.ArchivaConfiguration; import org.apache.maven.archiva.configuration.Configuration; import org.apache.maven.archiva.configuration.RemoteRepositoryConfiguration; diff --git a/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/RepositoryGroupsActionTest.java b/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/RepositoryGroupsActionTest.java index 92e14d50a..844778aa9 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/RepositoryGroupsActionTest.java +++ b/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/RepositoryGroupsActionTest.java @@ -22,9 +22,9 @@ package org.apache.maven.archiva.web.action.admin.repositories; import com.meterware.servletunit.ServletRunner; import com.meterware.servletunit.ServletUnitClient; import com.opensymphony.xwork2.Action; -import org.apache.archiva.admin.repository.RepositoryAdminException; +import org.apache.archiva.admin.model.RepositoryAdminException; +import org.apache.archiva.admin.model.group.RepositoryGroup; import org.apache.archiva.admin.repository.group.DefaultRepositoryGroupAdmin; -import org.apache.archiva.admin.repository.group.RepositoryGroup; import org.apache.archiva.admin.repository.managed.DefaultManagedRepositoryAdmin; import org.apache.maven.archiva.configuration.ArchivaConfiguration; import org.apache.maven.archiva.configuration.Configuration; diff --git a/archiva-modules/archiva-web/archiva-webdav/pom.xml b/archiva-modules/archiva-web/archiva-webdav/pom.xml index 1be3a0551..2bc0f3e82 100644 --- a/archiva-modules/archiva-web/archiva-webdav/pom.xml +++ b/archiva-modules/archiva-web/archiva-webdav/pom.xml @@ -52,7 +52,7 @@ org.apache.archiva - archiva-repository-admin + archiva-repository-admin-api org.apache.archiva @@ -160,6 +160,11 @@ httpunit test + + org.apache.archiva + archiva-repository-admin-default + test + diff --git a/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/ArchivaDavResource.java b/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/ArchivaDavResource.java index 99a490fbf..7797d534b 100644 --- a/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/ArchivaDavResource.java +++ b/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/ArchivaDavResource.java @@ -19,6 +19,7 @@ package org.apache.maven.archiva.webdav; * under the License. */ +import org.apache.archiva.admin.model.managed.ManagedRepository; import org.apache.archiva.audit.AuditEvent; import org.apache.archiva.audit.AuditListener; import org.apache.archiva.scheduler.ArchivaTaskScheduler; @@ -90,7 +91,7 @@ public class ArchivaDavResource private String remoteAddr; - private final ManagedRepositoryConfiguration repository; + private final ManagedRepository repository; private final MimeTypes mimeTypes; @@ -104,7 +105,7 @@ public class ArchivaDavResource private Logger log = LoggerFactory.getLogger( ArchivaDavResource.class ); - public ArchivaDavResource( String localResource, String logicalResource, ManagedRepositoryConfiguration repository, + public ArchivaDavResource( String localResource, String logicalResource, ManagedRepository repository, DavSession session, ArchivaDavResourceLocator locator, DavResourceFactory factory, MimeTypes mimeTypes, List auditListeners, RepositoryArchivaTaskScheduler scheduler ) @@ -124,7 +125,7 @@ public class ArchivaDavResource this.scheduler = scheduler; } - public ArchivaDavResource( String localResource, String logicalResource, ManagedRepositoryConfiguration repository, + public ArchivaDavResource( String localResource, String logicalResource, ManagedRepository repository, String remoteAddr, String principal, DavSession session, ArchivaDavResourceLocator locator, DavResourceFactory factory, MimeTypes mimeTypes, List auditListeners, RepositoryArchivaTaskScheduler scheduler ) diff --git a/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/RepositoryServlet.java b/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/RepositoryServlet.java index 2aabf858a..224e0a928 100644 --- a/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/RepositoryServlet.java +++ b/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/RepositoryServlet.java @@ -19,9 +19,9 @@ package org.apache.maven.archiva.webdav; * under the License. */ -import org.apache.archiva.admin.repository.RepositoryAdminException; -import org.apache.archiva.admin.repository.managed.ManagedRepository; -import org.apache.archiva.admin.repository.managed.ManagedRepositoryAdmin; +import org.apache.archiva.admin.model.RepositoryAdminException; +import org.apache.archiva.admin.model.managed.ManagedRepository; +import org.apache.archiva.admin.model.managed.ManagedRepositoryAdmin; import org.apache.archiva.security.ServletAuthenticator; import org.apache.jackrabbit.webdav.DavException; import org.apache.jackrabbit.webdav.DavLocatorFactory; diff --git a/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/archiva/metadata/repository/TestMetadataRepository.java b/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/archiva/metadata/repository/TestMetadataRepository.java index fc1370c52..571b2015d 100644 --- a/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/archiva/metadata/repository/TestMetadataRepository.java +++ b/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/archiva/metadata/repository/TestMetadataRepository.java @@ -36,67 +36,66 @@ public class TestMetadataRepository { public ProjectMetadata getProject( String repoId, String namespace, String projectId ) { - return null; //To change body of implemented methods use File | Settings | File Templates. + return null; } public ProjectVersionMetadata getProjectVersion( String repoId, String namespace, String projectId, String projectVersion ) { - return null; //To change body of implemented methods use File | Settings | File Templates. + return null; } public Collection getArtifactVersions( String repoId, String namespace, String projectId, String projectVersion ) { - return null; //To change body of implemented methods use File | Settings | File Templates. + return null; } public Collection getProjectReferences( String repoId, String namespace, String projectId, String projectVersion ) { - return null; //To change body of implemented methods use File | Settings | File Templates. + return null; } public Collection getRootNamespaces( String repoId ) { - return null; //To change body of implemented methods use File | Settings | File Templates. + return null; } public Collection getNamespaces( String repoId, String namespace ) { - return null; //To change body of implemented methods use File | Settings | File Templates. + return null; } public Collection getProjects( String repoId, String namespace ) { - return null; //To change body of implemented methods use File | Settings | File Templates. + return null; } public Collection getProjectVersions( String repoId, String namespace, String projectId ) { - return null; //To change body of implemented methods use File | Settings | File Templates. + return null; } public void updateProject( String repoId, ProjectMetadata project ) { - //To change body of implemented methods use File | Settings | File Templates. } public void updateArtifact( String repoId, String namespace, String projectId, String projectVersion, ArtifactMetadata artifactMeta ) { - //To change body of implemented methods use File | Settings | File Templates. + } public void updateProjectVersion( String repoId, String namespace, String projectId, ProjectVersionMetadata versionMetadata ) { - //To change body of implemented methods use File | Settings | File Templates. + } public void updateNamespace( String repoId, String namespace ) { - //To change body of implemented methods use File | Settings | File Templates. + } public List getMetadataFacets( String repodId, String facetId ) @@ -106,78 +105,78 @@ public class TestMetadataRepository public MetadataFacet getMetadataFacet( String repositoryId, String facetId, String name ) { - return null; //To change body of implemented methods use File | Settings | File Templates. + return null; } public void addMetadataFacet( String repositoryId, MetadataFacet metadataFacet ) { - //To change body of implemented methods use File | Settings | File Templates. + } public void removeMetadataFacets( String repositoryId, String facetId ) { - //To change body of implemented methods use File | Settings | File Templates. + } public void removeMetadataFacet( String repoId, String facetId, String name ) { - //To change body of implemented methods use File | Settings | File Templates. + } public List getArtifactsByDateRange( String repoId, Date startTime, Date endTime ) { - return null; //To change body of implemented methods use File | Settings | File Templates. + return null; } public Collection getRepositories() { - return null; //To change body of implemented methods use File | Settings | File Templates. + return null; } public List getArtifactsByChecksum( String repoId, String checksum ) { - return null; //To change body of implemented methods use File | Settings | File Templates. + return null; } public void removeArtifact( String repositoryId, String namespace, String project, String version, String id ) { - //To change body of implemented methods use File | Settings | File Templates. + } public void removeRepository( String repoId ) { - //To change body of implemented methods use File | Settings | File Templates. + } public Collection getArtifacts( String repoId, String namespace, String projectId, String projectVersion ) { - return null; //To change body of implemented methods use File | Settings | File Templates. + return null; } public void save() { - //To change body of implemented methods use File | Settings | File Templates. + } public void close() { - //To change body of implemented methods use File | Settings | File Templates. + } public void revert() { - //To change body of implemented methods use File | Settings | File Templates. + } public boolean canObtainAccess( Class aClass ) { - return false; //To change body of implemented methods use File | Settings | File Templates. + return false; } public Object obtainAccess( Class aClass ) { - return null; //To change body of implemented methods use File | Settings | File Templates. + return null; } public List getArtifacts( String repositoryId ) diff --git a/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/AbstractRepositoryServletTestCase.java b/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/AbstractRepositoryServletTestCase.java index cab60b2ec..3409dcc4b 100644 --- a/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/AbstractRepositoryServletTestCase.java +++ b/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/AbstractRepositoryServletTestCase.java @@ -26,7 +26,7 @@ import com.meterware.servletunit.ServletUnitClient; import junit.framework.Assert; import junit.framework.TestCase; import net.sf.ehcache.CacheManager; -import org.apache.archiva.admin.repository.managed.ManagedRepository; +import org.apache.archiva.admin.model.managed.ManagedRepository; import org.apache.commons.io.FileUtils; import org.apache.maven.archiva.configuration.ArchivaConfiguration; import org.apache.maven.archiva.configuration.Configuration; diff --git a/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/ArchivaDavResourceFactoryTest.java b/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/ArchivaDavResourceFactoryTest.java index b4a355ac9..2853b2a16 100644 --- a/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/ArchivaDavResourceFactoryTest.java +++ b/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/ArchivaDavResourceFactoryTest.java @@ -20,6 +20,11 @@ package org.apache.maven.archiva.webdav; */ import junit.framework.TestCase; +import org.apache.archiva.admin.model.RepositoryAdminException; +import org.apache.archiva.admin.model.group.RepositoryGroup; +import org.apache.archiva.admin.model.managed.ManagedRepository; +import org.apache.archiva.admin.repository.group.DefaultRepositoryGroupAdmin; +import org.apache.archiva.admin.repository.managed.DefaultManagedRepositoryAdmin; import org.apache.archiva.common.plexusbridge.PlexusSisuBridge; import org.apache.archiva.common.plexusbridge.PlexusSisuBridgeException; import org.apache.commons.io.FileUtils; @@ -29,7 +34,6 @@ import org.apache.jackrabbit.webdav.DavServletRequest; import org.apache.jackrabbit.webdav.DavServletResponse; import org.apache.maven.archiva.configuration.ArchivaConfiguration; import org.apache.maven.archiva.configuration.Configuration; -import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration; import org.apache.maven.archiva.configuration.RepositoryGroupConfiguration; import org.apache.maven.archiva.proxy.DefaultRepositoryProxyConnectors; import org.apache.maven.archiva.repository.ManagedRepositoryContent; @@ -101,6 +105,13 @@ public class ArchivaDavResourceFactoryTest @Inject PlexusSisuBridge plexusSisuBridge; + @Inject + DefaultManagedRepositoryAdmin defaultManagedRepositoryAdmin; + + @Inject + DefaultRepositoryGroupAdmin defaultRepositoryGroupAdmin; + + @Before public void setUp() throws Exception @@ -118,19 +129,36 @@ public class ArchivaDavResourceFactoryTest archivaConfiguration = (ArchivaConfiguration) archivaConfigurationControl.getMock(); config = new Configuration(); - config.addManagedRepository( - createManagedRepository( RELEASES_REPO, new File( "target/test-classes/" + RELEASES_REPO ).getPath(), - "default" ) ); - config.addManagedRepository( - createManagedRepository( INTERNAL_REPO, new File( "target/test-classes/" + INTERNAL_REPO ).getPath(), - "default" ) ); - - RepositoryGroupConfiguration repoGroupConfig = new RepositoryGroupConfiguration(); + archivaConfiguration.getConfiguration(); + archivaConfigurationControl.setReturnValue( config, 5, 20 ); + archivaConfiguration.save( config ); + archivaConfigurationControl.setVoidCallable( 1, 4 ); + archivaConfigurationControl.replay(); + + defaultManagedRepositoryAdmin.setArchivaConfiguration( archivaConfiguration ); + defaultManagedRepositoryAdmin.getRepositoryCommonValidator().setArchivaConfiguration( archivaConfiguration ); + if ( defaultManagedRepositoryAdmin.getManagedRepository( RELEASES_REPO ) == null ) + { + defaultManagedRepositoryAdmin.addManagedRepository( + createManagedRepository( RELEASES_REPO, new File( "target/test-classes/" + RELEASES_REPO ).getPath(), + "default" ), false, null ); + } + if ( defaultManagedRepositoryAdmin.getManagedRepository( INTERNAL_REPO ) == null ) + { + defaultManagedRepositoryAdmin.addManagedRepository( + createManagedRepository( INTERNAL_REPO, new File( "target/test-classes/" + INTERNAL_REPO ).getPath(), + "default" ), false, null ); + } + RepositoryGroup repoGroupConfig = new RepositoryGroup(); repoGroupConfig.setId( LOCAL_REPO_GROUP ); repoGroupConfig.addRepository( RELEASES_REPO ); repoGroupConfig.addRepository( INTERNAL_REPO ); - config.addRepositoryGroup( repoGroupConfig ); + defaultRepositoryGroupAdmin.setArchivaConfiguration( archivaConfiguration ); + if ( defaultManagedRepositoryAdmin.getManagedRepository( LOCAL_REPO_GROUP ) == null ) + { + defaultRepositoryGroupAdmin.addRepositoryGroup( repoGroupConfig, null ); + } repoContentFactoryControl = MockClassControl.createControl( RepositoryContentFactory.class ); repoFactory = (RepositoryContentFactory) repoContentFactoryControl.getMock(); @@ -146,9 +174,9 @@ public class ArchivaDavResourceFactoryTest resourceFactory.setConnectors( new OverridingRepositoryProxyConnectors() ); } - private ManagedRepositoryConfiguration createManagedRepository( String id, String location, String layout ) + private ManagedRepository createManagedRepository( String id, String location, String layout ) { - ManagedRepositoryConfiguration repoConfig = new ManagedRepositoryConfiguration(); + ManagedRepository repoConfig = new ManagedRepository(); repoConfig.setId( id ); repoConfig.setName( id ); repoConfig.setLocation( location ); @@ -158,9 +186,10 @@ public class ArchivaDavResourceFactoryTest } private ManagedRepositoryContent createManagedRepositoryContent( String repoId ) + throws RepositoryAdminException { ManagedRepositoryContent repoContent = new ManagedDefaultRepositoryContent(); - repoContent.setRepository( config.findManagedRepositoryById( repoId ) ); + repoContent.setRepository( defaultManagedRepositoryAdmin.getManagedRepository( repoId ) ); return repoContent; } @@ -182,13 +211,15 @@ public class ArchivaDavResourceFactoryTest new ArchivaDavLocatorFactory() ); ManagedRepositoryContent internalRepo = createManagedRepositoryContent( INTERNAL_REPO ); + ManagedRepositoryContent releasesRepo = createManagedRepositoryContent( RELEASES_REPO ); try { + archivaConfigurationControl.reset(); archivaConfigurationControl.expectAndReturn( archivaConfiguration.getConfiguration(), config ); requestControl.expectAndReturn( request.getMethod(), "GET", 2 ); repoContentFactoryControl.expectAndReturn( repoFactory.getManagedRepositoryContent( RELEASES_REPO ), - createManagedRepositoryContent( RELEASES_REPO ) ); + releasesRepo ); requestControl.expectAndReturn( request.getRemoteAddr(), "http://localhost:8080", 2 ); requestControl.expectAndReturn( request.getDavSession(), new ArchivaDavSession(), 2 ); repoRequestControl.expectAndReturn( @@ -247,14 +278,17 @@ public class ArchivaDavResourceFactoryTest ManagedRepositoryContent internalRepo = createManagedRepositoryContent( INTERNAL_REPO ); + ManagedRepositoryContent releasesRepo = createManagedRepositoryContent( RELEASES_REPO ); + try { + archivaConfigurationControl.reset(); archivaConfigurationControl.expectAndReturn( archivaConfiguration.getConfiguration(), config ); requestControl.expectAndReturn( request.getMethod(), "GET", 2 ); repoContentFactoryControl.expectAndReturn( repoFactory.getManagedRepositoryContent( INTERNAL_REPO ), internalRepo ); repoContentFactoryControl.expectAndReturn( repoFactory.getManagedRepositoryContent( RELEASES_REPO ), - createManagedRepositoryContent( RELEASES_REPO ) ); + releasesRepo ); requestControl.expectAndReturn( request.getRemoteAddr(), "http://localhost:8080", 2 ); requestControl.expectAndReturn( request.getDavSession(), new ArchivaDavSession(), 2 ); repoRequestControl.expectAndReturn( @@ -299,9 +333,9 @@ public class ArchivaDavResourceFactoryTest + "/org/apache/archiva/archiva/1.2-SNAPSHOT/archiva-1.2-SNAPSHOT.jar", LOCAL_REPO_GROUP, new ArchivaDavLocatorFactory() ); - config.addManagedRepository( + defaultManagedRepositoryAdmin.addManagedRepository( createManagedRepository( LOCAL_MIRROR_REPO, new File( "target/test-classes/local-mirror" ).getPath(), - "default" ) ); + "default" ), false, null ); List repoGroups = new ArrayList(); RepositoryGroupConfiguration repoGroup = new RepositoryGroupConfiguration(); @@ -318,6 +352,7 @@ public class ArchivaDavResourceFactoryTest try { + archivaConfigurationControl.reset(); archivaConfigurationControl.expectAndReturn( archivaConfiguration.getConfiguration(), config ); requestControl.expectAndReturn( request.getMethod(), "GET", 4 ); repoContentFactoryControl.expectAndReturn( repoFactory.getManagedRepositoryContent( INTERNAL_REPO ), @@ -384,6 +419,7 @@ public class ArchivaDavResourceFactoryTest try { + archivaConfigurationControl.reset(); archivaConfigurationControl.expectAndReturn( archivaConfiguration.getConfiguration(), config ); repoContentFactoryControl.expectAndReturn( repoFactory.getManagedRepositoryContent( INTERNAL_REPO ), internalRepo ); @@ -438,6 +474,7 @@ public class ArchivaDavResourceFactoryTest try { + archivaConfigurationControl.reset(); archivaConfigurationControl.expectAndReturn( archivaConfiguration.getConfiguration(), config ); repoContentFactoryControl.expectAndReturn( repoFactory.getManagedRepositoryContent( INTERNAL_REPO ), internalRepo ); @@ -467,9 +504,9 @@ public class ArchivaDavResourceFactoryTest public void testRequestMetadataRepoIsLegacy() throws Exception { - config.addManagedRepository( + defaultManagedRepositoryAdmin.addManagedRepository( createManagedRepository( LEGACY_REPO, new File( "target/test-classes/" + LEGACY_REPO ).getPath(), - "legacy" ) ); + "legacy" ), false, null ); DavResourceLocator locator = new ArchivaDavResourceLocator( "", "/repository/" + LEGACY_REPO + "/eclipse/maven-metadata.xml", LEGACY_REPO, new ArchivaDavLocatorFactory() ); @@ -482,6 +519,7 @@ public class ArchivaDavResourceFactoryTest try { + archivaConfigurationControl.reset(); archivaConfigurationControl.expectAndReturn( archivaConfiguration.getConfiguration(), config ); repoContentFactoryControl.expectAndReturn( repoFactory.getManagedRepositoryContent( LEGACY_REPO ), legacyRepo ); diff --git a/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/DavResourceTest.java b/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/DavResourceTest.java index c737f8e68..b62758df3 100644 --- a/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/DavResourceTest.java +++ b/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/DavResourceTest.java @@ -20,6 +20,7 @@ package org.apache.maven.archiva.webdav; */ import junit.framework.TestCase; +import org.apache.archiva.admin.model.managed.ManagedRepository; import org.apache.archiva.audit.AuditListener; import org.apache.commons.io.FileUtils; import org.apache.jackrabbit.webdav.DavException; @@ -72,7 +73,7 @@ public class DavResourceTest private LockManager lockManager; - private ManagedRepositoryConfiguration repository = new ManagedRepositoryConfiguration(); + private ManagedRepository repository = new ManagedRepository(); @Override @Before diff --git a/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/RepositoryServletTest.java b/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/RepositoryServletTest.java index 835eaf9bb..a9c21d21e 100644 --- a/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/RepositoryServletTest.java +++ b/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/RepositoryServletTest.java @@ -19,15 +19,13 @@ package org.apache.maven.archiva.webdav; * under the License. */ -import org.apache.archiva.admin.repository.managed.ManagedRepository; -import org.apache.maven.archiva.configuration.ArchivaConfiguration; -import org.apache.maven.archiva.configuration.Configuration; -import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration; -import org.apache.maven.archiva.webdav.RepositoryServlet; - import com.meterware.httpunit.GetMethodWebRequest; import com.meterware.httpunit.WebRequest; import com.meterware.httpunit.WebResponse; +import org.apache.archiva.admin.model.managed.ManagedRepository; +import org.apache.maven.archiva.configuration.ArchivaConfiguration; +import org.apache.maven.archiva.configuration.Configuration; +import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration; import org.junit.Test; import java.io.File; diff --git a/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/StubRepositoryContentConsumers.java b/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/StubRepositoryContentConsumers.java index 2105b3b45..5f221617a 100644 --- a/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/StubRepositoryContentConsumers.java +++ b/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/StubRepositoryContentConsumers.java @@ -19,19 +19,19 @@ package org.apache.maven.archiva.webdav; * under the License. */ -import java.util.List; - +import org.apache.archiva.admin.model.admin.ArchivaAdministration; import org.apache.archiva.repository.scanner.RepositoryContentConsumers; -import org.apache.maven.archiva.configuration.ArchivaConfiguration; import org.apache.maven.archiva.consumers.InvalidRepositoryContentConsumer; import org.apache.maven.archiva.consumers.KnownRepositoryContentConsumer; +import java.util.List; + public class StubRepositoryContentConsumers extends RepositoryContentConsumers { - public StubRepositoryContentConsumers(ArchivaConfiguration configuration) + public StubRepositoryContentConsumers( ArchivaAdministration archivaAdministration ) { - super(configuration); + super( archivaAdministration ); } @Override diff --git a/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/UnauthenticatedRepositoryServlet.java b/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/UnauthenticatedRepositoryServlet.java index f5bd767e0..cb4d130ac 100644 --- a/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/UnauthenticatedRepositoryServlet.java +++ b/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/UnauthenticatedRepositoryServlet.java @@ -19,7 +19,7 @@ package org.apache.maven.archiva.webdav; * under the License. */ -import org.apache.archiva.admin.repository.RepositoryAdminException; +import org.apache.archiva.admin.model.RepositoryAdminException; import javax.servlet.ServletConfig; diff --git a/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-api/pom.xml b/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-api/pom.xml index 8dce1e56d..2ffae6d76 100644 --- a/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-api/pom.xml +++ b/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-api/pom.xml @@ -37,7 +37,7 @@ org.apache.archiva - archiva-repository-admin + archiva-repository-admin-api com.atlassian.xmlrpc diff --git a/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-api/src/main/java/org/apache/archiva/web/xmlrpc/api/AdministrationService.java b/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-api/src/main/java/org/apache/archiva/web/xmlrpc/api/AdministrationService.java index f50bab5e9..3fe121b2f 100644 --- a/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-api/src/main/java/org/apache/archiva/web/xmlrpc/api/AdministrationService.java +++ b/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-api/src/main/java/org/apache/archiva/web/xmlrpc/api/AdministrationService.java @@ -20,7 +20,7 @@ package org.apache.archiva.web.xmlrpc.api; */ import com.atlassian.xmlrpc.ServiceObject; -import org.apache.archiva.admin.repository.RepositoryAdminException; +import org.apache.archiva.admin.model.RepositoryAdminException; import org.apache.archiva.web.xmlrpc.api.beans.ManagedRepository; import org.apache.archiva.web.xmlrpc.api.beans.RemoteRepository; diff --git a/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-services/pom.xml b/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-services/pom.xml index e6597f845..8a5ccc703 100644 --- a/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-services/pom.xml +++ b/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-services/pom.xml @@ -41,7 +41,7 @@ org.apache.archiva - archiva-repository-admin + archiva-repository-admin-api org.apache.archiva @@ -97,6 +97,11 @@ mockito-all test + + org.apache.archiva + archiva-repository-admin-default + test + diff --git a/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-services/src/main/java/org/apache/archiva/web/xmlrpc/services/AdministrationServiceImpl.java b/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-services/src/main/java/org/apache/archiva/web/xmlrpc/services/AdministrationServiceImpl.java index bdc558afd..b7b0004d7 100644 --- a/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-services/src/main/java/org/apache/archiva/web/xmlrpc/services/AdministrationServiceImpl.java +++ b/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-services/src/main/java/org/apache/archiva/web/xmlrpc/services/AdministrationServiceImpl.java @@ -19,10 +19,10 @@ package org.apache.archiva.web.xmlrpc.services; * under the License. */ -import org.apache.archiva.admin.AuditInformation; -import org.apache.archiva.admin.repository.RepositoryAdminException; -import org.apache.archiva.admin.repository.managed.ManagedRepositoryAdmin; -import org.apache.archiva.admin.repository.remote.RemoteRepositoryAdmin; +import org.apache.archiva.admin.model.AuditInformation; +import org.apache.archiva.admin.model.RepositoryAdminException; +import org.apache.archiva.admin.model.managed.ManagedRepositoryAdmin; +import org.apache.archiva.admin.model.remote.RemoteRepositoryAdmin; import org.apache.archiva.audit.AuditEvent; import org.apache.archiva.audit.AuditListener; import org.apache.archiva.metadata.model.ArtifactMetadata; @@ -315,7 +315,7 @@ public class AdministrationServiceImpl { List managedRepos = new ArrayList(); - for ( org.apache.archiva.admin.repository.managed.ManagedRepository repoConfig : managedRepositoryAdmin.getManagedRepositories() ) + for ( org.apache.archiva.admin.model.managed.ManagedRepository repoConfig : managedRepositoryAdmin.getManagedRepositories() ) { ManagedRepository repo = new ManagedRepository( repoConfig.getId(), repoConfig.getName(), repoConfig.getLocation(), @@ -334,7 +334,7 @@ public class AdministrationServiceImpl { List remoteRepos = new ArrayList(); - for ( org.apache.archiva.admin.repository.remote.RemoteRepository repoConfig : remoteRepositoryAdmin.getRemoteRepositories() ) + for ( org.apache.archiva.admin.model.remote.RemoteRepository repoConfig : remoteRepositoryAdmin.getRemoteRepositories() ) { RemoteRepository repo = new RemoteRepository( repoConfig.getId(), repoConfig.getName(), repoConfig.getUrl(), repoConfig.getLayout() ); @@ -368,8 +368,8 @@ public class AdministrationServiceImpl throws Exception { - org.apache.archiva.admin.repository.managed.ManagedRepository repository = - new org.apache.archiva.admin.repository.managed.ManagedRepository( repoId, name, location, layout, + org.apache.archiva.admin.model.managed.ManagedRepository repository = + new org.apache.archiva.admin.model.managed.ManagedRepository( repoId, name, location, layout, snapshotsIncluded, releasesIncluded, blockRedeployments, cronExpression, null, false, daysOlder, retentionCount, diff --git a/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-services/src/test/java/org/apache/archiva/web/xmlrpc/services/AdministrationServiceImplTest.java b/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-services/src/test/java/org/apache/archiva/web/xmlrpc/services/AdministrationServiceImplTest.java index 8acdd2f4b..cfedde318 100644 --- a/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-services/src/test/java/org/apache/archiva/web/xmlrpc/services/AdministrationServiceImplTest.java +++ b/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-services/src/test/java/org/apache/archiva/web/xmlrpc/services/AdministrationServiceImplTest.java @@ -20,6 +20,7 @@ package org.apache.archiva.web.xmlrpc.services; */ import junit.framework.TestCase; +import net.sf.beanlib.provider.replicator.BeanReplicator; import org.apache.archiva.admin.repository.RepositoryCommonValidator; import org.apache.archiva.admin.repository.managed.DefaultManagedRepositoryAdmin; import org.apache.archiva.admin.repository.remote.DefaultRemoteRepositoryAdmin; @@ -399,7 +400,8 @@ public class AdministrationServiceImplTest configControl.expectAndReturn( config.findManagedRepositoryById( "internal" ), managedRepo ); ManagedDefaultRepositoryContent repoContent = new ManagedDefaultRepositoryContent(); - repoContent.setRepository( managedRepo ); + repoContent.setRepository( new BeanReplicator().replicateBean( managedRepo, + org.apache.archiva.admin.model.managed.ManagedRepository.class ) ); repoFactoryControl.expectAndReturn( repositoryFactory.getManagedRepositoryContent( "internal" ), repoContent ); @@ -451,7 +453,8 @@ public class AdministrationServiceImplTest configControl.expectAndReturn( config.findManagedRepositoryById( "internal" ), managedRepo ); ManagedLegacyRepositoryContent repoContent = new ManagedLegacyRepositoryContent(); - repoContent.setRepository( managedRepo ); + repoContent.setRepository( new BeanReplicator().replicateBean( managedRepo, + org.apache.archiva.admin.model.managed.ManagedRepository.class ) ); repoContent.setFileTypes( fileTypes ); repoContent.setLegacyPathParser( parser ); @@ -511,7 +514,8 @@ public class AdministrationServiceImplTest configControl.expectAndReturn( config.findManagedRepositoryById( "internal" ), managedRepo ); ManagedDefaultRepositoryContent repoContent = new ManagedDefaultRepositoryContent(); - repoContent.setRepository( managedRepo ); + repoContent.setRepository( new BeanReplicator().replicateBean( managedRepo, + org.apache.archiva.admin.model.managed.ManagedRepository.class ) ); repoFactoryControl.expectAndReturn( repositoryFactory.getManagedRepositoryContent( "internal" ), repoContent ); diff --git a/archiva-modules/plugins/problem-reports/pom.xml b/archiva-modules/plugins/problem-reports/pom.xml index 697cab1a7..241f317f2 100644 --- a/archiva-modules/plugins/problem-reports/pom.xml +++ b/archiva-modules/plugins/problem-reports/pom.xml @@ -32,6 +32,15 @@ org.apache.archiva metadata-repository-api + + + org.apache.archiva + archiva-configuration + + + org.apache.archiva + archiva-repository-admin-api + org.apache.archiva archiva-checksum diff --git a/archiva-modules/plugins/problem-reports/src/main/java/org/apache/archiva/reports/consumers/DuplicateArtifactsConsumer.java b/archiva-modules/plugins/problem-reports/src/main/java/org/apache/archiva/reports/consumers/DuplicateArtifactsConsumer.java index bb033fd28..235094dd7 100644 --- a/archiva-modules/plugins/problem-reports/src/main/java/org/apache/archiva/reports/consumers/DuplicateArtifactsConsumer.java +++ b/archiva-modules/plugins/problem-reports/src/main/java/org/apache/archiva/reports/consumers/DuplicateArtifactsConsumer.java @@ -19,6 +19,7 @@ package org.apache.archiva.reports.consumers; * under the License. */ +import org.apache.archiva.admin.model.managed.ManagedRepository; import org.apache.archiva.checksum.ChecksumAlgorithm; import org.apache.archiva.checksum.ChecksummedFile; import org.apache.archiva.metadata.model.ArtifactMetadata; @@ -32,7 +33,6 @@ import org.apache.commons.collections.CollectionUtils; import org.apache.maven.archiva.configuration.ArchivaConfiguration; import org.apache.maven.archiva.configuration.ConfigurationNames; import org.apache.maven.archiva.configuration.FileTypes; -import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration; import org.apache.maven.archiva.consumers.AbstractMonitoredConsumer; import org.apache.maven.archiva.consumers.ConsumerException; import org.apache.maven.archiva.consumers.KnownRepositoryContentConsumer; @@ -138,7 +138,7 @@ public class DuplicateArtifactsConsumer return Collections.emptyList(); } - public void beginScan( ManagedRepositoryConfiguration repo, Date whenGathered ) + public void beginScan( ManagedRepository repo, Date whenGathered ) throws ConsumerException { repoId = repo.getId(); @@ -146,7 +146,7 @@ public class DuplicateArtifactsConsumer repositorySession = repositorySessionFactory.createSession(); } - public void beginScan( ManagedRepositoryConfiguration repo, Date whenGathered, boolean executeOnEntireRepo ) + public void beginScan( ManagedRepository repo, Date whenGathered, boolean executeOnEntireRepo ) throws ConsumerException { beginScan( repo, whenGathered ); diff --git a/archiva-modules/plugins/problem-reports/src/test/java/org/apache/archiva/reports/consumers/DuplicateArtifactsConsumerTest.java b/archiva-modules/plugins/problem-reports/src/test/java/org/apache/archiva/reports/consumers/DuplicateArtifactsConsumerTest.java index 359f7a499..fb1cc6bb0 100644 --- a/archiva-modules/plugins/problem-reports/src/test/java/org/apache/archiva/reports/consumers/DuplicateArtifactsConsumerTest.java +++ b/archiva-modules/plugins/problem-reports/src/test/java/org/apache/archiva/reports/consumers/DuplicateArtifactsConsumerTest.java @@ -20,6 +20,7 @@ package org.apache.archiva.reports.consumers; */ import junit.framework.TestCase; +import org.apache.archiva.admin.model.managed.ManagedRepository; import org.apache.archiva.metadata.model.ArtifactMetadata; import org.apache.archiva.metadata.model.MetadataFacet; import org.apache.archiva.metadata.repository.MetadataRepository; @@ -57,7 +58,7 @@ public class DuplicateArtifactsConsumerTest @Named( value = "knownRepositoryContentConsumer#duplicate-artifacts" ) private DuplicateArtifactsConsumer consumer; - private ManagedRepositoryConfiguration config; + private ManagedRepository config; private MetadataRepository metadataRepository; @@ -92,7 +93,7 @@ public class DuplicateArtifactsConsumerTest assertNotNull( consumer ); - config = new ManagedRepositoryConfiguration(); + config = new ManagedRepository(); config.setId( TEST_REPO ); config.setLocation( new File( "target/test-repository" ).getAbsolutePath() ); diff --git a/pom.xml b/pom.xml index 3e35d4c9d..e04378727 100644 --- a/pom.xml +++ b/pom.xml @@ -117,7 +117,12 @@ org.apache.archiva - archiva-repository-admin + archiva-repository-admin-api + ${project.version} + + + org.apache.archiva + archiva-repository-admin-default ${project.version} @@ -748,6 +753,11 @@ + + org.codehaus.redback + redback-users-api + ${redback.version} + org.codehaus.redback @@ -850,6 +860,17 @@ + + org.codehaus.redback + redback-rbac-cached + ${redback.version} + + + commons-logging + commons-logging + + + org.codehaus.redback redback-struts2-content