use of aQute.bnd.maven.PomFromManifest in project bnd by bndtools.
the class bnd method _buildx.
@Description("Build project, is deprecated but here for backward compatibility")
public void _buildx(buildxOptions options) throws Exception {
// Create a build order
List<Builder> builders = new ArrayList<Builder>();
List<String> order = new ArrayList<String>();
List<String> active = new ArrayList<String>();
for (String s : options._arguments()) {
prebuild(active, order, builders, s);
}
for (Builder b : builders) {
if (options.classpath() != null) {
for (String f : options.classpath()) {
b.addClasspath(getFile(f));
}
}
if (options.sourcepath() != null) {
for (String f : options.sourcepath()) {
b.addSourcepath(getFile(f));
}
}
if (options.sources())
b.setSources(true);
if (options.eclipse()) {
EclipseClasspath ep = new EclipseClasspath(this, getBase().getParentFile(), getBase());
b.addClasspath(ep.getClasspath());
b.addClasspath(ep.getBootclasspath());
b.addSourcepath(ep.getSourcepath());
}
Jar jar = b.build();
File outputFile = b.getOutputFile(options.output());
if (options.pom()) {
Resource r = new PomFromManifest(jar.getManifest());
jar.putResource("pom.xml", r);
String path = outputFile.getName().replaceAll("\\.jar$", ".pom");
if (path.equals(outputFile.getName()))
path = outputFile.getName() + ".pom";
File pom = new File(outputFile.getParentFile(), path);
try (OutputStream os = IO.outputStream(pom)) {
r.write(os);
}
}
getInfo(b, b.getPropertiesFile().getName());
if (isOk()) {
b.save(outputFile, options.force());
}
b.close();
}
}
Aggregations