Search in sources :

Example 1 with MavenRemoteRepository

use of org.apache.archiva.repository.maven2.MavenRemoteRepository in project archiva by apache.

the class AbstractRepositoryLayerTestCase method createRemoteRepository.

protected MavenRemoteRepository createRemoteRepository(String id, String name, String url) throws URISyntaxException {
    MavenRemoteRepository repo = new MavenRemoteRepository(id, name, Paths.get("target/remotes"));
    repo.setLocation(new URI(url));
    return repo;
}
Also used : MavenRemoteRepository(org.apache.archiva.repository.maven2.MavenRemoteRepository) URI(java.net.URI)

Example 2 with MavenRemoteRepository

use of org.apache.archiva.repository.maven2.MavenRemoteRepository in project archiva by apache.

the class MavenIndexManagerTest method createTestContextForRemote.

private ArchivaIndexingContext createTestContextForRemote() throws URISyntaxException, IndexCreationFailedException, IOException {
    indexPath = Paths.get("target/repositories/test-repo/.index-test");
    Path repoPath = Paths.get("target/repositories").toAbsolutePath();
    repositoryRemote = new MavenRemoteRepository("test-repo", "Test Repo", repoPath);
    repositoryRemote.setLocation(repoPath.resolve("test-repo").toUri());
    RemoteIndexFeature icf = repositoryRemote.getFeature(RemoteIndexFeature.class).get();
    icf.setIndexUri(new URI(".index-test"));
    ctx = mavenIndexManager.createContext(repositoryRemote);
    return ctx;
}
Also used : Path(java.nio.file.Path) MavenRemoteRepository(org.apache.archiva.repository.maven2.MavenRemoteRepository) RemoteIndexFeature(org.apache.archiva.repository.features.RemoteIndexFeature) URI(java.net.URI)

Example 3 with MavenRemoteRepository

use of org.apache.archiva.repository.maven2.MavenRemoteRepository in project archiva by apache.

the class AbstractRepositoryLayerTestCase method createRemoteRepositoryContent.

protected RemoteRepositoryContent createRemoteRepositoryContent(String id, String name, String url, String layout) throws Exception {
    MavenRemoteRepository repo = new MavenRemoteRepository(id, name, Paths.get("target/remotes"));
    repo.setLocation(new URI(url));
    repo.setLayout(layout);
    RepositoryContentProvider provider = applicationContext.getBean("repositoryContentProvider#maven", RepositoryContentProvider.class);
    RemoteRepositoryContent repoContent = provider.createRemoteContent(repo);
    return repoContent;
}
Also used : MavenRemoteRepository(org.apache.archiva.repository.maven2.MavenRemoteRepository) URI(java.net.URI)

Aggregations

URI (java.net.URI)3 MavenRemoteRepository (org.apache.archiva.repository.maven2.MavenRemoteRepository)3 Path (java.nio.file.Path)1 RemoteIndexFeature (org.apache.archiva.repository.features.RemoteIndexFeature)1