From e2cdbc2b7229b4c141a61c8f9aa118304bee2632 Mon Sep 17 00:00:00 2001 From: Martin Stockhammer Date: Wed, 8 Nov 2017 22:59:33 +0100 Subject: [PATCH] Rearranging modules and adding indexer api Combining the indexer api and repository api into archiva-repository-api They have bidirectional dependencies so they are put together in one module. Adding new classes for a generalized indexer api that will be used for interfaces and implementation independent tasks. --- .../src/main/java/SimpleArtifactConsumer.java | 2 +- .../core/MetadataUpdaterConsumer.java | 2 +- ...eanupReleasedSnapshotsRepositoryPurge.java | 8 +- .../repository/DaysOldRepositoryPurge.java | 2 +- .../RetentionCountRepositoryPurge.java | 2 +- .../LegacyConverterArtifactConsumer.java | 2 +- .../archiva-base/archiva-indexer/pom.xml | 6 - .../archiva/proxy/ErrorHandlingTest.java | 2 +- .../pom.xml | 12 +- .../archiva/indexer/ArchivaIndexManager.java | 71 ++++++++++ .../indexer/ArchivaIndexingContext.java | 130 ++++++++++++++++++ .../archiva/indexer/IndexManagerFactory.java | 53 +++++++ .../indexer/search/ArtifactInfoFilter.java | 0 .../indexer/search/RepositorySearch.java | 0 .../search/RepositorySearchException.java | 0 .../archiva/indexer/search/SearchFields.java | 0 .../indexer/search/SearchResultHit.java | 0 .../indexer/search/SearchResultLimits.java | 0 .../archiva/indexer/search/SearchResults.java | 0 .../archiva/indexer/util/SearchUtil.java | 0 .../repository/ContentNotFoundException.java | 0 .../repository/EditableManagedRepository.java | 0 .../repository/EditableRemoteRepository.java | 0 .../repository/EditableRepository.java | 0 .../archiva/repository}/LayoutException.java | 2 +- .../archiva/repository/ManagedRepository.java | 3 + .../repository/ManagedRepositoryContent.java | 1 - .../archiva/repository/ReleaseScheme.java | 0 .../archiva/repository/RemoteRepository.java | 0 .../repository/RemoteRepositoryContent.java | 1 - .../apache/archiva/repository/Repository.java | 7 + .../repository/RepositoryCapabilities.java | 0 .../archiva/repository/RepositoryContent.java | 1 - .../repository/RepositoryContentFactory.java | 0 .../repository/RepositoryContentProvider.java | 0 .../repository/RepositoryCredentials.java | 0 .../repository/RepositoryException.java | 0 .../RepositoryNotFoundException.java | 0 .../repository/RepositoryProvider.java | 0 .../archiva/repository/RepositoryType.java | 0 .../repository/StandardCapabilities.java | 0 .../UnsupportedFeatureException.java | 0 .../UnsupportedRepositoryTypeException.java | 45 ++++++ .../repository/UnsupportedURIException.java | 0 .../features/RepositoryFeature.java | 0 .../resources/META-INF/spring-context.xml | 0 .../archiva-repository-layer/pom.xml | 4 + .../repository/AbstractRepository.java | 7 + .../repository/content/PathParser.java | 2 +- .../repository/metadata/MetadataTools.java | 2 +- archiva-modules/archiva-base/pom.xml | 2 +- .../scheduler/repository/TestConsumer.java | 2 +- .../webdav/ArchivaDavResourceFactory.java | 2 +- .../maven2/Maven2RepositoryStorage.java | 2 +- .../AbstractDefaultRepositoryContent.java | 5 +- .../content/maven2/DefaultPathParser.java | 2 +- .../ManagedDefaultRepositoryContent.java | 10 +- .../RemoteDefaultRepositoryContent.java | 6 +- .../content/maven2/RepositoryRequest.java | 6 +- ...tractDefaultRepositoryContentTestCase.java | 14 +- .../ManagedDefaultRepositoryContentTest.java | 3 +- .../RemoteDefaultRepositoryContentTest.java | 3 +- .../content/maven2/DefaultPathParserTest.java | 18 +-- .../content/maven2/RepositoryRequestTest.java | 2 +- .../metadata/MetadataToolsTest.java | 3 +- pom.xml | 10 +- 66 files changed, 381 insertions(+), 76 deletions(-) rename archiva-modules/archiva-base/{archiva-indexer-api => archiva-repository-api}/pom.xml (91%) create mode 100644 archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/indexer/ArchivaIndexManager.java create mode 100644 archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/indexer/ArchivaIndexingContext.java create mode 100644 archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/indexer/IndexManagerFactory.java rename archiva-modules/archiva-base/{archiva-indexer-api => archiva-repository-api}/src/main/java/org/apache/archiva/indexer/search/ArtifactInfoFilter.java (100%) rename archiva-modules/archiva-base/{archiva-indexer-api => archiva-repository-api}/src/main/java/org/apache/archiva/indexer/search/RepositorySearch.java (100%) rename archiva-modules/archiva-base/{archiva-indexer-api => archiva-repository-api}/src/main/java/org/apache/archiva/indexer/search/RepositorySearchException.java (100%) rename archiva-modules/archiva-base/{archiva-indexer-api => archiva-repository-api}/src/main/java/org/apache/archiva/indexer/search/SearchFields.java (100%) rename archiva-modules/archiva-base/{archiva-indexer-api => archiva-repository-api}/src/main/java/org/apache/archiva/indexer/search/SearchResultHit.java (100%) rename archiva-modules/archiva-base/{archiva-indexer-api => archiva-repository-api}/src/main/java/org/apache/archiva/indexer/search/SearchResultLimits.java (100%) rename archiva-modules/archiva-base/{archiva-indexer-api => archiva-repository-api}/src/main/java/org/apache/archiva/indexer/search/SearchResults.java (100%) rename archiva-modules/archiva-base/{archiva-indexer-api => archiva-repository-api}/src/main/java/org/apache/archiva/indexer/util/SearchUtil.java (100%) rename archiva-modules/archiva-base/{archiva-repository-layer => archiva-repository-api}/src/main/java/org/apache/archiva/repository/ContentNotFoundException.java (100%) rename archiva-modules/archiva-base/{archiva-repository-layer => archiva-repository-api}/src/main/java/org/apache/archiva/repository/EditableManagedRepository.java (100%) rename archiva-modules/archiva-base/{archiva-repository-layer => archiva-repository-api}/src/main/java/org/apache/archiva/repository/EditableRemoteRepository.java (100%) rename archiva-modules/archiva-base/{archiva-repository-layer => archiva-repository-api}/src/main/java/org/apache/archiva/repository/EditableRepository.java (100%) rename archiva-modules/archiva-base/{archiva-repository-layer/src/main/java/org/apache/archiva/repository/layout => archiva-repository-api/src/main/java/org/apache/archiva/repository}/LayoutException.java (96%) rename archiva-modules/archiva-base/{archiva-repository-layer => archiva-repository-api}/src/main/java/org/apache/archiva/repository/ManagedRepository.java (96%) rename archiva-modules/archiva-base/{archiva-repository-layer => archiva-repository-api}/src/main/java/org/apache/archiva/repository/ManagedRepositoryContent.java (99%) rename archiva-modules/archiva-base/{archiva-repository-layer => archiva-repository-api}/src/main/java/org/apache/archiva/repository/ReleaseScheme.java (100%) rename archiva-modules/archiva-base/{archiva-repository-layer => archiva-repository-api}/src/main/java/org/apache/archiva/repository/RemoteRepository.java (100%) rename archiva-modules/archiva-base/{archiva-repository-layer => archiva-repository-api}/src/main/java/org/apache/archiva/repository/RemoteRepositoryContent.java (97%) rename archiva-modules/archiva-base/{archiva-repository-layer => archiva-repository-api}/src/main/java/org/apache/archiva/repository/Repository.java (95%) rename archiva-modules/archiva-base/{archiva-repository-layer => archiva-repository-api}/src/main/java/org/apache/archiva/repository/RepositoryCapabilities.java (100%) rename archiva-modules/archiva-base/{archiva-repository-layer => archiva-repository-api}/src/main/java/org/apache/archiva/repository/RepositoryContent.java (96%) rename archiva-modules/archiva-base/{archiva-repository-layer => archiva-repository-api}/src/main/java/org/apache/archiva/repository/RepositoryContentFactory.java (100%) rename archiva-modules/archiva-base/{archiva-repository-layer => archiva-repository-api}/src/main/java/org/apache/archiva/repository/RepositoryContentProvider.java (100%) rename archiva-modules/archiva-base/{archiva-repository-layer => archiva-repository-api}/src/main/java/org/apache/archiva/repository/RepositoryCredentials.java (100%) rename archiva-modules/archiva-base/{archiva-repository-layer => archiva-repository-api}/src/main/java/org/apache/archiva/repository/RepositoryException.java (100%) rename archiva-modules/archiva-base/{archiva-repository-layer => archiva-repository-api}/src/main/java/org/apache/archiva/repository/RepositoryNotFoundException.java (100%) rename archiva-modules/archiva-base/{archiva-repository-layer => archiva-repository-api}/src/main/java/org/apache/archiva/repository/RepositoryProvider.java (100%) rename archiva-modules/archiva-base/{archiva-repository-layer => archiva-repository-api}/src/main/java/org/apache/archiva/repository/RepositoryType.java (100%) rename archiva-modules/archiva-base/{archiva-repository-layer => archiva-repository-api}/src/main/java/org/apache/archiva/repository/StandardCapabilities.java (100%) rename archiva-modules/archiva-base/{archiva-repository-layer => archiva-repository-api}/src/main/java/org/apache/archiva/repository/UnsupportedFeatureException.java (100%) create mode 100644 archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/UnsupportedRepositoryTypeException.java rename archiva-modules/archiva-base/{archiva-repository-layer => archiva-repository-api}/src/main/java/org/apache/archiva/repository/UnsupportedURIException.java (100%) rename archiva-modules/archiva-base/{archiva-repository-layer => archiva-repository-api}/src/main/java/org/apache/archiva/repository/features/RepositoryFeature.java (100%) rename archiva-modules/archiva-base/{archiva-indexer-api => archiva-repository-api}/src/main/resources/META-INF/spring-context.xml (100%) diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-archetype/src/main/resources/archetype-resources/src/main/java/SimpleArtifactConsumer.java b/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-archetype/src/main/resources/archetype-resources/src/main/java/SimpleArtifactConsumer.java index 59ca6b012..54e04dc9a 100644 --- a/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-archetype/src/main/resources/archetype-resources/src/main/java/SimpleArtifactConsumer.java +++ b/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-archetype/src/main/resources/archetype-resources/src/main/java/SimpleArtifactConsumer.java @@ -38,7 +38,7 @@ import org.apache.archiva.redback.components.registry.RegistryListener; import org.apache.archiva.repository.ManagedRepositoryContent; import org.apache.archiva.repository.RepositoryContentFactory; import org.apache.archiva.repository.RepositoryException; -import org.apache.archiva.repository.layout.LayoutException; +import org.apache.archiva.repository.LayoutException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import javax.annotation.PostConstruct; diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/MetadataUpdaterConsumer.java b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/MetadataUpdaterConsumer.java index a09ff247d..8f537b56b 100644 --- a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/MetadataUpdaterConsumer.java +++ b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/MetadataUpdaterConsumer.java @@ -33,7 +33,7 @@ import org.apache.archiva.repository.ManagedRepositoryContent; import org.apache.archiva.repository.RepositoryException; import org.apache.archiva.repository.RepositoryNotFoundException; import org.apache.archiva.repository.RepositoryRegistry; -import org.apache.archiva.repository.layout.LayoutException; +import org.apache.archiva.repository.LayoutException; import org.apache.archiva.repository.metadata.MetadataTools; import org.apache.archiva.repository.metadata.RepositoryMetadataException; import org.slf4j.Logger; diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/repository/CleanupReleasedSnapshotsRepositoryPurge.java b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/repository/CleanupReleasedSnapshotsRepositoryPurge.java index 181cbf45c..265c8e2e7 100644 --- a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/repository/CleanupReleasedSnapshotsRepositoryPurge.java +++ b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/repository/CleanupReleasedSnapshotsRepositoryPurge.java @@ -19,9 +19,6 @@ package org.apache.archiva.consumers.core.repository; * under the License. */ -import org.apache.archiva.admin.model.RepositoryAdminException; -import org.apache.archiva.admin.model.beans.ManagedRepository; -import org.apache.archiva.admin.model.managed.ManagedRepositoryAdmin; import org.apache.archiva.common.utils.VersionComparator; import org.apache.archiva.common.utils.VersionUtil; import org.apache.archiva.metadata.repository.MetadataRepository; @@ -33,16 +30,13 @@ import org.apache.archiva.model.VersionedReference; import org.apache.archiva.repository.ContentNotFoundException; import org.apache.archiva.repository.ManagedRepositoryContent; import org.apache.archiva.repository.ReleaseScheme; -import org.apache.archiva.repository.RepositoryContentFactory; import org.apache.archiva.repository.RepositoryException; -import org.apache.archiva.repository.RepositoryNotFoundException; import org.apache.archiva.repository.RepositoryRegistry; import org.apache.archiva.repository.events.RepositoryListener; -import org.apache.archiva.repository.layout.LayoutException; +import org.apache.archiva.repository.LayoutException; import org.apache.archiva.repository.metadata.MetadataTools; import org.apache.archiva.repository.metadata.RepositoryMetadataException; -import javax.inject.Inject; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/repository/DaysOldRepositoryPurge.java b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/repository/DaysOldRepositoryPurge.java index 73fc456d0..2952f7fbc 100644 --- a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/repository/DaysOldRepositoryPurge.java +++ b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/repository/DaysOldRepositoryPurge.java @@ -27,7 +27,7 @@ import org.apache.archiva.model.VersionedReference; import org.apache.archiva.repository.ContentNotFoundException; import org.apache.archiva.repository.ManagedRepositoryContent; import org.apache.archiva.repository.events.RepositoryListener; -import org.apache.archiva.repository.layout.LayoutException; +import org.apache.archiva.repository.LayoutException; import org.apache.commons.lang.time.DateUtils; import java.io.IOException; diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/repository/RetentionCountRepositoryPurge.java b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/repository/RetentionCountRepositoryPurge.java index 98929bad8..bcecc8a8e 100644 --- a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/repository/RetentionCountRepositoryPurge.java +++ b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/repository/RetentionCountRepositoryPurge.java @@ -27,7 +27,7 @@ import org.apache.archiva.model.VersionedReference; import org.apache.archiva.repository.ContentNotFoundException; import org.apache.archiva.repository.ManagedRepositoryContent; import org.apache.archiva.repository.events.RepositoryListener; -import org.apache.archiva.repository.layout.LayoutException; +import org.apache.archiva.repository.LayoutException; import java.nio.file.Files; import java.nio.file.Path; diff --git a/archiva-modules/archiva-base/archiva-converter/src/main/java/org/apache/archiva/converter/legacy/LegacyConverterArtifactConsumer.java b/archiva-modules/archiva-base/archiva-converter/src/main/java/org/apache/archiva/converter/legacy/LegacyConverterArtifactConsumer.java index 9cdde0ada..04653a5ac 100644 --- a/archiva-modules/archiva-base/archiva-converter/src/main/java/org/apache/archiva/converter/legacy/LegacyConverterArtifactConsumer.java +++ b/archiva-modules/archiva-base/archiva-converter/src/main/java/org/apache/archiva/converter/legacy/LegacyConverterArtifactConsumer.java @@ -32,7 +32,7 @@ import org.apache.archiva.model.ArtifactReference; import org.apache.archiva.repository.ManagedRepository; import org.apache.archiva.repository.ManagedRepositoryContent; import org.apache.archiva.repository.content.maven2.ManagedDefaultRepositoryContent; -import org.apache.archiva.repository.layout.LayoutException; +import org.apache.archiva.repository.LayoutException; import org.apache.maven.artifact.Artifact; import org.apache.maven.artifact.factory.ArtifactFactory; import org.apache.maven.artifact.repository.ArtifactRepository; diff --git a/archiva-modules/archiva-base/archiva-indexer/pom.xml b/archiva-modules/archiva-base/archiva-indexer/pom.xml index ab0d89792..9634b7c75 100644 --- a/archiva-modules/archiva-base/archiva-indexer/pom.xml +++ b/archiva-modules/archiva-base/archiva-indexer/pom.xml @@ -42,12 +42,6 @@ org.apache.archiva archiva-repository-layer - - org.apache.archiva - archiva-indexer-api - - - org.springframework spring-context diff --git a/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/archiva/proxy/ErrorHandlingTest.java b/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/archiva/proxy/ErrorHandlingTest.java index 614a5fbd8..9137993f8 100644 --- a/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/archiva/proxy/ErrorHandlingTest.java +++ b/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/archiva/proxy/ErrorHandlingTest.java @@ -26,7 +26,7 @@ import org.apache.archiva.policies.PropagateErrorsOnUpdateDownloadPolicy; import org.apache.archiva.policies.ProxyDownloadException; import org.apache.archiva.policies.ReleasesPolicy; import org.apache.archiva.policies.SnapshotsPolicy; -import org.apache.archiva.repository.layout.LayoutException; +import org.apache.archiva.repository.LayoutException; import org.apache.maven.wagon.ResourceDoesNotExistException; import org.apache.maven.wagon.TransferFailedException; import org.apache.maven.wagon.authorization.AuthorizationException; diff --git a/archiva-modules/archiva-base/archiva-indexer-api/pom.xml b/archiva-modules/archiva-base/archiva-repository-api/pom.xml similarity index 91% rename from archiva-modules/archiva-base/archiva-indexer-api/pom.xml rename to archiva-modules/archiva-base/archiva-repository-api/pom.xml index 5aec104c3..168426c13 100644 --- a/archiva-modules/archiva-base/archiva-indexer-api/pom.xml +++ b/archiva-modules/archiva-base/archiva-repository-api/pom.xml @@ -25,9 +25,9 @@ 3.0.0-SNAPSHOT 4.0.0 - archiva-indexer-api + archiva-repository-api bundle - Archiva Base :: Indexer API + Archiva Base :: Repository API @@ -43,6 +43,14 @@ org.apache.archiva archiva-model + + org.apache.archiva + archiva-configuration + + + org.springframework + spring-context + diff --git a/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/indexer/ArchivaIndexManager.java b/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/indexer/ArchivaIndexManager.java new file mode 100644 index 000000000..d8299839b --- /dev/null +++ b/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/indexer/ArchivaIndexManager.java @@ -0,0 +1,71 @@ +package org.apache.archiva.indexer; + +/* + * 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.model.ArtifactReference; +import org.apache.archiva.repository.RepositoryType; + +import java.net.URI; + +public interface ArchivaIndexManager { + + /** + * Compresses the index to a more dense packed format. + * @param context + */ + void pack(ArchivaIndexingContext context); + + /** + * Rescans the whole repository, this index is associated to. + * @param context + * @param update + */ + void scan(ArchivaIndexingContext context, boolean update); + + /** + * Updates the index from the remote url. + * @param context + * @param remoteUpdateUri + * @param fullUpdate + */ + void update(ArchivaIndexingContext context, URI remoteUpdateUri, boolean fullUpdate); + + /** + * Adds a artifact to the index. + * @param context + * @param artifactReference + */ + void addArtifactToIndex(ArchivaIndexingContext context, ArtifactReference artifactReference); + + /** + * Removes a artifact from the index. + * @param context + * @param artifactReference + */ + void removeArtifactFromIndex(ArchivaIndexingContext context, ArtifactReference artifactReference); + + + /** + * Returns true, if this manager is able to apply the index actions for the given repository type. + * @param type + * @return + */ + boolean supportsRepository(RepositoryType type); +} diff --git a/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/indexer/ArchivaIndexingContext.java b/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/indexer/ArchivaIndexingContext.java new file mode 100644 index 000000000..23496e779 --- /dev/null +++ b/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/indexer/ArchivaIndexingContext.java @@ -0,0 +1,130 @@ +package org.apache.archiva.indexer; + +/* + * 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.repository.Repository; +import org.apache.archiva.repository.RepositoryType; + +import java.io.IOException; +import java.net.URI; +import java.time.LocalDateTime; +import java.util.Set; + +/** + * This represents a indexing context that is used to manage the index of a certain repository. + * + */ +public interface ArchivaIndexingContext { + + /** + * The identifier of the context + * @return + */ + String getId(); + + /** + * Returns the repository this index context is associated to. + * @return + */ + Repository getRepository(); + + /** + * The path where the index is stored. + * @return + */ + URI getPath(); + + /** + * Returns true, if the index has no entries or is not initialized. + * @return + */ + boolean isEmpty(); + + /** + * Writes the last changes to the index. + * @throws IOException + */ + void commit() throws IOException; + + /** + * Throws away the last changes. + * @throws IOException + */ + void rollback() throws IOException; + + /** + * Optimizes the index + * @throws IOException + */ + void optimize() throws IOException; + + /** + * Closes any resources, this context has open. + * @param deleteFiles True, if the index files should be deleted. + * @throws IOException + */ + void close(boolean deleteFiles) throws IOException; + + /** + * Removes all entries from the index. After this method finished, + * isEmpty() should return true. + * @throws IOException + */ + void purge() throws IOException; + + /** + * Returns true, if this index implementation has support for the given repository specific + * implementation class. + * @param clazz + * @return + */ + boolean supports(Class clazz); + + /** + * Returns the repository specific implementation of the index. E.g. the maven index class. + * @param clazz the specific class + * @return the instance of the given class representing this index + * @throws UnsupportedOperationException if the implementation is not supported + */ + T getBaseContext(Class clazz) throws UnsupportedOperationException; + + + + /** + * Returns the list of groups that are assigned to this index + * @return + */ + Set getGroups(); + + /** + * Updates the timestamp of the index. + * @param save + * @throws IOException + */ + void updateTimestamp(boolean save) throws IOException; + + /** + * Updates the timestamp with the given time. + * @param save + * @param time + * @throws IOException + */ + void updateTimestamp(boolean save, LocalDateTime time) throws IOException; +} diff --git a/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/indexer/IndexManagerFactory.java b/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/indexer/IndexManagerFactory.java new file mode 100644 index 000000000..3eb3a14fe --- /dev/null +++ b/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/indexer/IndexManagerFactory.java @@ -0,0 +1,53 @@ +package org.apache.archiva.indexer; + +/* + * 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.repository.RepositoryType; +import org.apache.archiva.repository.UnsupportedRepositoryTypeException; +import org.springframework.context.ApplicationContext; +import org.springframework.stereotype.Service; + +import javax.inject.Inject; +import java.util.HashMap; +import java.util.Map; + +/** + * This factory is used to get a index manager for a certain repository type. + */ +@Service("indexerManagerFactory") +public class IndexManagerFactory { + + Map managers= new HashMap<>(); + + @Inject + ApplicationContext applicationContext; + + ArchivaIndexManager getIndexManager(RepositoryType type) { + if (managers.containsKey(type)) { + return managers.get(type); + } else { + ArchivaIndexManager manager = applicationContext.getBeansOfType(ArchivaIndexManager.class).values().stream(). + filter(m -> m.supportsRepository(type)). + findFirst().orElseThrow(() -> new UnsupportedRepositoryTypeException(type)); + managers.put(type, manager); + return manager; + } + } +} diff --git a/archiva-modules/archiva-base/archiva-indexer-api/src/main/java/org/apache/archiva/indexer/search/ArtifactInfoFilter.java b/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/indexer/search/ArtifactInfoFilter.java similarity index 100% rename from archiva-modules/archiva-base/archiva-indexer-api/src/main/java/org/apache/archiva/indexer/search/ArtifactInfoFilter.java rename to archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/indexer/search/ArtifactInfoFilter.java diff --git a/archiva-modules/archiva-base/archiva-indexer-api/src/main/java/org/apache/archiva/indexer/search/RepositorySearch.java b/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/indexer/search/RepositorySearch.java similarity index 100% rename from archiva-modules/archiva-base/archiva-indexer-api/src/main/java/org/apache/archiva/indexer/search/RepositorySearch.java rename to archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/indexer/search/RepositorySearch.java diff --git a/archiva-modules/archiva-base/archiva-indexer-api/src/main/java/org/apache/archiva/indexer/search/RepositorySearchException.java b/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/indexer/search/RepositorySearchException.java similarity index 100% rename from archiva-modules/archiva-base/archiva-indexer-api/src/main/java/org/apache/archiva/indexer/search/RepositorySearchException.java rename to archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/indexer/search/RepositorySearchException.java diff --git a/archiva-modules/archiva-base/archiva-indexer-api/src/main/java/org/apache/archiva/indexer/search/SearchFields.java b/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/indexer/search/SearchFields.java similarity index 100% rename from archiva-modules/archiva-base/archiva-indexer-api/src/main/java/org/apache/archiva/indexer/search/SearchFields.java rename to archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/indexer/search/SearchFields.java diff --git a/archiva-modules/archiva-base/archiva-indexer-api/src/main/java/org/apache/archiva/indexer/search/SearchResultHit.java b/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/indexer/search/SearchResultHit.java similarity index 100% rename from archiva-modules/archiva-base/archiva-indexer-api/src/main/java/org/apache/archiva/indexer/search/SearchResultHit.java rename to archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/indexer/search/SearchResultHit.java diff --git a/archiva-modules/archiva-base/archiva-indexer-api/src/main/java/org/apache/archiva/indexer/search/SearchResultLimits.java b/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/indexer/search/SearchResultLimits.java similarity index 100% rename from archiva-modules/archiva-base/archiva-indexer-api/src/main/java/org/apache/archiva/indexer/search/SearchResultLimits.java rename to archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/indexer/search/SearchResultLimits.java diff --git a/archiva-modules/archiva-base/archiva-indexer-api/src/main/java/org/apache/archiva/indexer/search/SearchResults.java b/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/indexer/search/SearchResults.java similarity index 100% rename from archiva-modules/archiva-base/archiva-indexer-api/src/main/java/org/apache/archiva/indexer/search/SearchResults.java rename to archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/indexer/search/SearchResults.java diff --git a/archiva-modules/archiva-base/archiva-indexer-api/src/main/java/org/apache/archiva/indexer/util/SearchUtil.java b/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/indexer/util/SearchUtil.java similarity index 100% rename from archiva-modules/archiva-base/archiva-indexer-api/src/main/java/org/apache/archiva/indexer/util/SearchUtil.java rename to archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/indexer/util/SearchUtil.java diff --git a/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/ContentNotFoundException.java b/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/ContentNotFoundException.java similarity index 100% rename from archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/ContentNotFoundException.java rename to archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/ContentNotFoundException.java diff --git a/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/EditableManagedRepository.java b/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/EditableManagedRepository.java similarity index 100% rename from archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/EditableManagedRepository.java rename to archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/EditableManagedRepository.java diff --git a/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/EditableRemoteRepository.java b/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/EditableRemoteRepository.java similarity index 100% rename from archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/EditableRemoteRepository.java rename to archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/EditableRemoteRepository.java diff --git a/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/EditableRepository.java b/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/EditableRepository.java similarity index 100% rename from archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/EditableRepository.java rename to archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/EditableRepository.java diff --git a/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/layout/LayoutException.java b/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/LayoutException.java similarity index 96% rename from archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/layout/LayoutException.java rename to archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/LayoutException.java index 6e3a77996..f106937e7 100644 --- a/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/layout/LayoutException.java +++ b/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/LayoutException.java @@ -1,4 +1,4 @@ -package org.apache.archiva.repository.layout; +package org.apache.archiva.repository; /* * Licensed to the Apache Software Foundation (ASF) under one diff --git a/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/ManagedRepository.java b/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/ManagedRepository.java similarity index 96% rename from archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/ManagedRepository.java rename to archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/ManagedRepository.java index b4ab89d98..550a9ce86 100644 --- a/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/ManagedRepository.java +++ b/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/ManagedRepository.java @@ -20,6 +20,8 @@ package org.apache.archiva.repository; */ +import org.apache.archiva.indexer.ArchivaIndexingContext; + import java.util.Set; /** @@ -46,4 +48,5 @@ public interface ManagedRepository extends Repository { * @return */ Set getActiveReleaseSchemes(); + } diff --git a/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/ManagedRepositoryContent.java b/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/ManagedRepositoryContent.java similarity index 99% rename from archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/ManagedRepositoryContent.java rename to archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/ManagedRepositoryContent.java index 5baf32fdb..bf47b472d 100644 --- a/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/ManagedRepositoryContent.java +++ b/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/ManagedRepositoryContent.java @@ -23,7 +23,6 @@ import org.apache.archiva.model.ArchivaArtifact; import org.apache.archiva.model.ArtifactReference; import org.apache.archiva.model.ProjectReference; import org.apache.archiva.model.VersionedReference; -import org.apache.archiva.repository.layout.LayoutException; import java.nio.file.Path; import java.util.Set; diff --git a/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/ReleaseScheme.java b/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/ReleaseScheme.java similarity index 100% rename from archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/ReleaseScheme.java rename to archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/ReleaseScheme.java diff --git a/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/RemoteRepository.java b/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/RemoteRepository.java similarity index 100% rename from archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/RemoteRepository.java rename to archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/RemoteRepository.java diff --git a/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/RemoteRepositoryContent.java b/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/RemoteRepositoryContent.java similarity index 97% rename from archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/RemoteRepositoryContent.java rename to archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/RemoteRepositoryContent.java index 7002d7ebe..246e3343b 100644 --- a/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/RemoteRepositoryContent.java +++ b/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/RemoteRepositoryContent.java @@ -21,7 +21,6 @@ package org.apache.archiva.repository; import org.apache.archiva.model.ArtifactReference; import org.apache.archiva.model.RepositoryURL; -import org.apache.archiva.repository.layout.LayoutException; /** * RemoteRepositoryContent interface for interacting with a remote repository in an abstract way, diff --git a/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/Repository.java b/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/Repository.java similarity index 95% rename from archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/Repository.java rename to archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/Repository.java index 68c00d621..1c101ee48 100644 --- a/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/Repository.java +++ b/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/Repository.java @@ -19,6 +19,7 @@ package org.apache.archiva.repository; * under the License. */ +import org.apache.archiva.indexer.ArchivaIndexingContext; import org.apache.archiva.repository.features.RepositoryFeature; import java.net.URI; @@ -159,4 +160,10 @@ public interface Repository { > boolean supportsFeature(Class clazz); + /** + * Returns a indexing context. + * @return + * @throws UnsupportedOperationException + */ + ArchivaIndexingContext getIndexingContext(); } diff --git a/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/RepositoryCapabilities.java b/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/RepositoryCapabilities.java similarity index 100% rename from archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/RepositoryCapabilities.java rename to archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/RepositoryCapabilities.java diff --git a/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/RepositoryContent.java b/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/RepositoryContent.java similarity index 96% rename from archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/RepositoryContent.java rename to archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/RepositoryContent.java index 2ceedec10..d959a8629 100644 --- a/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/RepositoryContent.java +++ b/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/RepositoryContent.java @@ -21,7 +21,6 @@ package org.apache.archiva.repository; import org.apache.archiva.model.ArtifactReference; import org.apache.archiva.model.VersionedReference; -import org.apache.archiva.repository.layout.LayoutException; /** diff --git a/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/RepositoryContentFactory.java b/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/RepositoryContentFactory.java similarity index 100% rename from archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/RepositoryContentFactory.java rename to archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/RepositoryContentFactory.java diff --git a/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/RepositoryContentProvider.java b/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/RepositoryContentProvider.java similarity index 100% rename from archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/RepositoryContentProvider.java rename to archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/RepositoryContentProvider.java diff --git a/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/RepositoryCredentials.java b/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/RepositoryCredentials.java similarity index 100% rename from archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/RepositoryCredentials.java rename to archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/RepositoryCredentials.java diff --git a/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/RepositoryException.java b/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/RepositoryException.java similarity index 100% rename from archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/RepositoryException.java rename to archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/RepositoryException.java diff --git a/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/RepositoryNotFoundException.java b/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/RepositoryNotFoundException.java similarity index 100% rename from archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/RepositoryNotFoundException.java rename to archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/RepositoryNotFoundException.java diff --git a/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/RepositoryProvider.java b/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/RepositoryProvider.java similarity index 100% rename from archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/RepositoryProvider.java rename to archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/RepositoryProvider.java diff --git a/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/RepositoryType.java b/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/RepositoryType.java similarity index 100% rename from archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/RepositoryType.java rename to archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/RepositoryType.java diff --git a/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/StandardCapabilities.java b/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/StandardCapabilities.java similarity index 100% rename from archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/StandardCapabilities.java rename to archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/StandardCapabilities.java diff --git a/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/UnsupportedFeatureException.java b/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/UnsupportedFeatureException.java similarity index 100% rename from archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/UnsupportedFeatureException.java rename to archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/UnsupportedFeatureException.java diff --git a/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/UnsupportedRepositoryTypeException.java b/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/UnsupportedRepositoryTypeException.java new file mode 100644 index 000000000..9bfc02ecb --- /dev/null +++ b/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/UnsupportedRepositoryTypeException.java @@ -0,0 +1,45 @@ +package org.apache.archiva.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. + */ + +/** + * This is a fatal exception and should not happen. It is thrown if the implementation + * does not have certain classes to support this repository type. + */ +public class UnsupportedRepositoryTypeException extends RuntimeException { + + private static final String MESSAGE = "The repository type is not supported: "; + + public UnsupportedRepositoryTypeException(RepositoryType type) { + super(MESSAGE+type.name()); + } + + public UnsupportedRepositoryTypeException(RepositoryType type, Throwable cause) { + super(MESSAGE+type.name(), cause); + } + + public UnsupportedRepositoryTypeException(Throwable cause) { + super(cause); + } + + protected UnsupportedRepositoryTypeException(RepositoryType type, Throwable cause, boolean enableSuppression, boolean writableStackTrace) { + super(MESSAGE+type.name(), cause, enableSuppression, writableStackTrace); + } +} diff --git a/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/UnsupportedURIException.java b/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/UnsupportedURIException.java similarity index 100% rename from archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/UnsupportedURIException.java rename to archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/UnsupportedURIException.java diff --git a/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/features/RepositoryFeature.java b/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/features/RepositoryFeature.java similarity index 100% rename from archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/features/RepositoryFeature.java rename to archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/features/RepositoryFeature.java diff --git a/archiva-modules/archiva-base/archiva-indexer-api/src/main/resources/META-INF/spring-context.xml b/archiva-modules/archiva-base/archiva-repository-api/src/main/resources/META-INF/spring-context.xml similarity index 100% rename from archiva-modules/archiva-base/archiva-indexer-api/src/main/resources/META-INF/spring-context.xml rename to archiva-modules/archiva-base/archiva-repository-api/src/main/resources/META-INF/spring-context.xml diff --git a/archiva-modules/archiva-base/archiva-repository-layer/pom.xml b/archiva-modules/archiva-base/archiva-repository-layer/pom.xml index 8f2153439..2b03400ce 100644 --- a/archiva-modules/archiva-base/archiva-repository-layer/pom.xml +++ b/archiva-modules/archiva-base/archiva-repository-layer/pom.xml @@ -41,6 +41,10 @@ org.apache.archiva archiva-checksum + + org.apache.archiva + archiva-repository-api + org.apache.archiva archiva-configuration diff --git a/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/AbstractRepository.java b/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/AbstractRepository.java index 0ff3cb1ad..ab1c3fa83 100644 --- a/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/AbstractRepository.java +++ b/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/AbstractRepository.java @@ -23,6 +23,7 @@ import com.cronutils.model.CronType; import com.cronutils.model.definition.CronDefinition; import com.cronutils.model.definition.CronDefinitionBuilder; import com.cronutils.parser.CronParser; +import org.apache.archiva.indexer.ArchivaIndexingContext; import org.apache.archiva.repository.features.RepositoryFeature; import java.net.URI; @@ -237,4 +238,10 @@ public abstract class AbstractRepository implements EditableRepository protected > void addFeature(RepositoryFeature feature) { featureMap.put( (Class>) feature.getClass(), feature); } + + @Override + public ArchivaIndexingContext getIndexingContext() { + // TODO: Implement + return null; + } } diff --git a/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/content/PathParser.java b/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/content/PathParser.java index 5dc960913..ddbcb6d59 100644 --- a/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/content/PathParser.java +++ b/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/content/PathParser.java @@ -20,7 +20,7 @@ package org.apache.archiva.repository.content; */ import org.apache.archiva.model.ArtifactReference; -import org.apache.archiva.repository.layout.LayoutException; +import org.apache.archiva.repository.LayoutException; /** * PathParser interface. diff --git a/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/metadata/MetadataTools.java b/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/metadata/MetadataTools.java index 8706759a9..062169273 100644 --- a/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/metadata/MetadataTools.java +++ b/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/metadata/MetadataTools.java @@ -36,7 +36,7 @@ import org.apache.archiva.redback.components.registry.RegistryListener; import org.apache.archiva.repository.ContentNotFoundException; import org.apache.archiva.repository.ManagedRepositoryContent; import org.apache.archiva.repository.RemoteRepositoryContent; -import org.apache.archiva.repository.layout.LayoutException; +import org.apache.archiva.repository.LayoutException; import org.apache.archiva.xml.XMLException; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.lang.StringUtils; diff --git a/archiva-modules/archiva-base/pom.xml b/archiva-modules/archiva-base/pom.xml index d77129d62..5c3d64f6b 100644 --- a/archiva-modules/archiva-base/pom.xml +++ b/archiva-modules/archiva-base/pom.xml @@ -39,7 +39,7 @@ archiva-checksum archiva-plexus-bridge archiva-policies - archiva-indexer-api + archiva-repository-api archiva-indexer archiva-consumers archiva-repository-layer 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 96376736e..519ac4877 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 @@ -26,7 +26,7 @@ import org.apache.archiva.model.ArtifactReference; import org.apache.archiva.repository.ManagedRepository; import org.apache.archiva.repository.ManagedRepositoryContent; import org.apache.archiva.repository.RepositoryContentFactory; -import org.apache.archiva.repository.layout.LayoutException; +import org.apache.archiva.repository.LayoutException; import org.springframework.stereotype.Service; import javax.inject.Inject; diff --git a/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/archiva/webdav/ArchivaDavResourceFactory.java b/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/archiva/webdav/ArchivaDavResourceFactory.java index 6598b0771..c42380e23 100644 --- a/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/archiva/webdav/ArchivaDavResourceFactory.java +++ b/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/archiva/webdav/ArchivaDavResourceFactory.java @@ -65,7 +65,7 @@ import org.apache.archiva.repository.RepositoryRegistry; import org.apache.archiva.repository.content.maven2.RepositoryRequest; import org.apache.archiva.repository.events.AuditListener; import org.apache.archiva.repository.features.IndexCreationFeature; -import org.apache.archiva.repository.layout.LayoutException; +import org.apache.archiva.repository.LayoutException; import org.apache.archiva.repository.metadata.MetadataTools; import org.apache.archiva.repository.metadata.RepositoryMetadataException; import org.apache.archiva.repository.metadata.RepositoryMetadataMerge; diff --git a/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryStorage.java b/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryStorage.java index 359c7ebc1..4678950b7 100644 --- a/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryStorage.java +++ b/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryStorage.java @@ -47,7 +47,7 @@ import org.apache.archiva.proxy.common.WagonFactory; import org.apache.archiva.proxy.model.RepositoryProxyConnectors; import org.apache.archiva.repository.ManagedRepositoryContent; import org.apache.archiva.repository.content.PathParser; -import org.apache.archiva.repository.layout.LayoutException; +import org.apache.archiva.repository.LayoutException; import org.apache.archiva.xml.XMLException; import org.apache.commons.lang.ArrayUtils; import org.apache.commons.lang.StringUtils; diff --git a/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/repository/content/maven2/AbstractDefaultRepositoryContent.java b/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/repository/content/maven2/AbstractDefaultRepositoryContent.java index a15b5d76c..ae8a92281 100644 --- a/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/repository/content/maven2/AbstractDefaultRepositoryContent.java +++ b/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/repository/content/maven2/AbstractDefaultRepositoryContent.java @@ -20,7 +20,6 @@ package org.apache.archiva.repository.content.maven2; */ import org.apache.archiva.common.utils.VersionUtil; -import org.apache.archiva.configuration.FileTypes; import org.apache.archiva.metadata.repository.storage.RepositoryPathTranslator; import org.apache.archiva.metadata.repository.storage.maven2.ArtifactMappingProvider; import org.apache.archiva.metadata.repository.storage.maven2.Maven2RepositoryPathTranslator; @@ -30,13 +29,11 @@ import org.apache.archiva.model.ProjectReference; import org.apache.archiva.model.VersionedReference; import org.apache.archiva.repository.RepositoryContent; import org.apache.archiva.repository.content.PathParser; -import org.apache.archiva.repository.layout.LayoutException; +import org.apache.archiva.repository.LayoutException; import org.apache.commons.lang.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import javax.annotation.PostConstruct; -import javax.inject.Inject; import java.util.List; /** diff --git a/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/repository/content/maven2/DefaultPathParser.java b/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/repository/content/maven2/DefaultPathParser.java index c0bcaaf54..d28a8284b 100644 --- a/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/repository/content/maven2/DefaultPathParser.java +++ b/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/repository/content/maven2/DefaultPathParser.java @@ -27,7 +27,7 @@ import org.apache.archiva.metadata.repository.storage.maven2.DefaultArtifactMapp import org.apache.archiva.metadata.repository.storage.maven2.Maven2RepositoryPathTranslator; import org.apache.archiva.model.ArtifactReference; import org.apache.archiva.repository.content.PathParser; -import org.apache.archiva.repository.layout.LayoutException; +import org.apache.archiva.repository.LayoutException; import org.apache.commons.lang.StringUtils; import org.springframework.stereotype.Service; diff --git a/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/repository/content/maven2/ManagedDefaultRepositoryContent.java b/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/repository/content/maven2/ManagedDefaultRepositoryContent.java index 847dd7a6b..d5f55fc6e 100644 --- a/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/repository/content/maven2/ManagedDefaultRepositoryContent.java +++ b/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/repository/content/maven2/ManagedDefaultRepositoryContent.java @@ -28,9 +28,9 @@ import org.apache.archiva.model.ArtifactReference; import org.apache.archiva.model.ProjectReference; import org.apache.archiva.model.VersionedReference; import org.apache.archiva.repository.ContentNotFoundException; +import org.apache.archiva.repository.LayoutException; import org.apache.archiva.repository.ManagedRepositoryContent; import org.apache.archiva.repository.RepositoryException; -import org.apache.archiva.repository.layout.LayoutException; import org.apache.commons.lang.StringUtils; import java.io.IOException; @@ -245,8 +245,8 @@ public class ManagedDefaultRepositoryContent * information. * * @return the Set of available versions, based on the project reference. - * @throws org.apache.archiva.repository.layout.LayoutException - * @throws org.apache.archiva.repository.layout.LayoutException + * @throws LayoutException + * @throws LayoutException */ @Override public Set getVersions( ProjectReference reference ) @@ -395,7 +395,7 @@ public class ManagedDefaultRepositoryContent * Convert a path to an artifact reference. * * @param path the path to convert. (relative or full location path) - * @throws org.apache.archiva.repository.layout.LayoutException if the path cannot be converted to an artifact reference. + * @throws LayoutException if the path cannot be converted to an artifact reference. */ @Override public ArtifactReference toArtifactReference( String path ) @@ -440,7 +440,7 @@ public class ManagedDefaultRepositoryContent * @return the ArtifactReference to the first artifact located within the versioned reference. or null if * no artifact was found within the versioned reference. * @throws java.io.IOException if the versioned reference is invalid (example: doesn't exist, or isn't a directory) - * @throws org.apache.archiva.repository.layout.LayoutException + * @throws LayoutException */ private ArtifactReference getFirstArtifact( VersionedReference reference ) throws LayoutException, IOException diff --git a/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/repository/content/maven2/RemoteDefaultRepositoryContent.java b/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/repository/content/maven2/RemoteDefaultRepositoryContent.java index b9c2238fa..17426d8b9 100644 --- a/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/repository/content/maven2/RemoteDefaultRepositoryContent.java +++ b/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/repository/content/maven2/RemoteDefaultRepositoryContent.java @@ -22,11 +22,9 @@ package org.apache.archiva.repository.content.maven2; import org.apache.archiva.metadata.repository.storage.maven2.ArtifactMappingProvider; import org.apache.archiva.model.ArtifactReference; import org.apache.archiva.model.RepositoryURL; +import org.apache.archiva.repository.LayoutException; import org.apache.archiva.repository.RemoteRepository; import org.apache.archiva.repository.RemoteRepositoryContent; -import org.apache.archiva.repository.layout.LayoutException; -import org.springframework.context.annotation.Scope; -import org.springframework.stereotype.Service; import java.util.List; @@ -80,7 +78,7 @@ public class RemoteDefaultRepositoryContent * Convert a path to an artifact reference. * * @param path the path to convert. (relative or full url path) - * @throws org.apache.archiva.repository.layout.LayoutException if the path cannot be converted to an artifact reference. + * @throws LayoutException if the path cannot be converted to an artifact reference. */ @Override public ArtifactReference toArtifactReference( String path ) diff --git a/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/repository/content/maven2/RepositoryRequest.java b/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/repository/content/maven2/RepositoryRequest.java index a1fc5bd62..fa7ec895b 100644 --- a/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/repository/content/maven2/RepositoryRequest.java +++ b/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/repository/content/maven2/RepositoryRequest.java @@ -20,9 +20,9 @@ package org.apache.archiva.repository.content.maven2; */ import org.apache.archiva.model.ArtifactReference; +import org.apache.archiva.repository.LayoutException; import org.apache.archiva.repository.ManagedRepositoryContent; import org.apache.archiva.repository.content.PathParser; -import org.apache.archiva.repository.layout.LayoutException; import org.apache.archiva.repository.metadata.MetadataTools; import org.apache.commons.lang.StringUtils; @@ -45,7 +45,7 @@ public class RepositoryRequest * * @param requestedPath the relative path to the content. * @return the ArtifactReference for the requestedPath. - * @throws org.apache.archiva.repository.layout.LayoutException if the request path is not layout valid. + * @throws LayoutException if the request path is not layout valid. */ public ArtifactReference toArtifactReference( String requestedPath ) throws LayoutException @@ -236,7 +236,7 @@ public class RepositoryRequest * @param requestedPath the incoming requested path. * @param repository the repository to adjust to. * @return the adjusted (to native) path. - * @throws org.apache.archiva.repository.layout.LayoutException if the path cannot be parsed. + * @throws LayoutException if the path cannot be parsed. */ public String toNativePath( String requestedPath, ManagedRepositoryContent repository ) throws LayoutException diff --git a/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/AbstractDefaultRepositoryContentTestCase.java b/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/AbstractDefaultRepositoryContentTestCase.java index 0967e225f..c3b85ccf1 100644 --- a/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/AbstractDefaultRepositoryContentTestCase.java +++ b/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/AbstractDefaultRepositoryContentTestCase.java @@ -21,7 +21,7 @@ package org.apache.archiva.metadata.repository.storage.maven2; import org.apache.archiva.model.ArtifactReference; import org.apache.archiva.repository.AbstractRepositoryLayerTestCase; -import org.apache.archiva.repository.layout.LayoutException; +import org.apache.archiva.repository.LayoutException; import org.apache.commons.lang.StringUtils; import org.junit.Test; @@ -82,7 +82,7 @@ public abstract class AbstractDefaultRepositoryContentTestCase * [MRM-432] Oddball version spec. * Example of an oddball / unusual version spec. * - * @throws org.apache.archiva.repository.layout.LayoutException + * @throws LayoutException * */ @Test @@ -103,7 +103,7 @@ public abstract class AbstractDefaultRepositoryContentTestCase * [MRM-432] Oddball version spec. * Example of an oddball / unusual version spec. * - * @throws org.apache.archiva.repository.layout.LayoutException + * @throws LayoutException * */ @Test @@ -124,7 +124,7 @@ public abstract class AbstractDefaultRepositoryContentTestCase * Test the ejb-client type spec. * Type specs are not a 1 to 1 map to the extension. * This tests that effect. - * @throws org.apache.archiva.repository.layout.LayoutException + * @throws LayoutException */ /* TODO: Re-enabled in the future. public void testGoodFooEjbClient() @@ -145,7 +145,7 @@ public abstract class AbstractDefaultRepositoryContentTestCase * [MRM-432] Oddball version spec. * Example of an oddball / unusual version spec. * - * @throws org.apache.archiva.repository.layout.LayoutException + * @throws LayoutException * */ @Test @@ -252,7 +252,7 @@ public abstract class AbstractDefaultRepositoryContentTestCase /** * Test the classifier, and java-source type spec. * - * @throws org.apache.archiva.repository.layout.LayoutException + * @throws LayoutException * */ @Test @@ -272,7 +272,7 @@ public abstract class AbstractDefaultRepositoryContentTestCase /** * A timestamped versioned artifact, should reside in a SNAPSHOT baseversion directory. * - * @throws org.apache.archiva.repository.layout.LayoutException + * @throws LayoutException * */ @Test diff --git a/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/ManagedDefaultRepositoryContentTest.java b/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/ManagedDefaultRepositoryContentTest.java index 41e62faa3..98bfac076 100644 --- a/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/ManagedDefaultRepositoryContentTest.java +++ b/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/ManagedDefaultRepositoryContentTest.java @@ -27,9 +27,8 @@ import org.apache.archiva.model.ArtifactReference; import org.apache.archiva.model.ProjectReference; import org.apache.archiva.model.VersionedReference; import org.apache.archiva.repository.EditableManagedRepository; -import org.apache.archiva.repository.ManagedRepositoryContent; import org.apache.archiva.repository.content.maven2.ManagedDefaultRepositoryContent; -import org.apache.archiva.repository.layout.LayoutException; +import org.apache.archiva.repository.LayoutException; import org.apache.archiva.repository.maven2.MavenManagedRepository; import org.junit.Before; import org.junit.Test; diff --git a/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/RemoteDefaultRepositoryContentTest.java b/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/RemoteDefaultRepositoryContentTest.java index 0a1c03acf..4af23f6fd 100644 --- a/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/RemoteDefaultRepositoryContentTest.java +++ b/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/RemoteDefaultRepositoryContentTest.java @@ -23,11 +23,10 @@ import org.apache.archiva.model.ArtifactReference; import org.apache.archiva.repository.RemoteRepository; import org.apache.archiva.repository.RemoteRepositoryContent; import org.apache.archiva.repository.content.maven2.RemoteDefaultRepositoryContent; -import org.apache.archiva.repository.layout.LayoutException; +import org.apache.archiva.repository.LayoutException; import org.junit.Before; import javax.inject.Inject; -import javax.inject.Named; import java.util.List; /** diff --git a/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/repository/content/maven2/DefaultPathParserTest.java b/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/repository/content/maven2/DefaultPathParserTest.java index 74b2c0df8..f46dfa2d0 100644 --- a/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/repository/content/maven2/DefaultPathParserTest.java +++ b/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/repository/content/maven2/DefaultPathParserTest.java @@ -20,8 +20,8 @@ package org.apache.archiva.repository.content.maven2; */ import org.apache.archiva.model.ArtifactReference; +import org.apache.archiva.repository.LayoutException; import org.apache.archiva.repository.content.PathParser; -import org.apache.archiva.repository.layout.LayoutException; import org.apache.archiva.test.utils.ArchivaSpringJUnit4ClassRunner; import org.apache.commons.lang.StringUtils; import org.junit.Test; @@ -152,7 +152,7 @@ public class DefaultPathParserTest * [MRM-432] Oddball version spec. * Example of an oddball / unusual version spec. * - * @throws org.apache.archiva.repository.layout.LayoutException + * @throws LayoutException */ @Test public void testGoodButOddVersionSpecGanymedSsh2() @@ -172,7 +172,7 @@ public class DefaultPathParserTest * [MRM-432] Oddball version spec. * Example of an oddball / unusual version spec. * - * @throws org.apache.archiva.repository.layout.LayoutException + * @throws LayoutException */ @Test public void testGoodButOddVersionSpecJavaxComm() @@ -192,7 +192,7 @@ public class DefaultPathParserTest * Test the ejb-client type spec. * Type specs are not a 1 to 1 map to the extension. * This tests that effect. - * @throws org.apache.archiva.repository.layout.LayoutException + * @throws LayoutException */ /* TODO: Re-enabled in the future. public void testGoodFooEjbClient() @@ -213,7 +213,7 @@ public class DefaultPathParserTest * [MRM-432] Oddball version spec. * Example of an oddball / unusual version spec. * - * @throws org.apache.archiva.repository.layout.LayoutException + * @throws LayoutException */ @Test public void testGoodButOddVersionSpecJavaxPersistence() @@ -333,7 +333,7 @@ public class DefaultPathParserTest /** * Test the classifier, and java-source type spec. * - * @throws org.apache.archiva.repository.layout.LayoutException + * @throws LayoutException */ @Test public void testGoodFooLibSources() @@ -352,7 +352,7 @@ public class DefaultPathParserTest /** * A timestamped versioned artifact, should reside in a SNAPSHOT baseversion directory. * - * @throws org.apache.archiva.repository.layout.LayoutException + * @throws LayoutException */ @Test public void testGoodSnapshotMavenTest() @@ -372,7 +372,7 @@ public class DefaultPathParserTest /** * A timestamped versioned artifact, should reside in a SNAPSHOT baseversion directory. * - * @throws org.apache.archiva.repository.layout.LayoutException + * @throws LayoutException */ @Test public void testGoodLongSnapshotMavenTest() @@ -401,7 +401,7 @@ public class DefaultPathParserTest /** * A timestamped versioned artifact, should reside in a SNAPSHOT baseversion directory. * - * @throws org.apache.archiva.repository.layout.LayoutException + * @throws LayoutException */ @Test public void testClassifiedSnapshotMavenTest() diff --git a/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/repository/content/maven2/RepositoryRequestTest.java b/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/repository/content/maven2/RepositoryRequestTest.java index 928482b18..f918c1873 100644 --- a/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/repository/content/maven2/RepositoryRequestTest.java +++ b/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/repository/content/maven2/RepositoryRequestTest.java @@ -24,7 +24,7 @@ import org.apache.archiva.configuration.ArchivaConfiguration; import org.apache.archiva.model.ArtifactReference; import org.apache.archiva.repository.ManagedRepositoryContent; import org.apache.archiva.repository.RepositoryContentProvider; -import org.apache.archiva.repository.layout.LayoutException; +import org.apache.archiva.repository.LayoutException; import org.apache.archiva.repository.maven2.MavenManagedRepository; import org.apache.archiva.test.utils.ArchivaSpringJUnit4ClassRunner; import org.apache.commons.lang.StringUtils; diff --git a/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/repository/metadata/MetadataToolsTest.java b/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/repository/metadata/MetadataToolsTest.java index 650f49fff..7bbf4cb6f 100644 --- a/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/repository/metadata/MetadataToolsTest.java +++ b/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/repository/metadata/MetadataToolsTest.java @@ -19,7 +19,6 @@ package org.apache.archiva.repository.metadata; * under the License. */ -import org.apache.archiva.admin.model.beans.ManagedRepository; import org.apache.archiva.common.utils.VersionComparator; import org.apache.archiva.configuration.ProxyConnectorConfiguration; import org.apache.archiva.metadata.repository.storage.maven2.conf.MockConfiguration; @@ -33,7 +32,7 @@ import org.apache.archiva.repository.AbstractRepositoryLayerTestCase; import org.apache.archiva.repository.ManagedRepositoryContent; import org.apache.archiva.repository.RemoteRepositoryContent; import org.apache.archiva.repository.RepositoryContentProvider; -import org.apache.archiva.repository.layout.LayoutException; +import org.apache.archiva.repository.LayoutException; import org.apache.archiva.repository.maven2.MavenManagedRepository; import org.apache.commons.io.FileUtils; import org.apache.commons.lang.StringUtils; diff --git a/pom.xml b/pom.xml index 8b981b620..2469fd366 100644 --- a/pom.xml +++ b/pom.xml @@ -287,11 +287,6 @@ test-repository ${project.version} - - org.apache.archiva - archiva-indexer-api - ${project.version} - org.apache.archiva archiva-indexer @@ -437,6 +432,11 @@ archiva-repository-layer ${project.version} + + org.apache.archiva + archiva-repository-api + ${project.version} + org.apache.archiva archiva-repository-scanner -- 2.39.5