diff --git a/p2-maven-plugin/src/main/java/org/eclipse/tycho/p2maven/repository/DefaultMavenRepositorySettings.java b/p2-maven-plugin/src/main/java/org/eclipse/tycho/p2maven/repository/DefaultMavenRepositorySettings.java index d25b658821..791132c528 100644 --- a/p2-maven-plugin/src/main/java/org/eclipse/tycho/p2maven/repository/DefaultMavenRepositorySettings.java +++ b/p2-maven-plugin/src/main/java/org/eclipse/tycho/p2maven/repository/DefaultMavenRepositorySettings.java @@ -14,6 +14,7 @@ package org.eclipse.tycho.p2maven.repository; import java.net.URI; +import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -158,4 +159,14 @@ public void initialize() throws InitializationException { mirrors = Collections.emptyList(); } } + + @Override + public Iterable getMirrors() { + List result = new ArrayList<>(); + for (Mirror mirror : mirrors) { + MavenRepositoryLocation location = new MavenRepositoryLocation(mirror.getId(), URI.create(mirror.getUrl())); + result.add(location); + } + return result; + } } diff --git a/tycho-api/src/main/java/org/eclipse/tycho/MavenRepositorySettings.java b/tycho-api/src/main/java/org/eclipse/tycho/MavenRepositorySettings.java index 68286e8df3..cd88dff79b 100644 --- a/tycho-api/src/main/java/org/eclipse/tycho/MavenRepositorySettings.java +++ b/tycho-api/src/main/java/org/eclipse/tycho/MavenRepositorySettings.java @@ -60,4 +60,9 @@ public String toString() { */ Credentials getCredentials(MavenRepositoryLocation location); + /** + * Returns all configured mirror locations. + */ + Iterable getMirrors(); + }