use of aQute.bnd.maven.PomPropertiesResource in project bnd by bndtools.
the class Builder method doPom.
void doPom(Jar dot) throws Exception, IOException {
try (Processor scoped = new Processor(this)) {
String bsn = getBsn();
if (bsn != null)
scoped.setProperty("@bsn", bsn);
String version = getBundleVersion();
if (version != null)
scoped.setProperty("@version", version);
String pom = scoped.getProperty(POM);
if (pom != null && !pom.equalsIgnoreCase("false")) {
dot.removePrefix("META-INF/maven/");
scoped.addProperties(OSGiHeader.parseProperties(pom));
PomResource pomXml = new PomResource(scoped, dot.getManifest());
String v = pomXml.validate();
if (v != null) {
error("Invalid pom for %s: %s", getBundleSymbolicName(), v);
}
PomPropertiesResource pomProperties = new PomPropertiesResource(pomXml);
dot.putResource(pomXml.getWhere(), pomXml);
if (!pomProperties.getWhere().equals(pomXml.getWhere())) {
dot.putResource(pomProperties.getWhere(), pomProperties);
}
}
}
}
Aggregations