Search in sources :

Example 1 with PomPropertiesResource

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);
            }
        }
    }
}
Also used : PomResource(aQute.bnd.maven.PomResource) PomPropertiesResource(aQute.bnd.maven.PomPropertiesResource)

Aggregations

PomPropertiesResource (aQute.bnd.maven.PomPropertiesResource)1 PomResource (aQute.bnd.maven.PomResource)1