Search in sources :

Example 1 with P2ArtifactRepositoryLayout

use of org.eclipse.tycho.core.p2.P2ArtifactRepositoryLayout in project tycho by eclipse.

the class P2DependencyResolver method addEntireP2RepositoryToTargetPlatform.

private void addEntireP2RepositoryToTargetPlatform(ArtifactRepository repository, TargetPlatformConfigurationStub resolutionContext) {
    try {
        if (repository.getLayout() instanceof P2ArtifactRepositoryLayout) {
            URI url = new URL(repository.getUrl()).toURI();
            resolutionContext.addP2Repository(new MavenRepositoryLocation(repository.getId(), url));
            getLogger().debug("Added p2 repository " + repository.getId() + " (" + repository.getUrl() + ")");
        }
    } catch (MalformedURLException e) {
        throw new RuntimeException("Invalid repository URL: " + repository.getUrl(), e);
    } catch (URISyntaxException e) {
        throw new RuntimeException("Invalid repository URL: " + repository.getUrl(), e);
    }
}
Also used : MalformedURLException(java.net.MalformedURLException) MavenRepositoryLocation(org.eclipse.tycho.core.resolver.shared.MavenRepositoryLocation) P2ArtifactRepositoryLayout(org.eclipse.tycho.core.p2.P2ArtifactRepositoryLayout) URISyntaxException(java.net.URISyntaxException) URI(java.net.URI) URL(java.net.URL)

Example 2 with P2ArtifactRepositoryLayout

use of org.eclipse.tycho.core.p2.P2ArtifactRepositoryLayout in project tycho by eclipse.

the class TychoMirrorSelectorTest method createArtifactRepository.

private ArtifactRepository createArtifactRepository(String id, String url) {
    ArtifactRepository repository = new MavenArtifactRepository();
    repository.setId(id);
    repository.setUrl(url);
    repository.setLayout(new P2ArtifactRepositoryLayout());
    return repository;
}
Also used : P2ArtifactRepositoryLayout(org.eclipse.tycho.core.p2.P2ArtifactRepositoryLayout) MavenArtifactRepository(org.apache.maven.artifact.repository.MavenArtifactRepository) ArtifactRepository(org.apache.maven.artifact.repository.ArtifactRepository) MavenArtifactRepository(org.apache.maven.artifact.repository.MavenArtifactRepository)

Aggregations

P2ArtifactRepositoryLayout (org.eclipse.tycho.core.p2.P2ArtifactRepositoryLayout)2 MalformedURLException (java.net.MalformedURLException)1 URI (java.net.URI)1 URISyntaxException (java.net.URISyntaxException)1 URL (java.net.URL)1 ArtifactRepository (org.apache.maven.artifact.repository.ArtifactRepository)1 MavenArtifactRepository (org.apache.maven.artifact.repository.MavenArtifactRepository)1 MavenRepositoryLocation (org.eclipse.tycho.core.resolver.shared.MavenRepositoryLocation)1