use of aQute.maven.provider.POM in project bnd by bndtools.
the class MavenBndRepoTest method testPomGenerate.
public void testPomGenerate() throws Exception {
config(null);
ByteArrayOutputStream bout = new ByteArrayOutputStream();
PomOptions po = new PomOptions();
po.gav = "test:test:1.0";
po.parent = null;
po.dependencyManagement = false;
repo.toPom(bout, po);
ByteArrayInputStream bin = new ByteArrayInputStream(bout.toByteArray());
POM pom = new POM((MavenRepository) repo.storage, bin);
assertEquals(Revision.valueOf("test:test:1.0"), pom.getRevision());
assertEquals(3, pom.getDependencies(EnumSet.of(MavenScope.runtime), false).size());
System.out.println(new String(bout.toByteArray(), StandardCharsets.UTF_8));
}
use of aQute.maven.provider.POM in project bnd by bndtools.
the class Traverser method getResources.
Promise<Map<Archive, Resource>> getResources() throws Exception {
/*
* We don't want to resolve until all the work is queued so we
* initialize the count to 1 and call finish after queuing all the work.
*/
if (count.compareAndSet(-1, 1)) {
try {
if (!uris.isEmpty()) {
for (URI uri : uris) {
File in = client.build().useCache().age(1, TimeUnit.DAYS).go(uri);
POM pom = new POM(repo, in);
parsePom(pom, ROOT);
}
} else {
for (Revision revision : revisions) parse(revision.archive("jar", null), ROOT);
}
} finally {
finish();
}
}
return deferred.getPromise();
}
use of aQute.maven.provider.POM in project bnd by bndtools.
the class Traverser method parseArchive.
private void parseArchive(Archive archive) throws Exception {
POM pom = repo.getPom(archive.getRevision());
String parent = archive.getRevision().toString();
if (pom == null) {
logger.debug("no pom found for archive {} ", archive);
if (!archive.isPom())
parseResource(archive, parent);
return;
}
parsePom(pom, parent);
if (!pom.isPomOnly())
parseResource(archive, parent);
}
Aggregations