diff options
author | Martin Stockhammer <martin.stockhammer@ars.de> | 2017-11-08 22:59:33 +0100 |
---|---|---|
committer | Martin Stockhammer <martin.stockhammer@ars.de> | 2017-11-08 22:59:33 +0100 |
commit | e2cdbc2b7229b4c141a61c8f9aa118304bee2632 (patch) | |
tree | bf4a96c6e9d43c8796c4ab38c49c400a4973fd49 /archiva-modules | |
parent | 2ab8942ccff2a85c356b878875632410a3999ce8 (diff) | |
download | archiva-e2cdbc2b7229b4c141a61c8f9aa118304bee2632.tar.gz archiva-e2cdbc2b7229b4c141a61c8f9aa118304bee2632.zip |
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.
Diffstat (limited to 'archiva-modules')
65 files changed, 376 insertions, 71 deletions
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 @@ -43,12 +43,6 @@ <artifactId>archiva-repository-layer</artifactId> </dependency> <dependency> - <groupId>org.apache.archiva</groupId> - <artifactId>archiva-indexer-api</artifactId> - </dependency> - - - <dependency> <groupId>org.springframework</groupId> <artifactId>spring-context</artifactId> </dependency> 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 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 @@ <version>3.0.0-SNAPSHOT</version> </parent> <modelVersion>4.0.0</modelVersion> - <artifactId>archiva-indexer-api</artifactId> + <artifactId>archiva-repository-api</artifactId> <packaging>bundle</packaging> - <name>Archiva Base :: Indexer API</name> + <name>Archiva Base :: Repository API</name> <dependencies> <dependency> @@ -43,6 +43,14 @@ <groupId>org.apache.archiva</groupId> <artifactId>archiva-model</artifactId> </dependency> + <dependency> + <groupId>org.apache.archiva</groupId> + <artifactId>archiva-configuration</artifactId> + </dependency> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-context</artifactId> + </dependency> </dependencies> <build> <pluginManagement> 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> T getBaseContext(Class<T> clazz) throws UnsupportedOperationException; + + + + /** + * Returns the list of groups that are assigned to this index + * @return + */ + Set<String> 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<RepositoryType, ArchivaIndexManager> 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 index 39c32daf6..39c32daf6 100644 --- 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 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 index 272561b32..272561b32 100644 --- 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 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 index e3da55107..e3da55107 100644 --- 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 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 index e5844a765..e5844a765 100644 --- 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 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 index a493431c8..a493431c8 100644 --- 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 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 index 967ecc5ae..967ecc5ae 100644 --- 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 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 index 9dc650fdc..9dc650fdc 100644 --- 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 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 index 0a0c922ee..0a0c922ee 100644 --- 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 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 index 7579debfe..7579debfe 100644 --- 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 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 index 4596201c8..4596201c8 100644 --- 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 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 index f8a054f21..f8a054f21 100644 --- 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 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 index b27549211..b27549211 100644 --- 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 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 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 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<ReleaseScheme> 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 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 index 0868d35b4..0868d35b4 100644 --- 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 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 index 5a7c1e8ed..5a7c1e8ed 100644 --- 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 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 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 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 { <T extends RepositoryFeature<T>> boolean supportsFeature(Class<T> 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 index 525d52130..525d52130 100644 --- 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 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 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 index 65d54e605..65d54e605 100644 --- 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 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 index 823444925..823444925 100644 --- 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 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 index 2751bc05e..2751bc05e 100644 --- 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 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 index b9dca9553..b9dca9553 100644 --- 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 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 index ad4ad9b2f..ad4ad9b2f 100644 --- 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 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 index a501514da..a501514da 100644 --- 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 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 index f60c65787..f60c65787 100644 --- 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 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 index 0a41c0497..0a41c0497 100644 --- 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 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 index 112f3075d..112f3075d 100644 --- 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 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 index 5f7f96f8a..5f7f96f8a 100644 --- 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 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 index a4df8a2a9..a4df8a2a9 100644 --- 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 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 index ce334de40..ce334de40 100644 --- 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 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 @@ -43,6 +43,10 @@ </dependency> <dependency> <groupId>org.apache.archiva</groupId> + <artifactId>archiva-repository-api</artifactId> + </dependency> + <dependency> + <groupId>org.apache.archiva</groupId> <artifactId>archiva-configuration</artifactId> </dependency> <dependency> 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 <T extends RepositoryFeature<T>> void addFeature(RepositoryFeature<T> feature) { featureMap.put( (Class<? extends RepositoryFeature<?>>) 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 @@ <module>archiva-checksum</module> <module>archiva-plexus-bridge</module> <module>archiva-policies</module> - <module>archiva-indexer-api</module> + <module>archiva-repository-api</module> <module>archiva-indexer</module> <module>archiva-consumers</module> <module>archiva-repository-layer</module> 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<String> 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; |