From 5a9e353f2c10ea8b27160edb0ae56cc2fa0d4acb Mon Sep 17 00:00:00 2001 From: Florian Schmaus Date: Sat, 20 Sep 2014 09:53:22 +0200 Subject: [PATCH] Filter sun.security.* from smack-java7 Import-Package Quoting Jens Offenbach: "The header entry [sun.* in Import-Package] MUST be removed because its a native package and not exported by the OSGi framework. The bundle cannot be resolved. It is up to the OSGi framework deployer to declare this package as beeing "bootdelegated". This tells the classloader of the bundle to delegate a corresponding package request to the installed JRE. Only remove this entry and leave the "magic" of resolution to OSGi" SMACK-343 --- smack-java7/build.gradle | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/smack-java7/build.gradle b/smack-java7/build.gradle index 52f0197d7..78a1799e1 100644 --- a/smack-java7/build.gradle +++ b/smack-java7/build.gradle @@ -1,3 +1,9 @@ +// Although the osgi plugin is already applied by the root project's +// subprojects closure, we need to re-apply it here so that the +// manifest is a OsgiManifest. Possible caused by +// evaluationDependsOnChildren in the root project. +apply plugin: 'osgi' + description = """\ Smack for Java7 (or higher). This is a pseudo-artifact that pulls all the required dependencies to @@ -13,3 +19,9 @@ dependencies { javadoc { enabled = false } + +jar { + manifest { + instruction 'Import-Package', '!sun.security.*, *' + } +} \ No newline at end of file