use of org.apache.ivy.osgi.repo.RepoDescriptor in project ant-ivy by apache.
the class UpdateSiteLoader method load.
public RepoDescriptor load(URI repoUri) throws IOException, ParseException, SAXException {
if (!repoUri.toString().endsWith("/")) {
try {
repoUri = new URI(repoUri.toString() + "/");
} catch (URISyntaxException e) {
throw new RuntimeException("Cannot make an uri for the repo");
}
}
Message.info("Loading the update site " + repoUri);
// first look for a p2 repository
RepoDescriptor repo = loadP2(repoUri);
if (repo != null) {
return repo;
}
Message.verbose("\tNo P2 artifacts, falling back on the old fashioned updatesite");
// then try the old update site
UpdateSite site = loadSite(repoUri);
if (site == null) {
return null;
}
repo = loadFromDigest(site);
if (repo != null) {
return repo;
}
return loadFromSite(site);
}
use of org.apache.ivy.osgi.repo.RepoDescriptor in project ant-ivy by apache.
the class UpdateSiteLoaderTest method testComposite.
@Test
public void testComposite() throws Exception {
RepoDescriptor site = loader.load(new File("test/test-p2/composite/").toURI());
assertEquals(8, CollectionUtils.toList(site.getModules()).size());
// check that the url of the artifact is correctly resolved
String path = new File("test/test-p2/ivyde-repo/").toURI().toURL().toExternalForm();
ModuleDescriptor md = site.getModules().next().getModuleDescriptor();
assertTrue(md.getAllArtifacts()[0].getUrl().toExternalForm().startsWith(path));
}
use of org.apache.ivy.osgi.repo.RepoDescriptor in project ant-ivy by apache.
the class UpdateSiteLoaderTest method testM2Eclipse.
@Test
public void testM2Eclipse() throws IOException, ParseException, SAXException, URISyntaxException {
RepoDescriptor site = loader.load(new URI("http://download.eclipse.org/technology/m2e/releases/"));
assertTrue(CollectionUtils.toList(site.getModules()).size() > 20);
}
use of org.apache.ivy.osgi.repo.RepoDescriptor in project ant-ivy by apache.
the class UpdateSiteLoaderTest method testIvyDE.
@Test
public void testIvyDE() throws IOException, ParseException, SAXException, URISyntaxException {
RepoDescriptor site = loader.load(new URI("http://www.apache.org/dist/ant/ivyde/updatesite/"));
assertTrue(site.getModules().hasNext());
Iterator<ModuleDescriptorWrapper> it = site.getModules();
while (it.hasNext()) {
String name = it.next().getModuleDescriptor().getModuleRevisionId().getName();
assertTrue(name, name.startsWith("org.apache.ivy"));
}
}
use of org.apache.ivy.osgi.repo.RepoDescriptor in project ant-ivy by apache.
the class UpdateSiteLoaderTest method testHeliosEclipse.
@Ignore
@Test
public void testHeliosEclipse() throws IOException, ParseException, SAXException, URISyntaxException {
RepoDescriptor site = loader.load(new URI("http://download.eclipse.org/releases/helios/"));
assertTrue(CollectionUtils.toList(site.getModules()).size() > 900);
}
Aggregations