Search in sources :

Example 6 with BasicManagedRepository

use of org.apache.archiva.repository.BasicManagedRepository in project archiva by apache.

the class ArchivaIndexingTaskExecutorTest method setUp.

@Before
@Override
public void setUp() throws Exception {
    super.setUp();
    Path baseDir = Paths.get(System.getProperty("basedir"), "target/test-classes").toAbsolutePath();
    BasicManagedRepository repositoryConfig = new BasicManagedRepository("test-repo", "Test Repository", baseDir);
    Path repoLocation = baseDir.resolve("test-repo");
    repositoryConfig.setLocation(repoLocation.toUri());
    repositoryConfig.setLayout("default");
    repositoryConfig.setScanned(true);
    repositoryConfig.addActiveReleaseScheme(ReleaseScheme.RELEASE);
    repositoryConfig.removeActiveReleaseScheme(ReleaseScheme.SNAPSHOT);
    repositoryRegistry.putRepository(repositoryConfig);
    repo = repositoryRegistry.getManagedRepository(repositoryConfig.getId());
}
Also used : Path(java.nio.file.Path) BasicManagedRepository(org.apache.archiva.repository.BasicManagedRepository) Before(org.junit.Before)

Example 7 with BasicManagedRepository

use of org.apache.archiva.repository.BasicManagedRepository in project archiva by apache.

the class RepositoryContentConsumersTest method createRepository.

protected ManagedRepository createRepository(String id, String name, Path location) {
    BasicManagedRepository repo = new BasicManagedRepository(id, name, location.getParent());
    repo.setLocation(location.toAbsolutePath().toUri());
    return repo;
}
Also used : BasicManagedRepository(org.apache.archiva.repository.BasicManagedRepository)

Example 8 with BasicManagedRepository

use of org.apache.archiva.repository.BasicManagedRepository in project archiva by apache.

the class RepositoryProviderMock method createManagedInstance.

@Override
public ManagedRepository createManagedInstance(ManagedRepositoryConfiguration configuration) throws RepositoryException {
    BasicManagedRepository managedRepository = new BasicManagedRepository(configuration.getId(), configuration.getName(), Paths.get("target/repositories"));
    updateManagedInstance(managedRepository, configuration);
    return managedRepository;
}
Also used : BasicManagedRepository(org.apache.archiva.repository.BasicManagedRepository)

Example 9 with BasicManagedRepository

use of org.apache.archiva.repository.BasicManagedRepository in project archiva by apache.

the class RepositoryProviderMock method createStagingInstance.

@Override
public ManagedRepository createStagingInstance(ManagedRepositoryConfiguration configuration) throws RepositoryException {
    String id = configuration.getId() + StagingRepositoryFeature.STAGING_REPO_POSTFIX;
    BasicManagedRepository managedRepository = new BasicManagedRepository(id, configuration.getName(), Paths.get("target/repositories"));
    updateManagedInstance(managedRepository, configuration);
    managedRepository.getFeature(StagingRepositoryFeature.class).get().setStageRepoNeeded(false);
    return managedRepository;
}
Also used : BasicManagedRepository(org.apache.archiva.repository.BasicManagedRepository)

Example 10 with BasicManagedRepository

use of org.apache.archiva.repository.BasicManagedRepository in project archiva by apache.

the class NexusIndexerConsumerTest method setUp.

@Override
@Before
public void setUp() throws Exception {
    super.setUp();
    scheduler = new ArchivaTaskSchedulerStub();
    ArchivaConfiguration configuration = applicationContext.getBean(ArchivaConfiguration.class);
    FileTypes filetypes = applicationContext.getBean(FileTypes.class);
    nexusIndexerConsumer = new NexusIndexerConsumer(scheduler, configuration, filetypes, indexCreators, managedRepositoryAdmin);
    // initialize to set the file types to be processed
    nexusIndexerConsumer.initialize();
    repositoryConfig = new BasicManagedRepository("test-repo", "Test Repository", Paths.get("target/test-classes"));
    repositoryConfig.setLocation(new URI("target/test-classes/test-repo"));
    repositoryConfig.setLayout("default");
    repositoryConfig.setScanned(true);
    repositoryConfig.addActiveReleaseScheme(ReleaseScheme.RELEASE);
    repositoryConfig.removeActiveReleaseScheme(ReleaseScheme.SNAPSHOT);
    repositoryRegistry.putRepository(repositoryConfig);
}
Also used : BasicManagedRepository(org.apache.archiva.repository.BasicManagedRepository) FileTypes(org.apache.archiva.configuration.FileTypes) URI(java.net.URI) ArchivaConfiguration(org.apache.archiva.configuration.ArchivaConfiguration) Before(org.junit.Before)

Aggregations

BasicManagedRepository (org.apache.archiva.repository.BasicManagedRepository)15 Path (java.nio.file.Path)4 Before (org.junit.Before)4 KnownRepositoryContentConsumer (org.apache.archiva.consumers.KnownRepositoryContentConsumer)3 URI (java.net.URI)2 ArrayList (java.util.ArrayList)2 InvalidRepositoryContentConsumer (org.apache.archiva.consumers.InvalidRepositoryContentConsumer)2 ArtifactCleanupFeature (org.apache.archiva.repository.features.ArtifactCleanupFeature)2 RepositoryScannerException (org.apache.archiva.repository.scanner.RepositoryScannerException)2 ArchivaConfiguration (org.apache.archiva.configuration.ArchivaConfiguration)1 FileTypes (org.apache.archiva.configuration.FileTypes)1 ManagedRepositoryConfiguration (org.apache.archiva.configuration.ManagedRepositoryConfiguration)1 RepositoryConversionException (org.apache.archiva.converter.RepositoryConversionException)1 MetadataRepository (org.apache.archiva.metadata.repository.MetadataRepository)1 RepositorySession (org.apache.archiva.metadata.repository.RepositorySession)1 RepositorySessionFactory (org.apache.archiva.metadata.repository.RepositorySessionFactory)1 RepositoryException (org.apache.archiva.repository.RepositoryException)1 IndexCreationFeature (org.apache.archiva.repository.features.IndexCreationFeature)1 StagingRepositoryFeature (org.apache.archiva.repository.features.StagingRepositoryFeature)1 RepositoryScanStatistics (org.apache.archiva.repository.scanner.RepositoryScanStatistics)1