Search in sources :

Example 1 with ManagedDefaultRepositoryContent

use of org.apache.archiva.repository.content.maven2.ManagedDefaultRepositoryContent in project archiva by apache.

the class LegacyConverterArtifactConsumer method beginScan.

@Override
public void beginScan(org.apache.archiva.repository.ManagedRepository repository, Date whenGathered) throws ConsumerException {
    this.managedRepository = new ManagedDefaultRepositoryContent(artifactMappingProviders, fileTypes);
    this.managedRepository.setRepository(repository);
}
Also used : ManagedDefaultRepositoryContent(org.apache.archiva.repository.content.maven2.ManagedDefaultRepositoryContent)

Example 2 with ManagedDefaultRepositoryContent

use of org.apache.archiva.repository.content.maven2.ManagedDefaultRepositoryContent in project archiva by apache.

the class ArchivaDavResourceFactoryTest method createManagedRepositoryContent.

private ManagedRepositoryContent createManagedRepositoryContent(String repoId) throws RepositoryAdminException {
    ManagedRepositoryContent repoContent = new ManagedDefaultRepositoryContent(artifactMappingProviders, fileTypes);
    org.apache.archiva.repository.ManagedRepository repo = repositoryRegistry.getManagedRepository(repoId);
    repoContent.setRepository(repo);
    if (repo != null && repo instanceof EditableManagedRepository) {
        ((EditableManagedRepository) repo).setContent(repoContent);
    }
    return repoContent;
}
Also used : EditableManagedRepository(org.apache.archiva.repository.EditableManagedRepository) ManagedRepositoryContent(org.apache.archiva.repository.ManagedRepositoryContent) ManagedDefaultRepositoryContent(org.apache.archiva.repository.content.maven2.ManagedDefaultRepositoryContent)

Example 3 with ManagedDefaultRepositoryContent

use of org.apache.archiva.repository.content.maven2.ManagedDefaultRepositoryContent in project archiva by apache.

the class ManagedDefaultRepositoryContentTest method setUp.

@Before
public void setUp() throws Exception {
    Path repoDir = Paths.get("src/test/repositories/default-repository");
    MavenManagedRepository repository = createRepository("testRepo", "Unit Test Repo", repoDir);
    FileType fileType = archivaConfiguration.getConfiguration().getRepositoryScanning().getFileTypes().get(0);
    fileType.addPattern("**/*.xml");
    assertEquals(FileTypes.ARTIFACTS, fileType.getId());
    fileTypes.afterConfigurationChange(null, "fileType", null);
    repoContent = new ManagedDefaultRepositoryContent(artifactMappingProviders, fileTypes);
    // repoContent = (ManagedRepositoryContent) lookup( ManagedRepositoryContent.class, "default" );
    repoContent.setRepository(repository);
}
Also used : Path(java.nio.file.Path) FileType(org.apache.archiva.configuration.FileType) MavenManagedRepository(org.apache.archiva.repository.maven2.MavenManagedRepository) ManagedDefaultRepositoryContent(org.apache.archiva.repository.content.maven2.ManagedDefaultRepositoryContent) Before(org.junit.Before)

Aggregations

ManagedDefaultRepositoryContent (org.apache.archiva.repository.content.maven2.ManagedDefaultRepositoryContent)3 Path (java.nio.file.Path)1 FileType (org.apache.archiva.configuration.FileType)1 EditableManagedRepository (org.apache.archiva.repository.EditableManagedRepository)1 ManagedRepositoryContent (org.apache.archiva.repository.ManagedRepositoryContent)1 MavenManagedRepository (org.apache.archiva.repository.maven2.MavenManagedRepository)1 Before (org.junit.Before)1