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 83879415f..9dfb36e1a 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 @@ -19,25 +19,23 @@ package $package; * under the License. */ +import org.apache.archiva.components.registry.Registry; +import org.apache.archiva.components.registry.RegistryListener; import org.apache.archiva.configuration.ArchivaConfiguration; import org.apache.archiva.configuration.FileTypes; import org.apache.archiva.consumers.AbstractMonitoredConsumer; import org.apache.archiva.consumers.ConsumerException; import org.apache.archiva.consumers.KnownRepositoryContentConsumer; -import org.apache.archiva.metadata.repository.MetadataResolutionException; import org.apache.archiva.metadata.repository.MetadataRepositoryException; +import org.apache.archiva.metadata.repository.MetadataResolutionException; import org.apache.archiva.metadata.repository.RepositorySession; import org.apache.archiva.metadata.repository.RepositorySessionFactory; -import org.apache.archiva.model.ArtifactReference; -import org.apache.archiva.components.registry.Registry; -import org.apache.archiva.components.registry.RegistryListener; -import org.apache.archiva.repository.ManagedRepositoryContent; +import org.apache.archiva.repository.BaseRepositoryContentLayout; import org.apache.archiva.repository.LayoutException; import org.apache.archiva.repository.ManagedRepository; -import org.apache.archiva.repository.BaseRepositoryContentLayout; +import org.apache.archiva.repository.ManagedRepositoryContent; import org.apache.archiva.repository.RepositoryContentFactory; import org.apache.archiva.repository.content.Artifact; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.context.annotation.Scope; 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 efa7e3c4c..c1c99651d 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 @@ -21,27 +21,26 @@ package org.apache.archiva.consumers.core.repository; import org.apache.archiva.common.utils.VersionComparator; import org.apache.archiva.common.utils.VersionUtil; +import org.apache.archiva.metadata.audit.RepositoryListener; import org.apache.archiva.metadata.repository.MetadataRepository; import org.apache.archiva.metadata.repository.MetadataRepositoryException; import org.apache.archiva.metadata.repository.RepositorySession; -import org.apache.archiva.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.ManagedRepositoryContent; -import org.apache.archiva.repository.LayoutException; import org.apache.archiva.repository.BaseRepositoryContentLayout; +import org.apache.archiva.repository.ContentNotFoundException; +import org.apache.archiva.repository.LayoutException; +import org.apache.archiva.repository.ManagedRepositoryContent; import org.apache.archiva.repository.ReleaseScheme; import org.apache.archiva.repository.RepositoryRegistry; -import org.apache.archiva.metadata.audit.RepositoryListener; import org.apache.archiva.repository.content.Artifact; import org.apache.archiva.repository.content.ItemNotFoundException; import org.apache.archiva.repository.content.ItemSelector; import org.apache.archiva.repository.content.Project; import org.apache.archiva.repository.content.Version; import org.apache.archiva.repository.content.base.ArchivaItemSelector; -import org.apache.archiva.repository.metadata.base.MetadataTools; import org.apache.archiva.repository.metadata.RepositoryMetadataException; +import org.apache.archiva.repository.metadata.base.MetadataTools; import org.apache.archiva.repository.storage.StorageAsset; 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 74df6a679..ea431ea35 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 @@ -23,7 +23,6 @@ import org.apache.archiva.common.utils.VersionComparator; import org.apache.archiva.common.utils.VersionUtil; import org.apache.archiva.metadata.audit.RepositoryListener; import org.apache.archiva.metadata.repository.RepositorySession; -import org.apache.archiva.model.ArtifactReference; import org.apache.archiva.repository.BaseRepositoryContentLayout; import org.apache.archiva.repository.LayoutException; import org.apache.archiva.repository.ManagedRepositoryContent; @@ -133,19 +132,4 @@ public class RetentionCountRepositoryPurge } } - /* - * Returns a new artifact reference with different version - */ - private ArtifactReference getNewArtifactReference( ArtifactReference reference, String version ) - throws LayoutException - { - ArtifactReference artifact = new ArtifactReference( ); - artifact.setGroupId( reference.getGroupId( ) ); - artifact.setArtifactId( reference.getArtifactId( ) ); - artifact.setVersion( version ); - artifact.setClassifier( reference.getClassifier( ) ); - artifact.setType( reference.getType( ) ); - return artifact; - - } } diff --git a/archiva-modules/archiva-base/archiva-proxy-api/pom.xml b/archiva-modules/archiva-base/archiva-proxy-api/pom.xml index eec69e783..e54423b44 100644 --- a/archiva-modules/archiva-base/archiva-proxy-api/pom.xml +++ b/archiva-modules/archiva-base/archiva-proxy-api/pom.xml @@ -45,10 +45,6 @@ org.apache.archiva archiva-policies - - org.apache.archiva - archiva-model - diff --git a/archiva-modules/archiva-base/archiva-proxy-api/src/main/java/org/apache/archiva/proxy/model/RepositoryProxyHandler.java b/archiva-modules/archiva-base/archiva-proxy-api/src/main/java/org/apache/archiva/proxy/model/RepositoryProxyHandler.java index 42dd67fc0..a9e8de113 100644 --- a/archiva-modules/archiva-base/archiva-proxy-api/src/main/java/org/apache/archiva/proxy/model/RepositoryProxyHandler.java +++ b/archiva-modules/archiva-base/archiva-proxy-api/src/main/java/org/apache/archiva/proxy/model/RepositoryProxyHandler.java @@ -19,7 +19,6 @@ package org.apache.archiva.proxy.model; * under the License. */ -import org.apache.archiva.model.ArtifactReference; import org.apache.archiva.policies.Policy; import org.apache.archiva.policies.ProxyDownloadException; import org.apache.archiva.repository.ManagedRepository; diff --git a/archiva-modules/archiva-base/archiva-proxy/pom.xml b/archiva-modules/archiva-base/archiva-proxy/pom.xml index b863028da..6a6038df6 100644 --- a/archiva-modules/archiva-base/archiva-proxy/pom.xml +++ b/archiva-modules/archiva-base/archiva-proxy/pom.xml @@ -81,10 +81,6 @@ org.apache.archiva archiva-repository-api - - org.apache.archiva - archiva-model - org.apache.archiva archiva-checksum diff --git a/archiva-modules/archiva-base/archiva-proxy/src/main/java/org/apache/archiva/proxy/DefaultRepositoryProxyHandler.java b/archiva-modules/archiva-base/archiva-proxy/src/main/java/org/apache/archiva/proxy/DefaultRepositoryProxyHandler.java index 99ca6ca2f..7e95b614e 100644 --- a/archiva-modules/archiva-base/archiva-proxy/src/main/java/org/apache/archiva/proxy/DefaultRepositoryProxyHandler.java +++ b/archiva-modules/archiva-base/archiva-proxy/src/main/java/org/apache/archiva/proxy/DefaultRepositoryProxyHandler.java @@ -23,11 +23,10 @@ import org.apache.archiva.checksum.ChecksumAlgorithm; import org.apache.archiva.checksum.ChecksumUtil; import org.apache.archiva.common.filelock.FileLockManager; import org.apache.archiva.common.utils.PathUtil; +import org.apache.archiva.components.taskqueue.TaskQueueException; import org.apache.archiva.configuration.ArchivaConfiguration; import org.apache.archiva.configuration.ProxyConnectorConfiguration; import org.apache.archiva.configuration.ProxyConnectorRuleConfiguration; -import org.apache.archiva.model.ArtifactReference; -import org.apache.archiva.model.Keys; import org.apache.archiva.policies.DownloadErrorPolicy; import org.apache.archiva.policies.DownloadPolicy; import org.apache.archiva.policies.Policy; @@ -42,9 +41,6 @@ import org.apache.archiva.proxy.model.NetworkProxy; import org.apache.archiva.proxy.model.ProxyConnector; import org.apache.archiva.proxy.model.ProxyFetchResult; import org.apache.archiva.proxy.model.RepositoryProxyHandler; -import org.apache.archiva.components.taskqueue.TaskQueueException; -import org.apache.archiva.repository.BaseRepositoryContentLayout; -import org.apache.archiva.repository.LayoutException; import org.apache.archiva.repository.ManagedRepository; import org.apache.archiva.repository.RemoteRepository; import org.apache.archiva.repository.RemoteRepositoryContent; @@ -52,12 +48,11 @@ import org.apache.archiva.repository.RepositoryType; import org.apache.archiva.repository.content.Artifact; import org.apache.archiva.repository.content.ContentItem; import org.apache.archiva.repository.content.ItemSelector; -import org.apache.archiva.repository.content.base.ArchivaItemSelector; -import org.apache.archiva.repository.metadata.base.MetadataTools; import org.apache.archiva.repository.metadata.RepositoryMetadataException; +import org.apache.archiva.repository.metadata.base.MetadataTools; +import org.apache.archiva.repository.storage.StorageAsset; import org.apache.archiva.repository.storage.fs.FilesystemStorage; import org.apache.archiva.repository.storage.fs.FsStorageUtil; -import org.apache.archiva.repository.storage.StorageAsset; import org.apache.archiva.scheduler.ArchivaTaskScheduler; import org.apache.archiva.scheduler.repository.model.RepositoryTask; import org.apache.commons.collections4.CollectionUtils; @@ -470,19 +465,6 @@ public abstract class DefaultRepositoryProxyHandler implements RepositoryProxyHa } } - private StorageAsset toLocalFile(ManagedRepository repository, ArtifactReference artifact ) throws LayoutException - { - ItemSelector selector = ArchivaItemSelector.builder( ) - .withNamespace( artifact.getGroupId( ) ) - .withProjectId( artifact.getArtifactId( ) ) - .withArtifactId( artifact.getArtifactId( ) ) - .withArtifactVersion( artifact.getVersion() ) - .withVersion( artifact.getProjectVersion( ) ) - .withType( artifact.getType( ) ).build(); - Artifact repoArtifact = repository.getContent( ).getLayout( BaseRepositoryContentLayout.class ).getArtifact( selector ); - return repoArtifact.getAsset( ); - } - /** * Simple method to test if the file exists on the local disk. * @@ -775,59 +757,6 @@ public abstract class DefaultRepositoryProxyHandler implements RepositoryProxyHa log.debug( "Full stack trace", exception ); } - private void validatePolicies( Map policies, Map settings, - Properties request, ArtifactReference artifact, RemoteRepositoryContent content, - StorageAsset localFile, Exception exception, Map previousExceptions ) - throws ProxyDownloadException - { - boolean process = true; - for ( Map.Entry entry : policies.entrySet() ) - { - - // olamy with spring rolehint is now downloadPolicy#hint - // so substring after last # to get the hint as with plexus - String key = entry.getValue( ).getId( ); - DownloadErrorPolicy policy = entry.getValue(); - PolicyOption option = settings.containsKey( policy ) ? settings.get(policy) : policy.getDefaultOption(); - - log.debug( "Applying [{}] policy with [{}]", key, option ); - try - { - // all policies must approve the exception, any can cancel - process = policy.applyPolicy( option, request, localFile, exception, previousExceptions ); - if ( !process ) - { - break; - } - } - catch ( PolicyConfigurationException e ) - { - log.error( e.getMessage(), e ); - } - } - - if ( process ) - { - // if the exception was queued, don't throw it - if ( !previousExceptions.containsKey( content.getId() ) ) - { - throw new ProxyDownloadException( - "An error occurred in downloading from the remote repository, and the policy is to fail immediately", - content.getId(), exception ); - } - } - else - { - // if the exception was queued, but cancelled, remove it - previousExceptions.remove( content.getId() ); - } - - log.warn( - "Transfer error from repository {} for artifact {} , continuing to next repository. Error message: {}", - content.getRepository().getId(), Keys.toKey( artifact ), exception.getMessage() ); - log.debug( "Full stack trace", exception ); - } - /** * Creates a working directory * diff --git a/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/BaseRepositoryContentLayout.java b/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/BaseRepositoryContentLayout.java index 2aeb6454b..72acb3661 100644 --- a/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/BaseRepositoryContentLayout.java +++ b/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/BaseRepositoryContentLayout.java @@ -19,10 +19,6 @@ package org.apache.archiva.repository; * under the License. */ -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.content.Artifact; import org.apache.archiva.repository.content.ContentItem; import org.apache.archiva.repository.content.DataItem; diff --git a/archiva-modules/archiva-base/archiva-repository-api/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 bc67aa0fe..7890aaa9c 100644 --- a/archiva-modules/archiva-base/archiva-repository-api/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 @@ -19,9 +19,6 @@ package org.apache.archiva.repository; * under the License. */ -import org.apache.archiva.model.ArtifactReference; -import org.apache.archiva.model.RepositoryURL; - /** * RemoteRepositoryContent interface for interacting with a remote repository in an abstract way, * without the need for processing based on URLs, or working with the database. diff --git a/archiva-modules/archiva-base/archiva-repository-api/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 a4e98da9f..417f49a5e 100644 --- a/archiva-modules/archiva-base/archiva-repository-api/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 @@ -19,7 +19,6 @@ package org.apache.archiva.repository; * under the License. */ -import org.apache.archiva.model.ArtifactReference; import org.apache.archiva.repository.content.ItemSelector; diff --git a/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/RepositoryRequestInfo.java b/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/RepositoryRequestInfo.java index e2249370b..07a31603d 100644 --- a/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/RepositoryRequestInfo.java +++ b/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/RepositoryRequestInfo.java @@ -19,7 +19,6 @@ package org.apache.archiva.repository; * under the License. */ -import org.apache.archiva.model.ArtifactReference; import org.apache.archiva.repository.content.ItemSelector; import org.apache.archiva.repository.features.RepositoryFeature; diff --git a/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/content/Artifact.java b/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/content/Artifact.java index 693b696ee..3aecc1fd0 100644 --- a/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/content/Artifact.java +++ b/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/content/Artifact.java @@ -19,8 +19,6 @@ package org.apache.archiva.repository.content; * under the License. */ -import org.apache.archiva.model.ArtifactReference; - /** * Represents a artifact of a repository. This object contains unique coordinates of the * artifact. A artifact has exactly one file representation in the repository. diff --git a/archiva-modules/archiva-base/archiva-repository-layer/pom.xml b/archiva-modules/archiva-base/archiva-repository-layer/pom.xml index 9f9db76af..2c18c4d86 100644 --- a/archiva-modules/archiva-base/archiva-repository-layer/pom.xml +++ b/archiva-modules/archiva-base/archiva-repository-layer/pom.xml @@ -73,18 +73,7 @@ org.springframework spring-context - - org.apache.archiva - archiva-test-utils - ${project.version} - test - - + org.apache.archiva.components.registry archiva-components-spring-registry-api @@ -117,25 +106,16 @@ - org.apache.logging.log4j log4j-slf4j-impl test - org.apache.logging.log4j log4j-core @@ -146,11 +126,7 @@ log4j-jcl test - - org.apache.archiva.components.cache - archiva-components-spring-cache-ehcache - test - + org.springframework spring-test diff --git a/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/metadata/base/MetadataTools.java b/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/metadata/base/MetadataTools.java index 379179c2d..d153e34c3 100644 --- a/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/metadata/base/MetadataTools.java +++ b/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/metadata/base/MetadataTools.java @@ -23,25 +23,23 @@ import org.apache.archiva.checksum.ChecksumAlgorithm; import org.apache.archiva.checksum.ChecksummedFile; import org.apache.archiva.common.utils.VersionComparator; import org.apache.archiva.common.utils.VersionUtil; +import org.apache.archiva.components.registry.Registry; +import org.apache.archiva.components.registry.RegistryListener; import org.apache.archiva.configuration.ArchivaConfiguration; import org.apache.archiva.configuration.ConfigurationEvent; import org.apache.archiva.configuration.ConfigurationListener; import org.apache.archiva.configuration.ConfigurationNames; import org.apache.archiva.configuration.FileTypes; import org.apache.archiva.configuration.ProxyConnectorConfiguration; -// import org.apache.archiva.maven2.metadata.MavenMetadataReader; import org.apache.archiva.model.ArchivaRepositoryMetadata; -import org.apache.archiva.model.ArtifactReference; import org.apache.archiva.model.Plugin; import org.apache.archiva.model.ProjectReference; import org.apache.archiva.model.SnapshotVersion; import org.apache.archiva.model.VersionedReference; -import org.apache.archiva.components.registry.Registry; -import org.apache.archiva.components.registry.RegistryListener; -import org.apache.archiva.repository.ContentNotFoundException; -import org.apache.archiva.repository.ManagedRepositoryContent; -import org.apache.archiva.repository.LayoutException; import org.apache.archiva.repository.BaseRepositoryContentLayout; +import org.apache.archiva.repository.ContentNotFoundException; +import org.apache.archiva.repository.LayoutException; +import org.apache.archiva.repository.ManagedRepositoryContent; import org.apache.archiva.repository.RemoteRepositoryContent; import org.apache.archiva.repository.RepositoryRegistry; import org.apache.archiva.repository.RepositoryType; @@ -63,15 +61,28 @@ import javax.annotation.PostConstruct; import javax.inject.Inject; import javax.inject.Named; import java.io.IOException; -import java.nio.file.Files; -import java.nio.file.Path; import java.text.ParseException; import java.text.SimpleDateFormat; -import java.util.*; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Calendar; +import java.util.Collection; +import java.util.Collections; +import java.util.Date; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.TimeZone; import java.util.regex.Matcher; import java.util.stream.Collectors; import java.util.stream.Stream; +// import org.apache.archiva.maven2.metadata.MavenMetadataReader; + /** * MetadataTools * diff --git a/archiva-modules/archiva-base/archiva-repository-scanner/src/test/java/org/apache/archiva/repository/scanner/mock/ManagedRepositoryContentMock.java b/archiva-modules/archiva-base/archiva-repository-scanner/src/test/java/org/apache/archiva/repository/scanner/mock/ManagedRepositoryContentMock.java index ec32d1d24..e04a08ff3 100644 --- a/archiva-modules/archiva-base/archiva-repository-scanner/src/test/java/org/apache/archiva/repository/scanner/mock/ManagedRepositoryContentMock.java +++ b/archiva-modules/archiva-base/archiva-repository-scanner/src/test/java/org/apache/archiva/repository/scanner/mock/ManagedRepositoryContentMock.java @@ -21,10 +21,15 @@ package org.apache.archiva.repository.scanner.mock; import org.apache.archiva.common.filelock.DefaultFileLockManager; import org.apache.archiva.common.utils.VersionUtil; -import org.apache.archiva.metadata.model.ArtifactMetadata; import org.apache.archiva.metadata.maven.model.MavenArtifactFacet; -import org.apache.archiva.model.ArtifactReference; -import org.apache.archiva.repository.*; +import org.apache.archiva.metadata.model.ArtifactMetadata; +import org.apache.archiva.repository.BaseRepositoryContentLayout; +import org.apache.archiva.repository.ContentAccessException; +import org.apache.archiva.repository.ItemDeleteStatus; +import org.apache.archiva.repository.LayoutException; +import org.apache.archiva.repository.ManagedRepository; +import org.apache.archiva.repository.ManagedRepositoryContent; +import org.apache.archiva.repository.ManagedRepositoryContentLayout; import org.apache.archiva.repository.content.Artifact; import org.apache.archiva.repository.content.BaseDataItemTypes; import org.apache.archiva.repository.content.ContentItem; @@ -38,15 +43,13 @@ import org.apache.archiva.repository.content.base.ArchivaDataItem; import org.apache.archiva.repository.content.base.ArchivaNamespace; import org.apache.archiva.repository.content.base.ArchivaProject; import org.apache.archiva.repository.content.base.ArchivaVersion; -import org.apache.archiva.repository.storage.fs.FilesystemStorage; import org.apache.archiva.repository.storage.StorageAsset; +import org.apache.archiva.repository.storage.fs.FilesystemStorage; import java.io.IOException; import java.nio.file.Path; import java.nio.file.Paths; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.function.Consumer; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -339,8 +342,6 @@ public class ManagedRepositoryContentMock implements BaseRepositoryContentLayout this.repository = repo; } - private Map refs = new HashMap<>(); - public ArtifactMetadata getArtifactForPath( String repoId, String relativePath ) { String[] parts = relativePath.replace( '\\', '/' ).split( "/" ); diff --git a/archiva-modules/archiva-maven/archiva-maven-proxy/src/test/java/org/apache/archiva/proxy/CacheFailuresTransferTest.java b/archiva-modules/archiva-maven/archiva-maven-proxy/src/test/java/org/apache/archiva/proxy/CacheFailuresTransferTest.java index b2fdf14a6..b8d0102c0 100644 --- a/archiva-modules/archiva-maven/archiva-maven-proxy/src/test/java/org/apache/archiva/proxy/CacheFailuresTransferTest.java +++ b/archiva-modules/archiva-maven/archiva-maven-proxy/src/test/java/org/apache/archiva/proxy/CacheFailuresTransferTest.java @@ -20,7 +20,6 @@ package org.apache.archiva.proxy; */ import org.apache.archiva.common.utils.PathUtil; -import org.apache.archiva.model.ArtifactReference; import org.apache.archiva.policies.CachedFailuresPolicy; import org.apache.archiva.policies.ChecksumPolicy; import org.apache.archiva.policies.ReleasesPolicy; diff --git a/archiva-modules/archiva-maven/archiva-maven-proxy/src/test/java/org/apache/archiva/proxy/ChecksumTransferTest.java b/archiva-modules/archiva-maven/archiva-maven-proxy/src/test/java/org/apache/archiva/proxy/ChecksumTransferTest.java index a0d08bbd0..5dd8f0ff9 100644 --- a/archiva-modules/archiva-maven/archiva-maven-proxy/src/test/java/org/apache/archiva/proxy/ChecksumTransferTest.java +++ b/archiva-modules/archiva-maven/archiva-maven-proxy/src/test/java/org/apache/archiva/proxy/ChecksumTransferTest.java @@ -20,7 +20,6 @@ package org.apache.archiva.proxy; */ import org.apache.archiva.common.utils.FileUtils; -import org.apache.archiva.model.ArtifactReference; import org.apache.archiva.policies.CachedFailuresPolicy; import org.apache.archiva.policies.ChecksumPolicy; import org.apache.archiva.policies.ReleasesPolicy; diff --git a/archiva-modules/archiva-maven/archiva-maven-proxy/src/test/java/org/apache/archiva/proxy/HttpProxyTransferTest.java b/archiva-modules/archiva-maven/archiva-maven-proxy/src/test/java/org/apache/archiva/proxy/HttpProxyTransferTest.java index 19eb0812c..bdd34db31 100644 --- a/archiva-modules/archiva-maven/archiva-maven-proxy/src/test/java/org/apache/archiva/proxy/HttpProxyTransferTest.java +++ b/archiva-modules/archiva-maven/archiva-maven-proxy/src/test/java/org/apache/archiva/proxy/HttpProxyTransferTest.java @@ -23,7 +23,6 @@ import org.apache.archiva.configuration.ArchivaConfiguration; import org.apache.archiva.configuration.NetworkProxyConfiguration; import org.apache.archiva.configuration.ProxyConnectorConfiguration; import org.apache.archiva.configuration.RemoteRepositoryConfiguration; -import org.apache.archiva.model.ArtifactReference; import org.apache.archiva.policies.CachedFailuresPolicy; import org.apache.archiva.policies.ChecksumPolicy; import org.apache.archiva.policies.PropagateErrorsDownloadPolicy; @@ -31,7 +30,10 @@ import org.apache.archiva.policies.PropagateErrorsOnUpdateDownloadPolicy; import org.apache.archiva.policies.ReleasesPolicy; import org.apache.archiva.policies.SnapshotsPolicy; import org.apache.archiva.proxy.model.RepositoryProxyHandler; -import org.apache.archiva.repository.*; +import org.apache.archiva.repository.BaseRepositoryContentLayout; +import org.apache.archiva.repository.ManagedRepository; +import org.apache.archiva.repository.ManagedRepositoryContent; +import org.apache.archiva.repository.RepositoryRegistry; import org.apache.archiva.repository.base.BasicManagedRepository; import org.apache.archiva.repository.content.Artifact; import org.apache.archiva.repository.storage.StorageAsset; diff --git a/archiva-modules/archiva-maven/archiva-maven-proxy/src/test/java/org/apache/archiva/proxy/ManagedDefaultTransferTest.java b/archiva-modules/archiva-maven/archiva-maven-proxy/src/test/java/org/apache/archiva/proxy/ManagedDefaultTransferTest.java index 36026da78..3311d3e63 100644 --- a/archiva-modules/archiva-maven/archiva-maven-proxy/src/test/java/org/apache/archiva/proxy/ManagedDefaultTransferTest.java +++ b/archiva-modules/archiva-maven/archiva-maven-proxy/src/test/java/org/apache/archiva/proxy/ManagedDefaultTransferTest.java @@ -19,7 +19,6 @@ package org.apache.archiva.proxy; * under the License. */ -import org.apache.archiva.model.ArtifactReference; import org.apache.archiva.policies.CachedFailuresPolicy; import org.apache.archiva.policies.ChecksumPolicy; import org.apache.archiva.policies.ReleasesPolicy; diff --git a/archiva-modules/archiva-maven/archiva-maven-proxy/src/test/java/org/apache/archiva/proxy/SnapshotTransferTest.java b/archiva-modules/archiva-maven/archiva-maven-proxy/src/test/java/org/apache/archiva/proxy/SnapshotTransferTest.java index de99d95a3..90a944e35 100644 --- a/archiva-modules/archiva-maven/archiva-maven-proxy/src/test/java/org/apache/archiva/proxy/SnapshotTransferTest.java +++ b/archiva-modules/archiva-maven/archiva-maven-proxy/src/test/java/org/apache/archiva/proxy/SnapshotTransferTest.java @@ -19,7 +19,6 @@ package org.apache.archiva.proxy; * under the License. */ -import org.apache.archiva.model.ArtifactReference; import org.apache.archiva.policies.CachedFailuresPolicy; import org.apache.archiva.policies.ChecksumPolicy; import org.apache.archiva.policies.ReleasesPolicy; diff --git a/archiva-modules/archiva-maven/archiva-maven-proxy/src/test/java/org/apache/archiva/repository/mock/ManagedRepositoryContentMock.java b/archiva-modules/archiva-maven/archiva-maven-proxy/src/test/java/org/apache/archiva/repository/mock/ManagedRepositoryContentMock.java index bc506b15d..08852e14e 100644 --- a/archiva-modules/archiva-maven/archiva-maven-proxy/src/test/java/org/apache/archiva/repository/mock/ManagedRepositoryContentMock.java +++ b/archiva-modules/archiva-maven/archiva-maven-proxy/src/test/java/org/apache/archiva/repository/mock/ManagedRepositoryContentMock.java @@ -21,10 +21,15 @@ package org.apache.archiva.repository.mock; import org.apache.archiva.common.filelock.DefaultFileLockManager; import org.apache.archiva.common.utils.VersionUtil; -import org.apache.archiva.metadata.model.ArtifactMetadata; import org.apache.archiva.metadata.maven.model.MavenArtifactFacet; -import org.apache.archiva.model.ArtifactReference; -import org.apache.archiva.repository.*; +import org.apache.archiva.metadata.model.ArtifactMetadata; +import org.apache.archiva.repository.BaseRepositoryContentLayout; +import org.apache.archiva.repository.ContentAccessException; +import org.apache.archiva.repository.ItemDeleteStatus; +import org.apache.archiva.repository.LayoutException; +import org.apache.archiva.repository.ManagedRepository; +import org.apache.archiva.repository.ManagedRepositoryContent; +import org.apache.archiva.repository.ManagedRepositoryContentLayout; import org.apache.archiva.repository.content.Artifact; import org.apache.archiva.repository.content.BaseDataItemTypes; import org.apache.archiva.repository.content.ContentItem; @@ -40,17 +45,15 @@ import org.apache.archiva.repository.content.base.ArchivaDataItem; import org.apache.archiva.repository.content.base.ArchivaNamespace; import org.apache.archiva.repository.content.base.ArchivaProject; import org.apache.archiva.repository.content.base.ArchivaVersion; -import org.apache.archiva.repository.storage.fs.FilesystemStorage; import org.apache.archiva.repository.storage.RepositoryStorage; import org.apache.archiva.repository.storage.StorageAsset; +import org.apache.archiva.repository.storage.fs.FilesystemStorage; import org.springframework.stereotype.Service; import java.io.IOException; import java.nio.file.Path; import java.nio.file.Paths; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.function.Consumer; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -372,8 +375,6 @@ public class ManagedRepositoryContentMock implements BaseRepositoryContentLayout this.repository = repo; } - private Map refs = new HashMap<>(); - public ArtifactMetadata getArtifactForPath( String repoId, String relativePath ) { String[] parts = relativePath.replace( '\\', '/' ).split( "/" ); diff --git a/archiva-modules/archiva-maven/archiva-maven-repository/src/main/java/org/apache/archiva/repository/maven/content/ManagedDefaultRepositoryContent.java b/archiva-modules/archiva-maven/archiva-maven-repository/src/main/java/org/apache/archiva/repository/maven/content/ManagedDefaultRepositoryContent.java index 07affa7c4..231665e8d 100644 --- a/archiva-modules/archiva-maven/archiva-maven-repository/src/main/java/org/apache/archiva/repository/maven/content/ManagedDefaultRepositoryContent.java +++ b/archiva-modules/archiva-maven/archiva-maven-repository/src/main/java/org/apache/archiva/repository/maven/content/ManagedDefaultRepositoryContent.java @@ -23,7 +23,6 @@ import org.apache.archiva.common.utils.FileUtils; import org.apache.archiva.common.utils.VersionUtil; import org.apache.archiva.configuration.FileTypes; import org.apache.archiva.metadata.maven.MavenMetadataReader; -import org.apache.archiva.model.ArtifactReference; import org.apache.archiva.repository.BaseRepositoryContentLayout; import org.apache.archiva.repository.ContentAccessException; import org.apache.archiva.repository.EditableManagedRepository; @@ -57,10 +56,8 @@ import org.apache.commons.lang3.StringUtils; import javax.inject.Inject; import javax.inject.Named; import java.io.IOException; -import java.net.URI; import java.nio.file.Files; import java.nio.file.Path; -import java.nio.file.Paths; import java.util.Arrays; import java.util.Collections; import java.util.List; @@ -1549,75 +1546,6 @@ public class ManagedDefaultRepositoryContent return repository.getId( ); } - /* - * Create the filter for various combinations of classifier and type - */ - private Predicate getChecker( ArtifactReference referenceObject, String extension ) - { - // TODO: Check, if extension is the correct parameter here - // We compare type with extension which works for artifacts like .jar.md5 but may - // be not the best way. - - if ( referenceObject.getClassifier( ) != null && referenceObject.getType( ) != null ) - { - return ( ( ArtifactReference a ) -> - referenceObject.getGroupId( ).equals( a.getGroupId( ) ) - && referenceObject.getArtifactId( ).equals( a.getArtifactId( ) ) - && referenceObject.getVersion( ).equals( a.getVersion( ) ) - && ( ( a.getType( ) == null ) - || referenceObject.getType( ).equals( a.getType( ) ) - || a.getType( ).startsWith( extension ) ) - && referenceObject.getClassifier( ).equals( a.getClassifier( ) ) - ); - } - else if ( referenceObject.getClassifier( ) != null && referenceObject.getType( ) == null ) - { - return ( ( ArtifactReference a ) -> - referenceObject.getGroupId( ).equals( a.getGroupId( ) ) - && referenceObject.getArtifactId( ).equals( a.getArtifactId( ) ) - && referenceObject.getVersion( ).equals( a.getVersion( ) ) - && referenceObject.getClassifier( ).equals( a.getClassifier( ) ) - ); - } - else if ( referenceObject.getClassifier( ) == null && referenceObject.getType( ) != null ) - { - return ( ( ArtifactReference a ) -> - referenceObject.getGroupId( ).equals( a.getGroupId( ) ) - && referenceObject.getArtifactId( ).equals( a.getArtifactId( ) ) - && referenceObject.getVersion( ).equals( a.getVersion( ) ) - && ( ( a.getType( ) == null ) - || referenceObject.getType( ).equals( a.getType( ) ) - || a.getType( ).startsWith( extension ) ) - ); - } - else - { - return ( ( ArtifactReference a ) -> - referenceObject.getGroupId( ).equals( a.getGroupId( ) ) - && referenceObject.getArtifactId( ).equals( a.getArtifactId( ) ) - && referenceObject.getVersion( ).equals( a.getVersion( ) ) - ); - } - - - } - - private String convertUriToPath( URI uri ) - { - if ( uri.getScheme( ) == null ) - { - return Paths.get( uri.getPath( ) ).toString( ); - } - else if ( "file".equals( uri.getScheme( ) ) ) - { - return Paths.get( uri ).toString( ); - } - else - { - return uri.toString( ); - } - } - @Override public ManagedRepository getRepository( ) { diff --git a/archiva-modules/archiva-maven/archiva-maven-repository/src/test/java/org/apache/archiva/repository/maven/content/AbstractRepositoryContentTest.java b/archiva-modules/archiva-maven/archiva-maven-repository/src/test/java/org/apache/archiva/repository/maven/content/AbstractRepositoryContentTest.java index 0a18de76c..8c84dbe23 100644 --- a/archiva-modules/archiva-maven/archiva-maven-repository/src/test/java/org/apache/archiva/repository/maven/content/AbstractRepositoryContentTest.java +++ b/archiva-modules/archiva-maven/archiva-maven-repository/src/test/java/org/apache/archiva/repository/maven/content/AbstractRepositoryContentTest.java @@ -18,19 +18,17 @@ package org.apache.archiva.repository.maven.content; * under the License. */ -import org.apache.archiva.model.ArtifactReference; +import org.apache.archiva.repository.BaseRepositoryContentLayout; +import org.apache.archiva.repository.LayoutException; import org.apache.archiva.repository.ManagedRepositoryContent; import org.apache.archiva.repository.RepositoryContent; -import org.apache.archiva.repository.content.base.ArchivaArtifact; -import org.apache.archiva.repository.maven.AbstractRepositoryLayerTestCase; -import org.apache.archiva.repository.LayoutException; -import org.apache.archiva.repository.BaseRepositoryContentLayout; import org.apache.archiva.repository.content.Artifact; import org.apache.archiva.repository.content.ItemSelector; import org.apache.archiva.repository.content.Namespace; import org.apache.archiva.repository.content.Project; import org.apache.archiva.repository.content.Version; import org.apache.archiva.repository.content.base.ArchivaItemSelector; +import org.apache.archiva.repository.maven.AbstractRepositoryLayerTestCase; import org.apache.commons.lang3.StringUtils; import org.junit.Test; diff --git a/archiva-modules/archiva-maven/archiva-maven-repository/src/test/java/org/apache/archiva/repository/maven/content/ManagedDefaultRepositoryContentTest.java b/archiva-modules/archiva-maven/archiva-maven-repository/src/test/java/org/apache/archiva/repository/maven/content/ManagedDefaultRepositoryContentTest.java index 279a26c5d..48ec82ab0 100644 --- a/archiva-modules/archiva-maven/archiva-maven-repository/src/test/java/org/apache/archiva/repository/maven/content/ManagedDefaultRepositoryContentTest.java +++ b/archiva-modules/archiva-maven/archiva-maven-repository/src/test/java/org/apache/archiva/repository/maven/content/ManagedDefaultRepositoryContentTest.java @@ -25,14 +25,11 @@ import org.apache.archiva.configuration.FileType; import org.apache.archiva.configuration.FileTypes; import org.apache.archiva.metadata.maven.MavenMetadataReader; import org.apache.archiva.metadata.repository.storage.RepositoryPathTranslator; -import org.apache.archiva.model.ArtifactReference; -import org.apache.archiva.model.ProjectReference; -import org.apache.archiva.model.VersionedReference; +import org.apache.archiva.repository.BaseRepositoryContentLayout; import org.apache.archiva.repository.EditableManagedRepository; -import org.apache.archiva.repository.ManagedRepositoryContent; import org.apache.archiva.repository.LayoutException; import org.apache.archiva.repository.ManagedRepository; -import org.apache.archiva.repository.BaseRepositoryContentLayout; +import org.apache.archiva.repository.ManagedRepositoryContent; import org.apache.archiva.repository.RepositoryContent; import org.apache.archiva.repository.content.Artifact; import org.apache.archiva.repository.content.BaseArtifactTypes; diff --git a/archiva-modules/archiva-maven/archiva-maven-repository/src/test/java/org/apache/archiva/repository/maven/content/MavenRepositoryRequestInfoTest.java b/archiva-modules/archiva-maven/archiva-maven-repository/src/test/java/org/apache/archiva/repository/maven/content/MavenRepositoryRequestInfoTest.java index cfd5814d7..759fd134c 100644 --- a/archiva-modules/archiva-maven/archiva-maven-repository/src/test/java/org/apache/archiva/repository/maven/content/MavenRepositoryRequestInfoTest.java +++ b/archiva-modules/archiva-maven/archiva-maven-repository/src/test/java/org/apache/archiva/repository/maven/content/MavenRepositoryRequestInfoTest.java @@ -24,13 +24,12 @@ import org.apache.archiva.configuration.ArchivaConfiguration; import org.apache.archiva.configuration.FileType; import org.apache.archiva.configuration.FileTypes; import org.apache.archiva.metadata.repository.storage.RepositoryPathTranslator; -import org.apache.archiva.repository.ManagedRepositoryContent; -import org.apache.archiva.repository.content.ItemSelector; -import org.apache.archiva.repository.maven.metadata.storage.ArtifactMappingProvider; -import org.apache.archiva.model.ArtifactReference; import org.apache.archiva.repository.LayoutException; +import org.apache.archiva.repository.ManagedRepositoryContent; import org.apache.archiva.repository.RepositoryContentProvider; +import org.apache.archiva.repository.content.ItemSelector; import org.apache.archiva.repository.maven.MavenManagedRepository; +import org.apache.archiva.repository.maven.metadata.storage.ArtifactMappingProvider; import org.apache.archiva.test.utils.ArchivaSpringJUnit4ClassRunner; import org.apache.commons.lang3.StringUtils; import org.junit.Before; diff --git a/archiva-modules/archiva-maven/archiva-maven-repository/src/test/java/org/apache/archiva/repository/maven/content/RemoteDefaultRepositoryContentTest.java b/archiva-modules/archiva-maven/archiva-maven-repository/src/test/java/org/apache/archiva/repository/maven/content/RemoteDefaultRepositoryContentTest.java index 827c8c832..5e49c14a1 100644 --- a/archiva-modules/archiva-maven/archiva-maven-repository/src/test/java/org/apache/archiva/repository/maven/content/RemoteDefaultRepositoryContentTest.java +++ b/archiva-modules/archiva-maven/archiva-maven-repository/src/test/java/org/apache/archiva/repository/maven/content/RemoteDefaultRepositoryContentTest.java @@ -19,12 +19,9 @@ package org.apache.archiva.repository.maven.content; */ import org.apache.archiva.metadata.repository.storage.RepositoryPathTranslator; -import org.apache.archiva.model.ArtifactReference; import org.apache.archiva.repository.LayoutException; -import org.apache.archiva.repository.BaseRepositoryContentLayout; import org.apache.archiva.repository.ManagedRepositoryContent; import org.apache.archiva.repository.RemoteRepository; -import org.apache.archiva.repository.RemoteRepositoryContent; import org.apache.archiva.repository.RepositoryContent; import org.apache.archiva.repository.content.Artifact; import org.apache.archiva.repository.content.ItemSelector; diff --git a/archiva-modules/archiva-scheduler/archiva-scheduler-repository/src/test/java/org/apache/archiva/scheduler/repository/ArchivaRepositoryScanningTaskExecutorPhase1Test.java b/archiva-modules/archiva-scheduler/archiva-scheduler-repository/src/test/java/org/apache/archiva/scheduler/repository/ArchivaRepositoryScanningTaskExecutorPhase1Test.java index c25b33247..64dd2df0b 100644 --- a/archiva-modules/archiva-scheduler/archiva-scheduler-repository/src/test/java/org/apache/archiva/scheduler/repository/ArchivaRepositoryScanningTaskExecutorPhase1Test.java +++ b/archiva-modules/archiva-scheduler/archiva-scheduler-repository/src/test/java/org/apache/archiva/scheduler/repository/ArchivaRepositoryScanningTaskExecutorPhase1Test.java @@ -19,7 +19,6 @@ package org.apache.archiva.scheduler.repository; * under the License. */ -import org.apache.archiva.model.ArtifactReference; import org.apache.archiva.scheduler.repository.model.RepositoryTask; import org.junit.Test; import org.springframework.test.context.ContextConfiguration; diff --git a/archiva-modules/archiva-scheduler/archiva-scheduler-repository/src/test/java/org/apache/archiva/scheduler/repository/ArchivaRepositoryScanningTaskExecutorPhase2Test.java b/archiva-modules/archiva-scheduler/archiva-scheduler-repository/src/test/java/org/apache/archiva/scheduler/repository/ArchivaRepositoryScanningTaskExecutorPhase2Test.java index 2d4feecd1..df054022c 100644 --- a/archiva-modules/archiva-scheduler/archiva-scheduler-repository/src/test/java/org/apache/archiva/scheduler/repository/ArchivaRepositoryScanningTaskExecutorPhase2Test.java +++ b/archiva-modules/archiva-scheduler/archiva-scheduler-repository/src/test/java/org/apache/archiva/scheduler/repository/ArchivaRepositoryScanningTaskExecutorPhase2Test.java @@ -22,7 +22,6 @@ package org.apache.archiva.scheduler.repository; import org.apache.archiva.metadata.repository.MetadataRepositoryException; import org.apache.archiva.metadata.repository.stats.model.DefaultRepositoryStatistics; import org.apache.archiva.metadata.repository.stats.model.RepositoryStatistics; -import org.apache.archiva.model.ArtifactReference; import org.apache.archiva.scheduler.repository.model.RepositoryTask; import org.apache.commons.io.FileUtils; import org.junit.Test; 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 8dc0f1940..2ea3bb389 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 @@ -22,11 +22,9 @@ package org.apache.archiva.scheduler.repository; import org.apache.archiva.consumers.AbstractMonitoredConsumer; import org.apache.archiva.consumers.ConsumerException; import org.apache.archiva.consumers.KnownRepositoryContentConsumer; -import org.apache.archiva.model.ArtifactReference; -import org.apache.archiva.repository.ManagedRepositoryContent; import org.apache.archiva.repository.LayoutException; import org.apache.archiva.repository.ManagedRepository; -import org.apache.archiva.repository.BaseRepositoryContentLayout; +import org.apache.archiva.repository.ManagedRepositoryContent; import org.apache.archiva.repository.RepositoryContentFactory; import org.springframework.stereotype.Service; diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultRepositoriesService.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultRepositoriesService.java index bf10591f1..9fd9723b0 100644 --- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultRepositoriesService.java +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultRepositoriesService.java @@ -25,29 +25,33 @@ import org.apache.archiva.checksum.ChecksumAlgorithm; import org.apache.archiva.checksum.ChecksummedFile; import org.apache.archiva.common.utils.VersionComparator; import org.apache.archiva.common.utils.VersionUtil; -import org.apache.archiva.maven2.model.Artifact; -import org.apache.archiva.metadata.model.ArtifactMetadata; -import org.apache.archiva.metadata.model.facets.AuditEvent; -import org.apache.archiva.metadata.maven.model.MavenArtifactFacet; -import org.apache.archiva.metadata.repository.*; -import org.apache.archiva.model.ArchivaRepositoryMetadata; -import org.apache.archiva.model.ArtifactReference; -import org.apache.archiva.model.VersionedReference; -import org.apache.archiva.redback.authentication.AuthenticationResult; -import org.apache.archiva.redback.authorization.AuthorizationException; import org.apache.archiva.components.cache.Cache; import org.apache.archiva.components.taskqueue.TaskQueueException; +import org.apache.archiva.maven2.model.Artifact; +import org.apache.archiva.metadata.audit.RepositoryListener; +import org.apache.archiva.metadata.maven.model.MavenArtifactFacet; +import org.apache.archiva.metadata.model.ArtifactMetadata; +import org.apache.archiva.metadata.model.facets.AuditEvent; +import org.apache.archiva.metadata.repository.MetadataRepository; +import org.apache.archiva.metadata.repository.MetadataRepositoryException; +import org.apache.archiva.metadata.repository.MetadataResolutionException; +import org.apache.archiva.metadata.repository.MetadataSessionException; +import org.apache.archiva.metadata.repository.RepositorySession; +import org.apache.archiva.metadata.repository.RepositorySessionFactory; +import org.apache.archiva.model.ArchivaRepositoryMetadata; +import org.apache.archiva.redback.authentication.AuthenticationResult; +import org.apache.archiva.redback.authorization.AuthorizationException; import org.apache.archiva.redback.system.DefaultSecuritySession; import org.apache.archiva.redback.system.SecuritySession; import org.apache.archiva.redback.system.SecuritySystem; import org.apache.archiva.redback.users.User; import org.apache.archiva.redback.users.UserManagerException; import org.apache.archiva.redback.users.UserNotFoundException; +import org.apache.archiva.repository.BaseRepositoryContentLayout; import org.apache.archiva.repository.ContentNotFoundException; -import org.apache.archiva.repository.ManagedRepositoryContent; import org.apache.archiva.repository.LayoutException; import org.apache.archiva.repository.ManagedRepository; -import org.apache.archiva.repository.BaseRepositoryContentLayout; +import org.apache.archiva.repository.ManagedRepositoryContent; import org.apache.archiva.repository.RepositoryException; import org.apache.archiva.repository.RepositoryNotFoundException; import org.apache.archiva.repository.RepositoryRegistry; @@ -57,26 +61,25 @@ import org.apache.archiva.repository.content.ItemNotFoundException; import org.apache.archiva.repository.content.ItemSelector; import org.apache.archiva.repository.content.Version; import org.apache.archiva.repository.content.base.ArchivaItemSelector; -import org.apache.archiva.repository.storage.fs.FsStorageUtil; -import org.apache.archiva.repository.storage.RepositoryStorage; -import org.apache.archiva.repository.storage.StorageAsset; -import org.apache.archiva.metadata.audit.RepositoryListener; -import org.apache.archiva.repository.metadata.base.MetadataTools; import org.apache.archiva.repository.metadata.RepositoryMetadataException; +import org.apache.archiva.repository.metadata.base.MetadataTools; import org.apache.archiva.repository.metadata.base.RepositoryMetadataWriter; import org.apache.archiva.repository.scanner.RepositoryScanStatistics; import org.apache.archiva.repository.scanner.RepositoryScanner; import org.apache.archiva.repository.scanner.RepositoryScannerException; import org.apache.archiva.repository.scanner.RepositoryScannerInstance; +import org.apache.archiva.repository.storage.RepositoryStorage; +import org.apache.archiva.repository.storage.StorageAsset; +import org.apache.archiva.repository.storage.fs.FsStorageUtil; import org.apache.archiva.rest.api.model.ArtifactTransferRequest; import org.apache.archiva.rest.api.model.StringList; import org.apache.archiva.rest.api.services.ArchivaRestServiceException; import org.apache.archiva.rest.api.services.RepositoriesService; import org.apache.archiva.scheduler.ArchivaTaskScheduler; -import org.apache.archiva.scheduler.indexing.maven.ArchivaIndexingTaskExecutor; import org.apache.archiva.scheduler.indexing.ArtifactIndexingTask; import org.apache.archiva.scheduler.indexing.DownloadRemoteIndexException; import org.apache.archiva.scheduler.indexing.DownloadRemoteIndexScheduler; +import org.apache.archiva.scheduler.indexing.maven.ArchivaIndexingTaskExecutor; import org.apache.archiva.scheduler.repository.model.RepositoryTask; import org.apache.archiva.security.ArchivaSecurityException; import org.apache.archiva.security.common.ArchivaRoleConstants; @@ -778,13 +781,6 @@ public class DefaultRepositoriesService Version version1 = layout.getVersion( versionSelector ); String path = repository.toPath( version1 ); - ArtifactReference artifactReference = new ArtifactReference(); - artifactReference.setArtifactId( artifact.getArtifactId() ); - artifactReference.setGroupId( artifact.getGroupId() ); - artifactReference.setVersion( artifact.getVersion() ); - artifactReference.setClassifier( artifact.getClassifier() ); - artifactReference.setType( artifact.getType() ); - ArchivaItemSelector selector = ArchivaItemSelector.builder( ) .withNamespace( artifact.getGroupId( ) ) .withProjectId( artifact.getArtifactId( ) ) diff --git a/archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/api/DefaultFileUploadService.java b/archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/api/DefaultFileUploadService.java index 0dd280731..1abf0e3c0 100644 --- a/archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/api/DefaultFileUploadService.java +++ b/archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/api/DefaultFileUploadService.java @@ -31,7 +31,6 @@ import org.apache.archiva.components.taskqueue.TaskQueueException; import org.apache.archiva.configuration.ArchivaConfiguration; import org.apache.archiva.metadata.model.facets.AuditEvent; import org.apache.archiva.model.ArchivaRepositoryMetadata; -import org.apache.archiva.model.ArtifactReference; import org.apache.archiva.model.SnapshotVersion; import org.apache.archiva.repository.ReleaseScheme; import org.apache.archiva.repository.Repository; @@ -517,15 +516,6 @@ public class DefaultFileUploadService } } - private ArtifactReference createArtifactRef(FileMetadata fileMetadata, String groupId, String artifactId, String version) { - ArtifactReference artifactReference = new ArtifactReference(); - artifactReference.setArtifactId(artifactId); - artifactReference.setGroupId(groupId); - artifactReference.setVersion(version); - artifactReference.setClassifier(fileMetadata.getClassifier()); - return artifactReference; - } - private ArchivaRepositoryMetadata getMetadata(StorageAsset metadataFile) throws RepositoryMetadataException { ArchivaRepositoryMetadata metadata = new ArchivaRepositoryMetadata(); 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 b83dcdb61..6d58e106f 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 @@ -35,16 +35,16 @@ import org.apache.archiva.indexer.ArchivaIndexingContext; import org.apache.archiva.indexer.merger.IndexMerger; import org.apache.archiva.indexer.merger.IndexMergerException; import org.apache.archiva.indexer.merger.IndexMergerRequest; +import org.apache.archiva.indexer.merger.TemporaryGroupIndex; import org.apache.archiva.indexer.merger.base.MergedRemoteIndexesTask; import org.apache.archiva.indexer.merger.base.MergedRemoteIndexesTaskRequest; -import org.apache.archiva.indexer.merger.TemporaryGroupIndex; import org.apache.archiva.indexer.search.RepositorySearch; import org.apache.archiva.indexer.search.RepositorySearchException; +import org.apache.archiva.metadata.audit.AuditListener; import org.apache.archiva.metadata.model.facets.AuditEvent; import org.apache.archiva.metadata.repository.storage.RelocationException; import org.apache.archiva.metadata.repository.storage.RepositoryStorage; import org.apache.archiva.model.ArchivaRepositoryMetadata; -import org.apache.archiva.model.ArtifactReference; import org.apache.archiva.policies.ProxyDownloadException; import org.apache.archiva.proxy.ProxyRegistry; import org.apache.archiva.proxy.model.RepositoryProxyHandler; @@ -58,10 +58,10 @@ import org.apache.archiva.redback.policy.MustChangePasswordException; import org.apache.archiva.redback.system.SecuritySession; import org.apache.archiva.redback.users.User; import org.apache.archiva.redback.users.UserManager; -import org.apache.archiva.repository.ManagedRepositoryContent; +import org.apache.archiva.repository.BaseRepositoryContentLayout; import org.apache.archiva.repository.LayoutException; import org.apache.archiva.repository.ManagedRepository; -import org.apache.archiva.repository.BaseRepositoryContentLayout; +import org.apache.archiva.repository.ManagedRepositoryContent; import org.apache.archiva.repository.ReleaseScheme; import org.apache.archiva.repository.RepositoryGroup; import org.apache.archiva.repository.RepositoryRegistry; @@ -69,14 +69,13 @@ import org.apache.archiva.repository.RepositoryRequestInfo; import org.apache.archiva.repository.content.Artifact; import org.apache.archiva.repository.content.ContentItem; import org.apache.archiva.repository.content.ItemSelector; -import org.apache.archiva.repository.storage.fs.FilesystemStorage; -import org.apache.archiva.repository.storage.StorageAsset; -import org.apache.archiva.metadata.audit.AuditListener; import org.apache.archiva.repository.features.IndexCreationFeature; -import org.apache.archiva.repository.metadata.base.MetadataTools; import org.apache.archiva.repository.metadata.RepositoryMetadataException; +import org.apache.archiva.repository.metadata.base.MetadataTools; import org.apache.archiva.repository.metadata.base.RepositoryMetadataMerge; import org.apache.archiva.repository.metadata.base.RepositoryMetadataWriter; +import org.apache.archiva.repository.storage.StorageAsset; +import org.apache.archiva.repository.storage.fs.FilesystemStorage; import org.apache.archiva.scheduler.repository.model.RepositoryArchivaTaskScheduler; import org.apache.archiva.security.ServletAuthenticator; import org.apache.archiva.webdav.util.MimeTypes; diff --git a/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/storage/RepositoryStorage.java b/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/storage/RepositoryStorage.java index 44a4fa764..98e352f05 100644 --- a/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/storage/RepositoryStorage.java +++ b/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/storage/RepositoryStorage.java @@ -19,14 +19,13 @@ package org.apache.archiva.metadata.repository.storage; * under the License. */ +import org.apache.archiva.filter.Filter; import org.apache.archiva.metadata.model.ArtifactMetadata; import org.apache.archiva.metadata.model.ProjectMetadata; import org.apache.archiva.metadata.model.ProjectVersionMetadata; -import org.apache.archiva.filter.Filter; -import org.apache.archiva.model.ArtifactReference; import org.apache.archiva.policies.ProxyDownloadException; -import org.apache.archiva.repository.ManagedRepositoryContent; import org.apache.archiva.repository.ManagedRepository; +import org.apache.archiva.repository.ManagedRepositoryContent; import org.apache.archiva.repository.content.ItemSelector; import org.apache.archiva.xml.XMLException;