use of org.apache.archiva.maven.repository.MavenManagedRepository in project archiva by apache.
the class MetadataToolsTest method createTestRepoContent.
private ManagedRepositoryContent createTestRepoContent() throws Exception {
Path repoRoot = Paths.get("target/metadata-tests/" + name.getMethodName());
if (Files.exists(repoRoot)) {
org.apache.archiva.common.utils.FileUtils.deleteDirectory(repoRoot);
}
Files.createDirectories(repoRoot);
MavenManagedRepository repoConfig = createRepository("test-repo", "Test Repository: " + name.getMethodName(), repoRoot);
RepositoryContentProvider provider = applicationContext.getBean("repositoryContentProvider#maven", RepositoryContentProvider.class);
ManagedRepositoryContent repoContent = provider.createManagedContent(repoConfig);
return repoContent;
}
use of org.apache.archiva.maven.repository.MavenManagedRepository in project archiva by apache.
the class MavenRepositoryRequestInfoTest method createRepository.
protected MavenManagedRepository createRepository(String id, String name, Path location) throws IOException {
MavenManagedRepository repo = MavenManagedRepository.newLocalInstance(id, name, location.getParent().toAbsolutePath());
repo.setLocation(location.toAbsolutePath().toUri());
return repo;
}
use of org.apache.archiva.maven.repository.MavenManagedRepository in project archiva by apache.
the class MavenRepositoryRequestInfoTest method createManagedRepositoryContent.
protected ManagedRepositoryContent createManagedRepositoryContent(String id, String name, Path location, String layout) throws Exception {
MavenManagedRepository repo = MavenManagedRepository.newLocalInstance(id, name, archivaConfiguration.getRepositoryBaseDir());
repo.setLocation(location.toAbsolutePath().toUri());
repo.setLayout(layout);
RepositoryContentProvider provider = applicationContext.getBean("repositoryContentProvider#maven", RepositoryContentProvider.class);
ManagedRepositoryContent repoContent = provider.createManagedContent(repo);
return repoContent;
}
use of org.apache.archiva.maven.repository.MavenManagedRepository in project archiva by apache.
the class MavenRepositoryRequestInfoTest method setUp.
@Before
public void setUp() throws Exception {
Path repoDir = getRepositoryPath("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);
ManagedDefaultRepositoryContent repoContent = new ManagedDefaultRepositoryContent(repository, fileTypes, fileLockManager);
// repoContent = (ManagedRepositoryContent) lookup( ManagedRepositoryContent.class, "default" );
repository.setContent(repoContent);
repoContent.setMavenContentHelper(mavenContentHelper);
repoContent.setArtifactMappingProviders(artifactMappingProviders);
repoContent.setPathTranslator(pathTranslator);
repoRequest = new MavenRepositoryRequestInfo(repository);
}
use of org.apache.archiva.maven.repository.MavenManagedRepository in project archiva by apache.
the class ManagedDefaultRepositoryContentTest method createManagedRepoWithContent.
private ManagedRepository createManagedRepoWithContent(String sourceRepoName) throws IOException, URISyntaxException {
Path repoDir = copyRepository(sourceRepoName);
MavenManagedRepository repo = createRepository(sourceRepoName, sourceRepoName, repoDir);
ManagedDefaultRepositoryContent deleteRepoContent = new ManagedDefaultRepositoryContent(repo, fileTypes, fileLockManager);
deleteRepoContent.setMavenContentHelper(contentHelper);
return repo;
}
Aggregations