mirror of https://github.com/apache/archiva.git
Renaming packages to make them distinct over modules
This commit is contained in:
parent
ff28da65a6
commit
5d90a2102d
|
@ -27,7 +27,7 @@ import org.apache.archiva.consumers.KnownRepositoryContentConsumer;
|
|||
import org.apache.archiva.consumers.RepositoryContentConsumer;
|
||||
import org.apache.archiva.converter.RepositoryConversionException;
|
||||
import org.apache.archiva.converter.legacy.LegacyRepositoryConverter;
|
||||
import org.apache.archiva.repository.BasicManagedRepository;
|
||||
import org.apache.archiva.repository.base.BasicManagedRepository;
|
||||
import org.apache.archiva.repository.scanner.RepositoryScanStatistics;
|
||||
import org.apache.archiva.repository.scanner.RepositoryScanner;
|
||||
import org.apache.archiva.repository.scanner.RepositoryScannerException;
|
||||
|
|
|
@ -22,14 +22,14 @@ package $package;
|
|||
import org.apache.archiva.configuration.ManagedRepositoryConfiguration;
|
||||
import org.apache.archiva.configuration.RemoteRepositoryConfiguration;
|
||||
import org.apache.archiva.configuration.RepositoryGroupConfiguration;
|
||||
import org.apache.archiva.repository.BasicManagedRepository;
|
||||
import org.apache.archiva.repository.BasicRemoteRepository;
|
||||
import org.apache.archiva.repository.base.BasicManagedRepository;
|
||||
import org.apache.archiva.repository.base.BasicRemoteRepository;
|
||||
import org.apache.archiva.repository.EditableManagedRepository;
|
||||
import org.apache.archiva.repository.EditableRemoteRepository;
|
||||
import org.apache.archiva.repository.RepositoryGroup;
|
||||
import org.apache.archiva.repository.EditableRepositoryGroup;
|
||||
import org.apache.archiva.repository.ManagedRepository;
|
||||
import org.apache.archiva.repository.PasswordCredentials;
|
||||
import org.apache.archiva.repository.base.PasswordCredentials;
|
||||
import org.apache.archiva.repository.ReleaseScheme;
|
||||
import org.apache.archiva.repository.RemoteRepository;
|
||||
import org.apache.archiva.repository.RepositoryCredentials;
|
||||
|
|
|
@ -23,7 +23,7 @@ import org.apache.archiva.admin.model.RepositoryAdminException;
|
|||
import org.apache.archiva.admin.model.managed.ManagedRepositoryAdmin;
|
||||
import org.apache.archiva.metadata.repository.MetadataRepository;
|
||||
import org.apache.archiva.metadata.repository.RepositorySessionFactory;
|
||||
import org.apache.archiva.repository.BasicManagedRepository;
|
||||
import org.apache.archiva.repository.base.BasicManagedRepository;
|
||||
import org.apache.archiva.repository.RepositoryException;
|
||||
import org.apache.archiva.repository.RepositoryRegistry;
|
||||
import org.junit.Before;
|
||||
|
|
|
@ -27,14 +27,13 @@ import org.apache.archiva.consumers.KnownRepositoryContentConsumer;
|
|||
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.ManagedRepository;
|
||||
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.metadata.MetadataTools;
|
||||
import org.apache.archiva.repository.metadata.base.MetadataTools;
|
||||
import org.apache.archiva.repository.metadata.RepositoryMetadataException;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
|
|
@ -34,7 +34,7 @@ import org.apache.archiva.repository.ReleaseScheme;
|
|||
import org.apache.archiva.repository.RepositoryException;
|
||||
import org.apache.archiva.repository.RepositoryRegistry;
|
||||
import org.apache.archiva.metadata.audit.RepositoryListener;
|
||||
import org.apache.archiva.repository.metadata.MetadataTools;
|
||||
import org.apache.archiva.repository.metadata.base.MetadataTools;
|
||||
import org.apache.archiva.repository.metadata.RepositoryMetadataException;
|
||||
|
||||
import java.io.IOException;
|
||||
|
|
|
@ -35,7 +35,7 @@ import org.apache.archiva.repository.RepositoryContentFactory;
|
|||
import org.apache.archiva.repository.RepositoryRegistry;
|
||||
import org.apache.archiva.metadata.audit.RepositoryListener;
|
||||
import org.apache.archiva.repository.features.ArtifactCleanupFeature;
|
||||
import org.apache.archiva.repository.metadata.MetadataTools;
|
||||
import org.apache.archiva.repository.metadata.base.MetadataTools;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Scope;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
|
|
@ -4,7 +4,7 @@ import org.apache.archiva.checksum.ChecksumAlgorithm;
|
|||
import org.apache.archiva.checksum.ChecksummedFile;
|
||||
import org.apache.archiva.common.utils.PathUtil;
|
||||
import org.apache.archiva.consumers.KnownRepositoryContentConsumer;
|
||||
import org.apache.archiva.repository.BasicManagedRepository;
|
||||
import org.apache.archiva.repository.base.BasicManagedRepository;
|
||||
import org.apache.archiva.repository.EditableManagedRepository;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.assertj.core.api.Assertions;
|
||||
|
|
|
@ -24,7 +24,7 @@ import org.apache.archiva.metadata.repository.MetadataRepository;
|
|||
import org.apache.archiva.metadata.repository.RepositorySession;
|
||||
import org.apache.archiva.metadata.repository.RepositorySessionFactory;
|
||||
import org.apache.archiva.metadata.repository.storage.maven2.Maven2RepositoryPathTranslator;
|
||||
import org.apache.archiva.repository.BasicManagedRepository;
|
||||
import org.apache.archiva.repository.base.BasicManagedRepository;
|
||||
import org.apache.archiva.repository.ManagedRepositoryContent;
|
||||
import org.apache.archiva.repository.ReleaseScheme;
|
||||
import org.apache.archiva.repository.RepositoryContentProvider;
|
||||
|
|
|
@ -24,12 +24,12 @@ import org.apache.archiva.admin.repository.managed.DefaultManagedRepositoryAdmin
|
|||
import org.apache.archiva.configuration.ArchivaConfiguration;
|
||||
import org.apache.archiva.metadata.model.ArtifactMetadata;
|
||||
import org.apache.archiva.metadata.model.MetadataFacet;
|
||||
import org.apache.archiva.repository.ArchivaRepositoryRegistry;
|
||||
import org.apache.archiva.repository.base.ArchivaRepositoryRegistry;
|
||||
import org.apache.archiva.repository.ManagedRepository;
|
||||
import org.apache.archiva.repository.RepositoryContentFactory;
|
||||
import org.apache.archiva.repository.RepositoryRegistry;
|
||||
import org.apache.archiva.metadata.audit.RepositoryListener;
|
||||
import org.apache.archiva.repository.metadata.MetadataTools;
|
||||
import org.apache.archiva.repository.metadata.base.MetadataTools;
|
||||
import org.custommonkey.xmlunit.XMLAssert;
|
||||
import org.easymock.EasyMock;
|
||||
import org.junit.Before;
|
||||
|
|
|
@ -27,7 +27,7 @@ import org.apache.archiva.consumers.KnownRepositoryContentConsumer;
|
|||
import org.apache.archiva.consumers.functors.ConsumerWantsFilePredicate;
|
||||
import org.apache.archiva.metadata.model.ArtifactMetadata;
|
||||
import org.apache.archiva.metadata.model.MetadataFacet;
|
||||
import org.apache.archiva.repository.ArchivaRepositoryRegistry;
|
||||
import org.apache.archiva.repository.base.ArchivaRepositoryRegistry;
|
||||
import org.apache.archiva.repository.RepositoryRegistry;
|
||||
import org.apache.archiva.repository.features.ArtifactCleanupFeature;
|
||||
import org.custommonkey.xmlunit.XMLAssert;
|
||||
|
|
|
@ -22,13 +22,13 @@ package org.apache.archiva.repository.mock;
|
|||
import org.apache.archiva.configuration.ManagedRepositoryConfiguration;
|
||||
import org.apache.archiva.configuration.RemoteRepositoryConfiguration;
|
||||
import org.apache.archiva.configuration.RepositoryGroupConfiguration;
|
||||
import org.apache.archiva.repository.BasicManagedRepository;
|
||||
import org.apache.archiva.repository.BasicRemoteRepository;
|
||||
import org.apache.archiva.repository.base.BasicManagedRepository;
|
||||
import org.apache.archiva.repository.base.BasicRemoteRepository;
|
||||
import org.apache.archiva.repository.EditableManagedRepository;
|
||||
import org.apache.archiva.repository.EditableRemoteRepository;
|
||||
import org.apache.archiva.repository.EditableRepositoryGroup;
|
||||
import org.apache.archiva.repository.ManagedRepository;
|
||||
import org.apache.archiva.repository.PasswordCredentials;
|
||||
import org.apache.archiva.repository.base.PasswordCredentials;
|
||||
import org.apache.archiva.repository.ReleaseScheme;
|
||||
import org.apache.archiva.repository.RemoteRepository;
|
||||
import org.apache.archiva.repository.RepositoryCredentials;
|
||||
|
|
|
@ -24,8 +24,8 @@ import org.apache.archiva.common.utils.PathUtil;
|
|||
import org.apache.archiva.configuration.ArchivaConfiguration;
|
||||
import org.apache.archiva.configuration.FileTypes;
|
||||
import org.apache.archiva.redback.components.taskqueue.TaskQueueException;
|
||||
import org.apache.archiva.repository.ArchivaRepositoryRegistry;
|
||||
import org.apache.archiva.repository.BasicManagedRepository;
|
||||
import org.apache.archiva.repository.base.ArchivaRepositoryRegistry;
|
||||
import org.apache.archiva.repository.base.BasicManagedRepository;
|
||||
import org.apache.archiva.repository.ReleaseScheme;
|
||||
import org.apache.archiva.scheduler.ArchivaTaskScheduler;
|
||||
import org.apache.archiva.scheduler.indexing.ArtifactIndexingTask;
|
||||
|
|
|
@ -28,7 +28,7 @@ import org.apache.archiva.policies.PolicyUtil;
|
|||
import org.apache.archiva.proxy.model.NetworkProxy;
|
||||
import org.apache.archiva.proxy.model.ProxyConnector;
|
||||
import org.apache.archiva.proxy.model.RepositoryProxyHandler;
|
||||
import org.apache.archiva.repository.ArchivaRepositoryRegistry;
|
||||
import org.apache.archiva.repository.base.ArchivaRepositoryRegistry;
|
||||
import org.apache.archiva.repository.ManagedRepository;
|
||||
import org.apache.archiva.repository.RemoteRepository;
|
||||
import org.apache.archiva.repository.RepositoryType;
|
||||
|
|
|
@ -46,7 +46,7 @@ import org.apache.archiva.repository.ManagedRepository;
|
|||
import org.apache.archiva.repository.RemoteRepository;
|
||||
import org.apache.archiva.repository.RemoteRepositoryContent;
|
||||
import org.apache.archiva.repository.RepositoryType;
|
||||
import org.apache.archiva.repository.metadata.MetadataTools;
|
||||
import org.apache.archiva.repository.metadata.base.MetadataTools;
|
||||
import org.apache.archiva.repository.metadata.RepositoryMetadataException;
|
||||
import org.apache.archiva.repository.storage.FilesystemStorage;
|
||||
import org.apache.archiva.repository.storage.StorageAsset;
|
||||
|
|
|
@ -28,7 +28,7 @@ import org.apache.archiva.configuration.RemoteRepositoryConfiguration;
|
|||
import org.apache.archiva.configuration.RepositoryCheckPath;
|
||||
import org.apache.archiva.indexer.UnsupportedBaseContextException;
|
||||
import org.apache.archiva.metadata.model.facets.AuditEvent;
|
||||
import org.apache.archiva.repository.PasswordCredentials;
|
||||
import org.apache.archiva.repository.base.PasswordCredentials;
|
||||
import org.apache.archiva.repository.RemoteRepository;
|
||||
import org.apache.archiva.repository.RepositoryCredentials;
|
||||
import org.apache.archiva.repository.RepositoryException;
|
||||
|
|
|
@ -20,7 +20,6 @@ package org.apache.archiva.admin.mock;
|
|||
*/
|
||||
|
||||
import org.apache.archiva.common.filelock.DefaultFileLockManager;
|
||||
import org.apache.archiva.common.utils.FileUtils;
|
||||
import org.apache.archiva.common.utils.PathUtil;
|
||||
import org.apache.archiva.configuration.ArchivaConfiguration;
|
||||
import org.apache.archiva.indexer.ArchivaIndexManager;
|
||||
|
@ -35,7 +34,7 @@ import org.apache.archiva.proxy.maven.WagonFactoryRequest;
|
|||
import org.apache.archiva.proxy.model.NetworkProxy;
|
||||
import org.apache.archiva.repository.EditableRepository;
|
||||
import org.apache.archiva.repository.ManagedRepository;
|
||||
import org.apache.archiva.repository.PasswordCredentials;
|
||||
import org.apache.archiva.repository.base.PasswordCredentials;
|
||||
import org.apache.archiva.repository.RemoteRepository;
|
||||
import org.apache.archiva.repository.Repository;
|
||||
import org.apache.archiva.repository.RepositoryType;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
package org.apache.archiva.repository.internal.metadata;
|
||||
package org.apache.archiva.repository.metadata;
|
||||
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
|
@ -1,4 +1,4 @@
|
|||
package org.apache.archiva.indexer.merger;
|
||||
package org.apache.archiva.indexer.merger.base;
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
|
@ -18,7 +18,6 @@ package org.apache.archiva.indexer.merger;
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
import org.apache.archiva.common.utils.FileUtils;
|
||||
import org.apache.archiva.indexer.ArchivaIndexManager;
|
||||
import org.apache.archiva.indexer.ArchivaIndexingContext;
|
||||
import org.apache.archiva.indexer.IndexCreationFailedException;
|
||||
|
@ -38,8 +37,6 @@ import org.springframework.stereotype.Service;
|
|||
|
||||
import javax.inject.Inject;
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
|
@ -1,4 +1,4 @@
|
|||
package org.apache.archiva.indexer.merger;
|
||||
package org.apache.archiva.indexer.merger.base;
|
||||
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
|
@ -19,6 +19,9 @@ package org.apache.archiva.indexer.merger;
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
import org.apache.archiva.indexer.merger.IndexMerger;
|
||||
import org.apache.archiva.indexer.merger.IndexMergerRequest;
|
||||
import org.apache.archiva.indexer.merger.MergedRemoteIndexesScheduler;
|
||||
import org.apache.archiva.repository.ManagedRepository;
|
||||
import org.apache.archiva.repository.RepositoryGroup;
|
||||
import org.apache.archiva.repository.features.IndexCreationFeature;
|
|
@ -1,4 +1,4 @@
|
|||
package org.apache.archiva.indexer.merger;
|
||||
package org.apache.archiva.indexer.merger.base;
|
||||
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
|
@ -20,6 +20,8 @@ package org.apache.archiva.indexer.merger;
|
|||
*/
|
||||
|
||||
import org.apache.archiva.indexer.ArchivaIndexingContext;
|
||||
import org.apache.archiva.indexer.merger.IndexMerger;
|
||||
import org.apache.archiva.indexer.merger.IndexMergerException;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package org.apache.archiva.indexer.merger;
|
||||
package org.apache.archiva.indexer.merger.base;
|
||||
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
|
@ -19,6 +19,9 @@ package org.apache.archiva.indexer.merger;
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
import org.apache.archiva.indexer.merger.IndexMerger;
|
||||
import org.apache.archiva.indexer.merger.IndexMergerRequest;
|
||||
|
||||
/**
|
||||
* @author Olivier Lamy
|
||||
* @since 2.0.0
|
|
@ -1,4 +1,4 @@
|
|||
package org.apache.archiva.indexer.merger;
|
||||
package org.apache.archiva.indexer.merger.base;
|
||||
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
|
@ -1,4 +1,4 @@
|
|||
package org.apache.archiva.indexer.merger;
|
||||
package org.apache.archiva.indexer.merger.base;
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
|
@ -18,6 +18,7 @@ package org.apache.archiva.indexer.merger;
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
import org.apache.archiva.indexer.merger.IndexMerger;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
|
@ -1,4 +1,4 @@
|
|||
package org.apache.archiva.repository;
|
||||
package org.apache.archiva.repository.base;
|
||||
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
|
@ -20,6 +20,10 @@ package org.apache.archiva.repository;
|
|||
*/
|
||||
|
||||
|
||||
import org.apache.archiva.repository.EditableManagedRepository;
|
||||
import org.apache.archiva.repository.ManagedRepositoryContent;
|
||||
import org.apache.archiva.repository.ReleaseScheme;
|
||||
import org.apache.archiva.repository.RepositoryType;
|
||||
import org.apache.archiva.repository.storage.RepositoryStorage;
|
||||
|
||||
import java.util.Collections;
|
||||
|
@ -37,7 +41,7 @@ public abstract class AbstractManagedRepository extends AbstractRepository imple
|
|||
private Set<ReleaseScheme> activeReleaseSchemes = new HashSet<>( );
|
||||
private Set<ReleaseScheme> uActiveReleaseSchemes = Collections.unmodifiableSet( activeReleaseSchemes );
|
||||
|
||||
public AbstractManagedRepository(RepositoryType type, String id, String name, RepositoryStorage storage)
|
||||
public AbstractManagedRepository( RepositoryType type, String id, String name, RepositoryStorage storage)
|
||||
{
|
||||
super( type, id, name, storage );
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
package org.apache.archiva.repository;
|
||||
package org.apache.archiva.repository.base;
|
||||
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
|
@ -20,11 +20,14 @@ package org.apache.archiva.repository;
|
|||
*/
|
||||
|
||||
|
||||
import org.apache.archiva.repository.EditableRemoteRepository;
|
||||
import org.apache.archiva.repository.RemoteRepositoryContent;
|
||||
import org.apache.archiva.repository.RepositoryCredentials;
|
||||
import org.apache.archiva.repository.RepositoryType;
|
||||
import org.apache.archiva.repository.storage.RepositoryStorage;
|
||||
import org.apache.archiva.repository.storage.StorageAsset;
|
||||
|
||||
import java.net.URI;
|
||||
import java.nio.file.Path;
|
||||
import java.time.Duration;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
|
@ -48,7 +51,7 @@ public abstract class AbstractRemoteRepository extends AbstractRepository implem
|
|||
private String proxyId;
|
||||
private RemoteRepositoryContent content;
|
||||
|
||||
public AbstractRemoteRepository(RepositoryType type, String id, String name , RepositoryStorage storage)
|
||||
public AbstractRemoteRepository( RepositoryType type, String id, String name , RepositoryStorage storage)
|
||||
{
|
||||
super( type, id, name, storage );
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
package org.apache.archiva.repository;
|
||||
package org.apache.archiva.repository.base;
|
||||
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
|
@ -28,6 +28,10 @@ import org.apache.archiva.event.EventHandler;
|
|||
import org.apache.archiva.event.EventManager;
|
||||
import org.apache.archiva.event.EventType;
|
||||
import org.apache.archiva.indexer.ArchivaIndexingContext;
|
||||
import org.apache.archiva.repository.EditableRepository;
|
||||
import org.apache.archiva.repository.RepositoryCapabilities;
|
||||
import org.apache.archiva.repository.RepositoryType;
|
||||
import org.apache.archiva.repository.UnsupportedFeatureException;
|
||||
import org.apache.archiva.repository.event.*;
|
||||
import org.apache.archiva.repository.storage.RepositoryStorage;
|
||||
import org.apache.archiva.repository.storage.StorageAsset;
|
|
@ -1,4 +1,4 @@
|
|||
package org.apache.archiva.repository;
|
||||
package org.apache.archiva.repository.base;
|
||||
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
|
@ -19,6 +19,10 @@ package org.apache.archiva.repository;
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
import org.apache.archiva.repository.EditableRepositoryGroup;
|
||||
import org.apache.archiva.repository.ManagedRepository;
|
||||
import org.apache.archiva.repository.RepositoryCapabilities;
|
||||
import org.apache.archiva.repository.RepositoryType;
|
||||
import org.apache.archiva.repository.storage.RepositoryStorage;
|
||||
import org.apache.commons.collections4.map.ListOrderedMap;
|
||||
|
||||
|
@ -31,7 +35,8 @@ import java.util.concurrent.locks.ReentrantReadWriteLock;
|
|||
* Abstract repository group implementation.
|
||||
*
|
||||
*/
|
||||
public class AbstractRepositoryGroup extends AbstractRepository implements EditableRepositoryGroup {
|
||||
public class AbstractRepositoryGroup extends AbstractRepository implements EditableRepositoryGroup
|
||||
{
|
||||
|
||||
private ListOrderedMap<String, ManagedRepository> repositories = new ListOrderedMap<>();
|
||||
|
||||
|
@ -41,7 +46,7 @@ public class AbstractRepositoryGroup extends AbstractRepository implements Edita
|
|||
|
||||
private RepositoryCapabilities capabilities;
|
||||
|
||||
public AbstractRepositoryGroup(RepositoryType type, String id, String name, RepositoryStorage storage) {
|
||||
public AbstractRepositoryGroup( RepositoryType type, String id, String name, RepositoryStorage storage) {
|
||||
super(type, id, name, storage);
|
||||
}
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package org.apache.archiva.repository;
|
||||
package org.apache.archiva.repository.base;
|
||||
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
|
@ -22,10 +22,22 @@ package org.apache.archiva.repository;
|
|||
import org.apache.archiva.configuration.*;
|
||||
import org.apache.archiva.event.Event;
|
||||
import org.apache.archiva.event.EventManager;
|
||||
import org.apache.archiva.event.EventSource;
|
||||
import org.apache.archiva.event.EventType;
|
||||
import org.apache.archiva.indexer.*;
|
||||
import org.apache.archiva.redback.components.registry.RegistryException;
|
||||
import org.apache.archiva.repository.EditableManagedRepository;
|
||||
import org.apache.archiva.repository.EditableRemoteRepository;
|
||||
import org.apache.archiva.repository.EditableRepository;
|
||||
import org.apache.archiva.repository.EditableRepositoryGroup;
|
||||
import org.apache.archiva.repository.ManagedRepository;
|
||||
import org.apache.archiva.repository.RemoteRepository;
|
||||
import org.apache.archiva.repository.Repository;
|
||||
import org.apache.archiva.repository.RepositoryContentFactory;
|
||||
import org.apache.archiva.repository.RepositoryException;
|
||||
import org.apache.archiva.repository.RepositoryGroup;
|
||||
import org.apache.archiva.repository.RepositoryProvider;
|
||||
import org.apache.archiva.repository.RepositoryRegistry;
|
||||
import org.apache.archiva.repository.RepositoryType;
|
||||
import org.apache.archiva.repository.event.*;
|
||||
import org.apache.archiva.event.EventHandler;
|
||||
import org.apache.archiva.repository.features.IndexCreationFeature;
|
||||
|
@ -151,7 +163,8 @@ public class ArchivaRepositoryRegistry implements ConfigurationListener, EventHa
|
|||
return map;
|
||||
}
|
||||
|
||||
private RepositoryProvider getProvider(RepositoryType type) throws RepositoryException {
|
||||
private RepositoryProvider getProvider(RepositoryType type) throws RepositoryException
|
||||
{
|
||||
return repositoryProviders.stream().filter(repositoryProvider -> repositoryProvider.provides().contains(type)).findFirst().orElseThrow(() -> new RepositoryException("Repository type cannot be handled: " + type));
|
||||
}
|
||||
|
||||
|
@ -221,7 +234,7 @@ public class ArchivaRepositoryRegistry implements ConfigurationListener, EventHa
|
|||
feature.setStagingRepository(stageRepo);
|
||||
}
|
||||
}
|
||||
if (repo instanceof EditableManagedRepository) {
|
||||
if (repo instanceof EditableManagedRepository ) {
|
||||
EditableManagedRepository editableRepo = (EditableManagedRepository) repo;
|
||||
if (repo.getContent() == null) {
|
||||
editableRepo.setContent(repositoryContentFactory.getManagedRepositoryContent(repo));
|
||||
|
@ -241,7 +254,7 @@ public class ArchivaRepositoryRegistry implements ConfigurationListener, EventHa
|
|||
return indexManagerFactory.getIndexManager(type);
|
||||
}
|
||||
|
||||
private void createIndexingContext(EditableRepository editableRepo) throws RepositoryException {
|
||||
private void createIndexingContext( EditableRepository editableRepo) throws RepositoryException {
|
||||
if (editableRepo.supportsFeature(IndexCreationFeature.class)) {
|
||||
ArchivaIndexManager idxManager = getIndexManager(editableRepo.getType());
|
||||
try {
|
||||
|
@ -350,7 +363,7 @@ public class ArchivaRepositoryRegistry implements ConfigurationListener, EventHa
|
|||
}
|
||||
|
||||
private void updateRepositoryReferences(RepositoryProvider provider, RepositoryGroup group, RepositoryGroupConfiguration configuration) {
|
||||
if (group instanceof EditableRepositoryGroup) {
|
||||
if (group instanceof EditableRepositoryGroup ) {
|
||||
EditableRepositoryGroup eGroup = (EditableRepositoryGroup) group;
|
||||
eGroup.setRepositories(configuration.getRepositories().stream().map(r -> getManagedRepository(r)).collect(Collectors.toList()));
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
package org.apache.archiva.repository;
|
||||
package org.apache.archiva.repository.base;
|
||||
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
|
@ -21,6 +21,11 @@ package org.apache.archiva.repository;
|
|||
|
||||
import org.apache.archiva.common.filelock.DefaultFileLockManager;
|
||||
import org.apache.archiva.common.filelock.FileLockManager;
|
||||
import org.apache.archiva.repository.ReleaseScheme;
|
||||
import org.apache.archiva.repository.RepositoryCapabilities;
|
||||
import org.apache.archiva.repository.RepositoryRequestInfo;
|
||||
import org.apache.archiva.repository.RepositoryType;
|
||||
import org.apache.archiva.repository.StandardCapabilities;
|
||||
import org.apache.archiva.repository.storage.FilesystemStorage;
|
||||
import org.apache.archiva.repository.storage.RepositoryStorage;
|
||||
import org.apache.archiva.repository.features.ArtifactCleanupFeature;
|
|
@ -1,4 +1,4 @@
|
|||
package org.apache.archiva.repository;
|
||||
package org.apache.archiva.repository.base;
|
||||
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
|
@ -21,6 +21,10 @@ package org.apache.archiva.repository;
|
|||
|
||||
import org.apache.archiva.common.filelock.DefaultFileLockManager;
|
||||
import org.apache.archiva.common.filelock.FileLockManager;
|
||||
import org.apache.archiva.repository.ReleaseScheme;
|
||||
import org.apache.archiva.repository.RepositoryCapabilities;
|
||||
import org.apache.archiva.repository.RepositoryType;
|
||||
import org.apache.archiva.repository.StandardCapabilities;
|
||||
import org.apache.archiva.repository.storage.FilesystemStorage;
|
||||
import org.apache.archiva.repository.storage.RepositoryStorage;
|
||||
import org.apache.archiva.repository.features.IndexCreationFeature;
|
|
@ -1,4 +1,4 @@
|
|||
package org.apache.archiva.repository;
|
||||
package org.apache.archiva.repository.base;
|
||||
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
|
@ -19,6 +19,8 @@ package org.apache.archiva.repository;
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
import org.apache.archiva.repository.RepositoryCredentials;
|
||||
|
||||
/**
|
||||
* Simple credentials that hold username and password
|
||||
*/
|
|
@ -1,4 +1,4 @@
|
|||
package org.apache.archiva.repository.internal.content;
|
||||
package org.apache.archiva.repository.content.base;
|
||||
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
|
@ -1,4 +1,4 @@
|
|||
package org.apache.archiva.repository.internal.content;
|
||||
package org.apache.archiva.repository.content.base;
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
|
@ -1,4 +1,4 @@
|
|||
package org.apache.archiva.repository.internal.metadata;
|
||||
package org.apache.archiva.repository.metadata.base;
|
||||
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
|
@ -41,6 +41,7 @@ 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.metadata.RepositoryMetadataException;
|
||||
import org.apache.archiva.repository.storage.StorageAsset;
|
||||
import org.apache.archiva.xml.XMLException;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
|
@ -1,4 +1,4 @@
|
|||
package org.apache.archiva.repository.internal.metadata;
|
||||
package org.apache.archiva.repository.metadata.base;
|
||||
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
|
@ -23,6 +23,7 @@ import org.apache.archiva.model.ArchivaModelCloner;
|
|||
import org.apache.archiva.model.ArchivaRepositoryMetadata;
|
||||
import org.apache.archiva.model.Plugin;
|
||||
import org.apache.archiva.model.SnapshotVersion;
|
||||
import org.apache.archiva.repository.metadata.RepositoryMetadataException;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import java.util.ArrayList;
|
|
@ -1,4 +1,4 @@
|
|||
package org.apache.archiva.repository.internal.metadata;
|
||||
package org.apache.archiva.repository.metadata.base;
|
||||
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
|
@ -21,6 +21,7 @@ package org.apache.archiva.repository.internal.metadata;
|
|||
|
||||
import org.apache.archiva.model.ArchivaRepositoryMetadata;
|
||||
import org.apache.archiva.model.Plugin;
|
||||
import org.apache.archiva.repository.metadata.RepositoryMetadataException;
|
||||
import org.apache.archiva.repository.storage.StorageAsset;
|
||||
import org.apache.archiva.xml.XMLException;
|
||||
import org.apache.archiva.xml.XMLWriter;
|
|
@ -0,0 +1,519 @@
|
|||
package org.apache.archiva.repository.base;
|
||||
|
||||
/*
|
||||
* 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.configuration.ArchivaConfiguration;
|
||||
import org.apache.archiva.configuration.Configuration;
|
||||
import org.apache.archiva.configuration.ManagedRepositoryConfiguration;
|
||||
import org.apache.archiva.configuration.RemoteRepositoryConfiguration;
|
||||
import org.apache.archiva.repository.ManagedRepository;
|
||||
import org.apache.archiva.repository.ReleaseScheme;
|
||||
import org.apache.archiva.repository.RemoteRepository;
|
||||
import org.apache.archiva.repository.Repository;
|
||||
import org.apache.archiva.repository.RepositoryException;
|
||||
import org.apache.archiva.repository.RepositoryRegistry;
|
||||
import org.apache.archiva.repository.RepositoryType;
|
||||
import org.apache.archiva.test.utils.ArchivaSpringJUnit4ClassRunner;
|
||||
import org.junit.After;
|
||||
import org.junit.AfterClass;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Before;
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import java.io.IOException;
|
||||
import java.net.URISyntaxException;
|
||||
import java.net.URL;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.nio.file.StandardCopyOption;
|
||||
import java.util.Collection;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* Test for RepositoryRegistry
|
||||
*/
|
||||
@RunWith(ArchivaSpringJUnit4ClassRunner.class)
|
||||
@ContextConfiguration(locations = { "classpath*:/META-INF/spring-context.xml", "classpath:/spring-context.xml" })
|
||||
public class ArchivaRepositoryRegistryTest
|
||||
{
|
||||
|
||||
@Inject
|
||||
RepositoryRegistry repositoryRegistry;
|
||||
|
||||
@Inject
|
||||
ArchivaConfiguration archivaConfiguration;
|
||||
|
||||
private static final Path userCfg = Paths.get(System.getProperty( "user.home" ), ".m2/archiva.xml");
|
||||
|
||||
private static Path cfgCopy;
|
||||
private static Path archivaCfg;
|
||||
|
||||
@BeforeClass
|
||||
public static void classSetup() throws IOException, URISyntaxException
|
||||
{
|
||||
URL archivaCfgUri = Thread.currentThread().getContextClassLoader().getResource( "archiva.xml" );
|
||||
if (archivaCfgUri!=null) {
|
||||
archivaCfg = Paths.get(archivaCfgUri.toURI());
|
||||
cfgCopy = Files.createTempFile( "archiva-backup", ".xml" );
|
||||
Files.copy( archivaCfg, cfgCopy, StandardCopyOption.REPLACE_EXISTING);
|
||||
}
|
||||
}
|
||||
|
||||
@AfterClass
|
||||
public static void classTearDown() throws IOException
|
||||
{
|
||||
if (cfgCopy!=null) {
|
||||
Files.deleteIfExists( cfgCopy );
|
||||
}
|
||||
}
|
||||
|
||||
@Before
|
||||
public void setUp( ) throws Exception
|
||||
{
|
||||
assertNotNull( repositoryRegistry );
|
||||
Files.deleteIfExists( userCfg );
|
||||
URL archivaCfgUri = Thread.currentThread().getContextClassLoader().getResource( "archiva.xml" );
|
||||
if (archivaCfgUri!=null) {
|
||||
archivaCfg = Paths.get(archivaCfgUri.toURI());
|
||||
if (Files.exists(cfgCopy))
|
||||
{
|
||||
Files.copy( cfgCopy, archivaCfg , StandardCopyOption.REPLACE_EXISTING);
|
||||
}
|
||||
}
|
||||
archivaConfiguration.reload();
|
||||
repositoryRegistry.reload();
|
||||
}
|
||||
|
||||
@After
|
||||
public void tearDown( ) throws Exception
|
||||
{
|
||||
Files.deleteIfExists( userCfg );
|
||||
if (cfgCopy!=null && Files.exists(cfgCopy)) {
|
||||
Files.copy(cfgCopy, archivaCfg, StandardCopyOption.REPLACE_EXISTING);
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getRepositories( ) throws Exception
|
||||
{
|
||||
Collection<Repository> repos = repositoryRegistry.getRepositories( );
|
||||
assertEquals( 5, repos.size( ) );
|
||||
assertTrue(repos.stream().anyMatch( rep -> rep.getId().equals("internal") ));
|
||||
assertTrue( repos.stream( ).anyMatch( rep -> rep.getId( ).equals( "snapshots") ) );
|
||||
assertTrue(repos.stream().anyMatch( rep -> rep.getId().equals( "central") ));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getManagedRepositories( ) throws Exception
|
||||
{
|
||||
Collection<ManagedRepository> repos = repositoryRegistry.getManagedRepositories();
|
||||
assertEquals( 4, repos.size( ) );
|
||||
assertTrue(repos.stream().anyMatch( rep -> rep.getId().equals("internal") ));
|
||||
assertTrue( repos.stream( ).anyMatch( rep -> rep.getId( ).equals( "snapshots") ) );
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getRemoteRepositories( ) throws Exception
|
||||
{
|
||||
Collection<RemoteRepository> repos = repositoryRegistry.getRemoteRepositories( );
|
||||
assertEquals( 1, repos.size( ) );
|
||||
assertTrue(repos.stream().anyMatch( rep -> rep.getId().equals( "central") ));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getRepository( ) throws Exception
|
||||
{
|
||||
Repository repo = repositoryRegistry.getRepository( "internal" );
|
||||
assertNotNull(repo);
|
||||
assertEquals("internal", repo.getId());
|
||||
assertEquals("Archiva Managed Internal Repository", repo.getName());
|
||||
assertEquals("This is internal repository.", repo.getDescription());
|
||||
assertEquals( "default", repo.getLayout( ) );
|
||||
assertEquals("0 0 * * * ?", repo.getSchedulingDefinition());
|
||||
assertTrue(repo instanceof ManagedRepository);
|
||||
assertTrue( repo.hasIndex( ) );
|
||||
assertTrue(repo.isScanned());
|
||||
Assert.assertEquals( RepositoryType.MAVEN, repo.getType());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getManagedRepository( ) throws Exception
|
||||
{
|
||||
ManagedRepository repo = repositoryRegistry.getManagedRepository( "internal" );
|
||||
assertNotNull(repo);
|
||||
assertEquals("internal", repo.getId());
|
||||
assertEquals("Archiva Managed Internal Repository", repo.getName());
|
||||
assertEquals("This is internal repository.", repo.getDescription());
|
||||
assertEquals( "default", repo.getLayout( ) );
|
||||
assertEquals("0 0 * * * ?", repo.getSchedulingDefinition());
|
||||
assertTrue( repo.hasIndex( ) );
|
||||
assertTrue(repo.isScanned());
|
||||
assertEquals(RepositoryType.MAVEN, repo.getType());
|
||||
assertTrue(repo.getActiveReleaseSchemes().contains( ReleaseScheme.RELEASE));
|
||||
assertFalse( repo.getActiveReleaseSchemes( ).contains( ReleaseScheme.SNAPSHOT ) );
|
||||
assertNotNull(repo.getContent());
|
||||
|
||||
assertNull(repositoryRegistry.getManagedRepository( "xyu" ));
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getRemoteRepository( ) throws Exception
|
||||
{
|
||||
RemoteRepository repo = repositoryRegistry.getRemoteRepository( "central" );
|
||||
assertNotNull(repo);
|
||||
assertEquals("central", repo.getId());
|
||||
assertEquals("Central Repository", repo.getName());
|
||||
assertEquals("", repo.getDescription());
|
||||
assertEquals( "default", repo.getLayout( ) );
|
||||
assertEquals("0 0 08 ? * SUN", repo.getSchedulingDefinition());
|
||||
assertTrue( repo.hasIndex( ) );
|
||||
assertTrue(repo.isScanned());
|
||||
assertEquals(RepositoryType.MAVEN, repo.getType());
|
||||
|
||||
assertEquals(35, repo.getTimeout().getSeconds());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void putManagedRepository( ) throws Exception
|
||||
{
|
||||
BasicManagedRepository managedRepository = BasicManagedRepository.newFilesystemInstance("test001", "Test repo", archivaConfiguration.getRepositoryBaseDir().resolve("test001"));
|
||||
managedRepository.setDescription( managedRepository.getPrimaryLocale(), "This is just a test" );
|
||||
repositoryRegistry.putRepository(managedRepository);
|
||||
|
||||
assertNotNull(managedRepository.getContent());
|
||||
assertEquals(6, repositoryRegistry.getRepositories().size());
|
||||
|
||||
managedRepository = BasicManagedRepository.newFilesystemInstance("central", "Test repo", archivaConfiguration.getRepositoryBaseDir().resolve("central"));
|
||||
managedRepository.setDescription( managedRepository.getPrimaryLocale(), "This is just a test" );
|
||||
ManagedRepository updatedRepo = null;
|
||||
try {
|
||||
repositoryRegistry.putRepository( managedRepository );
|
||||
throw new RuntimeException("Repository exception should be thrown, if there exists a remote repository already with that id");
|
||||
} catch ( RepositoryException e) {
|
||||
// OK
|
||||
}
|
||||
managedRepository = BasicManagedRepository.newFilesystemInstance("internal", "Test repo", archivaConfiguration.getRepositoryBaseDir().resolve("internal"));
|
||||
managedRepository.setDescription( managedRepository.getPrimaryLocale(), "This is just a test" );
|
||||
updatedRepo = repositoryRegistry.putRepository( managedRepository );
|
||||
|
||||
assertTrue(updatedRepo==managedRepository);
|
||||
assertNotNull(managedRepository.getContent());
|
||||
assertEquals(6, repositoryRegistry.getRepositories().size());
|
||||
ManagedRepository managedRepository1 = repositoryRegistry.getManagedRepository( "internal" );
|
||||
assertEquals("Test repo", managedRepository1.getName());
|
||||
assertTrue(managedRepository1==managedRepository);
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void putManagedRepositoryFromConfig( ) throws Exception
|
||||
{
|
||||
ManagedRepositoryConfiguration cfg = new ManagedRepositoryConfiguration();
|
||||
cfg.setId("test002");
|
||||
cfg.setName("This is test 002");
|
||||
ManagedRepository repo = repositoryRegistry.putRepository( cfg );
|
||||
assertNotNull(repo);
|
||||
assertEquals("test002", repo.getId());
|
||||
assertEquals("This is test 002", repo.getName());
|
||||
assertNotNull(repo.getContent());
|
||||
archivaConfiguration.reload();
|
||||
Collection<ManagedRepository> repos = repositoryRegistry.getManagedRepositories();
|
||||
assertEquals(5, repos.size());
|
||||
|
||||
ManagedRepository internalRepo = repositoryRegistry.getManagedRepository( "internal" );
|
||||
cfg = new ManagedRepositoryConfiguration();
|
||||
cfg.setId("internal");
|
||||
cfg.setName("This is internal test 002");
|
||||
repo = repositoryRegistry.putRepository( cfg );
|
||||
assertTrue(internalRepo==repo);
|
||||
assertEquals("This is internal test 002",repo.getName());
|
||||
assertEquals(5, repositoryRegistry.getManagedRepositories().size());
|
||||
|
||||
repositoryRegistry.reload();
|
||||
assertEquals(5, repositoryRegistry.getManagedRepositories().size());
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void putManagedRepositoryFromConfigWithoutSave( ) throws Exception
|
||||
{
|
||||
Configuration configuration = archivaConfiguration.getConfiguration();
|
||||
ManagedRepositoryConfiguration cfg = new ManagedRepositoryConfiguration();
|
||||
cfg.setId("test002");
|
||||
cfg.setName("This is test 002");
|
||||
ManagedRepository repo = repositoryRegistry.putRepository( cfg, configuration );
|
||||
assertNotNull(repo);
|
||||
assertEquals("test002", repo.getId());
|
||||
assertEquals("This is test 002", repo.getName());
|
||||
assertNotNull(repo.getContent());
|
||||
archivaConfiguration.reload();
|
||||
assertEquals(3, archivaConfiguration.getConfiguration().getManagedRepositories().size());
|
||||
Collection<ManagedRepository> repos = repositoryRegistry.getManagedRepositories();
|
||||
assertEquals(5, repos.size());
|
||||
|
||||
ManagedRepository internalRepo = repositoryRegistry.getManagedRepository( "internal" );
|
||||
cfg = new ManagedRepositoryConfiguration();
|
||||
cfg.setId("internal");
|
||||
cfg.setName("This is internal test 002");
|
||||
repo = repositoryRegistry.putRepository( cfg, configuration );
|
||||
assertTrue(internalRepo==repo);
|
||||
assertEquals("This is internal test 002",repo.getName());
|
||||
assertEquals(5, repositoryRegistry.getManagedRepositories().size());
|
||||
|
||||
repositoryRegistry.reload();
|
||||
assertEquals(4, repositoryRegistry.getManagedRepositories().size());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void putRemoteRepository( ) throws Exception
|
||||
{
|
||||
BasicRemoteRepository remoteRepository = BasicRemoteRepository.newFilesystemInstance( "test001", "Test repo", archivaConfiguration.getRemoteRepositoryBaseDir() );
|
||||
remoteRepository.setDescription( remoteRepository.getPrimaryLocale(), "This is just a test" );
|
||||
RemoteRepository newRepo = repositoryRegistry.putRepository(remoteRepository);
|
||||
|
||||
assertTrue(remoteRepository==newRepo);
|
||||
assertNotNull(remoteRepository.getContent());
|
||||
assertEquals(6, repositoryRegistry.getRepositories().size());
|
||||
|
||||
remoteRepository = BasicRemoteRepository.newFilesystemInstance( "internal", "Test repo", archivaConfiguration.getRemoteRepositoryBaseDir() );
|
||||
remoteRepository.setDescription( remoteRepository.getPrimaryLocale(), "This is just a test" );
|
||||
RemoteRepository updatedRepo = null;
|
||||
try
|
||||
{
|
||||
updatedRepo = repositoryRegistry.putRepository( remoteRepository );
|
||||
throw new RuntimeException("Should throw repository exception, if repository exists already and is not the same type.");
|
||||
} catch (RepositoryException e) {
|
||||
// OK
|
||||
}
|
||||
|
||||
remoteRepository = BasicRemoteRepository.newFilesystemInstance( "central", "Test repo", archivaConfiguration.getRemoteRepositoryBaseDir() );
|
||||
remoteRepository.setDescription( remoteRepository.getPrimaryLocale(), "This is just a test" );
|
||||
updatedRepo = repositoryRegistry.putRepository( remoteRepository );
|
||||
|
||||
assertTrue(updatedRepo==remoteRepository);
|
||||
assertNotNull(remoteRepository.getContent());
|
||||
assertEquals(6, repositoryRegistry.getRepositories().size());
|
||||
RemoteRepository remoteRepository1 = repositoryRegistry.getRemoteRepository( "central" );
|
||||
assertEquals("Test repo", remoteRepository1.getName());
|
||||
assertTrue(remoteRepository1==remoteRepository);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void putRemoteRepositoryFromConfig( ) throws Exception
|
||||
{
|
||||
RemoteRepositoryConfiguration cfg = new RemoteRepositoryConfiguration();
|
||||
cfg.setId("test002");
|
||||
cfg.setName("This is test 002");
|
||||
RemoteRepository repo = repositoryRegistry.putRepository( cfg );
|
||||
assertNotNull(repo);
|
||||
assertEquals("test002", repo.getId());
|
||||
assertEquals("This is test 002", repo.getName());
|
||||
assertNotNull(repo.getContent());
|
||||
archivaConfiguration.reload();
|
||||
Collection<RemoteRepository> repos = repositoryRegistry.getRemoteRepositories();
|
||||
assertEquals(2, repos.size());
|
||||
|
||||
RemoteRepository internalRepo = repositoryRegistry.getRemoteRepository( "central" );
|
||||
cfg = new RemoteRepositoryConfiguration();
|
||||
cfg.setId("central");
|
||||
cfg.setName("This is central test 002");
|
||||
repo = repositoryRegistry.putRepository( cfg );
|
||||
assertTrue(internalRepo==repo);
|
||||
assertEquals("This is central test 002",repo.getName());
|
||||
assertEquals(2, repositoryRegistry.getRemoteRepositories().size());
|
||||
|
||||
repositoryRegistry.reload();
|
||||
assertEquals(2, repositoryRegistry.getRemoteRepositories().size());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void putRemoteRepositoryFromConfigWithoutSave( ) throws Exception
|
||||
{
|
||||
Configuration configuration = archivaConfiguration.getConfiguration();
|
||||
RemoteRepositoryConfiguration cfg = new RemoteRepositoryConfiguration();
|
||||
cfg.setId("test002");
|
||||
cfg.setName("This is test 002");
|
||||
RemoteRepository repo = repositoryRegistry.putRepository( cfg, configuration );
|
||||
assertNotNull(repo);
|
||||
assertEquals("test002", repo.getId());
|
||||
assertEquals("This is test 002", repo.getName());
|
||||
assertNotNull(repo.getContent());
|
||||
archivaConfiguration.reload();
|
||||
assertEquals(1, archivaConfiguration.getConfiguration().getRemoteRepositories().size());
|
||||
Collection<RemoteRepository> repos = repositoryRegistry.getRemoteRepositories();
|
||||
assertEquals(2, repos.size());
|
||||
|
||||
RemoteRepository internalRepo = repositoryRegistry.getRemoteRepository( "central" );
|
||||
cfg = new RemoteRepositoryConfiguration();
|
||||
cfg.setId("central");
|
||||
cfg.setName("This is central test 002");
|
||||
repo = repositoryRegistry.putRepository( cfg, configuration );
|
||||
assertTrue(internalRepo==repo);
|
||||
assertEquals("This is central test 002",repo.getName());
|
||||
assertEquals(2, repositoryRegistry.getRemoteRepositories().size());
|
||||
|
||||
repositoryRegistry.reload();
|
||||
assertEquals(1, repositoryRegistry.getRemoteRepositories().size());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void removeRepository( ) throws Exception
|
||||
{
|
||||
assertEquals(5, repositoryRegistry.getRepositories().size());
|
||||
Repository repo = repositoryRegistry.getRepository( "snapshots" );
|
||||
repositoryRegistry.removeRepository( repo );
|
||||
assertEquals(4, repositoryRegistry.getRepositories().size());
|
||||
assertTrue( repositoryRegistry.getRepositories( ).stream( ).noneMatch( rep -> rep.getId( ).equals( "snapshots" ) ) );
|
||||
archivaConfiguration.reload();
|
||||
repositoryRegistry.reload();
|
||||
assertEquals(4, repositoryRegistry.getRepositories().size());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void removeManagedRepository( ) throws Exception
|
||||
{
|
||||
|
||||
assertEquals(4, repositoryRegistry.getManagedRepositories().size());
|
||||
ManagedRepository repo = repositoryRegistry.getManagedRepository( "snapshots" );
|
||||
repositoryRegistry.removeRepository( repo );
|
||||
assertEquals(3, repositoryRegistry.getManagedRepositories().size());
|
||||
assertTrue( repositoryRegistry.getManagedRepositories( ).stream( ).noneMatch( rep -> rep.getId( ).equals( "snapshots" ) ) );
|
||||
archivaConfiguration.reload();
|
||||
repositoryRegistry.reload();
|
||||
assertEquals(3, repositoryRegistry.getManagedRepositories().size());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void removeManagedRepositoryWithoutSave( ) throws Exception
|
||||
{
|
||||
Configuration configuration = archivaConfiguration.getConfiguration();
|
||||
assertEquals(4, repositoryRegistry.getManagedRepositories().size());
|
||||
ManagedRepository repo = repositoryRegistry.getManagedRepository( "snapshots" );
|
||||
repositoryRegistry.removeRepository( repo, configuration );
|
||||
assertEquals(3, repositoryRegistry.getManagedRepositories().size());
|
||||
assertTrue( repositoryRegistry.getManagedRepositories( ).stream( ).noneMatch( rep -> rep.getId( ).equals( "snapshots" ) ) );
|
||||
archivaConfiguration.reload();
|
||||
repositoryRegistry.reload();
|
||||
assertEquals(4, repositoryRegistry.getManagedRepositories().size());
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void removeRemoteRepository( ) throws Exception
|
||||
{
|
||||
assertEquals(1, repositoryRegistry.getRemoteRepositories().size());
|
||||
RemoteRepository repo = repositoryRegistry.getRemoteRepository( "central" );
|
||||
repositoryRegistry.removeRepository( repo );
|
||||
assertEquals(0, repositoryRegistry.getRemoteRepositories().size());
|
||||
assertTrue( repositoryRegistry.getRemoteRepositories( ).stream( ).noneMatch( rep -> rep.getId( ).equals( "central" ) ) );
|
||||
archivaConfiguration.reload();
|
||||
repositoryRegistry.reload();
|
||||
assertEquals(0, repositoryRegistry.getRemoteRepositories().size());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void removeRemoteRepositoryWithoutSave( ) throws Exception
|
||||
{
|
||||
Configuration configuration = archivaConfiguration.getConfiguration();
|
||||
assertEquals(1, repositoryRegistry.getRemoteRepositories().size());
|
||||
RemoteRepository repo = repositoryRegistry.getRemoteRepository( "central" );
|
||||
repositoryRegistry.removeRepository( repo, configuration );
|
||||
assertEquals(0, repositoryRegistry.getRemoteRepositories().size());
|
||||
assertTrue( repositoryRegistry.getRemoteRepositories( ).stream( ).noneMatch( rep -> rep.getId( ).equals( "central" ) ) );
|
||||
archivaConfiguration.reload();
|
||||
repositoryRegistry.reload();
|
||||
assertEquals(1, repositoryRegistry.getRemoteRepositories().size());
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void cloneManagedRepo( ) throws Exception
|
||||
{
|
||||
ManagedRepository managedRepository = repositoryRegistry.getManagedRepository( "internal" );
|
||||
|
||||
try
|
||||
{
|
||||
repositoryRegistry.clone(managedRepository, "snapshots");
|
||||
throw new RuntimeException("RepositoryRegistry exception should be thrown if id exists already.");
|
||||
}
|
||||
catch ( RepositoryException e )
|
||||
{
|
||||
// OK
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
repositoryRegistry.clone(managedRepository, "central");
|
||||
throw new RuntimeException("RepositoryRegistry exception should be thrown if id exists already.");
|
||||
}
|
||||
catch ( RepositoryException e )
|
||||
{
|
||||
// OK
|
||||
}
|
||||
|
||||
ManagedRepository clone = repositoryRegistry.clone( managedRepository, "newinternal" );
|
||||
assertNotNull(clone);
|
||||
assertNull(clone.getContent());
|
||||
assertEquals("Archiva Managed Internal Repository", clone.getName());
|
||||
assertFalse(managedRepository==clone);
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void cloneRemoteRepo( ) throws Exception
|
||||
{
|
||||
RemoteRepository remoteRepository = repositoryRegistry.getRemoteRepository( "central" );
|
||||
|
||||
try
|
||||
{
|
||||
repositoryRegistry.clone(remoteRepository, "snapshots");
|
||||
throw new RuntimeException("RepositoryRegistry exception should be thrown if id exists already.");
|
||||
}
|
||||
catch ( RepositoryException e )
|
||||
{
|
||||
// OK
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
repositoryRegistry.clone(remoteRepository, "central");
|
||||
throw new RuntimeException("RepositoryRegistry exception should be thrown if id exists already.");
|
||||
}
|
||||
catch ( RepositoryException e )
|
||||
{
|
||||
// OK
|
||||
}
|
||||
|
||||
RemoteRepository clone = repositoryRegistry.clone( remoteRepository, "newCentral" );
|
||||
assertNotNull(clone);
|
||||
assertNull(clone.getContent());
|
||||
assertEquals("Central Repository", clone.getName());
|
||||
assertFalse(remoteRepository==clone);
|
||||
|
||||
}
|
||||
|
||||
}
|
|
@ -28,6 +28,9 @@ import org.apache.archiva.repository.features.ArtifactCleanupFeature;
|
|||
import org.apache.archiva.repository.features.IndexCreationFeature;
|
||||
import org.apache.archiva.repository.features.RemoteIndexFeature;
|
||||
import org.apache.archiva.repository.features.StagingRepositoryFeature;
|
||||
import org.apache.archiva.repository.base.BasicManagedRepository;
|
||||
import org.apache.archiva.repository.base.BasicRemoteRepository;
|
||||
import org.apache.archiva.repository.base.PasswordCredentials;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.io.IOException;
|
||||
|
|
|
@ -23,9 +23,8 @@ import junit.framework.TestCase;
|
|||
import org.apache.archiva.configuration.ArchivaConfiguration;
|
||||
import org.apache.archiva.consumers.InvalidRepositoryContentConsumer;
|
||||
import org.apache.archiva.consumers.KnownRepositoryContentConsumer;
|
||||
import org.apache.archiva.consumers.RepositoryContentConsumer;
|
||||
import org.apache.archiva.repository.BasicManagedRepository;
|
||||
import org.apache.archiva.repository.BasicRemoteRepository;
|
||||
import org.apache.archiva.repository.base.BasicManagedRepository;
|
||||
import org.apache.archiva.repository.base.BasicRemoteRepository;
|
||||
import org.apache.archiva.repository.ManagedRepository;
|
||||
import org.apache.archiva.repository.RemoteRepository;
|
||||
import org.apache.archiva.test.utils.ArchivaSpringJUnit4ClassRunner;
|
||||
|
|
|
@ -24,8 +24,8 @@ import org.apache.archiva.common.filelock.DefaultFileLockManager;
|
|||
import org.apache.archiva.common.filelock.FileLockManager;
|
||||
import org.apache.archiva.consumers.InvalidRepositoryContentConsumer;
|
||||
import org.apache.archiva.consumers.KnownRepositoryContentConsumer;
|
||||
import org.apache.archiva.repository.BasicManagedRepository;
|
||||
import org.apache.archiva.repository.BasicRemoteRepository;
|
||||
import org.apache.archiva.repository.base.BasicManagedRepository;
|
||||
import org.apache.archiva.repository.base.BasicRemoteRepository;
|
||||
import org.apache.archiva.repository.EditableManagedRepository;
|
||||
import org.apache.archiva.repository.EditableRemoteRepository;
|
||||
import org.apache.archiva.repository.ManagedRepository;
|
||||
|
|
|
@ -27,7 +27,7 @@ import org.apache.archiva.configuration.FileTypes;
|
|||
import org.apache.archiva.consumers.InvalidRepositoryContentConsumer;
|
||||
import org.apache.archiva.consumers.KnownRepositoryContentConsumer;
|
||||
import org.apache.archiva.converter.RepositoryConversionException;
|
||||
import org.apache.archiva.repository.BasicManagedRepository;
|
||||
import org.apache.archiva.repository.base.BasicManagedRepository;
|
||||
import org.apache.archiva.repository.storage.FilesystemStorage;
|
||||
import org.apache.archiva.repository.content.maven2.ManagedDefaultRepositoryContent;
|
||||
import org.apache.archiva.repository.scanner.RepositoryScanner;
|
||||
|
|
|
@ -19,7 +19,6 @@ package org.apache.archiva.indexer.maven;
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
import org.apache.archiva.common.utils.FileUtils;
|
||||
import org.apache.archiva.common.utils.PathUtil;
|
||||
import org.apache.archiva.configuration.ArchivaConfiguration;
|
||||
import org.apache.archiva.indexer.ArchivaIndexManager;
|
||||
|
@ -34,7 +33,7 @@ import org.apache.archiva.proxy.maven.WagonFactoryRequest;
|
|||
import org.apache.archiva.proxy.model.NetworkProxy;
|
||||
import org.apache.archiva.repository.EditableRepository;
|
||||
import org.apache.archiva.repository.ManagedRepository;
|
||||
import org.apache.archiva.repository.PasswordCredentials;
|
||||
import org.apache.archiva.repository.base.PasswordCredentials;
|
||||
import org.apache.archiva.repository.RemoteRepository;
|
||||
import org.apache.archiva.repository.Repository;
|
||||
import org.apache.archiva.repository.RepositoryType;
|
||||
|
|
|
@ -22,7 +22,7 @@ package org.apache.archiva.indexer.maven;
|
|||
import org.apache.archiva.common.utils.FileUtils;
|
||||
import org.apache.archiva.indexer.ArchivaIndexingContext;
|
||||
import org.apache.archiva.indexer.IndexCreationFailedException;
|
||||
import org.apache.archiva.repository.ArchivaRepositoryRegistry;
|
||||
import org.apache.archiva.repository.base.ArchivaRepositoryRegistry;
|
||||
import org.apache.archiva.repository.RepositoryType;
|
||||
import org.apache.archiva.repository.features.IndexCreationFeature;
|
||||
import org.apache.archiva.repository.features.RemoteIndexFeature;
|
||||
|
|
|
@ -29,7 +29,7 @@ import org.apache.archiva.configuration.ManagedRepositoryConfiguration;
|
|||
import org.apache.archiva.indexer.ArchivaIndexingContext;
|
||||
import org.apache.archiva.indexer.search.SearchResultHit;
|
||||
import org.apache.archiva.indexer.search.SearchResults;
|
||||
import org.apache.archiva.repository.ArchivaRepositoryRegistry;
|
||||
import org.apache.archiva.repository.base.ArchivaRepositoryRegistry;
|
||||
import org.apache.archiva.repository.Repository;
|
||||
import org.apache.archiva.repository.features.IndexCreationFeature;
|
||||
import org.apache.archiva.test.utils.ArchivaSpringJUnit4ClassRunner;
|
||||
|
|
|
@ -22,7 +22,7 @@ package org.apache.archiva.indexer.maven.search;
|
|||
import org.apache.archiva.indexer.search.SearchFields;
|
||||
import org.apache.archiva.indexer.search.SearchResultHit;
|
||||
import org.apache.archiva.indexer.search.SearchResults;
|
||||
import org.apache.archiva.repository.ArchivaRepositoryRegistry;
|
||||
import org.apache.archiva.repository.base.ArchivaRepositoryRegistry;
|
||||
import org.easymock.EasyMock;
|
||||
import org.junit.After;
|
||||
import org.junit.Test;
|
||||
|
|
|
@ -23,7 +23,7 @@ import org.apache.archiva.indexer.search.SearchResultHit;
|
|||
import org.apache.archiva.indexer.search.SearchResultLimits;
|
||||
import org.apache.archiva.indexer.search.SearchResults;
|
||||
import org.apache.archiva.indexer.util.SearchUtil;
|
||||
import org.apache.archiva.repository.ArchivaRepositoryRegistry;
|
||||
import org.apache.archiva.repository.base.ArchivaRepositoryRegistry;
|
||||
import org.apache.archiva.test.utils.ArchivaSpringJUnit4ClassRunner;
|
||||
import org.junit.After;
|
||||
import org.junit.Test;
|
||||
|
|
|
@ -19,7 +19,6 @@ package org.apache.archiva.proxy.maven;
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
import org.apache.archiva.configuration.NetworkProxyConfiguration;
|
||||
import org.apache.archiva.model.RepositoryURL;
|
||||
import org.apache.archiva.proxy.DefaultRepositoryProxyHandler;
|
||||
import org.apache.archiva.proxy.NotFoundException;
|
||||
|
@ -29,6 +28,7 @@ import org.apache.archiva.proxy.model.NetworkProxy;
|
|||
import org.apache.archiva.proxy.model.ProxyConnector;
|
||||
import org.apache.archiva.proxy.model.RepositoryProxyHandler;
|
||||
import org.apache.archiva.repository.*;
|
||||
import org.apache.archiva.repository.base.PasswordCredentials;
|
||||
import org.apache.archiva.repository.storage.StorageAsset;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.maven.wagon.ConnectionException;
|
||||
|
@ -322,7 +322,7 @@ public class MavenRepositoryProxyHandler extends DefaultRepositoryProxyHandler {
|
|||
String username = "";
|
||||
String password = "";
|
||||
RepositoryCredentials repCred = remoteRepository.getLoginCredentials();
|
||||
if (repCred != null && repCred instanceof PasswordCredentials) {
|
||||
if (repCred != null && repCred instanceof PasswordCredentials ) {
|
||||
PasswordCredentials pwdCred = (PasswordCredentials) repCred;
|
||||
username = pwdCred.getUsername();
|
||||
password = pwdCred.getPassword() == null ? "" : new String(pwdCred.getPassword());
|
||||
|
|
|
@ -24,6 +24,7 @@ import org.apache.archiva.configuration.*;
|
|||
import org.apache.archiva.policies.*;
|
||||
import org.apache.archiva.proxy.model.RepositoryProxyHandler;
|
||||
import org.apache.archiva.repository.*;
|
||||
import org.apache.archiva.repository.base.BasicManagedRepository;
|
||||
import org.apache.archiva.repository.storage.StorageAsset;
|
||||
import org.apache.archiva.test.utils.ArchivaSpringJUnit4ClassRunner;
|
||||
import org.apache.maven.wagon.Wagon;
|
||||
|
|
|
@ -30,11 +30,9 @@ import org.apache.archiva.policies.PropagateErrorsDownloadPolicy;
|
|||
import org.apache.archiva.policies.PropagateErrorsOnUpdateDownloadPolicy;
|
||||
import org.apache.archiva.policies.ReleasesPolicy;
|
||||
import org.apache.archiva.policies.SnapshotsPolicy;
|
||||
import org.apache.archiva.proxy.maven.DefaultWagonFactory;
|
||||
import org.apache.archiva.proxy.maven.WagonFactory;
|
||||
import org.apache.archiva.proxy.maven.WagonFactoryRequest;
|
||||
import org.apache.archiva.proxy.model.RepositoryProxyHandler;
|
||||
import org.apache.archiva.repository.*;
|
||||
import org.apache.archiva.repository.base.BasicManagedRepository;
|
||||
import org.apache.archiva.repository.storage.StorageAsset;
|
||||
import org.apache.archiva.test.utils.ArchivaSpringJUnit4ClassRunner;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
|
|
|
@ -32,9 +32,9 @@ import org.apache.archiva.policies.CachedFailuresPolicy;
|
|||
import org.apache.archiva.policies.ChecksumPolicy;
|
||||
import org.apache.archiva.policies.ReleasesPolicy;
|
||||
import org.apache.archiva.policies.SnapshotsPolicy;
|
||||
import org.apache.archiva.repository.metadata.MetadataTools;
|
||||
import org.apache.archiva.repository.metadata.base.MetadataTools;
|
||||
import org.apache.archiva.repository.metadata.RepositoryMetadataException;
|
||||
import org.apache.archiva.repository.metadata.RepositoryMetadataWriter;
|
||||
import org.apache.archiva.repository.metadata.base.RepositoryMetadataWriter;
|
||||
import org.apache.archiva.repository.storage.FilesystemStorage;
|
||||
import org.apache.archiva.repository.storage.StorageAsset;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
|
|
@ -22,13 +22,13 @@ package org.apache.archiva.repository.mock;
|
|||
import org.apache.archiva.configuration.ManagedRepositoryConfiguration;
|
||||
import org.apache.archiva.configuration.RemoteRepositoryConfiguration;
|
||||
import org.apache.archiva.configuration.RepositoryGroupConfiguration;
|
||||
import org.apache.archiva.repository.BasicManagedRepository;
|
||||
import org.apache.archiva.repository.BasicRemoteRepository;
|
||||
import org.apache.archiva.repository.base.BasicManagedRepository;
|
||||
import org.apache.archiva.repository.base.BasicRemoteRepository;
|
||||
import org.apache.archiva.repository.EditableManagedRepository;
|
||||
import org.apache.archiva.repository.EditableRemoteRepository;
|
||||
import org.apache.archiva.repository.EditableRepositoryGroup;
|
||||
import org.apache.archiva.repository.ManagedRepository;
|
||||
import org.apache.archiva.repository.PasswordCredentials;
|
||||
import org.apache.archiva.repository.base.PasswordCredentials;
|
||||
import org.apache.archiva.repository.ReleaseScheme;
|
||||
import org.apache.archiva.repository.RemoteRepository;
|
||||
import org.apache.archiva.repository.RepositoryCredentials;
|
||||
|
|
|
@ -57,11 +57,11 @@
|
|||
|
||||
<alias name="repositoryProxyHandler#test" alias="repositoryProxyHandler#maven"/>
|
||||
|
||||
<bean name="metadataTools#default" class="org.apache.archiva.repository.metadata.MetadataTools">
|
||||
<bean name="metadataTools#default" class="org.apache.archiva.repository.metadata.base.MetadataTools">
|
||||
<property name="configuration" ref="archivaConfiguration#mock"/>
|
||||
</bean>
|
||||
|
||||
<bean name="metadataTools#mocked" class="org.apache.archiva.repository.metadata.MetadataTools">
|
||||
<bean name="metadataTools#mocked" class="org.apache.archiva.repository.metadata.base.MetadataTools">
|
||||
<property name="configuration" ref="archivaConfiguration#mock"/>
|
||||
</bean>
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ import org.apache.archiva.repository.ManagedRepository;
|
|||
import org.apache.archiva.repository.RemoteRepository;
|
||||
import org.apache.archiva.repository.RepositoryRegistry;
|
||||
import org.apache.archiva.repository.maven2.MavenSystemManager;
|
||||
import org.apache.archiva.repository.metadata.MetadataTools;
|
||||
import org.apache.archiva.repository.metadata.base.MetadataTools;
|
||||
import org.apache.archiva.repository.storage.StorageAsset;
|
||||
import org.apache.archiva.xml.XMLException;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
|
|
@ -23,7 +23,7 @@ import org.apache.archiva.model.ArtifactReference;
|
|||
import org.apache.archiva.repository.*;
|
||||
import org.apache.archiva.repository.content.PathParser;
|
||||
import org.apache.archiva.repository.features.RepositoryFeature;
|
||||
import org.apache.archiva.repository.metadata.MetadataTools;
|
||||
import org.apache.archiva.repository.metadata.base.MetadataTools;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
/**
|
||||
|
|
|
@ -21,9 +21,9 @@ package org.apache.archiva.repository.maven2;
|
|||
|
||||
import org.apache.archiva.common.filelock.DefaultFileLockManager;
|
||||
import org.apache.archiva.common.filelock.FileLockManager;
|
||||
import org.apache.archiva.common.utils.PathUtil;
|
||||
import org.apache.archiva.indexer.ArchivaIndexingContext;
|
||||
import org.apache.archiva.repository.*;
|
||||
import org.apache.archiva.repository.base.AbstractManagedRepository;
|
||||
import org.apache.archiva.repository.storage.FilesystemStorage;
|
||||
import org.apache.archiva.repository.content.maven2.MavenRepositoryRequestInfo;
|
||||
import org.apache.archiva.repository.features.ArtifactCleanupFeature;
|
||||
|
@ -34,8 +34,6 @@ import org.slf4j.Logger;
|
|||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.URI;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.util.Locale;
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@ package org.apache.archiva.repository.maven2;
|
|||
|
||||
import org.apache.archiva.common.filelock.DefaultFileLockManager;
|
||||
import org.apache.archiva.common.filelock.FileLockManager;
|
||||
import org.apache.archiva.repository.AbstractRemoteRepository;
|
||||
import org.apache.archiva.repository.base.AbstractRemoteRepository;
|
||||
import org.apache.archiva.repository.ReleaseScheme;
|
||||
import org.apache.archiva.repository.RemoteRepository;
|
||||
import org.apache.archiva.repository.RepositoryCapabilities;
|
||||
|
|
|
@ -22,6 +22,7 @@ package org.apache.archiva.repository.maven2;
|
|||
import org.apache.archiva.common.filelock.DefaultFileLockManager;
|
||||
import org.apache.archiva.common.filelock.FileLockManager;
|
||||
import org.apache.archiva.repository.*;
|
||||
import org.apache.archiva.repository.base.AbstractRepositoryGroup;
|
||||
import org.apache.archiva.repository.storage.FilesystemStorage;
|
||||
import org.apache.archiva.repository.features.IndexCreationFeature;
|
||||
import org.slf4j.Logger;
|
||||
|
|
|
@ -27,6 +27,8 @@ import org.apache.archiva.repository.features.ArtifactCleanupFeature;
|
|||
import org.apache.archiva.repository.features.IndexCreationFeature;
|
||||
import org.apache.archiva.repository.features.RemoteIndexFeature;
|
||||
import org.apache.archiva.repository.features.StagingRepositoryFeature;
|
||||
import org.apache.archiva.repository.base.BasicManagedRepository;
|
||||
import org.apache.archiva.repository.base.PasswordCredentials;
|
||||
import org.apache.archiva.repository.storage.FilesystemStorage;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.slf4j.Logger;
|
||||
|
@ -374,7 +376,7 @@ public class MavenRepositoryProvider implements RepositoryProvider {
|
|||
|
||||
@Override
|
||||
public ManagedRepositoryConfiguration getManagedConfiguration(ManagedRepository managedRepository) throws RepositoryException {
|
||||
if (!(managedRepository instanceof MavenManagedRepository || managedRepository instanceof BasicManagedRepository)) {
|
||||
if (!(managedRepository instanceof MavenManagedRepository || managedRepository instanceof BasicManagedRepository )) {
|
||||
log.error("Wrong remote repository type " + managedRepository.getClass().getName());
|
||||
throw new RepositoryException("The given repository type cannot be handled by the maven provider: " + managedRepository.getClass().getName());
|
||||
}
|
||||
|
|
|
@ -37,7 +37,7 @@ import org.apache.archiva.model.ArchivaRepositoryMetadata;
|
|||
import org.apache.archiva.repository.RepositoryException;
|
||||
import org.apache.archiva.repository.RepositoryType;
|
||||
import org.apache.archiva.repository.metadata.RepositoryMetadataException;
|
||||
import org.apache.archiva.repository.metadata.RepositoryMetadataWriter;
|
||||
import org.apache.archiva.repository.metadata.base.RepositoryMetadataWriter;
|
||||
import org.apache.archiva.repository.storage.FilesystemAsset;
|
||||
import org.apache.archiva.repository.storage.FilesystemStorage;
|
||||
import org.apache.archiva.repository.storage.StorageAsset;
|
||||
|
|
|
@ -19,6 +19,8 @@ package org.apache.archiva.repository;
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
import org.apache.archiva.repository.base.ArchivaRepositoryRegistry;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.TreeMap;
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ import org.apache.archiva.proxy.maven.WagonFactoryRequest;
|
|||
import org.apache.archiva.proxy.model.NetworkProxy;
|
||||
import org.apache.archiva.repository.EditableRepository;
|
||||
import org.apache.archiva.repository.ManagedRepository;
|
||||
import org.apache.archiva.repository.PasswordCredentials;
|
||||
import org.apache.archiva.repository.base.PasswordCredentials;
|
||||
import org.apache.archiva.repository.RemoteRepository;
|
||||
import org.apache.archiva.repository.Repository;
|
||||
import org.apache.archiva.repository.RepositoryType;
|
||||
|
|
|
@ -19,7 +19,6 @@ package org.apache.archiva.repository.maven2;
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
import org.apache.archiva.common.filelock.DefaultFileLockManager;
|
||||
import org.apache.archiva.common.utils.FileUtils;
|
||||
import org.apache.archiva.configuration.ArchivaRuntimeConfiguration;
|
||||
import org.apache.archiva.configuration.ManagedRepositoryConfiguration;
|
||||
|
@ -27,11 +26,11 @@ import org.apache.archiva.configuration.RemoteRepositoryConfiguration;
|
|||
import org.apache.archiva.configuration.RepositoryGroupConfiguration;
|
||||
import org.apache.archiva.metadata.repository.storage.maven2.conf.MockConfiguration;
|
||||
import org.apache.archiva.repository.*;
|
||||
import org.apache.archiva.repository.content.maven2.MavenContentProvider;
|
||||
import org.apache.archiva.repository.features.ArtifactCleanupFeature;
|
||||
import org.apache.archiva.repository.features.IndexCreationFeature;
|
||||
import org.apache.archiva.repository.features.RemoteIndexFeature;
|
||||
import org.apache.archiva.repository.features.StagingRepositoryFeature;
|
||||
import org.apache.archiva.repository.base.PasswordCredentials;
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
@ -47,7 +46,6 @@ import java.time.Period;
|
|||
import java.time.temporal.ChronoUnit;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
@ -188,7 +186,7 @@ public class MavenRepositoryProviderTest
|
|||
assertEquals(50, mr.getTimeout().get( ChronoUnit.SECONDS ));
|
||||
assertTrue(mr.isScanned());
|
||||
assertNotNull(mr.getLoginCredentials());
|
||||
assertTrue(mr.getLoginCredentials() instanceof PasswordCredentials);
|
||||
assertTrue(mr.getLoginCredentials() instanceof PasswordCredentials );
|
||||
PasswordCredentials creds = (PasswordCredentials) mr.getLoginCredentials();
|
||||
assertEquals("testuser001", creds.getUsername());
|
||||
assertEquals("pwd0000abc", new String(creds.getPassword()));
|
||||
|
|
|
@ -33,6 +33,7 @@ import org.apache.archiva.repository.LayoutException;
|
|||
import org.apache.archiva.repository.ManagedRepositoryContent;
|
||||
import org.apache.archiva.repository.RemoteRepositoryContent;
|
||||
import org.apache.archiva.repository.RepositoryContentProvider;
|
||||
import org.apache.archiva.repository.metadata.base.MetadataTools;
|
||||
import org.apache.archiva.repository.maven2.MavenManagedRepository;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
|
|
@ -21,6 +21,7 @@ package org.apache.archiva.repository.metadata;
|
|||
|
||||
import junit.framework.TestCase;
|
||||
import org.apache.archiva.model.ArchivaRepositoryMetadata;
|
||||
import org.apache.archiva.repository.metadata.base.RepositoryMetadataWriter;
|
||||
import org.apache.archiva.test.utils.ArchivaBlockJUnit4ClassRunner;
|
||||
import org.custommonkey.xmlunit.XMLAssert;
|
||||
import org.junit.Test;
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
|
||||
<bean name="archivaConfiguration#mock" class="org.apache.archiva.metadata.repository.storage.maven2.conf.MockConfiguration"/>
|
||||
<alias name="archivaConfiguration#mock" alias="archivaConfiguration#default"/>
|
||||
<bean name="metadataTools#test" class="org.apache.archiva.repository.metadata.MetadataTools">
|
||||
<bean name="metadataTools#test" class="org.apache.archiva.repository.metadata.base.MetadataTools">
|
||||
<property name="configuration" ref="archivaConfiguration#mock"/>
|
||||
</bean>
|
||||
</beans>
|
|
@ -51,7 +51,7 @@
|
|||
</property>
|
||||
</bean>
|
||||
|
||||
<bean name="metadataTools#default" class="org.apache.archiva.repository.metadata.MetadataTools">
|
||||
<bean name="metadataTools#default" class="org.apache.archiva.repository.metadata.base.MetadataTools">
|
||||
<property name="configuration" ref="archivaConfiguration#default"/>
|
||||
</bean>
|
||||
|
||||
|
|
|
@ -52,7 +52,7 @@
|
|||
</property>
|
||||
</bean>
|
||||
|
||||
<bean name="metadataTools#default" class="org.apache.archiva.repository.metadata.MetadataTools">
|
||||
<bean name="metadataTools#default" class="org.apache.archiva.repository.metadata.base.MetadataTools">
|
||||
<property name="configuration" ref="archivaConfiguration#default"/>
|
||||
</bean>
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ package org.apache.archiva.scheduler.indexing.maven;
|
|||
import org.apache.archiva.proxy.maven.WagonFactory;
|
||||
import org.apache.archiva.proxy.maven.WagonFactoryRequest;
|
||||
import org.apache.archiva.proxy.model.NetworkProxy;
|
||||
import org.apache.archiva.repository.PasswordCredentials;
|
||||
import org.apache.archiva.repository.base.PasswordCredentials;
|
||||
import org.apache.archiva.repository.RemoteRepository;
|
||||
import org.apache.archiva.repository.RepositoryException;
|
||||
import org.apache.archiva.repository.RepositoryType;
|
||||
|
|
|
@ -22,8 +22,8 @@ package org.apache.archiva.scheduler.indexing.maven;
|
|||
import junit.framework.TestCase;
|
||||
import org.apache.archiva.indexer.ArchivaIndexingContext;
|
||||
import org.apache.archiva.indexer.UnsupportedBaseContextException;
|
||||
import org.apache.archiva.repository.ArchivaRepositoryRegistry;
|
||||
import org.apache.archiva.repository.BasicManagedRepository;
|
||||
import org.apache.archiva.repository.base.ArchivaRepositoryRegistry;
|
||||
import org.apache.archiva.repository.base.BasicManagedRepository;
|
||||
import org.apache.archiva.repository.ManagedRepository;
|
||||
import org.apache.archiva.repository.ReleaseScheme;
|
||||
import org.apache.archiva.repository.storage.StorageAsset;
|
||||
|
|
|
@ -34,7 +34,7 @@ import org.apache.archiva.proxy.maven.WagonFactoryRequest;
|
|||
import org.apache.archiva.proxy.model.NetworkProxy;
|
||||
import org.apache.archiva.repository.EditableRepository;
|
||||
import org.apache.archiva.repository.ManagedRepository;
|
||||
import org.apache.archiva.repository.PasswordCredentials;
|
||||
import org.apache.archiva.repository.base.PasswordCredentials;
|
||||
import org.apache.archiva.repository.RemoteRepository;
|
||||
import org.apache.archiva.repository.Repository;
|
||||
import org.apache.archiva.repository.RepositoryType;
|
||||
|
|
|
@ -42,7 +42,7 @@ import org.apache.archiva.repository.ManagedRepositoryContent;
|
|||
import org.apache.archiva.repository.ReleaseScheme;
|
||||
import org.apache.archiva.repository.RepositoryException;
|
||||
import org.apache.archiva.repository.RepositoryNotFoundException;
|
||||
import org.apache.archiva.repository.metadata.MetadataTools;
|
||||
import org.apache.archiva.repository.metadata.base.MetadataTools;
|
||||
import org.apache.archiva.repository.storage.StorageAsset;
|
||||
import org.apache.archiva.repository.storage.StorageUtil;
|
||||
import org.apache.archiva.rest.api.model.*;
|
||||
|
|
|
@ -54,9 +54,9 @@ import org.apache.archiva.repository.storage.RepositoryStorage;
|
|||
import org.apache.archiva.repository.storage.StorageAsset;
|
||||
import org.apache.archiva.repository.storage.StorageUtil;
|
||||
import org.apache.archiva.metadata.audit.RepositoryListener;
|
||||
import org.apache.archiva.repository.metadata.MetadataTools;
|
||||
import org.apache.archiva.repository.metadata.base.MetadataTools;
|
||||
import org.apache.archiva.repository.metadata.RepositoryMetadataException;
|
||||
import org.apache.archiva.repository.metadata.RepositoryMetadataWriter;
|
||||
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;
|
||||
|
|
|
@ -27,8 +27,8 @@ import org.apache.archiva.metadata.model.ArtifactMetadata;
|
|||
import org.apache.archiva.metadata.repository.MetadataRepository;
|
||||
import org.apache.archiva.metadata.repository.RepositorySession;
|
||||
import org.apache.archiva.metadata.repository.RepositorySessionFactory;
|
||||
import org.apache.archiva.repository.ArchivaRepositoryRegistry;
|
||||
import org.apache.archiva.repository.BasicManagedRepository;
|
||||
import org.apache.archiva.repository.base.ArchivaRepositoryRegistry;
|
||||
import org.apache.archiva.repository.base.BasicManagedRepository;
|
||||
import org.apache.archiva.repository.Repository;
|
||||
import org.apache.archiva.repository.RepositoryRegistry;
|
||||
import org.apache.archiva.repository.storage.FilesystemStorage;
|
||||
|
|
|
@ -38,10 +38,10 @@ import org.apache.archiva.model.SnapshotVersion;
|
|||
import org.apache.archiva.redback.components.taskqueue.TaskQueueException;
|
||||
import org.apache.archiva.repository.RepositoryException;
|
||||
import org.apache.archiva.repository.RepositoryNotFoundException;
|
||||
import org.apache.archiva.repository.content.ArtifactUtil;
|
||||
import org.apache.archiva.repository.metadata.MetadataTools;
|
||||
import org.apache.archiva.repository.content.base.ArtifactUtil;
|
||||
import org.apache.archiva.repository.metadata.base.MetadataTools;
|
||||
import org.apache.archiva.repository.metadata.RepositoryMetadataException;
|
||||
import org.apache.archiva.repository.metadata.RepositoryMetadataWriter;
|
||||
import org.apache.archiva.repository.metadata.base.RepositoryMetadataWriter;
|
||||
import org.apache.archiva.repository.storage.StorageAsset;
|
||||
import org.apache.archiva.rest.api.services.ArchivaRestServiceException;
|
||||
import org.apache.archiva.rest.services.AbstractRestService;
|
||||
|
@ -76,7 +76,6 @@ import java.text.DateFormat;
|
|||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.CopyOnWriteArrayList;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
|
@ -23,7 +23,7 @@ package org.apache.archiva.web.rss;
|
|||
import junit.framework.TestCase;
|
||||
import org.apache.archiva.common.filelock.DefaultFileLockManager;
|
||||
import org.apache.archiva.configuration.ArchivaConfiguration;
|
||||
import org.apache.archiva.repository.BasicManagedRepository;
|
||||
import org.apache.archiva.repository.base.BasicManagedRepository;
|
||||
import org.apache.archiva.repository.RepositoryRegistry;
|
||||
import org.apache.archiva.repository.storage.FilesystemStorage;
|
||||
import org.apache.archiva.test.utils.ArchivaSpringJUnit4ClassRunner;
|
||||
|
|
|
@ -35,8 +35,8 @@ 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.MergedRemoteIndexesTask;
|
||||
import org.apache.archiva.indexer.merger.MergedRemoteIndexesTaskRequest;
|
||||
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;
|
||||
|
@ -70,10 +70,10 @@ import org.apache.archiva.repository.storage.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.MetadataTools;
|
||||
import org.apache.archiva.repository.metadata.base.MetadataTools;
|
||||
import org.apache.archiva.repository.metadata.RepositoryMetadataException;
|
||||
import org.apache.archiva.repository.metadata.RepositoryMetadataMerge;
|
||||
import org.apache.archiva.repository.metadata.RepositoryMetadataWriter;
|
||||
import org.apache.archiva.repository.metadata.base.RepositoryMetadataMerge;
|
||||
import org.apache.archiva.repository.metadata.base.RepositoryMetadataWriter;
|
||||
import org.apache.archiva.scheduler.repository.model.RepositoryArchivaTaskScheduler;
|
||||
import org.apache.archiva.security.ServletAuthenticator;
|
||||
import org.apache.archiva.webdav.util.MimeTypes;
|
||||
|
|
|
@ -24,7 +24,7 @@ import org.apache.archiva.configuration.ArchivaConfiguration;
|
|||
import org.apache.archiva.configuration.ConfigurationEvent;
|
||||
import org.apache.archiva.configuration.ConfigurationListener;
|
||||
import org.apache.archiva.redback.integration.filter.authentication.HttpAuthenticator;
|
||||
import org.apache.archiva.repository.ArchivaRepositoryRegistry;
|
||||
import org.apache.archiva.repository.base.ArchivaRepositoryRegistry;
|
||||
import org.apache.archiva.repository.ManagedRepository;
|
||||
import org.apache.archiva.repository.RepositoryRegistry;
|
||||
import org.apache.archiva.security.ServletAuthenticator;
|
||||
|
|
|
@ -27,7 +27,7 @@ import org.apache.archiva.configuration.Configuration;
|
|||
import org.apache.archiva.configuration.ManagedRepositoryConfiguration;
|
||||
import org.apache.archiva.configuration.RemoteRepositoryConfiguration;
|
||||
import org.apache.archiva.indexer.ArchivaIndexingContext;
|
||||
import org.apache.archiva.repository.ArchivaRepositoryRegistry;
|
||||
import org.apache.archiva.repository.base.ArchivaRepositoryRegistry;
|
||||
import org.apache.archiva.repository.ManagedRepository;
|
||||
import org.apache.archiva.repository.RepositoryType;
|
||||
import org.apache.archiva.test.utils.ArchivaSpringJUnit4ClassRunner;
|
||||
|
|
|
@ -28,7 +28,7 @@ import org.apache.archiva.metadata.repository.MetadataRepository;
|
|||
import org.apache.archiva.metadata.repository.RepositorySession;
|
||||
import org.apache.archiva.metadata.repository.RepositorySessionFactory;
|
||||
import org.apache.archiva.metadata.repository.storage.RepositoryPathTranslator;
|
||||
import org.apache.archiva.repository.BasicManagedRepository;
|
||||
import org.apache.archiva.repository.base.BasicManagedRepository;
|
||||
import org.apache.archiva.test.utils.ArchivaSpringJUnit4ClassRunner;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
|
14
pom.xml
14
pom.xml
|
@ -1833,7 +1833,19 @@
|
|||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>license-maven-plugin</artifactId>
|
||||
<version>2.0.0</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>aggregate-download-licenses</id>
|
||||
<goals>
|
||||
<goal>aggregate-download-licenses</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
<pluginManagement>
|
||||
<plugins>
|
||||
|
|
Loading…
Reference in New Issue