From 8bce3af3045db7b795bfff226f2a9d8a333e0d4c Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Wed, 9 Jul 2025 11:23:01 +0200 Subject: [PATCH] Remove `java.*` packages from `Import-Package` headers in all jars ... to maximize compatibility with older OSGi runtimes. Resolves #4733. --- .../asciidoc/release-notes/release-notes-5.13.4.adoc | 10 ++++++++++ .../main/kotlin/junitbuild.osgi-conventions.gradle.kts | 5 +++++ 2 files changed, 15 insertions(+) diff --git a/documentation/src/docs/asciidoc/release-notes/release-notes-5.13.4.adoc b/documentation/src/docs/asciidoc/release-notes/release-notes-5.13.4.adoc index 1480ac637377..25dd429044a1 100644 --- a/documentation/src/docs/asciidoc/release-notes/release-notes-5.13.4.adoc +++ b/documentation/src/docs/asciidoc/release-notes/release-notes-5.13.4.adoc @@ -10,6 +10,16 @@ link:{junit-framework-repo}+/milestone/101?closed=1+[5.13.4] milestone page in t repository on GitHub. +[[release-notes-5.13.4-overall-improvements]] +=== Overall Changes + +[[release-notes-5.13.4-overall-new-features-and-improvements]] +==== New Features and Improvements + +* Remove `java.*` packages from `Import-Package` headers in all jar manifests to maximize + compatibility with older OSGi runtimes. + + [[release-notes-5.13.4-junit-platform]] === JUnit Platform diff --git a/gradle/plugins/common/src/main/kotlin/junitbuild.osgi-conventions.gradle.kts b/gradle/plugins/common/src/main/kotlin/junitbuild.osgi-conventions.gradle.kts index d5f47a50e2e8..68a7780d2314 100644 --- a/gradle/plugins/common/src/main/kotlin/junitbuild.osgi-conventions.gradle.kts +++ b/gradle/plugins/common/src/main/kotlin/junitbuild.osgi-conventions.gradle.kts @@ -67,6 +67,11 @@ tasks.withType().named { # Instruct the APIGuardianAnnotations how to operate. # See https://bnd.bndtools.org/instructions/export-apiguardian.html -export-apiguardian: *;version=${'$'}{versionmask;===;${'$'}{version_cleanup;${'$'}{task.archiveVersion}}} + + # Avoid including java packages in Import-Package header to maximize compatibility with older OSGi runtimes. + # See https://bnd.bndtools.org/instructions/noimportjava.html + # Issue: https://github.com/junit-team/junit-framework/issues/4733 + -noimportjava: true """ )