Force removal of Require-Bundle
[cc0/argeo-build.git] / src / org / argeo / build / Repackage.java
index f379b4e81dde7486dc5b2aef4f73c89cf175054a..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) {
@@ -1126,9 +1128,9 @@ public class Repackage {
                                Files.copy(jarIn, target);
 
                                // native libraries
-                               boolean removeDllFromJar = false;
+                               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));