diff options
author | Olivier Lamy <olamy@apache.org> | 2011-09-13 12:12:39 +0000 |
---|---|---|
committer | Olivier Lamy <olamy@apache.org> | 2011-09-13 12:12:39 +0000 |
commit | 919a5ac3eb725dc676e81fcbf868f3cc165598a4 (patch) | |
tree | 9aecd4829e214ecbb256dbd0ec5f13f428016ab3 | |
parent | 5c067f2a4deaa775213a3b5c2ca44ce62f4ba914 (diff) | |
download | archiva-919a5ac3eb725dc676e81fcbf868f3cc165598a4.tar.gz archiva-919a5ac3eb725dc676e81fcbf868f3cc165598a4.zip |
[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
305 files changed, 4470 insertions, 1242 deletions
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<String> 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<String> DEFAULT_EXCLUSIONS = - Arrays.asList( "**/maven-metadata.xml", "**/maven-metadata-*.xml", "**/*.sha1", "**/*.asc", "**/*.md5", - "**/*.pgp", "**/.index/**", "**/.indexer/**" ); + public static final List<String> 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 @@ <dependencies> <dependency> <groupId>org.apache.archiva</groupId> - <artifactId>archiva-configuration</artifactId> + <artifactId>archiva-repository-admin-api</artifactId> + </dependency> + <dependency> + <groupId>org.apache.archiva</groupId> + <artifactId>archiva-common</artifactId> </dependency> <dependency> <groupId>commons-collections</groupId> 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<String> 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 @@ -46,6 +46,10 @@ </dependency> <dependency> <groupId>org.apache.archiva</groupId> + <artifactId>archiva-repository-admin-api</artifactId> + </dependency> + <dependency> + <groupId>org.apache.archiva</groupId> <artifactId>archiva-repository-layer</artifactId> </dependency> <dependency> @@ -84,10 +88,36 @@ <artifactId>mockito-all</artifactId> <scope>test</scope> </dependency> + <dependency> + <groupId>org.apache.archiva</groupId> + <artifactId>archiva-repository-admin-default</artifactId> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.codehaus.redback</groupId> + <artifactId>redback-rbac-cached</artifactId> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.apache.derby</groupId> + <artifactId>derby</artifactId> + <scope>test</scope> + </dependency> </dependencies> <build> <pluginManagement> <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-surefire-plugin</artifactId> + <configuration> + <systemPropertyVariables> + <appserver.base>${basedir}/target/appserver-base</appserver.base> + <plexus.home>${project.build.outputDirectory}</plexus.home> + <java.io.tmpdir>${project.build.outputDirectory}</java.io.tmpdir> + </systemPropertyVariables> + </configuration> + </plugin> <plugin> <groupId>org.apache.rat</groupId> <artifactId>apache-rat-plugin</artifactId> 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. * </p> - * + * <p/> * <p> * So, if you have the following (presented in the m2/default layout form) ... * <pre> @@ -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<RepositoryListener> 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<String> allVersions = new ArrayList<String>( repository.getVersions( reference ) ); - List<ManagedRepositoryConfiguration> repos = archivaConfig.getConfiguration().getManagedRepositories(); - for ( ManagedRepositoryConfiguration repo : repos ) + List<ManagedRepository> 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<String> includes = new ArrayList<String>(); @@ -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<String> getArtifactVersions( String repoId, String namespace, String projectId, + String projectVersion ) + { + return null; + } + + public Collection<ProjectVersionReference> getProjectReferences( String repoId, String namespace, String projectId, + String projectVersion ) + { + return null; + } + + public Collection<String> getRootNamespaces( String repoId ) + { + return null; + } + + public Collection<String> getNamespaces( String repoId, String namespace ) + { + return null; + } + + public Collection<String> getProjects( String repoId, String namespace ) + { + return null; + } + + public Collection<String> 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<String> 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<ArtifactMetadata> getArtifactsByDateRange( String repoId, Date startTime, Date endTime ) + { + return null; + } + + public Collection<String> getRepositories() + { + return null; + } + + public List<ArtifactMetadata> 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<ArtifactMetadata> 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<ArtifactMetadata> 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<RepositoryListener> 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<RepositoryListener> 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<RepositoryListener> 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<RepositoryListener> listeners = Collections.singletonList( listener ); repoPurge = new RetentionCountRepositoryPurge( getRepository(), repoConfiguration.getRetentionCount(), repositorySession, listeners ); 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-consumers/archiva-core-consumers/src/test/resources/META-INF/redback/redback-core.xml index ecc1de8fb..ecc1de8fb 100644 --- a/archiva-modules/archiva-base/archiva-repository-admin/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 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 @@ +<?xml version="1.0"?> + +<!-- + ~ 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. + --> +<beans xmlns="http://www.springframework.org/schema/beans" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:context="http://www.springframework.org/schema/context" + xsi:schemaLocation="http://www.springframework.org/schema/beans + http://www.springframework.org/schema/beans/spring-beans-3.0.xsd + http://www.springframework.org/schema/context + http://www.springframework.org/schema/context/spring-context-3.0.xsd" default-lazy-init="true"> + + <bean name="scheduler" class="org.codehaus.redback.components.scheduler.DefaultScheduler"> + <property name="properties"> + <props> + <prop key="org.quartz.scheduler.instanceName">scheduler1</prop> + <prop key="org.quartz.threadPool.class">org.quartz.simpl.SimpleThreadPool</prop> + <prop key="org.quartz.threadPool.threadCount">2</prop> + <prop key="org.quartz.threadPool.threadPriority">4</prop> + <prop key="org.quartz.jobStore.class">org.quartz.simpl.RAMJobStore</prop> + </props> + </property> + </bean> + +</beans>
\ 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<String> includes = new ArrayList<String>(); - private ManagedRepositoryConfiguration repository; + private ManagedRepository repository; private List<? extends IndexCreator> 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<LegacyArtifactPath> 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<FileType> 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<String> knownContentConsumers, AuditInformation auditInformation ) + throws RepositoryAdminException + { + + } + + public List<String> 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<String> invalidContentConsumers, AuditInformation auditInformation ) + throws RepositoryAdminException + { + + } + + public List<String> 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"> + <bean name="mockArchivaAdministration" class="org.apache.maven.archiva.converter.mock.MockArchivaAdministration"/> </beans>
\ 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 @@ <artifactId>slf4j-simple</artifactId> <scope>test</scope> </dependency> + <dependency> + <groupId>org.apache.archiva</groupId> + <artifactId>archiva-repository-admin-default</artifactId> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.codehaus.redback</groupId> + <artifactId>redback-rbac-cached</artifactId> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.apache.derby</groupId> + <artifactId>derby</artifactId> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.apache.archiva</groupId> + <artifactId>archiva-security-common</artifactId> + </dependency> </dependencies> <build> <plugins> @@ -132,6 +151,8 @@ <artifactId>maven-surefire-plugin</artifactId> <configuration> <systemPropertyVariables> + <appserver.base>${basedir}/target/appserver-base</appserver.base> + <plexus.home>${project.build.outputDirectory}</plexus.home> <java.io.tmpdir>${project.build.outputDirectory}</java.io.tmpdir> </systemPropertyVariables> </configuration> 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 @@ -126,14 +129,17 @@ public abstract class AbstractProxyTestCase WagonDelegate delegate; @Inject + protected ManagedRepositoryAdmin managedRepositoryAdmin; + + @Inject PlexusSisuBridge plexusSisuBridge; @Before 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<ManagedRepositoryConfiguration>() ); config.getConfiguration().setRemoteRepositories( new ArrayList<RemoteRepositoryConfiguration>() ); @@ -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<File> tmpFiles = org.apache.commons.io.FileUtils.listFiles( workingDir, new String[]{"tmp"}, false ); + Collection<File> 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 @@ +<redback-role-model> + <modelVersion>1.0.0</modelVersion> + <applications> + <application> + <id>System</id> + <description>Roles that apply system-wide, across all of the applications</description> + <version>1.0.0</version> + <resources> + <resource> + <id>global</id> + <name>*</name> + <permanent>true</permanent> + <description>global resource implies full access for authorization</description> + </resource> + <resource> + <id>username</id> + <name>${username}</name> + <permanent>true</permanent> + <description>replaced with the username of the principal at authorization check time</description> + </resource> + </resources> + <operations> + <operation> + <id>configuration-edit</id> + <name>configuration-edit</name> + <description>edit configuration</description> + <permanent>true</permanent> + </operation> + <operation> + <id>user-management-user-create</id> + <name>user-management-user-create</name> + <description>create user</description> + <permanent>true</permanent> + </operation> + <operation> + <id>user-management-user-edit</id> + <name>user-management-user-edit</name> + <description>edit user</description> + <permanent>true</permanent> + </operation> + <operation> + <id>user-management-user-role</id> + <name>user-management-user-role</name> + <description>user roles</description> + <permanent>true</permanent> + </operation> + <operation> + <id>user-management-user-delete</id> + <name>user-management-user-delete</name> + <description>delete user</description> + <permanent>true</permanent> + </operation> + <operation> + <id>user-management-user-list</id> + <name>user-management-user-list</name> + <description>list users</description> + <permanent>true</permanent> + </operation> + <operation> + <id>user-management-role-grant</id> + <name>user-management-role-grant</name> + <description>grant role</description> + <permanent>true</permanent> + </operation> + <operation> + <id>user-management-role-drop</id> + <name>user-management-role-drop</name> + <description>drop role</description> + <permanent>true</permanent> + </operation> + <operation> + <id>user-management-rbac-admin</id> + <name>user-management-rbac-admin</name> + <description>administer rbac</description> + <permanent>true</permanent> + </operation> + <operation> + <id>guest-access</id> + <name>guest-access</name> + <description>access guest</description> + <permanent>true</permanent> + </operation> + <operation> + <id>user-management-manage-data</id> + <name>user-management-manage-data</name> + <description>manage data</description> + <permanent>true</permanent> + </operation> + </operations> + <roles> + <role> + <id>system-administrator</id> + <name>System Administrator</name> + <permanent>true</permanent> + <assignable>true</assignable> + <permissions> + <permission> + <id>edit-redback-configuration</id> + <name>Edit Redback Configuration</name> + <operation>configuration-edit</operation> + <resource>global</resource> + <permanent>true</permanent> + </permission> + <permission> + <id>manage-rbac-setup</id> + <name>User RBAC Management</name> + <operation>user-management-rbac-admin</operation> + <resource>global</resource> + <permanent>true</permanent> + </permission> + <permission> + <id>manage-rbac-data</id> + <name>RBAC Manage Data</name> + <operation>user-management-manage-data</operation> + <resource>global</resource> + <permanent>true</permanent> + </permission> + </permissions> + <childRoles> + <childRole>user-administrator</childRole> + </childRoles> + </role> + <role> + <id>user-administrator</id> + <name>User Administrator</name> + <permanent>true</permanent> + <assignable>true</assignable> + <permissions> + <permission> + <id>drop-roles-for-anyone</id> + <name>Drop Roles for Anyone</name> + <operation>user-management-role-drop</operation> + <resource>global</resource> + <permanent>true</permanent> + </permission> + <permission> + <id>grant-roles-for-anyone</id> + <name>Grant Roles for Anyone</name> + <operation>user-management-role-grant</operation> + <resource>global</resource> + <permanent>true</permanent> + </permission> + <permission> + <id>user-create</id> + <name>Create Users</name> + <operation>user-management-user-create</operation> + <resource>global</resource> + <permanent>true</permanent> + </permission> + <permission> + <id>user-delete</id> + <name>Delete Users</name> + <operation>user-management-user-delete</operation> + <resource>global</resource> + <permanent>true</permanent> + </permission> + <permission> + <id>user-edit</id> + <name>Edit Users</name> + <operation>user-management-user-edit</operation> + <resource>global</resource> + <permanent>true</permanent> + </permission> + <permission> + <id>access-users-roles</id> + <name>Access Users Roles</name> + <operation>user-management-user-role</operation> + <resource>global</resource> + <permanent>true</permanent> + </permission> + <permission> + <id>access-user-list</id> + <name>Access User List</name> + <operation>user-management-user-list</operation> + <resource>global</resource> + <permanent>true</permanent> + </permission> + </permissions> + </role> + <role> + <id>registered-user</id> + <name>Registered User</name> + <permanent>true</permanent> + <assignable>true</assignable> + <permissions> + <permission> + <id>edit-user-by-username</id> + <name>Edit User Data by Username</name> + <operation>user-management-user-edit</operation> + <resource>username</resource> + <permanent>true</permanent> + </permission> + </permissions> + </role> + <role> + <id>guest</id> + <name>Guest</name> + <permanent>true</permanent> + <assignable>true</assignable> + <permissions> + <permission> + <id>guest-permission</id> + <name>Guest Permission</name> + <operation>guest-access</operation> + <resource>global</resource> + <permanent>true</permanent> + </permission> + </permissions> + </role> + </roles> + </application> + </applications> +</redback-role-model>
\ 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 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + ~ Licensed to the Apache Software Foundation (ASF) under one + ~ or more contributor license agreements. See the NOTICE file + ~ distributed with this work for additional information + ~ regarding copyright ownership. The ASF licenses this file + ~ to you under the Apache License, Version 2.0 (the + ~ "License"); you may not use this file except in compliance + ~ with the License. You may obtain a copy of the License at + ~ + ~ http://www.apache.org/licenses/LICENSE-2.0 + ~ + ~ Unless required by applicable law or agreed to in writing, + ~ software distributed under the License is distributed on an + ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + ~ KIND, either express or implied. See the License for the + ~ specific language governing permissions and limitations + ~ under the License. + --> + +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>org.apache.archiva</groupId> + <artifactId>archiva-repository-admin</artifactId> + <version>1.4-SNAPSHOT</version> + </parent> + <artifactId>archiva-repository-admin-api</artifactId> + <name>Archiva Base :: Repository Admin Api</name> + <dependencies> + <dependency> + <groupId>commons-collections</groupId> + <artifactId>commons-collections</artifactId> + </dependency> + <dependency> + <groupId>commons-lang</groupId> + <artifactId>commons-lang</artifactId> + </dependency> + <dependency> + <groupId>org.codehaus.redback</groupId> + <artifactId>redback-users-api</artifactId> + </dependency> + </dependencies> + +</project> 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/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/AbstractRepository.java index 6f7cf8286..053068454 100644 --- 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/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/AbstractRepository.java @@ -1,4 +1,4 @@ -package org.apache.archiva.admin.repository; +package org.apache.archiva.admin.model; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file 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/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/AbstractRepositoryConnector.java index c5ecf32ec..84f9a5117 100644 --- 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/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/AbstractRepositoryConnector.java @@ -1,4 +1,4 @@ -package org.apache.archiva.admin.repository; +package org.apache.archiva.admin.model; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file 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/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/AuditInformation.java index 098e09351..6d96a42e0 100644 --- 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/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/AuditInformation.java @@ -1,4 +1,4 @@ -package org.apache.archiva.admin; +package org.apache.archiva.admin.model; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file 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/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/RepositoryAdminException.java index 12f9b1b10..0237bca8c 100644 --- 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/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/RepositoryAdminException.java @@ -1,4 +1,4 @@ -package org.apache.archiva.admin.repository; +package org.apache.archiva.admin.model; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file 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/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/admin/ArchivaAdministration.java index 48a365faf..f7cc51497 100644 --- 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/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/admin/ArchivaAdministration.java @@ -1,4 +1,4 @@ -package org.apache.archiva.admin.repository.admin; +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 @@ -18,8 +18,8 @@ package org.apache.archiva.admin.repository.admin; * under the License. */ -import org.apache.archiva.admin.AuditInformation; -import org.apache.archiva.admin.repository.RepositoryAdminException; +import org.apache.archiva.admin.model.AuditInformation; +import org.apache.archiva.admin.model.RepositoryAdminException; import java.util.List; 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/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/admin/FileType.java index 8f3a3f24d..5fe4e6afa 100644 --- 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/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/admin/FileType.java @@ -1,4 +1,4 @@ -package org.apache.archiva.admin.repository.admin; +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 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/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/admin/LegacyArtifactPath.java index e9489489e..2031d9569 100644 --- 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/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/admin/LegacyArtifactPath.java @@ -1,4 +1,4 @@ -package org.apache.archiva.admin.repository.admin; +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 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/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/admin/OrganisationInformation.java index 77bd06d0d..23941fe0a 100644 --- 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/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/admin/OrganisationInformation.java @@ -1,4 +1,4 @@ -package org.apache.archiva.admin.repository.admin; +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 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/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/group/RepositoryGroup.java index 5e44596ed..e242bf441 100644 --- 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/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/group/RepositoryGroup.java @@ -1,4 +1,4 @@ -package org.apache.archiva.admin.repository.group; +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 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/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/group/RepositoryGroupAdmin.java index 7c21b3a5b..18c5c9469 100644 --- 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/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/group/RepositoryGroupAdmin.java @@ -1,4 +1,4 @@ -package org.apache.archiva.admin.repository.group; +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 @@ -18,8 +18,8 @@ package org.apache.archiva.admin.repository.group; * under the License. */ -import org.apache.archiva.admin.AuditInformation; -import org.apache.archiva.admin.repository.RepositoryAdminException; +import org.apache.archiva.admin.model.AuditInformation; +import org.apache.archiva.admin.model.RepositoryAdminException; import java.util.List; import java.util.Map; 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/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/managed/ManagedRepository.java index a47d109cd..8d0e48bad 100644 --- 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/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/managed/ManagedRepository.java @@ -1,4 +1,4 @@ -package org.apache.archiva.admin.repository.managed; +package org.apache.archiva.admin.model.managed; /* * Licensed to the Apache Software Foundation (ASF) under one @@ -19,7 +19,7 @@ package org.apache.archiva.admin.repository.managed; * under the License. */ -import org.apache.archiva.admin.repository.AbstractRepository; +import org.apache.archiva.admin.model.AbstractRepository; import java.io.Serializable; @@ -51,7 +51,7 @@ public class ManagedRepository */ private ManagedRepository stagingRepository; - private boolean scanned = true; + private boolean scanned = false; private String indexDirectory; 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/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/managed/ManagedRepositoryAdmin.java index 8f9e2cd6f..cf79f4316 100644 --- 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/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/managed/ManagedRepositoryAdmin.java @@ -1,4 +1,4 @@ -package org.apache.archiva.admin.repository.managed; +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 @@ -19,8 +19,8 @@ package org.apache.archiva.admin.repository.managed; */ -import org.apache.archiva.admin.AuditInformation; -import org.apache.archiva.admin.repository.RepositoryAdminException; +import org.apache.archiva.admin.model.AuditInformation; +import org.apache.archiva.admin.model.RepositoryAdminException; import java.util.List; import java.util.Map; 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/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/networkproxy/NetworkProxy.java index ec5250bf3..b60138fbc 100644 --- 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/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/networkproxy/NetworkProxy.java @@ -1,4 +1,4 @@ -package org.apache.archiva.admin.repository.networkproxy; +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 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/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/networkproxy/NetworkProxyAdmin.java index e8c0a0113..52e2bd2af 100644 --- 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/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/networkproxy/NetworkProxyAdmin.java @@ -1,4 +1,4 @@ -package org.apache.archiva.admin.repository.networkproxy; +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 @@ -18,8 +18,8 @@ package org.apache.archiva.admin.repository.networkproxy; * under the License. */ -import org.apache.archiva.admin.AuditInformation; -import org.apache.archiva.admin.repository.RepositoryAdminException; +import org.apache.archiva.admin.model.AuditInformation; +import org.apache.archiva.admin.model.RepositoryAdminException; import java.util.List; 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/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/proxyconnector/ProxyConnector.java index 67a767216..57838eab7 100644 --- 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/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/proxyconnector/ProxyConnector.java @@ -1,4 +1,4 @@ -package org.apache.archiva.admin.repository.proxyconnector; +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 @@ -18,7 +18,7 @@ package org.apache.archiva.admin.repository.proxyconnector; * under the License. */ -import org.apache.archiva.admin.repository.AbstractRepositoryConnector; +import org.apache.archiva.admin.model.AbstractRepositoryConnector; import java.io.Serializable; 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/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/proxyconnector/ProxyConnectorAdmin.java index cfb549b2a..1c31b996d 100644 --- 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/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/proxyconnector/ProxyConnectorAdmin.java @@ -1,4 +1,4 @@ -package org.apache.archiva.admin.repository.proxyconnector; +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 @@ -18,8 +18,8 @@ package org.apache.archiva.admin.repository.proxyconnector; * under the License. */ -import org.apache.archiva.admin.AuditInformation; -import org.apache.archiva.admin.repository.RepositoryAdminException; +import org.apache.archiva.admin.model.AuditInformation; +import org.apache.archiva.admin.model.RepositoryAdminException; import java.util.List; import java.util.Map; 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/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/proxyconnector/ProxyConnectorOrderComparator.java index 3f8b0d05b..34aee666c 100644 --- 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/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/proxyconnector/ProxyConnectorOrderComparator.java @@ -1,4 +1,4 @@ -package org.apache.archiva.admin.repository.proxyconnector; +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 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/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/proxyconnector/ProxyConnectorSelectionPredicate.java index 01983b71d..953c9f194 100644 --- 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/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/proxyconnector/ProxyConnectorSelectionPredicate.java @@ -1,4 +1,4 @@ -package org.apache.archiva.admin.repository.proxyconnector; +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 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/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/remote/RemoteRepository.java index db9f965d7..ced425b63 100644 --- 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/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/remote/RemoteRepository.java @@ -1,4 +1,4 @@ -package org.apache.archiva.admin.repository.remote; +package org.apache.archiva.admin.model.remote; /* * Licensed to the Apache Software Foundation (ASF) under one @@ -19,7 +19,7 @@ package org.apache.archiva.admin.repository.remote; * under the License. */ -import org.apache.archiva.admin.repository.AbstractRepository; +import org.apache.archiva.admin.model.AbstractRepository; import java.io.Serializable; 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/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/remote/RemoteRepositoryAdmin.java index 15218ba8d..0753f9019 100644 --- 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/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/remote/RemoteRepositoryAdmin.java @@ -1,4 +1,4 @@ -package org.apache.archiva.admin.repository.remote; +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 @@ -19,8 +19,8 @@ package org.apache.archiva.admin.repository.remote; */ -import org.apache.archiva.admin.AuditInformation; -import org.apache.archiva.admin.repository.RepositoryAdminException; +import org.apache.archiva.admin.model.AuditInformation; +import org.apache.archiva.admin.model.RepositoryAdminException; import java.util.List; import java.util.Map; 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 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + ~ Licensed to the Apache Software Foundation (ASF) under one + ~ or more contributor license agreements. See the NOTICE file + ~ distributed with this work for additional information + ~ regarding copyright ownership. The ASF licenses this file + ~ to you under the Apache License, Version 2.0 (the + ~ "License"); you may not use this file except in compliance + ~ with the License. You may obtain a copy of the License at + ~ + ~ http://www.apache.org/licenses/LICENSE-2.0 + ~ + ~ Unless required by applicable law or agreed to in writing, + ~ software distributed under the License is distributed on an + ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + ~ KIND, either express or implied. See the License for the + ~ specific language governing permissions and limitations + ~ under the License. + --> + +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>org.apache.archiva</groupId> + <artifactId>archiva-repository-admin</artifactId> + <version>1.4-SNAPSHOT</version> + </parent> + <artifactId>archiva-repository-admin-default</artifactId> + <name>Archiva Base :: Repository Admin Default</name> + <dependencies> + <dependency> + <groupId>org.apache.archiva</groupId> + <artifactId>archiva-configuration</artifactId> + </dependency> + <dependency> + <groupId>org.apache.archiva</groupId> + <artifactId>archiva-security-common</artifactId> + </dependency> + <dependency> + <groupId>org.apache.archiva</groupId> + <artifactId>archiva-scheduler-repository</artifactId> + </dependency> + <dependency> + <groupId>org.apache.archiva</groupId> + <artifactId>archiva-repository-admin-api</artifactId> + </dependency> + <dependency> + <groupId>org.apache.archiva</groupId> + <artifactId>audit</artifactId> + </dependency> + <dependency> + <groupId>javax.inject</groupId> + <artifactId>javax.inject</artifactId> + </dependency> + <dependency> + <groupId>net.sf.beanlib</groupId> + <artifactId>beanlib</artifactId> + <exclusions> + <exclusion> + <groupId>cglib</groupId> + <artifactId>cglib</artifactId> + </exclusion> + <exclusion> + <groupId>aopalliance</groupId> + <artifactId>aopalliance</artifactId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-context-support</artifactId> + <version>${spring.version}</version> + <exclusions> + <exclusion> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-context</artifactId> + <version>${spring.version}</version> + <exclusions> + <exclusion> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-api</artifactId> + </dependency> + <dependency> + <groupId>commons-validator</groupId> + <artifactId>commons-validator</artifactId> + </dependency> + <dependency> + <groupId>oro</groupId> + <artifactId>oro</artifactId> + </dependency> + <dependency> + <groupId>org.codehaus.redback.components</groupId> + <artifactId>spring-quartz</artifactId> + </dependency> + <dependency> + <groupId>org.codehaus.redback</groupId> + <artifactId>redback-rbac-role-manager</artifactId> + <exclusions> + <exclusion> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>org.codehaus.redback</groupId> + <artifactId>redback-authentication-api</artifactId> + <exclusions> + <exclusion> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-log4j12</artifactId> + <scope>test</scope> + </dependency> + + <dependency> + <groupId>org.codehaus.redback</groupId> + <artifactId>redback-users-memory</artifactId> + <scope>test</scope> + <version>${redback.version}</version> + </dependency> + + <dependency> + <groupId>org.codehaus.redback</groupId> + <artifactId>redback-keys-memory</artifactId> + <scope>test</scope> + <version>${redback.version}</version> + </dependency> + + <dependency> + <groupId>org.codehaus.redback</groupId> + <artifactId>redback-rbac-cached</artifactId> + <version>${redback.version}</version> + <scope>test</scope> + <exclusions> + <exclusion> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + </exclusion> + </exclusions> + </dependency> + + <dependency> + <groupId>org.apache.derby</groupId> + <artifactId>derby</artifactId> + <scope>test</scope> + </dependency> + + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>jcl-over-slf4j</artifactId> + <scope>test</scope> + </dependency> + + <dependency> + <groupId>org.apache.archiva</groupId> + <artifactId>metadata-store-file</artifactId> + <scope>test</scope> + </dependency> + + </dependencies> + + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-surefire-plugin</artifactId> + <configuration> + <systemPropertyVariables> + <appserver.base>${project.build.outputDirectory}</appserver.base> + <plexus.home>${project.build.outputDirectory}</plexus.home> + </systemPropertyVariables> + </configuration> + + </plugin> + </plugins> + </build> +</project> 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/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/AbstractRepositoryAdmin.java index d917a6a48..298705f83 100644 --- 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/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/AbstractRepositoryAdmin.java @@ -18,7 +18,8 @@ package org.apache.archiva.admin.repository; * under the License. */ -import org.apache.archiva.admin.AuditInformation; +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; 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/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/RepositoryCommonValidator.java index e49fb3e0d..5ac48f34b 100644 --- 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/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/RepositoryCommonValidator.java @@ -18,6 +18,8 @@ package org.apache.archiva.admin.repository; * 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; 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/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/admin/DefaultArchivaAdministration.java index 084869214..e89952352 100644 --- 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/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/admin/DefaultArchivaAdministration.java @@ -19,9 +19,13 @@ package org.apache.archiva.admin.repository.admin; */ import net.sf.beanlib.provider.replicator.BeanReplicator; -import org.apache.archiva.admin.AuditInformation; +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.admin.repository.RepositoryAdminException; import org.apache.archiva.audit.AuditEvent; import org.apache.commons.lang.StringUtils; import org.apache.maven.archiva.configuration.Configuration; 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/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/admin/FiletypeToMapClosure.java index 5465b6e71..b48392e5e 100644 --- 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/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/admin/FiletypeToMapClosure.java @@ -19,6 +19,7 @@ package org.apache.archiva.admin.repository.admin; * under the License. */ +import org.apache.archiva.admin.model.admin.FileType; import org.apache.commons.collections.Closure; import java.util.HashMap; 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/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/group/DefaultRepositoryGroupAdmin.java index 78e183ba3..e3c2b6376 100644 --- 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/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/group/DefaultRepositoryGroupAdmin.java @@ -18,11 +18,13 @@ package org.apache.archiva.admin.repository.group; * under the License. */ -import org.apache.archiva.admin.AuditInformation; +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.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; 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/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/managed/DefaultManagedRepositoryAdmin.java index e525c3bc9..bee986948 100644 --- 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/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/managed/DefaultManagedRepositoryAdmin.java @@ -18,9 +18,11 @@ package org.apache.archiva.admin.repository.managed; * under the License. */ -import org.apache.archiva.admin.AuditInformation; +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.admin.repository.RepositoryAdminException; import org.apache.archiva.audit.AuditEvent; import org.apache.archiva.metadata.repository.MetadataRepository; import org.apache.archiva.metadata.repository.MetadataRepositoryException; @@ -206,6 +208,8 @@ public class DefaultManagedRepositoryAdmin repository.setDaysOlder( daysOlder ); repository.setRetentionCount( retentionCount ); repository.setDeleteReleasedSnapshots( deteleReleasedSnapshots ); + + try { addRepository( repository, config ); 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/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/networkproxy/DefaultNetworkProxyAdmin.java index b2dcdd087..1455354ae 100644 --- 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/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/networkproxy/DefaultNetworkProxyAdmin.java @@ -19,9 +19,11 @@ package org.apache.archiva.admin.repository.networkproxy; */ import net.sf.beanlib.provider.replicator.BeanReplicator; -import org.apache.archiva.admin.AuditInformation; +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.admin.repository.RepositoryAdminException; import org.apache.archiva.audit.AuditEvent; import org.apache.commons.lang.StringUtils; import org.apache.maven.archiva.configuration.Configuration; 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/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/proxyconnector/DefaultProxyConnectorAdmin.java index 7b77cfd3c..fc3580e28 100644 --- 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/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/proxyconnector/DefaultProxyConnectorAdmin.java @@ -19,11 +19,14 @@ package org.apache.archiva.admin.repository.proxyconnector; */ import net.sf.beanlib.provider.replicator.BeanReplicator; -import org.apache.archiva.admin.AuditInformation; +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.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; 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/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/remote/DefaultRemoteRepositoryAdmin.java index a2c83a473..b2c48e170 100644 --- 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/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/remote/DefaultRemoteRepositoryAdmin.java @@ -18,9 +18,11 @@ package org.apache.archiva.admin.repository.remote; * under the License. */ -import org.apache.archiva.admin.AuditInformation; +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.admin.repository.RepositoryAdminException; import org.apache.archiva.audit.AuditEvent; import org.apache.commons.lang.StringUtils; import org.apache.maven.archiva.configuration.Configuration; 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/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/utils/RepositoryComparator.java index f9b93697a..c65c2308d 100644 --- 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/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/utils/RepositoryComparator.java @@ -18,7 +18,7 @@ package org.apache.archiva.admin.repository.utils; * under the License. */ -import org.apache.archiva.admin.repository.AbstractRepository; +import org.apache.archiva.admin.model.AbstractRepository; import java.util.Comparator; 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/archiva-repository-admin-default/src/main/resources/META-INF/spring-context.xml index 3a9866691..3a9866691 100644 --- a/archiva-modules/archiva-base/archiva-repository-admin/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 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/archiva-repository-admin-default/src/test/java/org/apache/archiva/admin/mock/MockAuditListener.java index 42387a64d..42387a64d 100644 --- 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/archiva-repository-admin-default/src/test/java/org/apache/archiva/admin/mock/MockAuditListener.java 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/archiva-repository-admin-default/src/test/java/org/apache/archiva/admin/repository/AbstractRepositoryAdminTest.java index 0533faa37..254783779 100644 --- 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/archiva-repository-admin-default/src/test/java/org/apache/archiva/admin/repository/AbstractRepositoryAdminTest.java @@ -19,13 +19,13 @@ package org.apache.archiva.admin.repository; */ 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.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; 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/archiva-repository-admin-default/src/test/java/org/apache/archiva/admin/repository/admin/ArchivaAdministrationTest.java index c51c12664..2b8a1ce31 100644 --- 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/archiva-repository-admin-default/src/test/java/org/apache/archiva/admin/repository/admin/ArchivaAdministrationTest.java @@ -18,8 +18,12 @@ package org.apache.archiva.admin.repository.admin; * 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.admin.repository.RepositoryAdminException; import org.apache.archiva.audit.AuditEvent; import org.junit.Test; 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/archiva-repository-admin-default/src/test/java/org/apache/archiva/admin/repository/group/RepositoryGroupAdminTest.java index 7079a9caa..465f21fe7 100644 --- 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/archiva-repository-admin-default/src/test/java/org/apache/archiva/admin/repository/group/RepositoryGroupAdminTest.java @@ -18,8 +18,10 @@ package org.apache.archiva.admin.repository.group; * 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.admin.repository.managed.ManagedRepository; import org.apache.archiva.audit.AuditEvent; import org.junit.Test; 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/archiva-repository-admin-default/src/test/java/org/apache/archiva/admin/repository/managed/ManagedRepositoryAdminTest.java index 66dd71b5d..9cdf7f2a0 100644 --- 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/archiva-repository-admin-default/src/test/java/org/apache/archiva/admin/repository/managed/ManagedRepositoryAdminTest.java @@ -18,11 +18,10 @@ package org.apache.archiva.admin.repository.managed; * 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.apache.commons.io.FileUtils; -import org.apache.commons.lang.StringUtils; import org.junit.Test; import java.io.File; 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/archiva-repository-admin-default/src/test/java/org/apache/archiva/admin/repository/networkproxy/NetworkProxyAdminTest.java index 840ba19c7..02eec580f 100644 --- 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/archiva-repository-admin-default/src/test/java/org/apache/archiva/admin/repository/networkproxy/NetworkProxyAdminTest.java @@ -18,6 +18,8 @@ package org.apache.archiva.admin.repository.networkproxy; * 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; 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/archiva-repository-admin-default/src/test/java/org/apache/archiva/admin/repository/proxyconnector/ProxyConnectorAdminTest.java index 8b1eaafa6..b90c3b04a 100644 --- 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/archiva-repository-admin-default/src/test/java/org/apache/archiva/admin/repository/proxyconnector/ProxyConnectorAdminTest.java @@ -18,8 +18,9 @@ package org.apache.archiva.admin.repository.proxyconnector; * 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.admin.repository.remote.RemoteRepository; import org.apache.archiva.audit.AuditEvent; import org.junit.Test; 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/archiva-repository-admin-default/src/test/java/org/apache/archiva/admin/repository/remote/RemoteRepositoryAdminTest.java index 85f8ef723..ffc5a3311 100644 --- 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/archiva-repository-admin-default/src/test/java/org/apache/archiva/admin/repository/remote/RemoteRepositoryAdminTest.java @@ -18,6 +18,7 @@ package org.apache.archiva.admin.repository.remote; * 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; 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 @@ +<redback-role-model> + <modelVersion>1.0.0</modelVersion> + <applications> + <application> + <id>System</id> + <description>Roles that apply system-wide, across all of the applications</description> + <version>1.0.0</version> + <resources> + <resource> + <id>global</id> + <name>*</name> + <permanent>true</permanent> + <description>global resource implies full access for authorization</description> + </resource> + <resource> + <id>username</id> + <name>${username}</name> + <permanent>true</permanent> + <description>replaced with the username of the principal at authorization check time</description> + </resource> + </resources> + <operations> + <operation> + <id>configuration-edit</id> + <name>configuration-edit</name> + <description>edit configuration</description> + <permanent>true</permanent> + </operation> + <operation> + <id>user-management-user-create</id> + <name>user-management-user-create</name> + <description>create user</description> + <permanent>true</permanent> + </operation> + <operation> + <id>user-management-user-edit</id> + <name>user-management-user-edit</name> + <description>edit user</description> + <permanent>true</permanent> + </operation> + <operation> + <id>user-management-user-role</id> + <name>user-management-user-role</name> + <description>user roles</description> + <permanent>true</permanent> + </operation> + <operation> + <id>user-management-user-delete</id> + <name>user-management-user-delete</name> + <description>delete user</description> + <permanent>true</permanent> + </operation> + <operation> + <id>user-management-user-list</id> + <name>user-management-user-list</name> + <description>list users</description> + <permanent>true</permanent> + </operation> + <operation> + <id>user-management-role-grant</id> + <name>user-management-role-grant</name> + <description>grant role</description> + <permanent>true</permanent> + </operation> + <operation> + <id>user-management-role-drop</id> + <name>user-management-role-drop</name> + <description>drop role</description> + <permanent>true</permanent> + </operation> + <operation> + <id>user-management-rbac-admin</id> + <name>user-management-rbac-admin</name> + <description>administer rbac</description> + <permanent>true</permanent> + </operation> + <operation> + <id>guest-access</id> + <name>guest-access</name> + <description>access guest</description> + <permanent>true</permanent> + </operation> + <operation> + <id>user-management-manage-data</id> + <name>user-management-manage-data</name> + <description>manage data</description> + <permanent>true</permanent> + </operation> + </operations> + <roles> + <role> + <id>system-administrator</id> + <name>System Administrator</name> + <permanent>true</permanent> + <assignable>true</assignable> + <permissions> + <permission> + <id>edit-redback-configuration</id> + <name>Edit Redback Configuration</name> + <operation>configuration-edit</operation> + <resource>global</resource> + <permanent>true</permanent> + </permission> + <permission> + <id>manage-rbac-setup</id> + <name>User RBAC Management</name> + <operation>user-management-rbac-admin</operation> + <resource>global</resource> + <permanent>true</permanent> + </permission> + <permission> + <id>manage-rbac-data</id> + <name>RBAC Manage Data</name> + <operation>user-management-manage-data</operation> + <resource>global</resource> + <permanent>true</permanent> + </permission> + </permissions> + <childRoles> + <childRole>user-administrator</childRole> + </childRoles> + </role> + <role> + <id>user-administrator</id> + <name>User Administrator</name> + <permanent>true</permanent> + <assignable>true</assignable> + <permissions> + <permission> + <id>drop-roles-for-anyone</id> + <name>Drop Roles for Anyone</name> + <operation>user-management-role-drop</operation> + <resource>global</resource> + <permanent>true</permanent> + </permission> + <permission> + <id>grant-roles-for-anyone</id> + <name>Grant Roles for Anyone</name> + <operation>user-management-role-grant</operation> + <resource>global</resource> + <permanent>true</permanent> + </permission> + <permission> + <id>user-create</id> + <name>Create Users</name> + <operation>user-management-user-create</operation> + <resource>global</resource> + <permanent>true</permanent> + </permission> + <permission> + <id>user-delete</id> + <name>Delete Users</name> + <operation>user-management-user-delete</operation> + <resource>global</resource> + <permanent>true</permanent> + </permission> + <permission> + <id>user-edit</id> + <name>Edit Users</name> + <operation>user-management-user-edit</operation> + <resource>global</resource> + <permanent>true</permanent> + </permission> + <permission> + <id>access-users-roles</id> + <name>Access Users Roles</name> + <operation>user-management-user-role</operation> + <resource>global</resource> + <permanent>true</permanent> + </permission> + <permission> + <id>access-user-list</id> + <name>Access User List</name> + <operation>user-management-user-list</operation> + <resource>global</resource> + <permanent>true</permanent> + </permission> + </permissions> + </role> + <role> + <id>registered-user</id> + <name>Registered User</name> + <permanent>true</permanent> + <assignable>true</assignable> + <permissions> + <permission> + <id>edit-user-by-username</id> + <name>Edit User Data by Username</name> + <operation>user-management-user-edit</operation> + <resource>username</resource> + <permanent>true</permanent> + </permission> + </permissions> + </role> + <role> + <id>guest</id> + <name>Guest</name> + <permanent>true</permanent> + <assignable>true</assignable> + <permissions> + <permission> + <id>guest-permission</id> + <name>Guest Permission</name> + <operation>guest-access</operation> + <resource>global</resource> + <permanent>true</permanent> + </permission> + </permissions> + </role> + </roles> + </application> + </applications> +</redback-role-model>
\ 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/archiva-repository-admin-default/src/test/resources/log4j.xml index 9b1a6585b..9b1a6585b 100644 --- a/archiva-modules/archiva-base/archiva-repository-admin/src/test/resources/log4j.xml +++ b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/test/resources/log4j.xml diff --git a/archiva-modules/archiva-base/archiva-repository-admin/src/test/resources/spring-context.xml b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/test/resources/spring-context.xml index a18703d6d..a18703d6d 100644 --- a/archiva-modules/archiva-base/archiva-repository-admin/src/test/resources/spring-context.xml +++ b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/test/resources/spring-context.xml 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 @@ </parent> <artifactId>archiva-repository-admin</artifactId> <name>Archiva Base :: Repository Admin</name> - <dependencies> - <dependency> - <groupId>org.apache.archiva</groupId> - <artifactId>archiva-configuration</artifactId> - </dependency> - <dependency> - <groupId>org.apache.archiva</groupId> - <artifactId>archiva-security-common</artifactId> - </dependency> - <dependency> - <groupId>org.apache.archiva</groupId> - <artifactId>archiva-scheduler-repository</artifactId> - </dependency> - <dependency> - <groupId>org.apache.archiva</groupId> - <artifactId>audit</artifactId> - </dependency> - <dependency> - <groupId>javax.inject</groupId> - <artifactId>javax.inject</artifactId> - </dependency> - <dependency> - <groupId>net.sf.beanlib</groupId> - <artifactId>beanlib</artifactId> - <exclusions> - <exclusion> - <groupId>cglib</groupId> - <artifactId>cglib</artifactId> - </exclusion> - <exclusion> - <groupId>aopalliance</groupId> - <artifactId>aopalliance</artifactId> - </exclusion> - </exclusions> - </dependency> - <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-context-support</artifactId> - <version>${spring.version}</version> - <exclusions> - <exclusion> - <groupId>commons-logging</groupId> - <artifactId>commons-logging</artifactId> - </exclusion> - </exclusions> - </dependency> - <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-context</artifactId> - <version>${spring.version}</version> - <exclusions> - <exclusion> - <groupId>commons-logging</groupId> - <artifactId>commons-logging</artifactId> - </exclusion> - </exclusions> - </dependency> - <dependency> - <groupId>org.slf4j</groupId> - <artifactId>slf4j-api</artifactId> - </dependency> - <dependency> - <groupId>commons-validator</groupId> - <artifactId>commons-validator</artifactId> - </dependency> - <dependency> - <groupId>oro</groupId> - <artifactId>oro</artifactId> - </dependency> - <dependency> - <groupId>org.codehaus.redback.components</groupId> - <artifactId>spring-quartz</artifactId> - </dependency> - <dependency> - <groupId>org.codehaus.redback</groupId> - <artifactId>redback-rbac-role-manager</artifactId> - <exclusions> - <exclusion> - <groupId>commons-logging</groupId> - <artifactId>commons-logging</artifactId> - </exclusion> - </exclusions> - </dependency> - <dependency> - <groupId>org.codehaus.redback</groupId> - <artifactId>redback-authentication-api</artifactId> - <exclusions> - <exclusion> - <groupId>commons-logging</groupId> - <artifactId>commons-logging</artifactId> - </exclusion> - </exclusions> - </dependency> - <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.slf4j</groupId> - <artifactId>slf4j-log4j12</artifactId> - <scope>test</scope> - </dependency> - - <dependency> - <groupId>org.codehaus.redback</groupId> - <artifactId>redback-users-memory</artifactId> - <scope>test</scope> - <version>${redback.version}</version> - </dependency> - - <dependency> - <groupId>org.codehaus.redback</groupId> - <artifactId>redback-keys-memory</artifactId> - <scope>test</scope> - <version>${redback.version}</version> - </dependency> - - <dependency> - <groupId>org.codehaus.redback</groupId> - <artifactId>redback-rbac-cached</artifactId> - <version>${redback.version}</version> - <scope>test</scope> - <exclusions> - <exclusion> - <groupId>commons-logging</groupId> - <artifactId>commons-logging</artifactId> - </exclusion> - </exclusions> - </dependency> - - <dependency> - <groupId>org.apache.derby</groupId> - <artifactId>derby</artifactId> - <scope>test</scope> - </dependency> - - <dependency> - <groupId>org.slf4j</groupId> - <artifactId>jcl-over-slf4j</artifactId> - <scope>test</scope> - </dependency> - - <dependency> - <groupId>org.apache.archiva</groupId> - <artifactId>metadata-store-file</artifactId> - <scope>test</scope> - </dependency> - - </dependencies> - - <build> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-surefire-plugin</artifactId> - <configuration> - <systemPropertyVariables> - <appserver.base>${project.build.outputDirectory}</appserver.base> - <plexus.home>${project.build.outputDirectory}</plexus.home> - </systemPropertyVariables> - </configuration> - - </plugin> - </plugins> - </build> + <packaging>pom</packaging> + <modules> + <module>archiva-repository-admin-api</module> + <module>archiva-repository-admin-default</module> + </modules> </project> 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 * <p> * Convenience method to get the repository id. * </p> - * + * <p/> * <p> * Equivalent to calling <code>.getRepository().getId()</code> * </p> - * + * * @return the repository id. */ String getId(); @@ -63,18 +63,18 @@ public interface ManagedRepositoryContent /** * <p> * 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...) * </p> - * + * <p/> * <p> * <strong>NOTE:</strong> Some layouts (such as maven 1 "legacy") are not compatible with this query. - * </p> - * + * </p> + * * @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<ArtifactReference> getRelatedArtifacts( ArtifactReference reference ) throws ContentNotFoundException; @@ -83,11 +83,11 @@ public interface ManagedRepositoryContent * <p> * Convenience method to get the repository (on disk) root directory. * </p> - * + * <p/> * <p> * Equivalent to calling <code>.getRepository().getLocation()</code> * </p> - * + * * @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<String> 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. * </p> - * + * <p/> * <p> * <strong>NOTE:</strong> This is really only useful when working with SNAPSHOTs. * </p> - * + * * @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<String> getVersions( VersionedReference reference ) + Set<String> 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(); /** * <p> @@ -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; @@ -49,6 +52,12 @@ public class RepositoryContentFactory private ArchivaConfiguration archivaConfiguration; @Inject + private ManagedRepositoryAdmin managedRepositoryAdmin; + + @Inject + private RemoteRepositoryAdmin remoteRepositoryAdmin; + + @Inject private ApplicationContext applicationContext; private final Map<String, ManagedRepositoryContent> managedContentMap; @@ -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 @@ </dependency> <dependency> <groupId>org.apache.archiva</groupId> - <artifactId>archiva-configuration</artifactId> + <artifactId>archiva-repository-admin-api</artifactId> </dependency> <dependency> <groupId>org.springframework</groupId> @@ -46,6 +46,13 @@ <scope>test</scope> </dependency> <dependency> + <groupId>org.apache.archiva</groupId> + <artifactId>archiva-configuration</artifactId> + <!-- FIXME olamy : should be scope test but it depends on FileTypes + <scope>test</scope> + --> + </dependency> + <dependency> <groupId>org.springframework</groupId> <artifactId>spring-test</artifactId> <scope>test</scope> 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<RepositoryScannerInstance> inProgressScans = new LinkedHashSet<RepositoryScannerInstance>(); - public RepositoryScanStatistics scan( ManagedRepositoryConfiguration repository, long changesSince ) + public RepositoryScanStatistics scan( ManagedRepository repository, long changesSince ) throws RepositoryScannerException { - List<KnownRepositoryContentConsumer> knownContentConsumers = consumerUtil.getSelectedKnownConsumers(); - List<InvalidRepositoryContentConsumer> invalidContentConsumers = consumerUtil.getSelectedInvalidConsumers(); - List<String> ignoredPatterns = filetypes.getFileTypePatterns( FileTypes.IGNORED ); + try + { + List<KnownRepositoryContentConsumer> knownContentConsumers = consumerUtil.getSelectedKnownConsumers(); + List<InvalidRepositoryContentConsumer> invalidContentConsumers = consumerUtil.getSelectedInvalidConsumers(); + List<String> 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<KnownRepositoryContentConsumer> knownContentConsumers, List<InvalidRepositoryContentConsumer> invalidContentConsumers, List<String> 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<KnownRepositoryContentConsumer> selectedKnownConsumers; private List<InvalidRepositoryContentConsumer> 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<String> 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<String> 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<String, KnownRepositoryContentConsumer> getSelectedKnownConsumersMap() + throws RepositoryAdminException { Map<String, KnownRepositoryContentConsumer> consumerMap = new HashMap<String, KnownRepositoryContentConsumer>(); @@ -133,6 +140,7 @@ public class RepositoryContentConsumers * @return the map of String ids to {@link InvalidRepositoryContentConsumer} objects. */ public Map<String, InvalidRepositoryContentConsumer> getSelectedInvalidConsumersMap() + throws RepositoryAdminException { Map<String, InvalidRepositoryContentConsumer> consumerMap = new HashMap<String, InvalidRepositoryContentConsumer>(); @@ -153,6 +161,7 @@ public class RepositoryContentConsumers * by the active configuration. */ public synchronized List<KnownRepositoryContentConsumer> getSelectedKnownConsumers() + throws RepositoryAdminException { if ( selectedKnownConsumers == null ) { @@ -180,6 +189,7 @@ public class RepositoryContentConsumers * by the active configuration. */ public synchronized List<InvalidRepositoryContentConsumer> 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 * <p> * Typical Ignorable Content patterns. * </p> - * + * <p/> * <p><strong> * NOTE: Do not use for normal webapp or task driven repository scanning. * </strong></p> - * + * <p/> * <p> * These patterns are only valid for archiva-cli and archiva-converter use. * </p> */ - 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. - * + * <p/> * 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. - * + * <p/> * 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<KnownRepositoryContentConsumer> knownContentConsumers, - List<InvalidRepositoryContentConsumer> invalidContentConsumers, - List<String> ignoredContentPatterns, long changesSince ) + RepositoryScanStatistics scan( ManagedRepository repository, + List<KnownRepositoryContentConsumer> knownContentConsumers, + List<InvalidRepositoryContentConsumer> invalidContentConsumers, + List<String> ignoredContentPatterns, long changesSince ) throws RepositoryScannerException; Set<RepositoryScannerInstance> 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<InvalidRepositoryContentConsumer> invalidConsumers; - private ManagedRepositoryConfiguration repository; + private ManagedRepository repository; private RepositoryScanStatistics stats; @@ -74,7 +74,7 @@ public class RepositoryScannerInstance private Map<String, Long> consumerCounts; - public RepositoryScannerInstance( ManagedRepositoryConfiguration repository, + public RepositoryScannerInstance( ManagedRepository repository, List<KnownRepositoryContentConsumer> knownConsumerList, List<InvalidRepositoryContentConsumer> invalidConsumerList ) { @@ -106,7 +106,7 @@ public class RepositoryScannerInstance } } - public RepositoryScannerInstance( ManagedRepositoryConfiguration repository, + public RepositoryScannerInstance( ManagedRepository repository, List<KnownRepositoryContentConsumer> knownContentConsumers, List<InvalidRepositoryContentConsumer> 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 @@ <context:component-scan base-package="org.apache.archiva.repository.scanner"/> <alias name="repositoryScanner#default" alias="repositoryScanner"/> - <bean id="repositoryContentConsumers" class="org.apache.archiva.repository.scanner.RepositoryContentConsumers" scope="prototype"> - <constructor-arg> - <ref bean="archivaConfiguration"/> - </constructor-arg> - </bean> </beans> 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<LegacyArtifactPath> 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<FileType> 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<String> knownContentConsumers, AuditInformation auditInformation ) + throws RepositoryAdminException + { + + } + + public List<String> 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<String> invalidContentConsumers, AuditInformation auditInformation ) + throws RepositoryAdminException + { + + } + + public List<String> 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<KnownRepositoryContentConsumer> knownConsumers = new ArrayList<KnownRepositoryContentConsumer>(); KnownScanConsumer consumer = new KnownScanConsumer(); @@ -179,7 +181,7 @@ public class RepositoryScannerTest public void testTimestampRepositoryScannerFreshScan() throws Exception { - ManagedRepositoryConfiguration repository = createSimpleRepository(); + ManagedRepository repository = createSimpleRepository(); List<KnownRepositoryContentConsumer> knownConsumers = new ArrayList<KnownRepositoryContentConsumer>(); KnownScanConsumer consumer = new KnownScanConsumer(); @@ -205,7 +207,7 @@ public class RepositoryScannerTest public void testTimestampRepositoryScannerProcessUnmodified() throws Exception { - ManagedRepositoryConfiguration repository = createSimpleRepository(); + ManagedRepository repository = createSimpleRepository(); List<KnownRepositoryContentConsumer> knownConsumers = new ArrayList<KnownRepositoryContentConsumer>(); KnownScanConsumer consumer = new KnownScanConsumer(); @@ -232,7 +234,7 @@ public class RepositoryScannerTest public void testDefaultRepositoryScanner() throws Exception { - ManagedRepositoryConfiguration repository = createDefaultRepository(); + ManagedRepository repository = createDefaultRepository(); List<KnownRepositoryContentConsumer> knownConsumers = new ArrayList<KnownRepositoryContentConsumer>(); 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<KnownRepositoryContentConsumer> knownConsumers = new ArrayList<KnownRepositoryContentConsumer>(); 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<KnownRepositoryContentConsumer> knownConsumers = new ArrayList<KnownRepositoryContentConsumer>(); 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<KnownRepositoryContentConsumer> knownConsumers = new ArrayList<KnownRepositoryContentConsumer>(); 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<KnownRepositoryContentConsumer> knownConsumers = new ArrayList<KnownRepositoryContentConsumer>(); 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 @@ <property name="registry" ref="registry#configured"/> </bean> + <bean name="admin-test-conf" class="org.apache.archiva.repository.scanner.ArchivaAdministrationStub"> + <constructor-arg ref="archivaConfiguration#test-conf"/> + </bean> + <bean name="registry#configured" class="org.codehaus.redback.components.registry.commons.CommonsConfigurationRegistry"> <property name="properties"> <value> @@ -84,7 +88,7 @@ </bean> <bean name="repositoryContentConsumers#test" class="org.apache.archiva.repository.scanner.RepositoryContentConsumersStub"> - <constructor-arg ref="archivaConfiguration#test-conf"/> + <constructor-arg ref="admin-test-conf"/> </bean> 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 @@ -29,6 +29,10 @@ <name>Archiva Scheduler :: API</name> <dependencies> <dependency> + <groupId>org.apache.archiva</groupId> + <artifactId>archiva-repository-admin-api</artifactId> + </dependency> + <dependency> <groupId>org.codehaus.redback.components</groupId> <artifactId>spring-taskqueue</artifactId> </dependency> 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 @@ -34,6 +34,10 @@ </dependency> <dependency> <groupId>org.apache.archiva</groupId> + <artifactId>archiva-repository-admin-api</artifactId> + </dependency> + <dependency> + <groupId>org.apache.archiva</groupId> <artifactId>archiva-configuration</artifactId> </dependency> <dependency> 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<? extends IndexCreator> 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<LegacyArtifactPath> 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<FileType> 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<String> knownContentConsumers, AuditInformation auditInformation ) + throws RepositoryAdminException + { + //To change body of implemented methods use File | Settings | File Templates. + } + + public List<String> getKnownContentConsumers() + throws RepositoryAdminException + { + return new ArrayList<String>( + 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<String> invalidContentConsumers, AuditInformation auditInformation ) + throws RepositoryAdminException + { + //To change body of implemented methods use File | Settings | File Templates. + } + + public List<String> getInvalidContentConsumers() + throws RepositoryAdminException + { + return new ArrayList<String>( + 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<ManagedRepository> getManagedRepositories() + throws RepositoryAdminException + { + List<ManagedRepositoryConfiguration> managedRepoConfigs = + getArchivaConfiguration().getConfiguration().getManagedRepositories(); + + List<ManagedRepository> managedRepos = new ArrayList<ManagedRepository>( 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<String, ManagedRepository> getManagedRepositoriesAsMap() + throws RepositoryAdminException + { + return null; + } + + public ManagedRepository getManagedRepository( String repositoryId ) + throws RepositoryAdminException + { + List<ManagedRepository> repos = getManagedRepositories(); + for ( ManagedRepository repo : repos ) + { + if ( StringUtils.equals( repo.getId(), repositoryId ) ) + { + return repo; + } + } + return null; + } + + 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<RemoteRepository> 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<String, RemoteRepository> 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 @@ <context:annotation-config/> <context:component-scan base-package="org.apache.archiva.metadata.repository"/> - <bean name="taskExecutor#test-repository-scanning" class="org.apache.archiva.scheduler.repository.ArchivaRepositoryScanningTaskExecutor"> + <bean name="managedRepoAdmin#test" class="org.apache.archiva.mock.MockManagedRepositoryAdmin"> + <property name="archivaConfiguration" ref="archivaConfiguration#test-repository-scanning"/> + </bean> + + <bean name="archivaAdministration#mock" class="org.apache.archiva.mock.MockArchivaAdministration"> + <property name="archivaConfiguration" ref="archivaConfiguration#test-repository-scanning"/> + </bean> + + <bean name="remoteRepositoryAdmin#mock" class="org.apache.archiva.mock.MockRemoteRepositoryAdmin"> <property name="archivaConfiguration" ref="archivaConfiguration#test-repository-scanning"/> </bean> + <bean name="taskExecutor#test-repository-scanning" class="org.apache.archiva.scheduler.repository.ArchivaRepositoryScanningTaskExecutor"> + <property name="managedRepositoryAdmin" ref="managedRepoAdmin#test"/> + </bean> + <bean name="repositoryContentFactory#default" class="org.apache.maven.archiva.repository.RepositoryContentFactory"> <property name="archivaConfiguration" ref="archivaConfiguration#test-repository-scanning"/> </bean> 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 @@ </dependency> <dependency> <groupId>org.apache.archiva</groupId> - <artifactId>archiva-repository-admin</artifactId> + <artifactId>archiva-repository-admin-api</artifactId> </dependency> <dependency> <groupId>org.apache.archiva</groupId> @@ -55,6 +55,10 @@ <artifactId>archiva-scheduler-repository</artifactId> </dependency> <dependency> + <groupId>org.apache.archiva</groupId> + <artifactId>archiva-indexer</artifactId> + </dependency> + <dependency> <groupId>org.codehaus.redback</groupId> <artifactId>redback-authorization-api</artifactId> <exclusions> @@ -212,6 +216,12 @@ <scope>test</scope> </dependency> + <dependency> + <groupId>org.apache.archiva</groupId> + <artifactId>archiva-repository-admin-default</artifactId> + <scope>test</scope> + </dependency> + </dependencies> <build> @@ -234,6 +244,7 @@ <systemPropertyVariables> <plexus.home>${project.build.outputDirectory}</plexus.home> <appserver.base>${basedir}/target/appserver-base</appserver.base> + <targetDir>${basedir}/target/</targetDir> </systemPropertyVariables> </configuration> </plugin> 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<LegacyArtifactPath> legacyArtifactPaths = new ArrayList<LegacyArtifactPath>(); - 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<org.apache.archiva.admin.repository.admin.FileType> modelfileTypes = - archivaAdministration.getFileTypes(); + List<org.apache.archiva.admin.model.admin.FileType> modelfileTypes = archivaAdministration.getFileTypes(); if ( modelfileTypes == null || modelfileTypes.isEmpty() ) { return Collections.emptyList(); } List<FileType> fileTypes = new ArrayList<FileType>( 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<org.apache.archiva.admin.repository.managed.ManagedRepository> repos = + List<org.apache.archiva.admin.model.managed.ManagedRepository> repos = managedRepositoryAdmin.getManagedRepositories(); List<ManagedRepository> managedRepos = new ArrayList<ManagedRepository>( 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<NetworkProxy> networkProxies = new ArrayList<NetworkProxy>(); - 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<ProxyConnector> proxyConnectors = new ArrayList<ProxyConnector>(); - 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<RemoteRepository> remoteRepositories = new ArrayList<RemoteRepository>(); - 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<RepositoryGroup> repositoriesGroups = new ArrayList<RepositoryGroup>(); - 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<String>( 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<String>( + new org.apache.archiva.admin.model.group.RepositoryGroup( repoGroup.getId(), new ArrayList<String>( 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<String>( + new org.apache.archiva.admin.model.group.RepositoryGroup( repoGroup.getId(), new ArrayList<String>( 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<Artifact> quickSearch( String queryString ) + throws ArchivaRestServiceException + { + if ( StringUtils.isBlank( queryString ) ) + { + return Collections.emptyList(); + } + + SearchResultLimits limits = new SearchResultLimits( 0 ); + List<String> observableRepoIds = getObservableRepos(); + try + { + SearchResults searchResults = + repositorySearch.search( getPrincipal(), getObservableRepos(), queryString, limits, + Collections.<String>emptyList() ); + return getArtifacts( searchResults ); + } + catch ( RepositorySearchException e ) + { + log.error( e.getMessage(), e ); + throw new ArchivaRestServiceException( e.getMessage() ); + } + } + + public List<Artifact> getArtifactByChecksum( String checksum ) + throws ArchivaRestServiceException + { + return null; //To change body of implemented methods use File | Settings | File Templates. + } + + public List<Artifact> getArtifactVersions( String groupId, String artifactId ) + throws ArchivaRestServiceException + { + return null; //To change body of implemented methods use File | Settings | File Templates. + } + + public List<Dependency> getDependencies( String groupId, String artifactId, String version ) + throws ArchivaRestServiceException + { + return null; //To change body of implemented methods use File | Settings | File Templates. + } + + + protected List<String> getObservableRepos() + { + try + { + List<String> ids = userRepositories.getObservableRepositoryIds( getPrincipal() ); + return ids == null ? Collections.<String>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<Artifact> getArtifacts( SearchResults searchResults ) + { + if ( searchResults == null || searchResults.isEmpty() ) + { + return Collections.emptyList(); + } + List<Artifact> artifacts = new ArrayList<Artifact>( 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 @@ --> <import resource="classpath:META-INF/cxf/cxf-servlet.xml"/> - <context:annotation-config /> + <context:annotation-config/> <context:component-scan - base-package="org.apache.archiva.rest.services"/> + base-package="org.apache.archiva.rest.services"/> <jaxrs:server id="archivaServices" address="/archivaServices"> @@ -56,12 +56,13 @@ <ref bean="proxyConnectorService#rest"/> <ref bean="networkProxyService#rest"/> <ref bean="archivaAdministrationService#default"/> + <ref bean="searchService#rest"/> </jaxrs:serviceBeans> <jaxrs:outInterceptors> <ref bean="threadLocalUserCleaner#rest"/> </jaxrs:outInterceptors> - </jaxrs:server> + </jaxrs:server> </beans>
\ 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<Artifact> 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 Binary files differnew file mode 100644 index 000000000..8f67432bb --- /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 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 Binary files differnew file mode 100644 index 000000000..22a004e14 --- /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 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 @@ +<project> + <modelVersion>4.0.0</modelVersion> + <groupId>commons-cli</groupId> + <artifactId>commons-cli</artifactId> + <name>CLI</name> + <version>1.0</version> + <description>Commons CLI provides a simple API for working with the command line arguments and options.</description> + <inceptionYear>2002</inceptionYear> + <developers> + <developer> + <id>jstrachan</id> + <name>James Strachan</name> + <email>jstrachan@apache.org</email> + <organization>SpiritSoft, Inc.</organization> + </developer> + <developer> + <id>bob</id> + <name>bob mcwhirter</name> + <email>bob@werken.com</email> + <organization>Werken</organization> + </developer> + <developer> + <id>jkeyes</id> + <name>John Keyes</name> + <email>jbjk@mac.com</email> + <organization>integral Source</organization> + </developer> + </developers> + <contributors> + <contributor> + <name>Berin Loritsch</name> + <email>bloritsch@apache.org</email> + <roles> + <role>helped in the Avalon CLI merge</role> + </roles> + </contributor> + <contributor> + <name>Peter Maddocks</name> + <email>peter_maddocks@hp.com</email> + <organization>Hewlett-Packard</organization> + <roles> + <role>supplied patch</role> + </roles> + </contributor> + </contributors> + <build> + <plugins> + <plugin> + <artifactId>maven-surefire-plugin</artifactId> + <configuration> + <includes> + <include>**/*Test*.java</include> + </includes> + </configuration> + </plugin> + </plugins> + </build> + <dependencies> + <dependency> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + <version>1.0</version> + </dependency> + <dependency> + <groupId>commons-lang</groupId> + <artifactId>commons-lang</artifactId> + <version>1.0</version> + </dependency> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>3.7</version> + <scope>test</scope> + </dependency> + </dependencies> +</project>
\ 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 Binary files differnew file mode 100644 index 000000000..77ca3a939 --- /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 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 Binary files differnew file mode 100644 index 000000000..c64e88c4d --- /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 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 @@ +<project> + <modelVersion>4.0.0</modelVersion> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + <name>Logging</name> + <version>1.0.1</version> + <description>Commons Logging</description> + <inceptionYear>2002</inceptionYear> + <build /> + <dependencies> + <dependency> + <groupId>log4j</groupId> + <artifactId>log4j</artifactId> + <version>1.1.3</version> + <optional>true</optional> + </dependency> + <dependency> + <groupId>logkit</groupId> + <artifactId>logkit</artifactId> + <version>1.0.1</version> + <optional>true</optional> + </dependency> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>3.7</version> + <scope>test</scope> + </dependency> + </dependencies> +</project> 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 @@ +<metadata> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + <version>1.0.1</version> +</metadata>
\ 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 Binary files differnew file mode 100644 index 000000000..994637f8f --- /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 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 Binary files differnew file mode 100644 index 000000000..aca1e4132 --- /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 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 @@ +<project> + <modelVersion>4.0.0</modelVersion> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + <name>Logging</name> + <version>1.0.2</version> + <description>Commons Logging</description> + <inceptionYear>2002</inceptionYear> + <build /> + <dependencies> + <dependency> + <groupId>log4j</groupId> + <artifactId>log4j</artifactId> + <version>1.1.3</version> + <optional>true</optional> + </dependency> + <dependency> + <groupId>logkit</groupId> + <artifactId>logkit</artifactId> + <version>1.0.1</version> + <optional>true</optional> + </dependency> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>3.7</version> + <scope>test</scope> + </dependency> + </dependencies> +</project> 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 @@ +<metadata> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + <version>1.0.2</version> +</metadata>
\ 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 Binary files differnew file mode 100644 index 000000000..ce4d7ec40 --- /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 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 Binary files differnew file mode 100644 index 000000000..b99c9375a --- /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 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 @@ +<project> + <modelVersion>4.0.0</modelVersion> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + <name>Logging</name> + <version>1.0.3</version> + <description>Commons Logging</description> + <url>http://jakarta.apache.org/commons/logging/</url> + <inceptionYear>2001</inceptionYear> + <build /> + <dependencies> + <dependency> + <groupId>log4j</groupId> + <artifactId>log4j</artifactId> + <version>1.2.6</version> + <optional>true</optional> + </dependency> + <dependency> + <groupId>logkit</groupId> + <artifactId>logkit</artifactId> + <version>1.0.1</version> + <optional>true</optional> + </dependency> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>3.7</version> + <scope>test</scope> + </dependency> + </dependencies> +</project> 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 @@ +<metadata> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + <version>1.0.3</version> +</metadata>
\ 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 Binary files differnew file mode 100644 index 000000000..efacb52ba --- /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 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 Binary files differnew file mode 100644 index 000000000..fc4bc9fcb --- /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 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 Binary files differnew file mode 100644 index 000000000..b73a80fab --- /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 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 @@ +<project> + <modelVersion>4.0.0</modelVersion> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + <name>Logging</name> + <version>1.0.4</version> + <description>Commons Logging is a thin adapter allowing configurable bridging to other, + well known logging systems.</description> + <url>http://jakarta.apache.org/commons/logging/</url> + <issueManagement> + <url>http://issues.apache.org/bugzilla/</url> + </issueManagement> + <ciManagement> + <notifiers> + <notifier> + <configuration> + <address>commons-dev@jakarta.apache.org</address> + </configuration> + </notifier> + </notifiers> + </ciManagement> + <inceptionYear>2001</inceptionYear> + <mailingLists> + <mailingList> + <name>Commons Dev List</name> + <subscribe>commons-dev-subscribe@jakarta.apache.org</subscribe> + <unsubscribe>commons-dev-unsubscribe@jakarta.apache.org</unsubscribe> + <archive>http://nagoya.apache.org/eyebrowse/SummarizeList?listName=commons-dev@jakarta.apache.org</archive> + </mailingList> + <mailingList> + <name>Commons User List</name> + <subscribe>commons-user-subscribe@jakarta.apache.org</subscribe> + <unsubscribe>commons-user-unsubscribe@jakarta.apache.org</unsubscribe> + <archive>http://nagoya.apache.org/eyebrowse/SummarizeList?listName=commons-user@jakarta.apache.org</archive> + </mailingList> + </mailingLists> + <developers> + <developer> + <id>morgand</id> + <name>Morgan Delagrange</name> + <email>morgand at apache dot org</email> + <organization>Apache</organization> + <roles> + <role>Java Developer</role> + </roles> + </developer> + <developer> + <id>rwaldhoff</id> + <name>Rodney Waldhoff</name> + <email>rwaldhoff at apache org</email> + <organization>Apache Software Foundation</organization> + </developer> + <developer> + <id>craigmcc</id> + <name>Craig McClanahan</name> + <email>craigmcc at apache org</email> + <organization>Apache Software Foundation</organization> + </developer> + <developer> + <id>sanders</id> + <name>Scott Sanders</name> + <email>sanders at apache dot org</email> + <organization>Apache Software Foundation</organization> + </developer> + <developer> + <id>rdonkin</id> + <name>Robert Burrell Donkin</name> + <email>rdonkin at apache dot org</email> + <organization>Apache Software Foundation</organization> + </developer> + <developer> + <id>donaldp</id> + <name>Peter Donald</name> + <email>donaldp at apache dot org</email> + <organization></organization> + </developer> + <developer> + <id>costin</id> + <name>Costin Manolache</name> + <email>costin at apache dot org</email> + <organization>Apache Software Foundation</organization> + </developer> + <developer> + <id>rsitze</id> + <name>Richard Sitze</name> + <email>rsitze at apache dot org</email> + <organization>Apache Software Foundation</organization> + </developer> + <developer> + <id>baliuka</id> + <name>Juozas Baliuka</name> + <email>baliuka@apache.org</email> + <organization></organization> + <roles> + <role>Java Developer</role> + </roles> + </developer> + </developers> + <licenses> + <license> + <name>The Apache Software License, Version 2.0</name> + <url>/LICENSE.txt</url> + </license> + </licenses> + <scm> + <connection>scm:cvs:pserver:anoncvs@cvs.apache.org:/home/cvspublic:jakarta-commons/logging</connection> + <url>http://cvs.apache.org/viewcvs/jakarta-commons/logging/</url> + </scm> + <organization> + <name>The Apache Software Foundation</name> + <url>http://jakarta.apache.org</url> + </organization> + <build> + <sourceDirectory>src/java</sourceDirectory> + <testSourceDirectory>src/test</testSourceDirectory> + <plugins> + <plugin> + <artifactId>maven-surefire-plugin</artifactId> + <configuration> + <includes> + <include>**/AvalonLoggerTest.java</include> + </includes> + </configuration> + </plugin> + </plugins> + </build> + <dependencies> + <dependency> + <groupId>log4j</groupId> + <artifactId>log4j</artifactId> + <version>1.2.6</version> + <optional>true</optional> + </dependency> + <dependency> + <groupId>logkit</groupId> + <artifactId>logkit</artifactId> + <version>1.0.1</version> + <optional>true</optional> + </dependency> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>3.7</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>avalon-framework</groupId> + <artifactId>avalon-framework</artifactId> + <version>4.1.3</version> + <optional>true</optional> + </dependency> + </dependencies> + <distributionManagement> + <repository> + <id>default</id> + <name>Default Repository</name> + <url>file:///www/jakarta.apache.org/builds/jakarta-commons/logging/</url> + </repository> + <site> + <id>default</id> + <name>Default Site</name> + <url>scp://jakarta.apache.org//www/jakarta.apache.org/commons/logging/</url> + </site> + </distributionManagement> +</project> 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 @@ +<metadata> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + <version>1.0.4</version> +</metadata>
\ 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 Binary files differnew file mode 100644 index 000000000..42b59d140 --- /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 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 Binary files differnew file mode 100644 index 000000000..33232cd09 --- /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 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 @@ +<project> + <modelVersion>4.0.0</modelVersion> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + <version>1.0</version> +</project> 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 @@ +<metadata> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + <version>1.0</version> +</metadata>
\ 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 Binary files differnew file mode 100644 index 000000000..1e036f176 --- /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 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 Binary files differnew file mode 100644 index 000000000..2ff9bbd90 --- /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 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 @@ +<?xml version="1.0" encoding="UTF-8"?><project> + <modelVersion>4.0.0</modelVersion> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + <name>Logging</name> + <version>1.1</version> + <description>Commons Logging is a thin adapter allowing configurable bridging to other, + well known logging systems.</description> + <url>http://jakarta.apache.org/commons/${pom.artifactId.substring(8)}/</url> + <issueManagement> + <url>http://issues.apache.org/bugzilla/</url> + </issueManagement> + <ciManagement> + <notifiers> + <notifier> + <configuration> + <address>commons-dev@jakarta.apache.org</address> + </configuration> + </notifier> + </notifiers> + </ciManagement> + <inceptionYear>2001</inceptionYear> + <mailingLists> + <mailingList> + <name>Commons Dev List</name> + <subscribe>commons-dev-subscribe@jakarta.apache.org</subscribe> + <unsubscribe>commons-dev-unsubscribe@jakarta.apache.org</unsubscribe> + <archive>http://mail-archives.apache.org/mod_mbox/jakarta-commons-dev/</archive> + </mailingList> + <mailingList> + <name>Commons User List</name> + <subscribe>commons-user-subscribe@jakarta.apache.org</subscribe> + <unsubscribe>commons-user-unsubscribe@jakarta.apache.org</unsubscribe> + <archive>http://mail-archives.apache.org/mod_mbox/jakarta-commons-user/</archive> + </mailingList> + </mailingLists> + <developers> + <developer> + <id>morgand</id> + <name>Morgan Delagrange</name> + <email>morgand at apache dot org</email> + <organization>Apache</organization> + <roles> + <role>Java Developer</role> + </roles> + </developer> + <developer> + <id>rwaldhoff</id> + <name>Rodney Waldhoff</name> + <email>rwaldhoff at apache org</email> + <organization>Apache Software Foundation</organization> + </developer> + <developer> + <id>craigmcc</id> + <name>Craig McClanahan</name> + <email>craigmcc at apache org</email> + <organization>Apache Software Foundation</organization> + </developer> + <developer> + <id>sanders</id> + <name>Scott Sanders</name> + <email>sanders at apache dot org</email> + <organization>Apache Software Foundation</organization> + </developer> + <developer> + <id>rdonkin</id> + <name>Robert Burrell Donkin</name> + <email>rdonkin at apache dot org</email> + <organization>Apache Software Foundation</organization> + </developer> + <developer> + <id>donaldp</id> + <name>Peter Donald</name> + <email>donaldp at apache dot org</email> + <organization></organization> + </developer> + <developer> + <id>costin</id> + <name>Costin Manolache</name> + <email>costin at apache dot org</email> + <organization>Apache Software Foundation</organization> + </developer> + <developer> + <id>rsitze</id> + <name>Richard Sitze</name> + <email>rsitze at apache dot org</email> + <organization>Apache Software Foundation</organization> + </developer> + <developer> + <id>baliuka</id> + <name>Juozas Baliuka</name> + <email>baliuka@apache.org</email> + <organization></organization> + <roles> + <role>Java Developer</role> + </roles> + </developer> + <developer> + <id>skitching</id> + <name>Simon Kitching</name> + <email>skitching@apache.org</email> + <organization>Apache Software Foundation</organization> + </developer> + <developer> + <id>dennisl</id> + <name>Dennis Lundberg</name> + <email>dennisl@apache.org</email> + <organization>Apache Software Foundation</organization> + </developer> + <developer> + <id>bstansberry</id> + <name>Brian Stansberry</name> + </developer> + </developers> + <licenses> + <license> + <name>The Apache Software License, Version 2.0</name> + <url>/LICENSE.txt</url> + </license> + </licenses> + <scm> + <connection>scm:svn:http://svn.apache.org/repos/asf/jakarta/commons/proper/${pom.artifactId.substring(8)}/trunk</connection> + <url>http://svn.apache.org/repos/asf/jakarta/commons/proper/${pom.artifactId.substring(8)}/trunk</url> + </scm> + <organization> + <name>The Apache Software Foundation</name> + <url>http://jakarta.apache.org</url> + </organization> + <build> + <sourceDirectory>src/java</sourceDirectory> + <testSourceDirectory>src/test</testSourceDirectory> + <plugins> + <plugin> + <artifactId>maven-surefire-plugin</artifactId> + <configuration> + <includes> + <include>**/AvalonLoggerTest.java</include> + </includes> + </configuration> + </plugin> + <plugin> + <artifactId>maven-xdoc-plugin</artifactId> + <version>1.9.2</version> + <configuration> + <comment><strong>Site Only</strong> - v1.9.2 (minimum)</comment> + </configuration> + </plugin> + </plugins> + </build> + <dependencies> + <dependency> + <groupId>log4j</groupId> + <artifactId>log4j</artifactId> + <version>1.2.12</version> + </dependency> + <dependency> + <groupId>logkit</groupId> + <artifactId>logkit</artifactId> + <version>1.0.1</version> + </dependency> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>3.8.1</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>avalon-framework</groupId> + <artifactId>avalon-framework</artifactId> + <version>4.1.3</version> + </dependency> + <dependency> + <groupId>javax.servlet</groupId> + <artifactId>servlet-api</artifactId> + <version>2.3</version> + </dependency> + </dependencies> + <distributionManagement> + <repository> + <id>default</id> + <name>Default Repository</name> + <url>file:///www/jakarta.apache.org/builds/jakarta-commons/${pom.artifactId.substring(8)}/</url> + </repository> + <site> + <id>default</id> + <name>Default Site</name> + <url>scp://cvs.apache.org//www/jakarta.apache.org/commons/${pom.artifactId.substring(8)}/</url> + </site> + <status>converted</status> + </distributionManagement> +</project>
\ 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 @@ +<metadata> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + <version>1.1</version> +</metadata>
\ 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 @@ +<metadata> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + <version>1.0</version> + <versioning> + <versions> + <version>1.0</version> + <version>1.0.1</version> + <version>1.0.2</version> + <version>1.0.3</version> + <version>1.0.4</version> + <version>1.1</version> + </versions> + </versioning> +</metadata> 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 Binary files differnew file mode 100644 index 000000000..218330e3f --- /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.jar 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 @@ +<!-- + 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. +--> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + <parent> + <groupId>org.apache.felix</groupId> + <artifactId>felix-parent</artifactId> + <version>2.1</version> + <relativePath>../pom/pom.xml</relativePath> + </parent> + <modelVersion>4.0.0</modelVersion> + <packaging>bundle</packaging> + <name>Apache Felix Bundle Repository</name> + <description>Bundle repository service.</description> + <artifactId>org.apache.felix.bundlerepository</artifactId> + <version>1.6.6</version> + <scm> + <connection>scm:svn:http://svn.apache.org/repos/asf/felix/releases/org.apache.felix.bundlerepository-1.6.6</connection> + <developerConnection>scm:svn:https://svn.apache.org/repos/asf/felix/releases/org.apache.felix.bundlerepository-1.6.6</developerConnection> + <url>http://svn.apache.org/repos/asf/felix/releases/org.apache.felix.bundlerepository-1.6.6</url> + </scm> + <dependencies> + <dependency> + <groupId>${project.groupId}</groupId> + <artifactId>org.apache.felix.utils</artifactId> + <version>1.1.0</version> + <optional>true</optional> + </dependency> + <dependency> + <groupId>${project.groupId}</groupId> + <artifactId>org.osgi.service.obr</artifactId> + <version>1.0.2</version> + <optional>true</optional> + </dependency> + <dependency> + <groupId>${project.groupId}</groupId> + <artifactId>org.apache.felix.shell</artifactId> + <version>1.4.1</version> + <optional>true</optional> + </dependency> + <dependency> + <groupId>net.sf.kxml</groupId> + <artifactId>kxml2</artifactId> + <version>2.3.0</version> + <optional>true</optional> + <exclusions> + <exclusion> + <groupId>xmlpull</groupId> + <artifactId>xmlpull</artifactId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>org.osgi</groupId> + <artifactId>org.osgi.compendium</artifactId> + <version>4.0.0</version> + <optional>true</optional> + </dependency> + <dependency> + <groupId>org.osgi</groupId> + <artifactId>org.osgi.core</artifactId> + <version>4.1.0</version> + </dependency> + <dependency> + <groupId>org.codehaus.woodstox</groupId> + <artifactId>woodstox-core-asl</artifactId> + <version>4.0.7</version> + <optional>true</optional> + </dependency> + <dependency> + <groupId>org.easymock</groupId> + <artifactId>easymock</artifactId> + <version>2.4</version> + </dependency> + </dependencies> + <build> + <plugins> + <plugin> + <groupId>org.apache.felix</groupId> + <artifactId>maven-bundle-plugin</artifactId> + <version>2.3.4</version> + <extensions>true</extensions> + <configuration> + <instructions> + <Export-Package>org.apache.felix.bundlerepository;version="2.0"</Export-Package> + <Private-Package> + org.kxml2.io, + org.xmlpull.v1, + org.apache.felix.bundlerepository.impl.*, + org.apache.felix.utils.* + </Private-Package> + <Import-Package>!javax.xml.parsers,!org.xml.sax,org.osgi.service.log;resolution:=optional,org.osgi.service.obr;resolution:=optional,javax.xml.stream;resolution:=optional,*</Import-Package> + <DynamicImport-Package>org.apache.felix.shell</DynamicImport-Package> + <Bundle-Activator>${project.artifactId}.impl.Activator</Bundle-Activator> + <Bundle-DocURL>http://felix.apache.org/site/apache-felix-osgi-bundle-repository.html</Bundle-DocURL> + <Bundle-Url>http://felix.apache.org/site/downloads.cgi</Bundle-Url> + <Bundle-Source>http://felix.apache.org/site/downloads.cgi</Bundle-Source> + <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName> + <Bundle-Vendor>The Apache Software Foundation</Bundle-Vendor> + <Export-Service>org.apache.felix.bundlerepository.RepositoryAdmin,org.osgi.service.obr.RepositoryAdmin</Export-Service> + <_versionpolicy>[$(version;==;$(@)),$(version;+;$(@)))</_versionpolicy> + <Include-Resource>META-INF/LICENSE=LICENSE,META-INF/LICENSE.kxml2=LICENSE.kxml2,META-INF/NOTICE=NOTICE,META-INF/DEPENDENCIES=DEPENDENCIES</Include-Resource> + </instructions> + </configuration> + </plugin> + <plugin> + <groupId>org.apache.rat</groupId> + <artifactId>apache-rat-plugin</artifactId> + <configuration> + <excludeSubProjects>false</excludeSubProjects> + <useEclipseDefaultExcludes>true</useEclipseDefaultExcludes> + <useMavenDefaultExcludes>true</useMavenDefaultExcludes> + <excludes> + <param>doc/*</param> + <param>maven-eclipse.xml</param> + <param>.checkstyle</param> + <param>.externalToolBuilders/*</param> + </excludes> + </configuration> + </plugin> + </plugins> + </build> +</project> 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 Binary files differnew file mode 100644 index 000000000..e211324f3 --- /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.jar 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 Binary files differnew file mode 100644 index 000000000..a6c5b3556 --- /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.jar 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 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + + <!-- + + 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. + --> + + <modelVersion>4.0.0</modelVersion> + + <parent> + <groupId>org.apache.karaf.features</groupId> + <artifactId>features</artifactId> + <version>2.2.1</version> + </parent> + + <artifactId>org.apache.karaf.features.core</artifactId> + <packaging>bundle</packaging> + <name>Apache Karaf :: Features :: Core</name> + <description>This bundle is the core implementation of the Karaf features support.</description> + + <properties> + <appendedResourcesDirectory>${basedir}/../../etc/appended-resources</appendedResourcesDirectory> + </properties> + + <dependencies> + <dependency> + <groupId>org.osgi</groupId> + <artifactId>org.osgi.core</artifactId> + <scope>provided</scope> + </dependency> + + <dependency> + <groupId>org.osgi</groupId> + <artifactId>org.osgi.compendium</artifactId> + <scope>provided</scope> + </dependency> + + <dependency> + <groupId>org.apache.felix</groupId> + <artifactId>org.apache.felix.utils</artifactId> + <scope>provided</scope> + </dependency> + <dependency> + <groupId>org.apache.felix</groupId> + <artifactId>org.apache.felix.bundlerepository</artifactId> + </dependency> + + <dependency> + <groupId>org.apache.karaf.shell</groupId> + <artifactId>org.apache.karaf.shell.console</artifactId> + </dependency> + + <dependency> + <groupId>org.apache.karaf.shell</groupId> + <artifactId>org.apache.karaf.shell.obr</artifactId> + </dependency> + + <dependency> + <groupId>org.springframework.osgi</groupId> + <artifactId>spring-osgi-core</artifactId> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.apache.servicemix.bundles</groupId> + <artifactId>org.apache.servicemix.bundles.junit</artifactId> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.easymock</groupId> + <artifactId>easymock</artifactId> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-jdk14</artifactId> + <scope>test</scope> + </dependency> + </dependencies> + + <build> + <resources> + <resource> + <directory>${project.basedir}/src/main/resources</directory> + <includes> + <include>**/*</include> + </includes> + </resource> + <resource> + <directory>${project.basedir}/src/main/resources</directory> + <filtering>true</filtering> + <includes> + <include>**/*.info</include> + </includes> + </resource> + </resources> + <plugins> + <plugin> + <groupId>org.apache.felix</groupId> + <artifactId>maven-bundle-plugin</artifactId> + <configuration> + <instructions> + <Export-Package>org.apache.karaf.features;version=${project.version}</Export-Package> + <Import-Package> + !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, + * + </Import-Package> + <Private-Package> + org.apache.karaf.features.internal, + org.apache.felix.utils.version, + org.apache.felix.utils.manifest + </Private-Package> + </instructions> + </configuration> + </plugin> + </plugins> + </build> +</project> 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 Binary files differnew file mode 100644 index 000000000..0e6bb50db --- /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.jar 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 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + + <!-- + + 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. + --> + + <modelVersion>4.0.0</modelVersion> + + <parent> + <groupId>org.apache.karaf.features</groupId> + <artifactId>features</artifactId> + <version>2.2.2</version> + </parent> + + <artifactId>org.apache.karaf.features.core</artifactId> + <packaging>bundle</packaging> + <name>Apache Karaf :: Features :: Core</name> + <description>This bundle is the core implementation of the Karaf features support.</description> + + <properties> + <appendedResourcesDirectory>${basedir}/../../etc/appended-resources</appendedResourcesDirectory> + </properties> + + <dependencies> + <dependency> + <groupId>org.osgi</groupId> + <artifactId>org.osgi.core</artifactId> + <scope>provided</scope> + </dependency> + + <dependency> + <groupId>org.osgi</groupId> + <artifactId>org.osgi.compendium</artifactId> + <scope>provided</scope> + </dependency> + + <dependency> + <groupId>org.apache.felix</groupId> + <artifactId>org.apache.felix.utils</artifactId> + <scope>provided</scope> + </dependency> + <dependency> + <groupId>org.apache.felix</groupId> + <artifactId>org.apache.felix.bundlerepository</artifactId> + </dependency> + + <dependency> + <groupId>org.apache.karaf.shell</groupId> + <artifactId>org.apache.karaf.shell.console</artifactId> + </dependency> + + <dependency> + <groupId>org.apache.karaf.shell</groupId> + <artifactId>org.apache.karaf.shell.obr</artifactId> + </dependency> + + <dependency> + <groupId>org.springframework.osgi</groupId> + <artifactId>spring-osgi-core</artifactId> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.apache.servicemix.bundles</groupId> + <artifactId>org.apache.servicemix.bundles.junit</artifactId> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.easymock</groupId> + <artifactId>easymock</artifactId> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-jdk14</artifactId> + <scope>test</scope> + </dependency> + </dependencies> + + <build> + <resources> + <resource> + <directory>${project.basedir}/src/main/resources</directory> + <includes> + <include>**/*</include> + </includes> + </resource> + <resource> + <directory>${project.basedir}/src/main/resources</directory> + <filtering>true</filtering> + <includes> + <include>**/*.info</include> + </includes> + </resource> + </resources> + <plugins> + <plugin> + <groupId>org.apache.felix</groupId> + <artifactId>maven-bundle-plugin</artifactId> + <configuration> + <instructions> + <Export-Package>org.apache.karaf.features;version=${project.version}</Export-Package> + <Import-Package> + !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, + * + </Import-Package> + <Private-Package> + org.apache.karaf.features.internal, + org.apache.felix.utils.version, + org.apache.felix.utils.manifest + </Private-Package> + </instructions> + </configuration> + </plugin> + </plugins> + </build> +</project> 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 @@ -403,6 +403,17 @@ <dependency> <groupId>org.apache.archiva</groupId> + <artifactId>archiva-repository-admin-api</artifactId> + </dependency> + + + <dependency> + <groupId>org.apache.archiva</groupId> + <artifactId>archiva-repository-admin-default</artifactId> + </dependency> + + <dependency> + <groupId>org.apache.archiva</groupId> <artifactId>metadata-repository-api</artifactId> </dependency> <dependency> 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; @@ -66,9 +65,6 @@ public class RepositoriesAction { @Inject - private ArchivaConfiguration archivaConfiguration; - - @Inject private ManagedRepositoryAdmin managedRepositoryAdmin; @Inject 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<String> 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 @@ </dependency> <dependency> <groupId>org.apache.archiva</groupId> - <artifactId>archiva-repository-admin</artifactId> + <artifactId>archiva-repository-admin-api</artifactId> </dependency> <dependency> <groupId>org.apache.archiva</groupId> @@ -160,6 +160,11 @@ <artifactId>httpunit</artifactId> <scope>test</scope> </dependency> + <dependency> + <groupId>org.apache.archiva</groupId> + <artifactId>archiva-repository-admin-default</artifactId> + <scope>test</scope> + </dependency> </dependencies> <build> <plugins> 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<AuditListener> 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<AuditListener> 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<String> 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<ProjectVersionReference> 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<String> getRootNamespaces( String repoId ) { - return null; //To change body of implemented methods use File | Settings | File Templates. + return null; } public Collection<String> getNamespaces( String repoId, String namespace ) { - return null; //To change body of implemented methods use File | Settings | File Templates. + return null; } public Collection<String> getProjects( String repoId, String namespace ) { - return null; //To change body of implemented methods use File | Settings | File Templates. + return null; } public Collection<String> 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<String> 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<ArtifactMetadata> getArtifactsByDateRange( String repoId, Date startTime, Date endTime ) { - return null; //To change body of implemented methods use File | Settings | File Templates. + return null; } public Collection<String> getRepositories() { - return null; //To change body of implemented methods use File | Settings | File Templates. + return null; } public List<ArtifactMetadata> 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<ArtifactMetadata> 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<ArtifactMetadata> 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<RepositoryGroupConfiguration> repoGroups = new ArrayList<RepositoryGroupConfiguration>(); 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 @@ </dependency> <dependency> <groupId>org.apache.archiva</groupId> - <artifactId>archiva-repository-admin</artifactId> + <artifactId>archiva-repository-admin-api</artifactId> </dependency> <dependency> <groupId>com.atlassian.xmlrpc</groupId> 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 @@ </dependency> <dependency> <groupId>org.apache.archiva</groupId> - <artifactId>archiva-repository-admin</artifactId> + <artifactId>archiva-repository-admin-api</artifactId> </dependency> <dependency> <groupId>org.apache.archiva</groupId> @@ -97,6 +97,11 @@ <artifactId>mockito-all</artifactId> <scope>test</scope> </dependency> + <dependency> + <groupId>org.apache.archiva</groupId> + <artifactId>archiva-repository-admin-default</artifactId> + <scope>test</scope> + </dependency> </dependencies> <build> <pluginManagement> 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<ManagedRepository> managedRepos = new ArrayList<ManagedRepository>(); - 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<RemoteRepository> remoteRepos = new ArrayList<RemoteRepository>(); - 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 @@ <groupId>org.apache.archiva</groupId> <artifactId>metadata-repository-api</artifactId> </dependency> + <!-- FIXME this deps must be removed --> + <dependency> + <groupId>org.apache.archiva</groupId> + <artifactId>archiva-configuration</artifactId> + </dependency> + <dependency> + <groupId>org.apache.archiva</groupId> + <artifactId>archiva-repository-admin-api</artifactId> + </dependency> <dependency> <groupId>org.apache.archiva</groupId> <artifactId>archiva-checksum</artifactId> 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() ); @@ -117,7 +117,12 @@ </dependency> <dependency> <groupId>org.apache.archiva</groupId> - <artifactId>archiva-repository-admin</artifactId> + <artifactId>archiva-repository-admin-api</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>org.apache.archiva</groupId> + <artifactId>archiva-repository-admin-default</artifactId> <version>${project.version}</version> </dependency> <dependency> @@ -748,6 +753,11 @@ </dependency> <!-- redback --> + <dependency> + <groupId>org.codehaus.redback</groupId> + <artifactId>redback-users-api</artifactId> + <version>${redback.version}</version> + </dependency> <dependency> <groupId>org.codehaus.redback</groupId> @@ -852,6 +862,17 @@ </dependency> <dependency> <groupId>org.codehaus.redback</groupId> + <artifactId>redback-rbac-cached</artifactId> + <version>${redback.version}</version> + <exclusions> + <exclusion> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>org.codehaus.redback</groupId> <artifactId>redback-struts2-content</artifactId> <version>${redback.version}</version> <type>war</type> |