Force removal of Require-Bundle
[cc0/argeo-build.git] / src / org / argeo / build / Repackage.java
index f93776bca8dbdde16ecae61960b7531f7ad0da37..60b15f007dbbf2777b73e7d15d859453a08e06f3 100644 (file)
@@ -174,7 +174,7 @@ public class Repackage {
                /** Maven repository, if not the default one. */
                ARGEO_ORIGIN_M2_REPO("Argeo-Origin-M2-Repo"), //
                /**
-                * Do not perform BND analysis of the origin component. Typically Import_package
+                * Do not perform BND analysis of the origin component. Typically Import-Package
                 * and Export-Package will be kept untouched.
                 */
                ARGEO_ORIGIN_NO_METADATA_GENERATION("Argeo-Origin-NoMetadataGeneration"), //
@@ -1028,6 +1028,8 @@ public class Repackage {
                        if (sourceManifest == null)
                                logger.log(WARNING, file + " has no manifest");
                        manifest = sourceManifest != null ? new Manifest(sourceManifest) : new Manifest();
+                       if (!doNotModify)
+                               manifest.getMainAttributes().remove("Require-Bundle");
 
                        String rawSourceSymbolicName = manifest.getMainAttributes().getValue(BUNDLE_SYMBOLICNAME.toString());
                        if (rawSourceSymbolicName != null) {
@@ -1128,7 +1130,7 @@ public class Repackage {
                                // native libraries
                                boolean removeDllFromJar = true;
                                if (isNative && (entry.getName().endsWith(".so") || entry.getName().endsWith(".dll")
-                                               || entry.getName().endsWith(".jnilib"))) {
+                                               || entry.getName().endsWith(".jnilib") || entry.getName().endsWith(".a"))) {
                                        Path categoryDir = bundleDir.getParent();
                                        boolean copyDll = false;
                                        Path targetDll = categoryDir.resolve(bundleDir.relativize(target));