Search in sources :

Example 6 with BasicManagedRepository

use of org.apache.archiva.repository.base.managed.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;
    try {
        BasicManagedRepository managedRepository = BasicManagedRepository.newFilesystemInstance(id, configuration.getName(), Paths.get("target/repositories"));
        updateManagedInstance(managedRepository, configuration);
        return managedRepository;
    } catch (IOException e) {
        throw new RepositoryException(e);
    }
}
Also used : BasicManagedRepository(org.apache.archiva.repository.base.managed.BasicManagedRepository) RepositoryException(org.apache.archiva.repository.RepositoryException) IOException(java.io.IOException)

Example 7 with BasicManagedRepository

use of org.apache.archiva.repository.base.managed.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 = null;
    try {
        managedRepository = BasicManagedRepository.newFilesystemInstance(id, configuration.getName(), Paths.get("target/repositories").resolve(id));
    } catch (IOException e) {
        throw new RepositoryException(e);
    }
    updateManagedInstance(managedRepository, configuration);
    return managedRepository;
}
Also used : BasicManagedRepository(org.apache.archiva.repository.base.managed.BasicManagedRepository) RepositoryException(org.apache.archiva.repository.RepositoryException) IOException(java.io.IOException)

Example 8 with BasicManagedRepository

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

the class RepositoryContentConsumersTest method createRepository.

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

Example 9 with BasicManagedRepository

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

the class RepositoryProviderMock method createManagedInstance.

@Override
public ManagedRepository createManagedInstance(ManagedRepositoryConfiguration configuration) throws RepositoryException {
    BasicManagedRepository managedRepository = null;
    try {
        managedRepository = BasicManagedRepository.newFilesystemInstance(configuration.getId(), configuration.getName(), Paths.get("target/repositories").resolve(configuration.getId()));
    } catch (IOException e) {
        throw new RepositoryException(e);
    }
    updateManagedInstance(managedRepository, configuration);
    return managedRepository;
}
Also used : BasicManagedRepository(org.apache.archiva.repository.base.managed.BasicManagedRepository) IOException(java.io.IOException)

Example 10 with BasicManagedRepository

use of org.apache.archiva.repository.base.managed.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 = null;
    try {
        managedRepository = BasicManagedRepository.newFilesystemInstance(id, configuration.getName(), Paths.get("target/repositories").resolve(id));
    } catch (IOException e) {
        throw new RepositoryException(e);
    }
    updateManagedInstance(managedRepository, configuration);
    managedRepository.getFeature(StagingRepositoryFeature.class).setStageRepoNeeded(false);
    return managedRepository;
}
Also used : BasicManagedRepository(org.apache.archiva.repository.base.managed.BasicManagedRepository) IOException(java.io.IOException) StagingRepositoryFeature(org.apache.archiva.repository.features.StagingRepositoryFeature)

Aggregations

BasicManagedRepository (org.apache.archiva.repository.base.managed.BasicManagedRepository)20 IOException (java.io.IOException)8 RepositoryException (org.apache.archiva.repository.RepositoryException)8 DefaultFileLockManager (org.apache.archiva.common.filelock.DefaultFileLockManager)6 FilesystemStorage (org.apache.archiva.repository.storage.fs.FilesystemStorage)6 Path (java.nio.file.Path)4 StagingRepositoryFeature (org.apache.archiva.repository.features.StagingRepositoryFeature)4 ArtifactCleanupFeature (org.apache.archiva.repository.features.ArtifactCleanupFeature)3 IndexCreationFeature (org.apache.archiva.repository.features.IndexCreationFeature)3 Before (org.junit.Before)3 Test (org.junit.jupiter.api.Test)3 URI (java.net.URI)2 ArrayList (java.util.ArrayList)2 FileLockManager (org.apache.archiva.common.filelock.FileLockManager)2 EditableManagedRepository (org.apache.archiva.repository.EditableManagedRepository)2 MavenManagedRepository (org.apache.archiva.rest.api.v2.model.MavenManagedRepository)2 ManagedRepositoryConfiguration (org.apache.archiva.configuration.model.ManagedRepositoryConfiguration)1 InvalidRepositoryContentConsumer (org.apache.archiva.consumers.InvalidRepositoryContentConsumer)1 KnownRepositoryContentConsumer (org.apache.archiva.consumers.KnownRepositoryContentConsumer)1 MetadataRepository (org.apache.archiva.metadata.repository.MetadataRepository)1