public void removeImportPackages(Collection<String> importPackages) {
this.imports.removeAll(importPackages);
}
public Manifest getManifest() throws ManifestException {
Manifest manifest = new Manifest();
manifest.addConfiguredAttribute(new Manifest.Attribute(Constants.BUNDLE_MANIFESTVERSION, "2"));
manifest.addConfiguredAttribute(new Manifest.Attribute(Constants.BUNDLE_SYMBOLICNAME, configId.getGroupId() + "." + configId.getArtifactId()));
String versionString = "" + configId.getVersion().getMajorVersion() + "." + configId.getVersion().getMinorVersion() + "." + configId.getVersion().getIncrementalVersion();
if (configId.getVersion().getQualifier() != null) {
versionString += "." + configId.getVersion().getQualifier().replaceAll("[^-_\\w]{1}", "_");
}
manifest.addConfiguredAttribute(new Manifest.Attribute(Constants.BUNDLE_VERSION, versionString));
if (bundleActivator != null) {
manifest.addConfiguredAttribute(new Manifest.Attribute(Constants.BUNDLE_ACTIVATOR, bundleActivator));
}
if (!imports.isEmpty()) {
manifest.addConfiguredAttribute(new Manifest.Attribute(Manifest.Attribute.Separator.COMMA, Constants.IMPORT_PACKAGE, imports));
}
if (!exports.isEmpty()) {
manifest.addConfiguredAttribute(new Manifest.Attribute(Manifest.Attribute.Separator.COMMA, Constants.EXPORT_PACKAGE, exports));
}
if (!dynamicImports.isEmpty()) {
manifest.addConfiguredAttribute(new Manifest.Attribute(Manifest.Attribute.Separator.COMMA, Constants.DYNAMICIMPORT_PACKAGE, dynamicImports));
}
if (!bundleClassPath.isEmpty()) {
Manifest.Attribute bundleClassPath = new Manifest.Attribute(Manifest.Attribute.Separator.COMMA, Constants.BUNDLE_CLASSPATH, this.bundleClassPath);
manifest.addConfiguredAttribute(bundleClassPath);
}
if (!requireBundles.isEmpty()) {
Manifest.Attribute requireBundle = new Manifest.Attribute(Manifest.Attribute.Separator.COMMA, Constants.REQUIRE_BUNDLE, this.requireBundles);
manifest.addConfiguredAttribute(requireBundle);
}
return manifest;
}