From f6046d1a512f99d6db159e7dbfbcbdfb40b9d577 Mon Sep 17 00:00:00 2001 From: Holger Friedrich Date: Sat, 27 Dec 2025 14:09:44 +0100 Subject: [PATCH 01/23] Lift minimum JDK version to 21 and remove SecurityManager * Lift minimum JDK version to 21 * Remove occurrences of SecurityManager, as getSecurityManager returns null since JDK 18 * Enable verbose deprecation warnings * Replace getSubject and doAs calls, getSubject can no longer be activated via JRE command line as SecurityManager has been removed in JDK 25. A replacement is available since Java 21. doAs was deprecated and is replaced by callAll. * Remove SecurityManager form JavaSecurityTest --- .github/workflows/ci.yml | 4 +- .../resources/archetype-resources/pom.xml | 2 +- .../resources/archetype-resources/pom.xml | 5 +- archetypes/bundle/pom.xml | 5 +- .../resources/archetype-resources/pom.xml | 5 +- .../resources/archetype-resources/pom.xml | 5 +- assemblies/apache-karaf-minimal/pom.xml | 2 +- assemblies/apache-karaf-mix/pom.xml | 2 +- assemblies/apache-karaf/pom.xml | 2 +- .../main/filtered-resources/resources/bin/inc | 6 --- .../resources/bin/karaf.bat | 4 -- assemblies/features/enterprise/pom.xml | 2 +- assemblies/features/integration/pom.xml | 2 +- assemblies/features/specs/pom.xml | 4 +- assemblies/features/spring/pom.xml | 2 +- assemblies/features/standard/pom.xml | 2 +- .../karaf-docker-example-dynamic-dist/pom.xml | 4 +- .../karaf-docker-example-static-dist/pom.xml | 2 +- .../karaf-graphql-example-websocket/pom.xml | 4 +- .../core/internal/InstanceServiceImpl.java | 3 -- .../apache/karaf/itests/KarafTestSupport.java | 3 +- .../apache/karaf/itests/JavaSecurityTest.java | 3 -- .../karaf/jaas/command/WhoamiCommand.java | 3 +- .../modules/ldap/GSSAPILdapLoginModule.java | 6 ++- .../apache/karaf/main/MainLockingTest.java | 30 +++++------ .../internal/BulkRequestContext.java | 11 ++-- .../management/KarafMBeanServerGuardTest.java | 54 +++++++++---------- pom.xml | 17 ++++-- .../guard/impl/GuardProxyCatalogTest.java | 26 ++++----- .../impl/handler/EventAdminImpl.java | 2 +- .../impl/SecuredCommandProcessorImpl.java | 3 +- .../apache/karaf/shell/util/ShellUtil.java | 3 +- .../secured/SecuredSessionFactoryImpl.java | 6 +-- .../apache/karaf/shell/support/ShellUtil.java | 3 +- tooling/karaf-maven-plugin/pom.xml | 3 +- .../src/it/test-aggregate-features/pom.xml | 2 - .../src/it/test-basic-generation/pom.xml | 2 - .../test-check-dependencies-failure/pom.xml | 2 - .../src/it/test-check-dependencies/pom.xml | 2 - .../src/it/test-feature-dependencies/pom.xml | 2 - .../transitive/pom.xml | 2 - .../it/test-include-project-artifact/pom.xml | 2 - .../src/it/test-input-file/pom.xml | 2 - .../src/it/test-recursive/pom.xml | 2 - .../src/it/test-rename-main-feature/pom.xml | 2 - .../it/test-repository-dependencies/pom.xml | 2 - .../src/it/test-run-bundle/pom.xml | 2 - .../src/it/test-simplify-bundles/pom.xml | 2 - .../it/test-transitive-as-dependency/pom.xml | 2 - .../src/it/test-type-classifier/pom.xml | 2 - .../org/apache/karaf/util/ThreadUtils.java | 3 +- .../apache/karaf/util/jaas/JaasHelper.java | 6 +-- .../karaf/util/tracker/BaseActivator.java | 3 +- .../karaf/webconsole/gogo/GogoPlugin.java | 3 +- 54 files changed, 115 insertions(+), 170 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 82265a36d5c..2e50531e655 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -45,7 +45,7 @@ jobs: - name: Set up JDK 17 uses: actions/setup-java@v6 with: - java-version: '17' + java-version: '21' distribution: 'temurin' cache: 'maven' - name: Build @@ -77,7 +77,7 @@ jobs: - name: Set up JDK 17 uses: actions/setup-java@v6 with: - java-version: '17' + java-version: '21' distribution: 'temurin' cache: 'maven' - name: Restore Maven Local Repository diff --git a/archetypes/assembly/src/main/resources/archetype-resources/pom.xml b/archetypes/assembly/src/main/resources/archetype-resources/pom.xml index 4bd78a8db18..d8f83f8bffb 100644 --- a/archetypes/assembly/src/main/resources/archetype-resources/pom.xml +++ b/archetypes/assembly/src/main/resources/archetype-resources/pom.xml @@ -174,7 +174,7 @@ - 17 + 21 diff --git a/archetypes/blueprint/src/main/resources/archetype-resources/pom.xml b/archetypes/blueprint/src/main/resources/archetype-resources/pom.xml index d442fecc346..cd322ff1458 100644 --- a/archetypes/blueprint/src/main/resources/archetype-resources/pom.xml +++ b/archetypes/blueprint/src/main/resources/archetype-resources/pom.xml @@ -63,8 +63,9 @@ maven-compiler-plugin 3.15.0 - 1.8 - 1.8 + 21 + 21 + 21 256M diff --git a/archetypes/bundle/pom.xml b/archetypes/bundle/pom.xml index 3bbc2cecbac..0cb6128f97a 100644 --- a/archetypes/bundle/pom.xml +++ b/archetypes/bundle/pom.xml @@ -57,8 +57,9 @@ org.apache.maven.plugins maven-compiler-plugin - 1.8 - 1.8 + 21 + 21 + 21 256M diff --git a/archetypes/bundle/src/main/resources/archetype-resources/pom.xml b/archetypes/bundle/src/main/resources/archetype-resources/pom.xml index 798beaeab16..83654cd8942 100644 --- a/archetypes/bundle/src/main/resources/archetype-resources/pom.xml +++ b/archetypes/bundle/src/main/resources/archetype-resources/pom.xml @@ -82,8 +82,9 @@ maven-compiler-plugin 3.15.0 - 1.8 - 1.8 + 21 + 21 + 21 256M diff --git a/archetypes/command/src/main/resources/archetype-resources/pom.xml b/archetypes/command/src/main/resources/archetype-resources/pom.xml index 73ab71c704b..6a579d1cc27 100644 --- a/archetypes/command/src/main/resources/archetype-resources/pom.xml +++ b/archetypes/command/src/main/resources/archetype-resources/pom.xml @@ -67,8 +67,9 @@ true 3.15.0 - 1.8 - 1.8 + 21 + 21 + 21 diff --git a/assemblies/apache-karaf-minimal/pom.xml b/assemblies/apache-karaf-minimal/pom.xml index 072afd67715..481bbedd666 100644 --- a/assemblies/apache-karaf-minimal/pom.xml +++ b/assemblies/apache-karaf-minimal/pom.xml @@ -145,7 +145,7 @@ !org.apache.karaf.command.acl.*, * - 17 + 21 diff --git a/assemblies/apache-karaf-mix/pom.xml b/assemblies/apache-karaf-mix/pom.xml index e07eec0e8bf..0dad89e8c71 100644 --- a/assemblies/apache-karaf-mix/pom.xml +++ b/assemblies/apache-karaf-mix/pom.xml @@ -187,7 +187,7 @@ - 17 + 21 ${project.build.directory} Apache Karaf Mix diff --git a/assemblies/apache-karaf/pom.xml b/assemblies/apache-karaf/pom.xml index 9c05670f68f..60dd7a90911 100644 --- a/assemblies/apache-karaf/pom.xml +++ b/assemblies/apache-karaf/pom.xml @@ -178,7 +178,7 @@ - 17 + 21 ${project.build.directory} Apache Karaf (full) diff --git a/assemblies/features/base/src/main/filtered-resources/resources/bin/inc b/assemblies/features/base/src/main/filtered-resources/resources/bin/inc index 2809e8be7cf..004142ab4ba 100644 --- a/assemblies/features/base/src/main/filtered-resources/resources/bin/inc +++ b/assemblies/features/base/src/main/filtered-resources/resources/bin/inc @@ -282,12 +282,6 @@ setupVendorSepcifics() { setupDefaults() { DEFAULT_JAVA_OPTS="-XX:+UnlockDiagnosticVMOptions " - if [ "${VERSION}" -gt "11" ]; then - # TODO revisit EventAdminImpl to avoid use of Subject.getSubject(AccessController.getContext()); - # -Djava.security.manager=allow is a workaround for SecurityController deprecation in JDK23+ - DEFAULT_JAVA_OPTS="$DEFAULT_JAVA_OPTS -Djava.security.manager=allow " - fi - setupVendorSepcifics DEFAULT_JAVA_OPTS="${DEFAULT_JAVA_OPTS} ${JAVA_VENDOR_OPTS}" diff --git a/assemblies/features/base/src/main/filtered-resources/resources/bin/karaf.bat b/assemblies/features/base/src/main/filtered-resources/resources/bin/karaf.bat index b3893b53873..8f6a88694f1 100644 --- a/assemblies/features/base/src/main/filtered-resources/resources/bin/karaf.bat +++ b/assemblies/features/base/src/main/filtered-resources/resources/bin/karaf.bat @@ -267,10 +267,6 @@ if not exist "%JAVA_HOME%\bin\server\jvm.dll" ( ) set DEFAULT_JAVA_OPTS=-XX:+UnlockDiagnosticVMOptions -if %JAVA_VERSION% GTR 11 ( - set DEFAULT_JAVA_OPTS=%DEFAULT_JAVA_OPTS% -Djava.security.manager=allow -) - if "%JAVA_OPTS%" == "" set JAVA_OPTS=%DEFAULT_JAVA_OPTS% if "%EXTRA_JAVA_OPTS%" == "" goto :KARAF_EXTRA_JAVA_OPTS_END diff --git a/assemblies/features/enterprise/pom.xml b/assemblies/features/enterprise/pom.xml index 5ff00a0b820..281a0c4d0ee 100644 --- a/assemblies/features/enterprise/pom.xml +++ b/assemblies/features/enterprise/pom.xml @@ -214,7 +214,7 @@ file:${project.build.directory}/feature/feature.xml org.apache.karaf.features:framework - 17 + 21 framework diff --git a/assemblies/features/integration/pom.xml b/assemblies/features/integration/pom.xml index 54faea9360a..a4ec1f608c5 100644 --- a/assemblies/features/integration/pom.xml +++ b/assemblies/features/integration/pom.xml @@ -105,7 +105,7 @@ file:${project.build.directory}/feature/feature.xml org.apache.karaf.features:framework - 17 + 21 framework diff --git a/assemblies/features/specs/pom.xml b/assemblies/features/specs/pom.xml index 5944e6081b3..36ba1df5130 100644 --- a/assemblies/features/specs/pom.xml +++ b/assemblies/features/specs/pom.xml @@ -96,7 +96,7 @@ file:${project.build.directory}/feature/feature.xml org.apache.karaf.features:framework - 17 + 21 framework @@ -149,4 +149,4 @@ - \ No newline at end of file + diff --git a/assemblies/features/spring/pom.xml b/assemblies/features/spring/pom.xml index b5abe0e26ad..c04a2ca250c 100644 --- a/assemblies/features/spring/pom.xml +++ b/assemblies/features/spring/pom.xml @@ -158,7 +158,7 @@ file:${project.build.directory}/feature/feature.xml org.apache.karaf.features:framework - 17 + 21 framework diff --git a/assemblies/features/standard/pom.xml b/assemblies/features/standard/pom.xml index a5b8a708d98..de96c1303ef 100644 --- a/assemblies/features/standard/pom.xml +++ b/assemblies/features/standard/pom.xml @@ -488,7 +488,7 @@ file:${project.build.directory}/feature/feature.xml org.apache.karaf.features:framework - 17 + 21 framework diff --git a/examples/karaf-docker-example/karaf-docker-example-dynamic-dist/pom.xml b/examples/karaf-docker-example/karaf-docker-example-dynamic-dist/pom.xml index 737f04e70c6..178a862747c 100644 --- a/examples/karaf-docker-example/karaf-docker-example-dynamic-dist/pom.xml +++ b/examples/karaf-docker-example/karaf-docker-example-dynamic-dist/pom.xml @@ -139,7 +139,7 @@ - 17 + 21 @@ -195,4 +195,4 @@ - \ No newline at end of file + diff --git a/examples/karaf-docker-example/karaf-docker-example-static-dist/pom.xml b/examples/karaf-docker-example/karaf-docker-example-static-dist/pom.xml index 962cb65914f..d8441b63a56 100644 --- a/examples/karaf-docker-example/karaf-docker-example-static-dist/pom.xml +++ b/examples/karaf-docker-example/karaf-docker-example-static-dist/pom.xml @@ -111,7 +111,7 @@ static true static - 17 + 21 diff --git a/examples/karaf-graphql-example/karaf-graphql-example-websocket/pom.xml b/examples/karaf-graphql-example/karaf-graphql-example-websocket/pom.xml index c684882f738..61817c99136 100644 --- a/examples/karaf-graphql-example/karaf-graphql-example-websocket/pom.xml +++ b/examples/karaf-graphql-example/karaf-graphql-example-websocket/pom.xml @@ -70,8 +70,8 @@ org.apache.maven.plugins maven-compiler-plugin - 11 - 11 + 21 + 21 diff --git a/instance/src/main/java/org/apache/karaf/instance/core/internal/InstanceServiceImpl.java b/instance/src/main/java/org/apache/karaf/instance/core/internal/InstanceServiceImpl.java index 089c20dd60f..0345ba95bdf 100644 --- a/instance/src/main/java/org/apache/karaf/instance/core/internal/InstanceServiceImpl.java +++ b/instance/src/main/java/org/apache/karaf/instance/core/internal/InstanceServiceImpl.java @@ -589,9 +589,6 @@ private static void doStart(InstanceState instance, String name, String javaOpts " --add-exports=jdk.naming.rmi/com.sun.jndi.url.rmi=ALL-UNNAMED" + " --add-exports=java.security.sasl/com.sun.security.sasl=ALL-UNNAMED" + " --add-exports=java.naming/com.sun.jndi.ldap=ALL-UNNAMED"; - if (!System.getProperty("java.version").startsWith("11")) { - jdkOpts += " -Djava.security.manager=allow"; - } } else { jdkOpts = " -Djava.endorsed.dirs=\"" + new File(new File(new File(System.getProperty("java.home"), "jre"), "lib"), "endorsed") + System.getProperty("path.separator") + new File(new File(System.getProperty("java.home"), "lib"), "endorsed") + "\"" + " -Djava.ext.dirs=\"" + new File(new File(new File(System.getProperty("java.home"), "jre"), "lib"), "ext") + System.getProperty("path.separator") + new File(new File(System.getProperty("java.home"), "lib"), "ext") + System.getProperty("path.separator") + new File(libDir, "ext").getCanonicalPath() + "\""; diff --git a/itests/common/src/main/java/org/apache/karaf/itests/KarafTestSupport.java b/itests/common/src/main/java/org/apache/karaf/itests/KarafTestSupport.java index 0f6971c2315..79c4a4403aa 100644 --- a/itests/common/src/main/java/org/apache/karaf/itests/KarafTestSupport.java +++ b/itests/common/src/main/java/org/apache/karaf/itests/KarafTestSupport.java @@ -25,7 +25,6 @@ import java.nio.file.Path; import java.nio.file.Paths; import java.security.Principal; -import java.security.PrivilegedExceptionAction; import java.util.Arrays; import java.util.Collection; import java.util.Collections; @@ -421,7 +420,7 @@ private String executeCommand(final String command, final Long timeout, final Lo commandFuture = new FutureTask<>(() -> { Subject subject = new Subject(); subject.getPrincipals().addAll(Arrays.asList(principals)); - return Subject.doAs(subject, (PrivilegedExceptionAction) commandCallable::call); + return Subject.callAs(subject, (Callable) commandCallable::call); }); } diff --git a/itests/test/src/test/java/org/apache/karaf/itests/JavaSecurityTest.java b/itests/test/src/test/java/org/apache/karaf/itests/JavaSecurityTest.java index 009a9e436d3..2d6459b0a6b 100644 --- a/itests/test/src/test/java/org/apache/karaf/itests/JavaSecurityTest.java +++ b/itests/test/src/test/java/org/apache/karaf/itests/JavaSecurityTest.java @@ -34,7 +34,6 @@ import java.nio.file.StandardCopyOption; import java.util.*; -import static org.junit.Assert.assertNotNull; import static org.junit.Assert.fail; import static org.ops4j.pax.exam.CoreOptions.maven; import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.*; @@ -72,8 +71,6 @@ public Option[] config() { @Test public void testJavaSecurity() throws Exception { - assertNotNull("Karaf should run under a security manager", System.getSecurityManager()); - BundleService service = getOsgiService(BundleService.class); long tried = 0; while (true) { diff --git a/jaas/command/src/main/java/org/apache/karaf/jaas/command/WhoamiCommand.java b/jaas/command/src/main/java/org/apache/karaf/jaas/command/WhoamiCommand.java index 3ce1e5dc6df..c587f166ed5 100644 --- a/jaas/command/src/main/java/org/apache/karaf/jaas/command/WhoamiCommand.java +++ b/jaas/command/src/main/java/org/apache/karaf/jaas/command/WhoamiCommand.java @@ -55,8 +55,7 @@ public Object execute() throws Exception { ShellTable table = new ShellTable(); // Get the currently-active JAAS Subject. - AccessControlContext acc = AccessController.getContext(); - Subject subj = Subject.getSubject(acc); + Subject subj = Subject.current(); String classString = USER_CLASS; if (groups) { diff --git a/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/ldap/GSSAPILdapLoginModule.java b/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/ldap/GSSAPILdapLoginModule.java index 2c911765529..dd365e0fa05 100644 --- a/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/ldap/GSSAPILdapLoginModule.java +++ b/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/ldap/GSSAPILdapLoginModule.java @@ -34,6 +34,8 @@ import java.util.HashMap; import java.util.HashSet; import java.util.Map; +import java.util.concurrent.Callable; +import java.util.concurrent.CompletionException; /** * Specific LDAPLoginModule to be used with GSSAPI. Uses the specified realm as login context. @@ -62,9 +64,9 @@ public boolean login() throws LoginException { context.login(); try { - succeeded = Subject.doAs(context.getSubject(), (PrivilegedExceptionAction) this::doLogin); + succeeded = Subject.callAs(context.getSubject(), (Callable) this::doLogin); return succeeded; - } catch (PrivilegedActionException pExcp) { + } catch (CompletionException pExcp) { logger.error("error with delegated authentication", pExcp); throw new LoginException(pExcp.getMessage()); } diff --git a/main/src/test/java/org/apache/karaf/main/MainLockingTest.java b/main/src/test/java/org/apache/karaf/main/MainLockingTest.java index ac01543343c..d1beb601343 100644 --- a/main/src/test/java/org/apache/karaf/main/MainLockingTest.java +++ b/main/src/test/java/org/apache/karaf/main/MainLockingTest.java @@ -38,6 +38,16 @@ public class MainLockingTest { private File data; private File log; + private Bundle installTimeoutShutdownBundle(Framework framework) throws Exception { + return framework.getBundleContext().installBundle("foo", + TinyBundles.bundle() + .addClass(TimeoutShutdownActivator.class) + .setHeader(Constants.BUNDLE_ACTIVATOR, TimeoutShutdownActivator.class.getName()) + .setHeader(Constants.IMPORT_PACKAGE, "org.osgi.framework") + .build(TinyBundles.bndBuilder()) + ); + } + @Before public void setUp() throws IOException { File basedir = new File(getClass().getClassLoader().getResource("foo").getPath()).getParentFile(); @@ -82,12 +92,7 @@ public void testLostMasterLock() throws Exception { Main main = new Main(args); main.launch(); Framework framework = main.getFramework(); - Bundle bundle = framework.getBundleContext().installBundle("foo", - TinyBundles.bundle() - .addClass(TimeoutShutdownActivator.class) - .setHeader(Constants.BUNDLE_ACTIVATOR, TimeoutShutdownActivator.class.getName()) - .build(TinyBundles.bndBuilder()) - ); + Bundle bundle = installTimeoutShutdownBundle(framework); bundle.start(); @@ -127,12 +132,7 @@ public void testRetainsMasterLockOverFluctuation() throws Exception { Main main = new Main(args); main.launch(); Framework framework = main.getFramework(); - Bundle bundle = framework.getBundleContext().installBundle("foo", - TinyBundles.bundle() - .setHeader(Constants.BUNDLE_ACTIVATOR, TimeoutShutdownActivator.class.getName()) - .addClass(TimeoutShutdownActivator.class) - .build(TinyBundles.bndBuilder()) - ); + Bundle bundle = installTimeoutShutdownBundle(framework); bundle.start(); @@ -172,11 +172,7 @@ public void testLostMasterLockAfterThreshold() throws Exception { Main main = new Main(args); main.launch(); Framework framework = main.getFramework(); - Bundle bundle = framework.getBundleContext().installBundle("foo", - TinyBundles.bundle() - .setHeader(Constants.BUNDLE_ACTIVATOR, TimeoutShutdownActivator.class.getName()) - .addClass(TimeoutShutdownActivator.class) - .build(TinyBundles.bndBuilder())); + Bundle bundle = installTimeoutShutdownBundle(framework); bundle.start(); diff --git a/management/server/src/main/java/org/apache/karaf/management/internal/BulkRequestContext.java b/management/server/src/main/java/org/apache/karaf/management/internal/BulkRequestContext.java index 7d1e0641e80..ce6f8f796cb 100644 --- a/management/server/src/main/java/org/apache/karaf/management/internal/BulkRequestContext.java +++ b/management/server/src/main/java/org/apache/karaf/management/internal/BulkRequestContext.java @@ -63,16 +63,11 @@ public static BulkRequestContext newContext(ConfigurationAdmin configAdmin) thro context.configAdmin = configAdmin; try { // check JAAS subject here - AccessControlContext acc = AccessController.getContext(); - if (acc == null) { + Subject subject = Subject.current(); + if (subject == null) { context.anonymous = true; } else { - Subject subject = Subject.getSubject(acc); - if (subject == null) { - context.anonymous = true; - } else { - context.principals.addAll(subject.getPrincipals()); - } + context.principals.addAll(subject.getPrincipals()); } // list available ACL configs - valid for this instance only for (Configuration config : configAdmin.listConfigurations("(service.pid=jmx.acl*)")) { diff --git a/management/server/src/test/java/org/apache/karaf/management/KarafMBeanServerGuardTest.java b/management/server/src/test/java/org/apache/karaf/management/KarafMBeanServerGuardTest.java index dbaa404fcae..26f7d7e2a2f 100644 --- a/management/server/src/test/java/org/apache/karaf/management/KarafMBeanServerGuardTest.java +++ b/management/server/src/test/java/org/apache/karaf/management/KarafMBeanServerGuardTest.java @@ -33,8 +33,8 @@ import java.io.IOException; import java.lang.reflect.Method; import java.security.Principal; -import java.security.PrivilegedAction; import java.util.*; +import java.util.concurrent.Callable; public class KarafMBeanServerGuardTest extends TestCase { @@ -462,7 +462,7 @@ private static ConfigurationAdmin getMockConfigAdmin2(Dictionary public void testCurrentUserHasRole() throws Exception { Subject subject = loginWithTestRoles("test"); - Subject.doAs(subject, (PrivilegedAction) () -> { + Subject.callAs(subject, (Callable) () -> { assertTrue(JaasHelper.currentUserHasRole("test")); assertFalse(JaasHelper.currentUserHasRole("toast")); return null; @@ -476,7 +476,7 @@ public void testCurrentUserHasCustomRole() throws Exception { lm.login(); lm.commit(); - Subject.doAs(subject, (PrivilegedAction) () -> { + Subject.callAs(subject, (Callable) () -> { assertTrue(JaasHelper.currentUserHasRole(TestRolePrincipal.class.getCanonicalName() + ":foo")); assertFalse(JaasHelper.currentUserHasRole("foo")); return null; @@ -493,7 +493,7 @@ public void testInvoke() throws Throwable { guard.setConfigAdmin(ca); Subject subject = loginWithTestRoles("editor", "admin"); - Subject.doAs(subject, (PrivilegedAction) () -> { + Subject.callAs(subject, (Callable) () -> { try { Method im = MBeanServer.class.getMethod("invoke", ObjectName.class, String.class, Object[].class, String[].class); @@ -676,7 +676,7 @@ public void testGetAttributeIs() throws Throwable { guard.setConfigAdmin(ca); Subject subject = loginWithTestRoles("editor", "admin"); - Subject.doAs(subject, (PrivilegedAction) () -> { + Subject.callAs(subject, (Callable) () -> { try { Method im = MBeanServer.class.getMethod("getAttribute", ObjectName.class, String.class); @@ -722,7 +722,7 @@ public void testGetAttributes() throws Throwable { guard.setConfigAdmin(ca); Subject subject = loginWithTestRoles("editor", "admin"); - Subject.doAs(subject, (PrivilegedAction) () -> { + Subject.callAs(subject, (Callable) () -> { try { Method im = MBeanServer.class.getMethod("getAttributes", ObjectName.class, String[].class); @@ -770,7 +770,7 @@ public void testGetAttributes2() throws Throwable { guard.setConfigAdmin(ca); Subject subject = loginWithTestRoles("editor", "admin"); - Subject.doAs(subject, (PrivilegedAction) () -> { + Subject.callAs(subject, (Callable) () -> { try { Method im = MBeanServer.class.getMethod("getAttributes", ObjectName.class, String[].class); @@ -817,7 +817,7 @@ public void testSetAttribute() throws Throwable { guard.setConfigAdmin(ca); Subject subject = loginWithTestRoles("editor", "admin"); - Subject.doAs(subject, (PrivilegedAction) () -> { + Subject.callAs(subject, (Callable) () -> { try { Method im = MBeanServer.class.getMethod("setAttribute", ObjectName.class, Attribute.class); @@ -871,7 +871,7 @@ public void testSetAttributes() throws Throwable { guard.setConfigAdmin(ca); Subject subject = loginWithTestRoles("editor", "admin"); - Subject.doAs(subject, (PrivilegedAction) () -> { + Subject.callAs(subject, (Callable) () -> { try { Method im = MBeanServer.class.getMethod("setAttributes", ObjectName.class, AttributeList.class); @@ -939,7 +939,7 @@ public void testCanInvokeMBean() throws Exception { Subject subject = loginWithTestRoles("viewer"); - Subject.doAs(subject, (PrivilegedAction) () -> { + Subject.callAs(subject, (Callable) () -> { try { assertTrue(guard.canInvoke(mbs, on)); assertFalse(guard.canInvoke(mbs, on2)); @@ -980,7 +980,7 @@ public void testCanInvokeMBean2() throws Exception { Subject subject = loginWithTestRoles("viewer"); - Subject.doAs(subject, (PrivilegedAction) () -> { + Subject.callAs(subject, (Callable) () -> { try { assertFalse(guard.canInvoke(mbs, on)); @@ -1018,7 +1018,7 @@ public void testCanInvokeAnyOverload() throws Exception { guard.setConfigAdmin(ca); Subject subject = loginWithTestRoles("viewer"); - Subject.doAs(subject, (PrivilegedAction) () -> { + Subject.callAs(subject, (Callable) () -> { try { assertTrue(guard.canInvoke(mbs, on, "doit")); @@ -1057,7 +1057,7 @@ public void testCanInvokeAnyOverload2() throws Exception { guard.setConfigAdmin(ca); Subject subject = loginWithTestRoles("viewer"); - Subject.doAs(subject, (PrivilegedAction) () -> { + Subject.callAs(subject, (Callable) () -> { try { assertFalse(guard.canInvoke(mbs, on, "doit")); @@ -1089,7 +1089,7 @@ public void testCanInvokeAnyOverload3() throws Exception { guard.setConfigAdmin(ca); Subject subject = loginWithTestRoles("viewer"); - Subject.doAs(subject, (PrivilegedAction) () -> { + Subject.callAs(subject, (Callable) () -> { try { assertFalse(guard.canInvoke(mbs, on, "doit")); @@ -1123,7 +1123,7 @@ public void testCanGetAttributeAnyOverload() throws Exception { guard.setConfigAdmin(ca); Subject subject = loginWithTestRoles("viewer"); - Subject.doAs(subject, (PrivilegedAction) () -> { + Subject.callAs(subject, (Callable) () -> { try { assertTrue(guard.canInvoke(mbs, on, "getFoo")); @@ -1157,7 +1157,7 @@ public void testCanGetAttributeAnyOverload2() throws Exception { guard.setConfigAdmin(ca); Subject subject = loginWithTestRoles("viewer"); - Subject.doAs(subject, (PrivilegedAction) () -> { + Subject.callAs(subject, (Callable) () -> { try { assertFalse(guard.canInvoke(mbs, on, "getFoo")); @@ -1192,7 +1192,7 @@ public void testCanGetAttributeAnyOverload3() throws Exception { guard.setConfigAdmin(ca); Subject subject = loginWithTestRoles("viewer"); - Subject.doAs(subject, (PrivilegedAction) () -> { + Subject.callAs(subject, (Callable) () -> { try { assertTrue(guard.canInvoke(mbs, on, "isFoo")); @@ -1227,7 +1227,7 @@ public void testCanGetAttributeAnyOverload4() throws Exception { guard.setConfigAdmin(ca); Subject subject = loginWithTestRoles("viewer"); - Subject.doAs(subject, (PrivilegedAction) () -> { + Subject.callAs(subject, (Callable) () -> { try { assertFalse(guard.canInvoke(mbs, on, "isFoo")); @@ -1261,7 +1261,7 @@ public void testCanSetAttributeAnyOverload() throws Exception { guard.setConfigAdmin(ca); Subject subject = loginWithTestRoles("viewer"); - Subject.doAs(subject, (PrivilegedAction) () -> { + Subject.callAs(subject, (Callable) () -> { try { assertTrue(guard.canInvoke(mbs, on, "setFoo")); @@ -1295,7 +1295,7 @@ public void testCanSetAttributeAnyOverload2() throws Exception { guard.setConfigAdmin(ca); Subject subject = loginWithTestRoles("viewer"); - Subject.doAs(subject, (PrivilegedAction) () -> { + Subject.callAs(subject, (Callable) () -> { try { assertFalse(guard.canInvoke(mbs, on, "setFoo")); @@ -1331,7 +1331,7 @@ public void testCanInvokeMBeanGetter() throws Exception { Subject subject = loginWithTestRoles("viewer"); - Subject.doAs(subject, (PrivilegedAction) () -> { + Subject.callAs(subject, (Callable) () -> { try { assertTrue(guard.canInvoke(mbs, on)); @@ -1367,7 +1367,7 @@ public void testCanInvokeMBeanGetter2() throws Exception { Subject subject = loginWithTestRoles("viewer"); - Subject.doAs(subject, (PrivilegedAction) () -> { + Subject.callAs(subject, (Callable) () -> { try { assertFalse(guard.canInvoke(mbs, on)); @@ -1403,7 +1403,7 @@ public void testCanInvokeMBeanGetter3() throws Exception { Subject subject = loginWithTestRoles("viewer"); - Subject.doAs(subject, (PrivilegedAction) () -> { + Subject.callAs(subject, (Callable) () -> { try { assertTrue(guard.canInvoke(mbs, on)); @@ -1439,7 +1439,7 @@ public void testCanInvokeMBeanSetter() throws Exception { Subject subject = loginWithTestRoles("viewer"); - Subject.doAs(subject, (PrivilegedAction) () -> { + Subject.callAs(subject, (Callable) () -> { try { assertTrue(guard.canInvoke(mbs, on)); @@ -1475,7 +1475,7 @@ public void testCanInvokeMBeanSetter2() throws Exception { Subject subject = loginWithTestRoles("viewer"); - Subject.doAs(subject, (PrivilegedAction) () -> { + Subject.callAs(subject, (Callable) () -> { try { assertFalse(guard.canInvoke(mbs, on)); @@ -1503,7 +1503,7 @@ public void testCanInvokeMethod() throws Exception { Subject subject = loginWithTestRoles("viewer"); - Subject.doAs(subject, (PrivilegedAction) () -> { + Subject.callAs(subject, (Callable) () -> { try { assertTrue(guard.canInvoke(null, on, "dodo", new String[]{"java.lang.String"})); assertTrue(guard.canInvoke(null, on, "doit", new String[]{"java.lang.String", "java.lang.String"})); @@ -1536,7 +1536,7 @@ public void testCanInvokeMethod2() throws Exception { Subject subject = loginWithTestRoles("viewer"); - Subject.doAs(subject, (PrivilegedAction) () -> { + Subject.callAs(subject, (Callable) () -> { try { assertTrue(guard.canInvoke(null, on, "doit", new String[]{"java.lang.String"})); assertTrue(guard.canInvoke(null, on, "doit", new String[]{})); diff --git a/pom.xml b/pom.xml index f51dcf1bca3..c700755fa66 100644 --- a/pom.xml +++ b/pom.xml @@ -150,7 +150,8 @@ 1695310533 - 11 + 21 + 21 scm:git:https://gitbox.apache.org/repos/asf/karaf.git scm:git:https://gitbox.apache.org/repos/asf/karaf.git @@ -454,6 +455,15 @@ + + org.apache.maven.plugins + maven-compiler-plugin + + + -Xlint:deprecation + + + org.apache.maven.plugins maven-eclipse-plugin @@ -642,7 +652,8 @@ [3.8.8,4) - [17,) + + [21,) @@ -911,7 +922,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 1.8 + 21 diff --git a/service/guard/src/test/java/org/apache/karaf/service/guard/impl/GuardProxyCatalogTest.java b/service/guard/src/test/java/org/apache/karaf/service/guard/impl/GuardProxyCatalogTest.java index 21bb8f993f1..54bb4b737d3 100644 --- a/service/guard/src/test/java/org/apache/karaf/service/guard/impl/GuardProxyCatalogTest.java +++ b/service/guard/src/test/java/org/apache/karaf/service/guard/impl/GuardProxyCatalogTest.java @@ -28,9 +28,9 @@ import java.io.IOException; import java.security.Principal; -import java.security.PrivilegedAction; import java.util.ArrayList; import java.util.Arrays; +import java.util.concurrent.Callable; import java.util.Collection; import java.util.Collections; import java.util.Dictionary; @@ -338,7 +338,7 @@ public void testInvocationBlocking1() throws Exception { // Run with the right credentials so we can test the expected roles Subject subject = new Subject(); subject.getPrincipals().add(new RolePrincipal("b")); - Subject.doAs(subject, (PrivilegedAction) () -> { + Subject.callAs(subject, (Callable) () -> { assertEquals("Doing it", ((TestServiceAPI) proxy).doit()); if (!runningUnderCoverage) { try { @@ -369,7 +369,7 @@ public void testInvocationBlocking2() throws Exception { // Run with the right credentials so we can test the expected roles Subject subject = new Subject(); subject.getPrincipals().add(new RolePrincipal("b")); - Subject.doAs(subject, (PrivilegedAction) () -> { + Subject.callAs(subject, (Callable) () -> { if (!runningUnderCoverage) { assertEquals(-42L, ((TestObjectWithoutInterface) proxy).compute(42L)); try { @@ -414,7 +414,7 @@ public String doit() { // Run with the right credentials so we can test the expected roles Subject subject = new Subject(); subject.getPrincipals().add(new RolePrincipal("c")); - Subject.doAs(subject, (PrivilegedAction) () -> { + Subject.callAs(subject, (Callable) () -> { assertEquals("Doing it", ((TestServiceAPI) proxy).doit()); return null; }); @@ -422,7 +422,7 @@ public String doit() { Subject subject2 = new Subject(); subject2.getPrincipals().add(new RolePrincipal("b")); subject2.getPrincipals().add(new RolePrincipal("f")); - Subject.doAs(subject2, (PrivilegedAction) () -> { + Subject.callAs(subject2, (Callable) () -> { try { assertEquals("Doing it", ((TestServiceAPI) proxy).doit()); fail("Should have been blocked"); @@ -450,7 +450,7 @@ public void testInvocationBlocking4() throws Exception { // Run with the right credentials so we can test the expected roles Subject subject = new Subject(); subject.getPrincipals().add(new RolePrincipal("b")); - Subject.doAs(subject, (PrivilegedAction) () -> { + Subject.callAs(subject, (Callable) () -> { assertEquals("Doing it", ((TestServiceAPI) proxy).doit()); if (!runningUnderCoverage) { assertEquals(42L, ((TestObjectWithoutInterface) proxy).compute(-42L)); @@ -478,7 +478,7 @@ public void testInvocationBlocking5() throws Exception { // Invoke the service with role 'c'. Subject subject = new Subject(); subject.getPrincipals().add(new RolePrincipal("c")); - Subject.doAs(subject, (PrivilegedAction) () -> { + Subject.callAs(subject, (Callable) () -> { assertEquals("The invocation under role 'c' should be ok, as there are no rules specified " + "for this service at all.", "HELLO", ((TestServiceAPI2) proxy).doit("hello")); return null; @@ -507,7 +507,7 @@ public void testInvocationBlocking6() throws Exception { subject.getPrincipals().add(new RolePrincipal("a")); subject.getPrincipals().add(new RolePrincipal("b")); subject.getPrincipals().add(new RolePrincipal("c")); - Subject.doAs(subject, (PrivilegedAction) () -> { + Subject.callAs(subject, (Callable) () -> { try { ((TestServiceAPI2) proxy).doit("hello"); fail("The invocation should not process as the 'doit' operation has no roles associated with it"); @@ -533,7 +533,7 @@ public void testInvocationBlocking7() throws Exception { final Object proxy = testCreateProxy(bc, new Class [] {TestServiceAPI3.class}, new TestService3()); Subject s1 = new Subject(); - Subject.doAs(s1, (PrivilegedAction) () -> { + Subject.callAs(s1, (Callable) () -> { TestServiceAPI3 obj = (TestServiceAPI3) proxy; assertEquals("Should have allowed this invocation for any (or no) role", -7, obj.foo(7)); try { @@ -556,7 +556,7 @@ public void testInvocationBlocking7() throws Exception { s2.getPrincipals().add(new RolePrincipal("a")); s2.getPrincipals().add(new RolePrincipal("b")); s2.getPrincipals().add(new RolePrincipal("d")); - Subject.doAs(s2, (PrivilegedAction) () -> { + Subject.callAs(s2, (Callable) () -> { TestServiceAPI3 obj = (TestServiceAPI3) proxy; assertEquals(42, obj.foo()); assertEquals(99, obj.bar()); @@ -585,7 +585,7 @@ public String getName() { Subject s1 = new Subject(); s1.getPrincipals().add(new RolePrincipal("role1")); - Subject.doAs(s1, (PrivilegedAction) () -> { + Subject.callAs(s1, (Callable) () -> { try { ((TestServiceAPI) proxy).doit(); fail("Should have prevented this invocation as the custom role is required"); @@ -598,7 +598,7 @@ public String getName() { Subject s2 = new Subject(); s2.getPrincipals().add(new MyRolePrincipal()); - Subject.doAs(s2, (PrivilegedAction) () -> { + Subject.callAs(s2, (Callable) () -> { ((TestServiceAPI) proxy).doit(); // Should work, the custom role is there return null; }); @@ -606,7 +606,7 @@ public String getName() { Subject s3 = new Subject(); s3.getPrincipals().add(new MyRolePrincipal()); s3.getPrincipals().add(new RolePrincipal("role1")); - Subject.doAs(s3, (PrivilegedAction) () -> { + Subject.callAs(s3, (Callable) () -> { ((TestServiceAPI) proxy).doit(); // Should work, the custom role is there return null; }); diff --git a/services/eventadmin/src/main/java/org/apache/felix/eventadmin/impl/handler/EventAdminImpl.java b/services/eventadmin/src/main/java/org/apache/felix/eventadmin/impl/handler/EventAdminImpl.java index 5491865dd9a..04188de856b 100644 --- a/services/eventadmin/src/main/java/org/apache/felix/eventadmin/impl/handler/EventAdminImpl.java +++ b/services/eventadmin/src/main/java/org/apache/felix/eventadmin/impl/handler/EventAdminImpl.java @@ -143,7 +143,7 @@ private Event prepareEvent(Event event) { boolean needSubject = addSubject && !event.containsProperty(SUBJECT); Subject subject = null; if (needSubject) { - subject = Subject.getSubject(AccessController.getContext()); + subject = Subject.current(); needSubject = (subject != null); } if (needTimeStamp || needSubject) { diff --git a/shell/console/src/main/java/org/apache/karaf/shell/security/impl/SecuredCommandProcessorImpl.java b/shell/console/src/main/java/org/apache/karaf/shell/security/impl/SecuredCommandProcessorImpl.java index 8ae524c936d..6b882ec9002 100644 --- a/shell/console/src/main/java/org/apache/karaf/shell/security/impl/SecuredCommandProcessorImpl.java +++ b/shell/console/src/main/java/org/apache/karaf/shell/security/impl/SecuredCommandProcessorImpl.java @@ -58,8 +58,7 @@ private SecuredCommandProcessorImpl(BundleContext bc, ServiceReference bundleContext = bc; threadIOServiceReference = sr; - AccessControlContext acc = AccessController.getContext(); - Subject sub = Subject.getSubject(acc); + Subject sub = Subject.current(); if (sub == null) throw new SecurityException("No current Subject in the Access Control Context"); diff --git a/shell/console/src/main/java/org/apache/karaf/shell/util/ShellUtil.java b/shell/console/src/main/java/org/apache/karaf/shell/util/ShellUtil.java index 5942a890df8..4d75d3fa4a6 100644 --- a/shell/console/src/main/java/org/apache/karaf/shell/util/ShellUtil.java +++ b/shell/console/src/main/java/org/apache/karaf/shell/util/ShellUtil.java @@ -170,8 +170,7 @@ public static void logException(CommandSession session, Throwable t) { } public static String getCurrentUserName() { - AccessControlContext acc = AccessController.getContext(); - final Subject subject = Subject.getSubject(acc); + final Subject subject = Subject.current(); if (subject != null && subject.getPrincipals(UserPrincipal.class).iterator().hasNext()) { return subject.getPrincipals(UserPrincipal.class).iterator().next().getName(); } else { diff --git a/shell/core/src/main/java/org/apache/karaf/shell/impl/console/osgi/secured/SecuredSessionFactoryImpl.java b/shell/core/src/main/java/org/apache/karaf/shell/impl/console/osgi/secured/SecuredSessionFactoryImpl.java index e9544265ea6..77a8d8568d0 100644 --- a/shell/core/src/main/java/org/apache/karaf/shell/impl/console/osgi/secured/SecuredSessionFactoryImpl.java +++ b/shell/core/src/main/java/org/apache/karaf/shell/impl/console/osgi/secured/SecuredSessionFactoryImpl.java @@ -278,11 +278,7 @@ static boolean currentUserHasRole(String requestedRole) { role = requestedRole; } - AccessControlContext acc = AccessController.getContext(); - if (acc == null) { - return false; - } - Subject subject = Subject.getSubject(acc); + Subject subject = Subject.current(); if (subject == null) { return false; diff --git a/shell/core/src/main/java/org/apache/karaf/shell/support/ShellUtil.java b/shell/core/src/main/java/org/apache/karaf/shell/support/ShellUtil.java index 862a895c8e4..d2d6340f2ff 100644 --- a/shell/core/src/main/java/org/apache/karaf/shell/support/ShellUtil.java +++ b/shell/core/src/main/java/org/apache/karaf/shell/support/ShellUtil.java @@ -212,8 +212,7 @@ private static String getPrintStackTraces(Session session) { } public static String getCurrentUserName() { - AccessControlContext acc = AccessController.getContext(); - final Subject subject = Subject.getSubject(acc); + final Subject subject = Subject.current(); if (subject != null && subject.getPrincipals(UserPrincipal.class).iterator().hasNext()) { return subject.getPrincipals(UserPrincipal.class).iterator().next().getName(); } else { diff --git a/tooling/karaf-maven-plugin/pom.xml b/tooling/karaf-maven-plugin/pom.xml index 71541f1031e..dfd90a544c7 100644 --- a/tooling/karaf-maven-plugin/pom.xml +++ b/tooling/karaf-maven-plugin/pom.xml @@ -386,8 +386,7 @@ org.apache.maven.plugins maven-compiler-plugin - 1.8 - 1.8 + 21 256M ${compiler.fork} diff --git a/tooling/karaf-maven-plugin/src/it/test-aggregate-features/pom.xml b/tooling/karaf-maven-plugin/src/it/test-aggregate-features/pom.xml index 7f19a81b036..1902d902372 100644 --- a/tooling/karaf-maven-plugin/src/it/test-aggregate-features/pom.xml +++ b/tooling/karaf-maven-plugin/src/it/test-aggregate-features/pom.xml @@ -71,8 +71,6 @@ org.apache.maven.plugins maven-compiler-plugin - 1.8 - 1.8 256M ${compiler.fork} diff --git a/tooling/karaf-maven-plugin/src/it/test-basic-generation/pom.xml b/tooling/karaf-maven-plugin/src/it/test-basic-generation/pom.xml index 22bba2006db..3d6d4cdad85 100644 --- a/tooling/karaf-maven-plugin/src/it/test-basic-generation/pom.xml +++ b/tooling/karaf-maven-plugin/src/it/test-basic-generation/pom.xml @@ -60,8 +60,6 @@ org.apache.maven.plugins maven-compiler-plugin - 1.8 - 1.8 256M ${compiler.fork} diff --git a/tooling/karaf-maven-plugin/src/it/test-check-dependencies-failure/pom.xml b/tooling/karaf-maven-plugin/src/it/test-check-dependencies-failure/pom.xml index c6aba71d600..d5fba1e9cf5 100644 --- a/tooling/karaf-maven-plugin/src/it/test-check-dependencies-failure/pom.xml +++ b/tooling/karaf-maven-plugin/src/it/test-check-dependencies-failure/pom.xml @@ -67,8 +67,6 @@ org.apache.maven.plugins maven-compiler-plugin - 1.8 - 1.8 256M ${compiler.fork} diff --git a/tooling/karaf-maven-plugin/src/it/test-check-dependencies/pom.xml b/tooling/karaf-maven-plugin/src/it/test-check-dependencies/pom.xml index e16871cdc36..5a3d2e49ee1 100644 --- a/tooling/karaf-maven-plugin/src/it/test-check-dependencies/pom.xml +++ b/tooling/karaf-maven-plugin/src/it/test-check-dependencies/pom.xml @@ -68,8 +68,6 @@ org.apache.maven.plugins maven-compiler-plugin - 1.8 - 1.8 256M ${compiler.fork} diff --git a/tooling/karaf-maven-plugin/src/it/test-feature-dependencies/pom.xml b/tooling/karaf-maven-plugin/src/it/test-feature-dependencies/pom.xml index 4e164560029..e5fe6466f50 100644 --- a/tooling/karaf-maven-plugin/src/it/test-feature-dependencies/pom.xml +++ b/tooling/karaf-maven-plugin/src/it/test-feature-dependencies/pom.xml @@ -71,8 +71,6 @@ org.apache.maven.plugins maven-compiler-plugin - 1.8 - 1.8 256M ${compiler.fork} diff --git a/tooling/karaf-maven-plugin/src/it/test-feature-use-version-range-transfer-properties/transitive/pom.xml b/tooling/karaf-maven-plugin/src/it/test-feature-use-version-range-transfer-properties/transitive/pom.xml index d93bac3301f..cbc4cc32c0b 100644 --- a/tooling/karaf-maven-plugin/src/it/test-feature-use-version-range-transfer-properties/transitive/pom.xml +++ b/tooling/karaf-maven-plugin/src/it/test-feature-use-version-range-transfer-properties/transitive/pom.xml @@ -58,8 +58,6 @@ org.apache.maven.plugins maven-compiler-plugin - 1.8 - 1.8 256M ${compiler.fork} diff --git a/tooling/karaf-maven-plugin/src/it/test-include-project-artifact/pom.xml b/tooling/karaf-maven-plugin/src/it/test-include-project-artifact/pom.xml index 9a5dcb79371..52694c0c167 100644 --- a/tooling/karaf-maven-plugin/src/it/test-include-project-artifact/pom.xml +++ b/tooling/karaf-maven-plugin/src/it/test-include-project-artifact/pom.xml @@ -60,8 +60,6 @@ org.apache.maven.plugins maven-compiler-plugin - 1.8 - 1.8 256M ${compiler.fork} diff --git a/tooling/karaf-maven-plugin/src/it/test-input-file/pom.xml b/tooling/karaf-maven-plugin/src/it/test-input-file/pom.xml index 46177fc18fd..2aa28e6e086 100644 --- a/tooling/karaf-maven-plugin/src/it/test-input-file/pom.xml +++ b/tooling/karaf-maven-plugin/src/it/test-input-file/pom.xml @@ -66,8 +66,6 @@ org.apache.maven.plugins maven-compiler-plugin - 1.8 - 1.8 256M ${compiler.fork} diff --git a/tooling/karaf-maven-plugin/src/it/test-recursive/pom.xml b/tooling/karaf-maven-plugin/src/it/test-recursive/pom.xml index 7c9815ed525..3152796a2c1 100644 --- a/tooling/karaf-maven-plugin/src/it/test-recursive/pom.xml +++ b/tooling/karaf-maven-plugin/src/it/test-recursive/pom.xml @@ -67,8 +67,6 @@ org.apache.maven.plugins maven-compiler-plugin - 1.8 - 1.8 256M ${compiler.fork} diff --git a/tooling/karaf-maven-plugin/src/it/test-rename-main-feature/pom.xml b/tooling/karaf-maven-plugin/src/it/test-rename-main-feature/pom.xml index 7cc1618db8d..b7a752f7b8d 100644 --- a/tooling/karaf-maven-plugin/src/it/test-rename-main-feature/pom.xml +++ b/tooling/karaf-maven-plugin/src/it/test-rename-main-feature/pom.xml @@ -60,8 +60,6 @@ org.apache.maven.plugins maven-compiler-plugin - 1.8 - 1.8 256M ${compiler.fork} diff --git a/tooling/karaf-maven-plugin/src/it/test-repository-dependencies/pom.xml b/tooling/karaf-maven-plugin/src/it/test-repository-dependencies/pom.xml index ee55a1c08a4..d27f23e5545 100644 --- a/tooling/karaf-maven-plugin/src/it/test-repository-dependencies/pom.xml +++ b/tooling/karaf-maven-plugin/src/it/test-repository-dependencies/pom.xml @@ -69,8 +69,6 @@ org.apache.maven.plugins maven-compiler-plugin - 1.8 - 1.8 256M ${compiler.fork} diff --git a/tooling/karaf-maven-plugin/src/it/test-run-bundle/pom.xml b/tooling/karaf-maven-plugin/src/it/test-run-bundle/pom.xml index 1cc29951b9c..9fc6d6916e3 100644 --- a/tooling/karaf-maven-plugin/src/it/test-run-bundle/pom.xml +++ b/tooling/karaf-maven-plugin/src/it/test-run-bundle/pom.xml @@ -56,8 +56,6 @@ org.apache.maven.plugins maven-compiler-plugin - 1.8 - 1.8 256M ${compiler.fork} diff --git a/tooling/karaf-maven-plugin/src/it/test-simplify-bundles/pom.xml b/tooling/karaf-maven-plugin/src/it/test-simplify-bundles/pom.xml index d080db0a634..b2689a4b3a7 100644 --- a/tooling/karaf-maven-plugin/src/it/test-simplify-bundles/pom.xml +++ b/tooling/karaf-maven-plugin/src/it/test-simplify-bundles/pom.xml @@ -80,8 +80,6 @@ org.apache.maven.plugins maven-compiler-plugin - 1.8 - 1.8 256M ${compiler.fork} diff --git a/tooling/karaf-maven-plugin/src/it/test-transitive-as-dependency/pom.xml b/tooling/karaf-maven-plugin/src/it/test-transitive-as-dependency/pom.xml index 6531f6fbd1d..736cc532ccf 100644 --- a/tooling/karaf-maven-plugin/src/it/test-transitive-as-dependency/pom.xml +++ b/tooling/karaf-maven-plugin/src/it/test-transitive-as-dependency/pom.xml @@ -69,8 +69,6 @@ org.apache.maven.plugins maven-compiler-plugin - 1.8 - 1.8 256M ${compiler.fork} diff --git a/tooling/karaf-maven-plugin/src/it/test-type-classifier/pom.xml b/tooling/karaf-maven-plugin/src/it/test-type-classifier/pom.xml index bc359bd397d..64829fc8e36 100644 --- a/tooling/karaf-maven-plugin/src/it/test-type-classifier/pom.xml +++ b/tooling/karaf-maven-plugin/src/it/test-type-classifier/pom.xml @@ -61,8 +61,6 @@ org.apache.maven.plugins maven-compiler-plugin - 1.8 - 1.8 256M ${compiler.fork} diff --git a/util/src/main/java/org/apache/karaf/util/ThreadUtils.java b/util/src/main/java/org/apache/karaf/util/ThreadUtils.java index 9ea69e3ac0e..ad2a764972f 100644 --- a/util/src/main/java/org/apache/karaf/util/ThreadUtils.java +++ b/util/src/main/java/org/apache/karaf/util/ThreadUtils.java @@ -38,8 +38,7 @@ private static class NamedThreadFactory implements ThreadFactory { private final String namePrefix; public NamedThreadFactory(String prefix) { - SecurityManager s = System.getSecurityManager(); - group = (s != null) ? s.getThreadGroup() : Thread.currentThread().getThreadGroup(); + group = Thread.currentThread().getThreadGroup(); namePrefix = prefix + "-" + poolNumber.getAndIncrement() + "-thread-"; } diff --git a/util/src/main/java/org/apache/karaf/util/jaas/JaasHelper.java b/util/src/main/java/org/apache/karaf/util/jaas/JaasHelper.java index e9df8242daf..d121731081f 100644 --- a/util/src/main/java/org/apache/karaf/util/jaas/JaasHelper.java +++ b/util/src/main/java/org/apache/karaf/util/jaas/JaasHelper.java @@ -38,11 +38,7 @@ public static boolean currentUserHasRole(String requestedRole) { return true; } - AccessControlContext acc = AccessController.getContext(); - if (acc == null) { - return false; - } - Subject subject = Subject.getSubject(acc); + Subject subject = Subject.current(); if (subject == null) { return false; } diff --git a/util/src/main/java/org/apache/karaf/util/tracker/BaseActivator.java b/util/src/main/java/org/apache/karaf/util/tracker/BaseActivator.java index 484e78a3cbe..d01441df9a0 100644 --- a/util/src/main/java/org/apache/karaf/util/tracker/BaseActivator.java +++ b/util/src/main/java/org/apache/karaf/util/tracker/BaseActivator.java @@ -72,8 +72,7 @@ public class BaseActivator implements BundleActivator, Runnable, ThreadFactory { private final String namePrefix; public BaseActivator() { - SecurityManager s = System.getSecurityManager(); - group = (s != null) ? s.getThreadGroup() : Thread.currentThread().getThreadGroup(); + group = Thread.currentThread().getThreadGroup(); namePrefix = "activator-" + poolNumber.getAndIncrement() + "-thread-"; } diff --git a/webconsole/gogo/src/main/java/org/apache/karaf/webconsole/gogo/GogoPlugin.java b/webconsole/gogo/src/main/java/org/apache/karaf/webconsole/gogo/GogoPlugin.java index 0c1a1300c95..fb56645cabd 100644 --- a/webconsole/gogo/src/main/java/org/apache/karaf/webconsole/gogo/GogoPlugin.java +++ b/webconsole/gogo/src/main/java/org/apache/karaf/webconsole/gogo/GogoPlugin.java @@ -202,8 +202,7 @@ public SessionTerminal() throws IOException { } private String getCurrentUserName() { - AccessControlContext acc = AccessController.getContext(); - final Subject subject = Subject.getSubject(acc); + final Subject subject = Subject.current(); if (subject != null && subject.getPrincipals().iterator().hasNext()) { return subject.getPrincipals(UserPrincipal.class).iterator().next().getName(); } else { From 37d0943649456a43e734eab73402d33bd2acc140 Mon Sep 17 00:00:00 2001 From: Holger Friedrich Date: Wed, 15 Apr 2026 01:23:19 +0200 Subject: [PATCH 02/23] disable org.osgi.framework.security in JavaSecurityTest --- .../test/java/org/apache/karaf/itests/JavaSecurityTest.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/itests/test/src/test/java/org/apache/karaf/itests/JavaSecurityTest.java b/itests/test/src/test/java/org/apache/karaf/itests/JavaSecurityTest.java index 2d6459b0a6b..d2cfa7a59e1 100644 --- a/itests/test/src/test/java/org/apache/karaf/itests/JavaSecurityTest.java +++ b/itests/test/src/test/java/org/apache/karaf/itests/JavaSecurityTest.java @@ -62,7 +62,8 @@ public Option[] config() { // Add some extra options used by this test... options.addAll(Arrays.asList( editConfigurationFilePut("etc/system.properties", "java.security.policy", "${karaf.etc}/all.policy"), - editConfigurationFilePut("etc/system.properties", "org.osgi.framework.security", "osgi"), + // This is no longer allowed as felix framework 7.0.5 calls System.getSecurityManager() in case it is there, see Felix.java + // editConfigurationFilePut("etc/system.properties", "org.osgi.framework.security", "osgi"), editConfigurationFilePut("etc/system.properties", "org.osgi.framework.trust.repositories", "${karaf.etc}/trustStore.ks"), editConfigurationFilePut("etc/startup.properties", "mvn:org.apache.felix/org.apache.felix.framework.security/" + version, "1"), replaceConfigurationFile("system/org/apache/felix/org.apache.felix.framework.security/" + version + "/org.apache.felix.framework.security-" + version + ".jar", temp.toFile()))); From b10428f941a25591bc23254c8fca215d87a44d13 Mon Sep 17 00:00:00 2001 From: Fryderyk Wysocki Date: Mon, 8 Jun 2026 23:58:53 +0200 Subject: [PATCH 03/23] Updated how Java 21 is set in various places --- BUILDING.md | 4 +- .../resources/archetype-resources/pom.xml | 2 +- assemblies/apache-karaf-minimal/pom.xml | 2 +- assemblies/apache-karaf-mix/pom.xml | 2 +- assemblies/apache-karaf/pom.xml | 2 +- assemblies/features/enterprise/pom.xml | 2 +- assemblies/features/integration/pom.xml | 2 +- assemblies/features/specs/pom.xml | 2 +- assemblies/features/spring/pom.xml | 2 +- assemblies/features/standard/pom.xml | 4 +- .../karaf-docker-example-dynamic-dist/pom.xml | 2 +- .../karaf-docker-example-static-dist/pom.xml | 2 +- .../core/internal/InstanceServiceImpl.java | 49 ++++++------ .../java/org/apache/karaf/itests/JtaTest.java | 76 +++++-------------- .../features/EnterpriseFeaturesTest.java | 1 - .../apache/karaf/itests/util/RunIfRules.java | 40 ---------- pom.xml | 9 ++- 17 files changed, 58 insertions(+), 145 deletions(-) delete mode 100644 itests/test/src/test/java/org/apache/karaf/itests/util/RunIfRules.java diff --git a/BUILDING.md b/BUILDING.md index 4286805b25a..408efd5fe9b 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -21,13 +21,13 @@ ## Initial Setup -1. Install J2SE 11 SDK (or later) +1. Install J2SE 21 SDK (or later) 2. Make sure that your JAVA_HOME environment variable is set to the newly installed JDK location, and that your PATH includes `%JAVA_HOME%\bin` (windows) or `$JAVA_HOME$/bin` (unix). -3. Install Maven 3.8.0 (or later), which can be downloaded from +3. Install Maven 3.8.8 (or later), which can be downloaded from http://maven.apache.org/download.html. Make sure that your PATH includes the `$MVN_HOME/bin` directory. diff --git a/archetypes/assembly/src/main/resources/archetype-resources/pom.xml b/archetypes/assembly/src/main/resources/archetype-resources/pom.xml index d8f83f8bffb..c0fff59c068 100644 --- a/archetypes/assembly/src/main/resources/archetype-resources/pom.xml +++ b/archetypes/assembly/src/main/resources/archetype-resources/pom.xml @@ -174,7 +174,7 @@ - 21 + ^javaVersion^ diff --git a/assemblies/apache-karaf-minimal/pom.xml b/assemblies/apache-karaf-minimal/pom.xml index 481bbedd666..dff15d80164 100644 --- a/assemblies/apache-karaf-minimal/pom.xml +++ b/assemblies/apache-karaf-minimal/pom.xml @@ -145,7 +145,7 @@ !org.apache.karaf.command.acl.*, * - 21 + ${javaVersion} diff --git a/assemblies/apache-karaf-mix/pom.xml b/assemblies/apache-karaf-mix/pom.xml index 0dad89e8c71..4c4039b623c 100644 --- a/assemblies/apache-karaf-mix/pom.xml +++ b/assemblies/apache-karaf-mix/pom.xml @@ -187,7 +187,7 @@ - 21 + ${javaVersion} ${project.build.directory} Apache Karaf Mix diff --git a/assemblies/apache-karaf/pom.xml b/assemblies/apache-karaf/pom.xml index 60dd7a90911..2a263eca686 100644 --- a/assemblies/apache-karaf/pom.xml +++ b/assemblies/apache-karaf/pom.xml @@ -178,7 +178,7 @@ - 21 + ${javaVersion} ${project.build.directory} Apache Karaf (full) diff --git a/assemblies/features/enterprise/pom.xml b/assemblies/features/enterprise/pom.xml index 281a0c4d0ee..d8cc722ba0d 100644 --- a/assemblies/features/enterprise/pom.xml +++ b/assemblies/features/enterprise/pom.xml @@ -214,7 +214,7 @@ file:${project.build.directory}/feature/feature.xml org.apache.karaf.features:framework - 21 + ${javaVersion} framework diff --git a/assemblies/features/integration/pom.xml b/assemblies/features/integration/pom.xml index a4ec1f608c5..0e4d7c326a5 100644 --- a/assemblies/features/integration/pom.xml +++ b/assemblies/features/integration/pom.xml @@ -105,7 +105,7 @@ file:${project.build.directory}/feature/feature.xml org.apache.karaf.features:framework - 21 + ${javaVersion} framework diff --git a/assemblies/features/specs/pom.xml b/assemblies/features/specs/pom.xml index 36ba1df5130..1558c26aeec 100644 --- a/assemblies/features/specs/pom.xml +++ b/assemblies/features/specs/pom.xml @@ -96,7 +96,7 @@ file:${project.build.directory}/feature/feature.xml org.apache.karaf.features:framework - 21 + ${javaVersion} framework diff --git a/assemblies/features/spring/pom.xml b/assemblies/features/spring/pom.xml index c04a2ca250c..8658b716938 100644 --- a/assemblies/features/spring/pom.xml +++ b/assemblies/features/spring/pom.xml @@ -158,7 +158,7 @@ file:${project.build.directory}/feature/feature.xml org.apache.karaf.features:framework - 21 + ${javaVersion} framework diff --git a/assemblies/features/standard/pom.xml b/assemblies/features/standard/pom.xml index de96c1303ef..1116f71dc6b 100644 --- a/assemblies/features/standard/pom.xml +++ b/assemblies/features/standard/pom.xml @@ -488,7 +488,7 @@ file:${project.build.directory}/feature/feature.xml org.apache.karaf.features:framework - 21 + ${javaVersion} framework @@ -515,7 +515,7 @@ target/feature/feature.xml - features + features xml diff --git a/examples/karaf-docker-example/karaf-docker-example-dynamic-dist/pom.xml b/examples/karaf-docker-example/karaf-docker-example-dynamic-dist/pom.xml index 178a862747c..634aaab1618 100644 --- a/examples/karaf-docker-example/karaf-docker-example-dynamic-dist/pom.xml +++ b/examples/karaf-docker-example/karaf-docker-example-dynamic-dist/pom.xml @@ -139,7 +139,7 @@ - 21 + ${javaVersion} diff --git a/examples/karaf-docker-example/karaf-docker-example-static-dist/pom.xml b/examples/karaf-docker-example/karaf-docker-example-static-dist/pom.xml index d8441b63a56..91a3fe1d3e7 100644 --- a/examples/karaf-docker-example/karaf-docker-example-static-dist/pom.xml +++ b/examples/karaf-docker-example/karaf-docker-example-static-dist/pom.xml @@ -111,7 +111,7 @@ static true static - 21 + ${javaVersion} diff --git a/instance/src/main/java/org/apache/karaf/instance/core/internal/InstanceServiceImpl.java b/instance/src/main/java/org/apache/karaf/instance/core/internal/InstanceServiceImpl.java index 0345ba95bdf..c00c26c068e 100644 --- a/instance/src/main/java/org/apache/karaf/instance/core/internal/InstanceServiceImpl.java +++ b/instance/src/main/java/org/apache/karaf/instance/core/internal/InstanceServiceImpl.java @@ -565,34 +565,29 @@ private static void doStart(InstanceState instance, String name, String javaOpts classpath.append(childClasspath); } - String jdkOpts; - if (!System.getProperty("java.version").startsWith("1.")) { - StringBuilder jdk9Classpath = classpathFromLibDir(new File(new File(System.getProperty("karaf.home"), "lib"), "jdk9plus")); - if (jdk9Classpath.length() > 0) { - classpath.append(System.getProperty("path.separator")); - classpath.append(jdk9Classpath); - } - jdkOpts = " --add-opens java.base/java.security=ALL-UNNAMED" + - " --add-opens java.base/java.net=ALL-UNNAMED" + - " --add-opens java.base/java.lang=ALL-UNNAMED" + - " --add-opens java.base/java.util=ALL-UNNAMED" + - " --add-opens java.naming/javax.naming.spi=ALL-UNNAMED" + - " --add-opens java.rmi/sun.rmi.transport.tcp=ALL-UNNAMED" + - " --add-exports=java.base/sun.net.www.protocol.file=ALL-UNNAMED" + - " --add-exports=java.base/sun.net.www.protocol.ftp=ALL-UNNAMED" + - " --add-exports=java.base/sun.net.www.protocol.http=ALL-UNNAMED" + - " --add-exports=java.base/sun.net.www.protocol.https=ALL-UNNAMED" + - " --add-exports=java.base/sun.net.www.protocol.jar=ALL-UNNAMED" + - " --add-exports=java.base/sun.net.www.content.text=ALL-UNNAMED" + - " --add-exports=jdk.xml.dom/org.w3c.dom.html=ALL-UNNAMED" + - " --add-exports=java.rmi/sun.rmi.registry=ALL-UNNAMED" + - " --add-exports=jdk.naming.rmi/com.sun.jndi.url.rmi=ALL-UNNAMED" + - " --add-exports=java.security.sasl/com.sun.security.sasl=ALL-UNNAMED" + - " --add-exports=java.naming/com.sun.jndi.ldap=ALL-UNNAMED"; - } else { - jdkOpts = " -Djava.endorsed.dirs=\"" + new File(new File(new File(System.getProperty("java.home"), "jre"), "lib"), "endorsed") + System.getProperty("path.separator") + new File(new File(System.getProperty("java.home"), "lib"), "endorsed") + "\"" - + " -Djava.ext.dirs=\"" + new File(new File(new File(System.getProperty("java.home"), "jre"), "lib"), "ext") + System.getProperty("path.separator") + new File(new File(System.getProperty("java.home"), "lib"), "ext") + System.getProperty("path.separator") + new File(libDir, "ext").getCanonicalPath() + "\""; + StringBuilder jdk9Classpath = classpathFromLibDir(new File(new File(System.getProperty("karaf.home"), "lib"), "jdk9plus")); + if (!jdk9Classpath.isEmpty()) { + classpath.append(File.pathSeparator); + classpath.append(jdk9Classpath); } + String jdkOpts = " --add-opens java.base/java.security=ALL-UNNAMED" + + " --add-opens java.base/java.net=ALL-UNNAMED" + + " --add-opens java.base/java.lang=ALL-UNNAMED" + + " --add-opens java.base/java.util=ALL-UNNAMED" + + " --add-opens java.naming/javax.naming.spi=ALL-UNNAMED" + + " --add-opens java.rmi/sun.rmi.transport.tcp=ALL-UNNAMED" + + " --add-exports=java.base/sun.net.www.protocol.file=ALL-UNNAMED" + + " --add-exports=java.base/sun.net.www.protocol.ftp=ALL-UNNAMED" + + " --add-exports=java.base/sun.net.www.protocol.http=ALL-UNNAMED" + + " --add-exports=java.base/sun.net.www.protocol.https=ALL-UNNAMED" + + " --add-exports=java.base/sun.net.www.protocol.jar=ALL-UNNAMED" + + " --add-exports=java.base/sun.net.www.content.text=ALL-UNNAMED" + + " --add-exports=jdk.xml.dom/org.w3c.dom.html=ALL-UNNAMED" + + " --add-exports=java.rmi/sun.rmi.registry=ALL-UNNAMED" + + " --add-exports=jdk.naming.rmi/com.sun.jndi.url.rmi=ALL-UNNAMED" + + " --add-exports=java.security.sasl/com.sun.security.sasl=ALL-UNNAMED" + + " --add-exports=java.naming/com.sun.jndi.ldap=ALL-UNNAMED"; + String command = "\"" + new File(System.getProperty("java.home"), ScriptUtils.isWindows() ? "bin\\java.exe" : "bin/java").getCanonicalPath() + "\" " + opts diff --git a/itests/test/src/test/java/org/apache/karaf/itests/JtaTest.java b/itests/test/src/test/java/org/apache/karaf/itests/JtaTest.java index 7a8dbc80490..04f7d3a5232 100644 --- a/itests/test/src/test/java/org/apache/karaf/itests/JtaTest.java +++ b/itests/test/src/test/java/org/apache/karaf/itests/JtaTest.java @@ -69,25 +69,17 @@ public Option[] config() { public void noSpecialFeatures() throws Exception { ClassLoader cl = FrameworkUtil.getBundle(this.getClass()).adapt(BundleWiring.class).getClassLoader(); - if (isJDK8OrEarlier()) { - // these classes should be boot delegated because they should be part of JDK8, all used ONLY - // in com.sun.corba.se.impl.javax.rmi.CORBA.Util.mapSystemException() - ensureLoadedFromSystem(cl, "jakarta.transaction.InvalidTransactionException"); - ensureLoadedFromSystem(cl, "jakarta.transaction.TransactionRequiredException"); - ensureLoadedFromSystem(cl, "jakarta.transaction.TransactionRolledbackException"); - } else { - // JDK9+ doesn't provide jakarta.transaction package at all - ensureNotFound(cl, "jakarta.transaction.InvalidTransactionException"); - ensureNotFound(cl, "jakarta.transaction.TransactionRequiredException"); - ensureNotFound(cl, "jakarta.transaction.TransactionRolledbackException"); - } + // JDK9+ doesn't provide jakarta.transaction package at all + ensureNotFound(cl, "jakarta.transaction.InvalidTransactionException"); + ensureNotFound(cl, "jakarta.transaction.TransactionRequiredException"); + ensureNotFound(cl, "jakarta.transaction.TransactionRolledbackException"); - // whatever the JDK, these classes should be available + // these classes should be available ensureLoadedFromSystem(cl, "javax.transaction.xa.XAException"); ensureLoadedFromSystem(cl, "javax.transaction.xa.XAResource"); ensureLoadedFromSystem(cl, "javax.transaction.xa.Xid"); - // whatever the JDK, these classes should NOT be available + // these classes should NOT be available ensureNotFound(cl, "jakarta.transaction.UserTransaction"); ensureNotFound(cl, "jakarta.transaction.TransactionManager"); } @@ -101,19 +93,12 @@ public void jakartaTransaction2_0() throws Exception { ClassLoader myCl = FrameworkUtil.getBundle(this.getClass()).adapt(BundleWiring.class).getClassLoader(); ClassLoader jtaCl = FrameworkUtil.getBundle(myCl.loadClass("jakarta.transaction.UserTransaction")).adapt(BundleWiring.class).getClassLoader(); - if (isJDK8OrEarlier()) { - // these classes should be boot delegated - ensureLoadedFromSystem(myCl, "jakarta.transaction.InvalidTransactionException"); - ensureLoadedFromSystem(myCl, "jakarta.transaction.TransactionRequiredException"); - ensureLoadedFromSystem(myCl, "jakarta.transaction.TransactionRolledbackException"); - } else { - // these classes ARE boot delegated, but can't be found in JDK, so they're loaded from the API bundle - ensureLoadedFromCl(myCl, jtaCl, "jakarta.transaction.InvalidTransactionException"); - ensureLoadedFromCl(myCl, jtaCl, "jakarta.transaction.TransactionRequiredException"); - ensureLoadedFromCl(myCl, jtaCl, "jakarta.transaction.TransactionRolledbackException"); - } + // these classes are boot delegated, but can't be found in JDK, so they're loaded from the API bundle + ensureLoadedFromCl(myCl, jtaCl, "jakarta.transaction.InvalidTransactionException"); + ensureLoadedFromCl(myCl, jtaCl, "jakarta.transaction.TransactionRequiredException"); + ensureLoadedFromCl(myCl, jtaCl, "jakarta.transaction.TransactionRolledbackException"); - // whatever the JDK, these classes should be available from system CL, even if jakarta.transaction-api/2.0.1 + // these classes should be available from system CL, even if jakarta.transaction-api/2.0.1 // exports javax.transaction.xa package ensureLoadedFromSystem(myCl, "javax.transaction.xa.XAException"); ensureLoadedFromSystem(myCl, "javax.transaction.xa.XAResource"); @@ -151,15 +136,9 @@ public void jakartaTransaction2_0AndDBCP2() throws Exception { ClassLoader myCl = FrameworkUtil.getBundle(this.getClass()).adapt(BundleWiring.class).getClassLoader(); ClassLoader jtaCl = FrameworkUtil.getBundle(myCl.loadClass("jakarta.transaction.UserTransaction")).adapt(BundleWiring.class).getClassLoader(); - if (isJDK8OrEarlier()) { - ensureLoadedFromSystem(myCl, "jakarta.transaction.InvalidTransactionException"); - ensureLoadedFromSystem(myCl, "jakarta.transaction.TransactionRequiredException"); - ensureLoadedFromSystem(myCl, "jakarta.transaction.TransactionRolledbackException"); - } else { - ensureLoadedFromCl(myCl, jtaCl, "jakarta.transaction.InvalidTransactionException"); - ensureLoadedFromCl(myCl, jtaCl, "jakarta.transaction.TransactionRequiredException"); - ensureLoadedFromCl(myCl, jtaCl, "jakarta.transaction.TransactionRolledbackException"); - } + ensureLoadedFromCl(myCl, jtaCl, "jakarta.transaction.InvalidTransactionException"); + ensureLoadedFromCl(myCl, jtaCl, "jakarta.transaction.TransactionRequiredException"); + ensureLoadedFromCl(myCl, jtaCl, "jakarta.transaction.TransactionRolledbackException"); ensureLoadedFromSystem(myCl, "javax.transaction.xa.Xid"); ensureLoadedFromSystem(jtaCl, "javax.transaction.xa.Xid"); @@ -190,15 +169,9 @@ public void jakartaTransaction2_0_1AndDBCP2() throws Exception { ClassLoader myCl = FrameworkUtil.getBundle(this.getClass()).adapt(BundleWiring.class).getClassLoader(); ClassLoader jtaCl = FrameworkUtil.getBundle(myCl.loadClass("jakarta.transaction.UserTransaction")).adapt(BundleWiring.class).getClassLoader(); - if (isJDK8OrEarlier()) { - ensureLoadedFromSystem(myCl, "jakarta.transaction.InvalidTransactionException"); - ensureLoadedFromSystem(myCl, "jakarta.transaction.TransactionRequiredException"); - ensureLoadedFromSystem(myCl, "jakarta.transaction.TransactionRolledbackException"); - } else { - ensureLoadedFromCl(myCl, jtaCl, "jakarta.transaction.InvalidTransactionException"); - ensureLoadedFromCl(myCl, jtaCl, "jakarta.transaction.TransactionRequiredException"); - ensureLoadedFromCl(myCl, jtaCl, "jakarta.transaction.TransactionRolledbackException"); - } + ensureLoadedFromCl(myCl, jtaCl, "jakarta.transaction.InvalidTransactionException"); + ensureLoadedFromCl(myCl, jtaCl, "jakarta.transaction.TransactionRequiredException"); + ensureLoadedFromCl(myCl, jtaCl, "jakarta.transaction.TransactionRolledbackException"); ensureLoadedFromSystem(jtaCl, "javax.transaction.xa.Xid"); ensureLoadedFromSystem(myCl, "javax.transaction.xa.Xid"); @@ -235,19 +208,4 @@ private void ensureNotFound(ClassLoader cl, String className) { } } - private boolean isJDK8OrEarlier() { - String v = System.getProperty("java.specification.version"); - try { - if (v.contains(".")) { - float f = Float.parseFloat(v); - return f < 1.9F; - } else { - int i = Integer.parseInt(v); - return i < 9; - } - } catch (NumberFormatException ignored) { - return true; - } - } - } diff --git a/itests/test/src/test/java/org/apache/karaf/itests/features/EnterpriseFeaturesTest.java b/itests/test/src/test/java/org/apache/karaf/itests/features/EnterpriseFeaturesTest.java index 5e1253f8cda..852a11cbac4 100644 --- a/itests/test/src/test/java/org/apache/karaf/itests/features/EnterpriseFeaturesTest.java +++ b/itests/test/src/test/java/org/apache/karaf/itests/features/EnterpriseFeaturesTest.java @@ -14,7 +14,6 @@ package org.apache.karaf.itests.features; import org.apache.karaf.itests.BaseTest; -import org.apache.karaf.itests.util.RunIfRules.RunIfNotOnJdk8; import org.apache.karaf.itests.util.RunIfRule; import org.junit.Ignore; diff --git a/itests/test/src/test/java/org/apache/karaf/itests/util/RunIfRules.java b/itests/test/src/test/java/org/apache/karaf/itests/util/RunIfRules.java deleted file mode 100644 index 35c253b5134..00000000000 --- a/itests/test/src/test/java/org/apache/karaf/itests/util/RunIfRules.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.karaf.itests.util; - -import java.lang.annotation.Inherited; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; - -import org.apache.karaf.itests.util.RunIfRule.RunIf; -import org.apache.karaf.itests.util.RunIfRule.RunIfCondition; - -public class RunIfRules { - - @RunIf(condition = RunIfNotOnJdk8Condition.class) - @Retention(RetentionPolicy.RUNTIME) - @Inherited - public @interface RunIfNotOnJdk8 { - - } - - public static class RunIfNotOnJdk8Condition implements RunIfCondition { - @Override - public boolean isSatisfied() { - String jdk = System.getProperty("java.specification.version"); - return jdk.equals("1.5") || jdk.equals("1.6") || jdk.equals("1.7"); - } - } - -} diff --git a/pom.xml b/pom.xml index c700755fa66..76f15f9c4d4 100644 --- a/pom.xml +++ b/pom.xml @@ -150,8 +150,9 @@ 1695310533 - 21 - 21 + 21 + ${javaVersion} + ${javaVersion} scm:git:https://gitbox.apache.org/repos/asf/karaf.git scm:git:https://gitbox.apache.org/repos/asf/karaf.git @@ -653,7 +654,7 @@ - [21,) + [${javaVersion},) @@ -922,7 +923,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 21 + ${javaVersion} From 47795316fe8dc2fe3182b65f04b554ffe6ae054e Mon Sep 17 00:00:00 2001 From: Holger Friedrich Date: Sun, 19 Jul 2026 13:04:51 +0200 Subject: [PATCH 04/23] Fix Subject propagation for shell RBAC on JDK 25 Subject.current()/callAs() use a plain ScopedValue on JDK 25 (no SecurityManager fallback like on JDK 21), which doesn't survive a new Thread or an ExecutorService hop. Since Felix Gogo runs each command on its own executor thread, this broke current-user lookup and RBAC checks (bundle:list/bundle:info losing bundle visibility). - JaasHelper.doAs/runAs now use Subject.callAs() instead of the old AccessControlContext/SubjectDomainCombiner plumbing; drop the now dead OsgiSubjectDomainCombiner/DelegatingProtectionDomain classes. - SecuredCommand.execute() re-binds the subject from the session on whatever thread runs the command, since Session is always passed explicitly there regardless of the executing thread. - LocalConsoleManager, ShellFactoryImpl and SuCommand store the subject on the session so SecuredCommand can read it back. --- .../apache/karaf/jaas/command/SuCommand.java | 3 +- .../console/osgi/LocalConsoleManager.java | 5 +- .../console/osgi/secured/SecuredCommand.java | 20 +++- .../apache/karaf/shell/ssh/ShellCommand.java | 6 -- .../karaf/shell/ssh/ShellFactoryImpl.java | 6 +- .../apache/karaf/util/jaas/JaasHelper.java | 100 ++++-------------- .../internal/servlet/KarafOsgiManager.java | 6 -- 7 files changed, 47 insertions(+), 99 deletions(-) diff --git a/jaas/command/src/main/java/org/apache/karaf/jaas/command/SuCommand.java b/jaas/command/src/main/java/org/apache/karaf/jaas/command/SuCommand.java index 7f49dad7407..5bdfcca7c2d 100644 --- a/jaas/command/src/main/java/org/apache/karaf/jaas/command/SuCommand.java +++ b/jaas/command/src/main/java/org/apache/karaf/jaas/command/SuCommand.java @@ -67,11 +67,12 @@ public Object execute() throws Exception { JaasHelper.doAs(subject, (PrivilegedExceptionAction) () -> { final Session newSession = session.getFactory().create( System.in, System.out, System.err, SuCommand.this.session.getTerminal(), null, null); + newSession.put(Subject.class.getName(), subject); Object oldIgnoreInterrupts = session.get(Session.IGNORE_INTERRUPTS); try { session.put(Session.IGNORE_INTERRUPTS, Boolean.TRUE); String name = "Karaf local console user " + ShellUtil.getCurrentUserName(); - Thread thread = new Thread(newSession, name); + Thread thread = new Thread(() -> JaasHelper.runAs(subject, newSession), name); thread.start(); thread.join(); } finally { diff --git a/shell/core/src/main/java/org/apache/karaf/shell/impl/console/osgi/LocalConsoleManager.java b/shell/core/src/main/java/org/apache/karaf/shell/impl/console/osgi/LocalConsoleManager.java index 8a423b1c495..4632cf1204c 100644 --- a/shell/core/src/main/java/org/apache/karaf/shell/impl/console/osgi/LocalConsoleManager.java +++ b/shell/core/src/main/java/org/apache/karaf/shell/impl/console/osgi/LocalConsoleManager.java @@ -91,14 +91,15 @@ public void close() { encoding, LocalConsoleManager.this::close); session.put(Session.IS_LOCAL, true); + session.put(Subject.class.getName(), subject); registration = bundleContext.registerService(Session.class, session, null); String name = "Karaf local console user " + ShellUtil.getCurrentUserName(); boolean delayconsole = Boolean.parseBoolean(System.getProperty(KARAF_DELAY_CONSOLE)); if (delayconsole) { watcher = new DelayedStarted(session, name, bundleContext, System.in); - new Thread(watcher, name).start(); + new Thread(() -> JaasHelper.runAs(subject, watcher), name).start(); } else { - new Thread(session, name).start(); + new Thread(() -> JaasHelper.runAs(subject, session), name).start(); } return session; }); diff --git a/shell/core/src/main/java/org/apache/karaf/shell/impl/console/osgi/secured/SecuredCommand.java b/shell/core/src/main/java/org/apache/karaf/shell/impl/console/osgi/secured/SecuredCommand.java index 2df6e097fd7..9e48966b0b7 100644 --- a/shell/core/src/main/java/org/apache/karaf/shell/impl/console/osgi/secured/SecuredCommand.java +++ b/shell/core/src/main/java/org/apache/karaf/shell/impl/console/osgi/secured/SecuredCommand.java @@ -18,8 +18,12 @@ */ package org.apache.karaf.shell.impl.console.osgi.secured; +import java.security.PrivilegedActionException; +import java.security.PrivilegedExceptionAction; import java.util.List; +import javax.security.auth.Subject; + import org.apache.felix.gogo.runtime.Closure; import org.apache.felix.gogo.runtime.Token; import org.apache.felix.service.command.CommandSession; @@ -28,6 +32,7 @@ import org.apache.karaf.shell.api.console.Completer; import org.apache.karaf.shell.api.console.Parser; import org.apache.karaf.shell.api.console.Session; +import org.apache.karaf.util.jaas.JaasHelper; public class SecuredCommand implements Command, Function { @@ -64,8 +69,19 @@ public Parser getParser() { @Override public Object execute(Session session, List arguments) throws Exception { - factory.checkSecurity(getScope(), getName(), arguments); - return command.execute(session, arguments); + // Gogo may dispatch this command on a pool thread that never had the session's + // subject bound (Subject.callAs()'s ScopedValue binding does not cross an + // ExecutorService task boundary), so re-bind it here from the session before + // checking permissions or running the command. + Subject subject = (Subject) session.get(Subject.class.getName()); + try { + return JaasHelper.doAs(subject, (PrivilegedExceptionAction) () -> { + factory.checkSecurity(getScope(), getName(), arguments); + return command.execute(session, arguments); + }); + } catch (PrivilegedActionException e) { + throw e.getException(); + } } @Override diff --git a/shell/ssh/src/main/java/org/apache/karaf/shell/ssh/ShellCommand.java b/shell/ssh/src/main/java/org/apache/karaf/shell/ssh/ShellCommand.java index 67fa7f43a15..69f8553176d 100644 --- a/shell/ssh/src/main/java/org/apache/karaf/shell/ssh/ShellCommand.java +++ b/shell/ssh/src/main/java/org/apache/karaf/shell/ssh/ShellCommand.java @@ -51,12 +51,6 @@ public class ShellCommand implements Command { private static final Logger LOGGER = LoggerFactory.getLogger(ShellCommand.class); - private static final Class[] SECURITY_BUGFIX = { - JaasHelper.class, - JaasHelper.OsgiSubjectDomainCombiner.class, - JaasHelper.DelegatingProtectionDomain.class, - }; - private String command; private InputStream in; private OutputStream out; diff --git a/shell/ssh/src/main/java/org/apache/karaf/shell/ssh/ShellFactoryImpl.java b/shell/ssh/src/main/java/org/apache/karaf/shell/ssh/ShellFactoryImpl.java index 54487b71447..accaaa22fe8 100644 --- a/shell/ssh/src/main/java/org/apache/karaf/shell/ssh/ShellFactoryImpl.java +++ b/shell/ssh/src/main/java/org/apache/karaf/shell/ssh/ShellFactoryImpl.java @@ -24,6 +24,7 @@ import java.io.OutputStream; import java.io.PrintStream; import java.nio.charset.Charset; +import java.security.PrivilegedAction; import java.util.Map; import javax.security.auth.Subject; @@ -109,8 +110,9 @@ public void start(ChannelSession channelSession, Environment environment) throws shell.put(e.getKey(), e.getValue()); } shell.put(Subject.class.getName(), subject); - JaasHelper.runAs(subject, () -> - new Thread(shell, "Karaf ssh console user " + ShellUtil.getCurrentUserName()).start()); + String threadName = "Karaf ssh console user " + + JaasHelper.doAs(subject, (PrivilegedAction) ShellUtil::getCurrentUserName); + new Thread(() -> JaasHelper.runAs(subject, shell), threadName).start(); } catch (Exception e) { throw new IOException("Unable to start shell", e); } diff --git a/util/src/main/java/org/apache/karaf/util/jaas/JaasHelper.java b/util/src/main/java/org/apache/karaf/util/jaas/JaasHelper.java index d121731081f..f2b53169a5a 100644 --- a/util/src/main/java/org/apache/karaf/util/jaas/JaasHelper.java +++ b/util/src/main/java/org/apache/karaf/util/jaas/JaasHelper.java @@ -14,18 +14,14 @@ */ package org.apache.karaf.util.jaas; -import java.security.AccessControlContext; -import java.security.AccessController; -import java.security.Permission; import java.security.Principal; import java.security.PrivilegedAction; import java.security.PrivilegedActionException; import java.security.PrivilegedExceptionAction; -import java.security.ProtectionDomain; import java.util.Set; +import java.util.concurrent.CompletionException; import javax.security.auth.Subject; -import javax.security.auth.SubjectDomainCombiner; import org.apache.karaf.jaas.boot.principal.RolePrincipal; @@ -89,13 +85,11 @@ public static T doAs(final Subject subject, if (action == null) { throw new NullPointerException(); } - // set up the new Subject-based AccessControlContext for doPrivileged - final AccessControlContext currentAcc = AccessController.getContext(); - final AccessControlContext newAcc = AccessController.doPrivileged - ((PrivilegedAction) () -> new AccessControlContext(currentAcc, - subject != null ? new OsgiSubjectDomainCombiner(subject) : null)); - // call doPrivileged and push this new context on the stack - return AccessController.doPrivileged(action, newAcc); + try { + return Subject.callAs(subject, action::run); + } catch (CompletionException e) { + throw unwrapUnchecked(e); + } } public static T doAs(final Subject subject, @@ -103,79 +97,25 @@ public static T doAs(final Subject subject, if (action == null) { throw new NullPointerException(); } - // set up the new Subject-based AccessControlContext for doPrivileged - final AccessControlContext currentAcc = AccessController.getContext(); - final AccessControlContext newAcc = AccessController.doPrivileged - ((PrivilegedAction) () -> new AccessControlContext(currentAcc, - subject != null ? new OsgiSubjectDomainCombiner(subject) : null)); - // call doPrivileged and push this new context on the stack - return AccessController.doPrivileged(action, newAcc); - } - - public static class OsgiSubjectDomainCombiner extends SubjectDomainCombiner { - - private final Subject subject; - - public OsgiSubjectDomainCombiner(Subject subject) { - super(subject); - this.subject = subject; - } - - public ProtectionDomain[] combine(ProtectionDomain[] currentDomains, - ProtectionDomain[] assignedDomains) { - int cLen = (currentDomains == null ? 0 : currentDomains.length); - int aLen = (assignedDomains == null ? 0 : assignedDomains.length); - ProtectionDomain[] newDomains = new ProtectionDomain[cLen + aLen]; - Principal[] principals = subject.getPrincipals().toArray(new Principal[0]); - for (int i = 0; i < cLen; i++) { - newDomains[i] = new DelegatingProtectionDomain(currentDomains[i], principals); - } - if (assignedDomains != null) { - System.arraycopy(assignedDomains, 0, newDomains, cLen, aLen); - } - return optimize(newDomains); - } - - private ProtectionDomain[] optimize(ProtectionDomain[] domains) { - if (domains == null || domains.length == 0) { - return null; - } - ProtectionDomain[] optimized = new ProtectionDomain[domains.length]; - ProtectionDomain pd; - int num = 0; - for (ProtectionDomain domain : domains) { - if ((pd = domain) != null) { - boolean found = false; - for (int j = 0; j < num && !found; j++) { - found = (optimized[j] == pd); - } - if (!found) { - optimized[num++] = pd; - } - } - } - if (num > 0 && num < domains.length) { - ProtectionDomain[] downSize = new ProtectionDomain[num]; - System.arraycopy(optimized, 0, downSize, 0, downSize.length); - optimized = downSize; + try { + return Subject.callAs(subject, action::run); + } catch (CompletionException e) { + Throwable cause = e.getCause(); + if (cause instanceof Exception && !(cause instanceof RuntimeException)) { + throw new PrivilegedActionException((Exception) cause); } - return ((num == 0 || optimized.length == 0) ? null : optimized); + throw unwrapUnchecked(e); } } - public static class DelegatingProtectionDomain extends ProtectionDomain { - - private final ProtectionDomain delegate; - - DelegatingProtectionDomain(ProtectionDomain delegate, Principal[] principals) { - super(delegate.getCodeSource(), delegate.getPermissions(), delegate.getClassLoader(), principals); - this.delegate = delegate; + private static RuntimeException unwrapUnchecked(CompletionException e) { + Throwable cause = e.getCause(); + if (cause instanceof RuntimeException) { + return (RuntimeException) cause; } - - @Override - public boolean implies(Permission permission) { - return delegate.implies(permission); + if (cause instanceof Error) { + throw (Error) cause; } - + return e; } } diff --git a/webconsole/console/src/main/java/org/apache/felix/webconsole/internal/servlet/KarafOsgiManager.java b/webconsole/console/src/main/java/org/apache/felix/webconsole/internal/servlet/KarafOsgiManager.java index 39e420ccf3d..1eaeae4541a 100644 --- a/webconsole/console/src/main/java/org/apache/felix/webconsole/internal/servlet/KarafOsgiManager.java +++ b/webconsole/console/src/main/java/org/apache/felix/webconsole/internal/servlet/KarafOsgiManager.java @@ -36,12 +36,6 @@ public class KarafOsgiManager extends OsgiManager { private static final long serialVersionUID = 1090035807469459598L; - private static final Class[] SECURITY_BUGFIX = { - JaasHelper.class, - JaasHelper.OsgiSubjectDomainCombiner.class, - JaasHelper.DelegatingProtectionDomain.class, - }; - public static final String SUBJECT_RUN_AS = "karaf.subject.runas"; public KarafOsgiManager(BundleContext bundleContext) { From 05309b9b6acb534de53cad6e41bd94d9a3c9e70c Mon Sep 17 00:00:00 2001 From: Holger Friedrich Date: Sun, 19 Jul 2026 22:55:24 +0200 Subject: [PATCH 05/23] Change thread creation for itests --- .../main/java/org/apache/karaf/itests/KarafTestSupport.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/itests/common/src/main/java/org/apache/karaf/itests/KarafTestSupport.java b/itests/common/src/main/java/org/apache/karaf/itests/KarafTestSupport.java index 79c4a4403aa..f97c5c8df27 100644 --- a/itests/common/src/main/java/org/apache/karaf/itests/KarafTestSupport.java +++ b/itests/common/src/main/java/org/apache/karaf/itests/KarafTestSupport.java @@ -416,10 +416,14 @@ private String executeCommand(final String command, final Long timeout, final Lo if (principals.length == 0) { commandFuture = new FutureTask<>(commandCallable); } else { - // If principals are defined, run the command callable via Subject.doAs() + // If principals are defined, run the command callable via Subject.callAs(). + // Gogo dispatches the actual command execution on its own executor thread, which + // does not inherit the ScopedValue binding set up by Subject.callAs() on JDK 25, + // so also store the subject on the session for SecuredCommand to pick back up. commandFuture = new FutureTask<>(() -> { Subject subject = new Subject(); subject.getPrincipals().addAll(Arrays.asList(principals)); + session.put(Subject.class.getName(), subject); return Subject.callAs(subject, (Callable) commandCallable::call); }); } From 83aa632ea0bfd1b3736c2941a607175b1b49473f Mon Sep 17 00:00:00 2001 From: Holger Friedrich Date: Fri, 11 Sep 2026 21:36:20 +0200 Subject: [PATCH 06/23] Fix typo in ci workflow desc --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2e50531e655..0825d86ea60 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -42,7 +42,7 @@ jobs: steps: - name: Checkout uses: actions/checkout@v7 - - name: Set up JDK 17 + - name: Set up JDK 21 uses: actions/setup-java@v6 with: java-version: '21' @@ -74,7 +74,7 @@ jobs: steps: - name: Checkout uses: actions/checkout@v7 - - name: Set up JDK 17 + - name: Set up JDK 21 uses: actions/setup-java@v6 with: java-version: '21' From 4c27f01f3a758160f0d8a1ce901319c14852e83d Mon Sep 17 00:00:00 2001 From: Holger Friedrich Date: Fri, 11 Sep 2026 21:52:37 +0200 Subject: [PATCH 07/23] Replace doAs in newly added KarafMBeanServerGuardTest --- .../karaf/management/KarafMBeanServerGuardTest.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/management/server/src/test/java/org/apache/karaf/management/KarafMBeanServerGuardTest.java b/management/server/src/test/java/org/apache/karaf/management/KarafMBeanServerGuardTest.java index 26f7d7e2a2f..e8d481c9665 100644 --- a/management/server/src/test/java/org/apache/karaf/management/KarafMBeanServerGuardTest.java +++ b/management/server/src/test/java/org/apache/karaf/management/KarafMBeanServerGuardTest.java @@ -539,7 +539,7 @@ public void testCreateRegisterUnregisterMBeanRequireRole() throws Throwable { final ObjectName on = ObjectName.getInstance("foo.bar:type=Test"); Subject viewer = loginWithTestRoles("viewer"); - Subject.doAs(viewer, (PrivilegedAction) () -> { + Subject.callAs(viewer, (Callable) () -> { try { guard.invoke(null, createMBean, new Object[]{"javax.management.loading.MLet", on}); fail("createMBean should be blocked for a non-admin user"); @@ -568,7 +568,7 @@ public void testCreateRegisterUnregisterMBeanRequireRole() throws Throwable { }); Subject admin = loginWithTestRoles("admin"); - Subject.doAs(admin, (PrivilegedAction) () -> { + Subject.callAs(admin, (Callable) () -> { try { // none of these should throw for an admin user guard.invoke(null, createMBean, new Object[]{"javax.management.loading.MLet", on}); @@ -594,7 +594,7 @@ public void testCreateMBeanWithNullObjectName() throws Throwable { final Method createMBean = MBeanServer.class.getMethod("createMBean", String.class, ObjectName.class); Subject viewer = loginWithTestRoles("viewer"); - Subject.doAs(viewer, (PrivilegedAction) () -> { + Subject.callAs(viewer, (Callable) () -> { try { // a null ObjectName falls back to the generic jmx.acl configuration guard.invoke(null, createMBean, new Object[]{"javax.management.loading.MLet", null}); @@ -608,7 +608,7 @@ public void testCreateMBeanWithNullObjectName() throws Throwable { }); Subject admin = loginWithTestRoles("admin"); - Subject.doAs(admin, (PrivilegedAction) () -> { + Subject.callAs(admin, (Callable) () -> { try { guard.invoke(null, createMBean, new Object[]{"javax.management.loading.MLet", null}); return null; @@ -631,7 +631,7 @@ public void testCreateMBeanClassNameMatch() throws Throwable { final ObjectName on = ObjectName.getInstance("foo.bar:type=Test"); Subject viewer = loginWithTestRoles("viewer"); - Subject.doAs(viewer, (PrivilegedAction) () -> { + Subject.callAs(viewer, (Callable) () -> { try { // a "regular" class only requires the viewer role guard.invoke(null, createMBean, new Object[]{"com.example.Foo", on}); From 38d40adb673f5545f23ebe2932c527385d562276 Mon Sep 17 00:00:00 2001 From: Holger Friedrich Date: Fri, 11 Sep 2026 21:53:53 +0200 Subject: [PATCH 08/23] Replace java 17 in karaf-light pom --- assemblies/apache-karaf-light/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assemblies/apache-karaf-light/pom.xml b/assemblies/apache-karaf-light/pom.xml index 7abb40df3c2..be466fca926 100644 --- a/assemblies/apache-karaf-light/pom.xml +++ b/assemblies/apache-karaf-light/pom.xml @@ -181,7 +181,7 @@ mvn:org.ops4j.pax.logging/* - 17 + ${javaVersion} ${project.build.directory} Apache Karaf Light From c566cb42e7c07aace7e69d3bc3e29e6d87f28db9 Mon Sep 17 00:00:00 2001 From: Holger Friedrich Date: Fri, 11 Sep 2026 21:58:01 +0200 Subject: [PATCH 09/23] Add Java25 on Ubuntu to build matrix --- .github/workflows/ci.yml | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0825d86ea60..9063a5b528e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,7 +27,7 @@ on: jobs: build: - name: build (${{ matrix.os }}) + name: build (${{ matrix.os }}, jdk ${{ matrix.java }}) permissions: contents: read @@ -36,16 +36,19 @@ jobs: fail-fast: false matrix: os: [ ubuntu-24.04, windows-latest, macos-latest ] + java: [ '21' ] + # An early-access JDK on Linux only, and only on main. + include: ${{ github.ref == 'refs/heads/main' && fromJSON('[{"os":"ubuntu-24.04","java":"25"}]') || fromJSON('[]') }} runs-on: ${{ matrix.os }} steps: - name: Checkout uses: actions/checkout@v7 - - name: Set up JDK 21 + - name: Set up JDK ${{ matrix.java }} uses: actions/setup-java@v6 with: - java-version: '21' + java-version: ${{ matrix.java }} distribution: 'temurin' cache: 'maven' - name: Build @@ -53,12 +56,12 @@ jobs: - name: Save Maven Local Repository uses: actions/upload-artifact@v7 with: - name: maven-local-repo-${{ matrix.os }} + name: maven-local-repo-${{ matrix.os }}-jdk${{ matrix.java }} path: ~/.m2/repository retention-days: 1 test: - name: test (${{ matrix.os }}) + name: test (${{ matrix.os }}, jdk ${{ matrix.java }}) needs: build permissions: @@ -68,22 +71,25 @@ jobs: fail-fast: false matrix: os: [ ubuntu-24.04, windows-latest, macos-latest ] + java: [ '21' ] + # An early-access JDK on Linux only, and only on main. + include: ${{ github.ref == 'refs/heads/main' && fromJSON('[{"os":"ubuntu-24.04","java":"25"}]') || fromJSON('[]') }} runs-on: ${{ matrix.os }} steps: - name: Checkout uses: actions/checkout@v7 - - name: Set up JDK 21 + - name: Set up JDK ${{ matrix.java }} uses: actions/setup-java@v6 with: - java-version: '21' + java-version: ${{ matrix.java }} distribution: 'temurin' cache: 'maven' - name: Restore Maven Local Repository uses: actions/download-artifact@v8 with: - name: maven-local-repo-${{ matrix.os }} + name: maven-local-repo-${{ matrix.os }}-jdk${{ matrix.java }} path: ~/.m2/repository - name: Test run: mvn -B -e install -Ptest @@ -92,10 +98,10 @@ jobs: if: always() uses: actions/upload-artifact@v7 with: - name: test-results-${{ matrix.os }} + name: test-results-${{ matrix.os }}-jdk${{ matrix.java }} path: '**/target/surefire-reports/*.xml' - name: Upload Event File - if: always() + if: always() && matrix.java == '21' uses: actions/upload-artifact@v7 with: name: event-file-${{ matrix.os }} From dccb67a72f3b9c0d3d630f368e983c8a1c7bc012 Mon Sep 17 00:00:00 2001 From: Holger Friedrich Date: Fri, 11 Sep 2026 22:42:24 +0200 Subject: [PATCH 10/23] ubuntu 26.04 public preview for j25 --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9063a5b528e..1476b23aa85 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -38,7 +38,7 @@ jobs: os: [ ubuntu-24.04, windows-latest, macos-latest ] java: [ '21' ] # An early-access JDK on Linux only, and only on main. - include: ${{ github.ref == 'refs/heads/main' && fromJSON('[{"os":"ubuntu-24.04","java":"25"}]') || fromJSON('[]') }} + include: ${{ github.ref == 'refs/heads/main' && fromJSON('[{"os":"ubuntu-26.04","java":"25"}]') || fromJSON('[]') }} runs-on: ${{ matrix.os }} @@ -73,7 +73,7 @@ jobs: os: [ ubuntu-24.04, windows-latest, macos-latest ] java: [ '21' ] # An early-access JDK on Linux only, and only on main. - include: ${{ github.ref == 'refs/heads/main' && fromJSON('[{"os":"ubuntu-24.04","java":"25"}]') || fromJSON('[]') }} + include: ${{ github.ref == 'refs/heads/main' && fromJSON('[{"os":"ubuntu-26.04","java":"25"}]') || fromJSON('[]') }} runs-on: ${{ matrix.os }} From 84f747a434ffd70738291338860a216c3ac4518e Mon Sep 17 00:00:00 2001 From: Holger Friedrich Date: Fri, 11 Sep 2026 22:51:08 +0200 Subject: [PATCH 11/23] mvn-4.0.0-rc-7 for j25 --- .github/workflows/ci.yml | 42 ++++++++++++++++++++++++++++++++++------ 1 file changed, 36 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1476b23aa85..cdec48dd4c3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -37,8 +37,9 @@ jobs: matrix: os: [ ubuntu-24.04, windows-latest, macos-latest ] java: [ '21' ] - # An early-access JDK on Linux only, and only on main. - include: ${{ github.ref == 'refs/heads/main' && fromJSON('[{"os":"ubuntu-26.04","java":"25"}]') || fromJSON('[]') }} + # An early-access JDK on Linux only, and only on main. The runner image ships Maven 3.9.x, + # so the Maven 4 this entry asks for is installed by the "Set up Maven" step below. + include: ${{ github.ref == 'refs/heads/main' && fromJSON('[{"os":"ubuntu-26.04","java":"25","maven":"4.0.0-rc-7"}]') || fromJSON('[]') }} runs-on: ${{ matrix.os }} @@ -51,8 +52,22 @@ jobs: java-version: ${{ matrix.java }} distribution: 'temurin' cache: 'maven' + - name: Set up Maven ${{ matrix.maven }} + if: matrix.maven + env: + MAVEN_VERSION: ${{ matrix.maven }} + run: | + url="https://archive.apache.org/dist/maven/maven-4/${MAVEN_VERSION}/binaries/apache-maven-${MAVEN_VERSION}-bin.tar.gz" + curl -fsSL -o "${RUNNER_TEMP}/maven.tar.gz" "${url}" + echo "$(curl -fsSL "${url}.sha512") ${RUNNER_TEMP}/maven.tar.gz" | sha512sum -c - + tar -xzf "${RUNNER_TEMP}/maven.tar.gz" -C "${RUNNER_TEMP}" + # fails the step if the layout is not what we expect, rather than silently keeping Maven 3 + "${RUNNER_TEMP}/apache-maven-${MAVEN_VERSION}/bin/mvn" -v + echo "${RUNNER_TEMP}/apache-maven-${MAVEN_VERSION}/bin" >> "${GITHUB_PATH}" - name: Build - run: mvn -U -B -e clean install -Prat -DskipTests "-Dinvoker.skip=true" + run: | + mvn --version + mvn -U -B -e clean install -Prat -DskipTests "-Dinvoker.skip=true" - name: Save Maven Local Repository uses: actions/upload-artifact@v7 with: @@ -72,8 +87,9 @@ jobs: matrix: os: [ ubuntu-24.04, windows-latest, macos-latest ] java: [ '21' ] - # An early-access JDK on Linux only, and only on main. - include: ${{ github.ref == 'refs/heads/main' && fromJSON('[{"os":"ubuntu-26.04","java":"25"}]') || fromJSON('[]') }} + # An early-access JDK on Linux only, and only on main. The runner image ships Maven 3.9.x, + # so the Maven 4 this entry asks for is installed by the "Set up Maven" step below. + include: ${{ github.ref == 'refs/heads/main' && fromJSON('[{"os":"ubuntu-26.04","java":"25","maven":"4.0.0-rc-7"}]') || fromJSON('[]') }} runs-on: ${{ matrix.os }} @@ -91,8 +107,22 @@ jobs: with: name: maven-local-repo-${{ matrix.os }}-jdk${{ matrix.java }} path: ~/.m2/repository + - name: Set up Maven ${{ matrix.maven }} + if: matrix.maven + env: + MAVEN_VERSION: ${{ matrix.maven }} + run: | + url="https://archive.apache.org/dist/maven/maven-4/${MAVEN_VERSION}/binaries/apache-maven-${MAVEN_VERSION}-bin.tar.gz" + curl -fsSL -o "${RUNNER_TEMP}/maven.tar.gz" "${url}" + echo "$(curl -fsSL "${url}.sha512") ${RUNNER_TEMP}/maven.tar.gz" | sha512sum -c - + tar -xzf "${RUNNER_TEMP}/maven.tar.gz" -C "${RUNNER_TEMP}" + # fails the step if the layout is not what we expect, rather than silently keeping Maven 3 + "${RUNNER_TEMP}/apache-maven-${MAVEN_VERSION}/bin/mvn" -v + echo "${RUNNER_TEMP}/apache-maven-${MAVEN_VERSION}/bin" >> "${GITHUB_PATH}" - name: Test - run: mvn -B -e install -Ptest + run: | + mvn --version + mvn -B -e install -Ptest timeout-minutes: 180 - name: Upload Test Results if: always() From 169cd5f3099240d05f2c803a6e32da4ebe5eb51c Mon Sep 17 00:00:00 2001 From: Holger Friedrich Date: Mon, 19 Oct 2026 22:41:02 +0200 Subject: [PATCH 12/23] Cleanup * Prefer the bound subject in SecuredCommand, fall back to the session variable * Rethrow unchecked exceptions in GSSAPILdapLoginModule * Require JDK 21 in startup scripts, remove Java 8 leftovers * Remove unused java.security import --- .../main/filtered-resources/resources/bin/inc | 8 +++---- .../filtered-resources/resources/bin/karaf | 22 +++++++------------ .../resources/bin/karaf.bat | 12 ++++++---- .../karaf/jaas/command/WhoamiCommand.java | 2 -- .../modules/ldap/GSSAPILdapLoginModule.java | 6 +++-- .../internal/BulkRequestContext.java | 4 +--- .../impl/handler/EventAdminImpl.java | 1 - .../impl/SecuredCommandProcessorImpl.java | 2 -- .../apache/karaf/shell/util/ShellUtil.java | 2 -- .../console/osgi/secured/SecuredCommand.java | 9 ++++++-- .../secured/SecuredSessionFactoryImpl.java | 2 -- .../apache/karaf/shell/support/ShellUtil.java | 2 -- .../karaf/webconsole/gogo/GogoPlugin.java | 2 -- 13 files changed, 32 insertions(+), 42 deletions(-) diff --git a/assemblies/features/base/src/main/filtered-resources/resources/bin/inc b/assemblies/features/base/src/main/filtered-resources/resources/bin/inc index 004142ab4ba..b4f69655b7e 100644 --- a/assemblies/features/base/src/main/filtered-resources/resources/bin/inc +++ b/assemblies/features/base/src/main/filtered-resources/resources/bin/inc @@ -190,7 +190,7 @@ locateJava() { fi if [ "x${JAVA_HOME}" = "x" ] && [ "${darwin}" = "true" ]; then - JAVA_HOME="`/usr/libexec/java_home -v 1.8`" + JAVA_HOME="`/usr/libexec/java_home -v 21`" fi if [ "x${JAVA_HOME}" = "x" ] && [ -r /etc/gentoo-release ] ; then JAVA_HOME=`java-config --jre-home` @@ -243,9 +243,9 @@ checkJvmVersion() { VERSION=`"${JAVA}" -version 2>&1 | ${AWK} -F '"' '/version/ {print $2}' | sed -e 's/_.*//g; s/^1\.//g; s/\..*//g; s/-.*//g;s/-.*//g; s/^[A-Za-z].*//'` - # java must be at least version 11 - if [ "${VERSION}" -lt "11" ]; then - die "JVM must be version 11 or greater" + # java must be at least version 21 + if [ "${VERSION}" -lt "21" ]; then + die "JVM must be version 21 or greater" fi } diff --git a/assemblies/features/base/src/main/filtered-resources/resources/bin/karaf b/assemblies/features/base/src/main/filtered-resources/resources/bin/karaf index 65ecd5312c0..26c4b615d6f 100644 --- a/assemblies/features/base/src/main/filtered-resources/resources/bin/karaf +++ b/assemblies/features/base/src/main/filtered-resources/resources/bin/karaf @@ -94,16 +94,14 @@ setupClassPath() { CLASSPATH="${CLASSPATH}:${file}" fi done - if [ "${VERSION}" -gt "8" ] ; then - for file in "${KARAF_HOME}"/lib/jdk9plus/*.jar - do - if [ -z "${CLASSPATH}" ]; then - CLASSPATH="${file}" - else - CLASSPATH="${CLASSPATH}:${file}" - fi - done - fi + for file in "${KARAF_HOME}"/lib/jdk9plus/*.jar + do + if [ -z "${CLASSPATH}" ]; then + CLASSPATH="${file}" + else + CLASSPATH="${CLASSPATH}:${file}" + fi + done } checkRootInstance() { @@ -183,12 +181,8 @@ run() { if [ "x$CHECK_ROOT_INSTANCE_RUNNING" = "x" ]; then CHECK_ROOT_INSTANCE_RUNNING=true fi - JAVA_ENDORSED_DIRS="${JAVA_HOME}/jre/lib/endorsed:${JAVA_HOME}/lib/endorsed:${KARAF_HOME}/lib/endorsed" - JAVA_EXT_DIRS="${JAVA_HOME}/jre/lib/ext:${JAVA_HOME}/lib/ext:${KARAF_HOME}/lib/ext" if ${cygwin}; then JAVA_HOME=`cygpath --path --windows "${JAVA_HOME}"` - JAVA_ENDORSED_DIRS=`cygpath --path --windows "${JAVA_ENDORSED_DIRS}"` - JAVA_EXT_DIRS=`cygpath --path --windows "${JAVA_EXT_DIRS}"` fi convertPaths cd "${KARAF_BASE}" || exit 2 diff --git a/assemblies/features/base/src/main/filtered-resources/resources/bin/karaf.bat b/assemblies/features/base/src/main/filtered-resources/resources/bin/karaf.bat index 8f6a88694f1..981cd4fb9a1 100644 --- a/assemblies/features/base/src/main/filtered-resources/resources/bin/karaf.bat +++ b/assemblies/features/base/src/main/filtered-resources/resources/bin/karaf.bat @@ -234,12 +234,16 @@ for /f tokens^=2-5^ delims^=.-_+^" %%j in ('"%JAVA%" -fullversion 2^>^&1') do ( if %%j==1 (set JAVA_VERSION=%%k) else (set JAVA_VERSION=%%j) ) -if %JAVA_VERSION% GTR 8 ( - pushd "%KARAF_HOME%\lib\jdk9plus" - for %%G in (*.jar) do call:APPEND_TO_JDK9PLUS_CLASSPATH %%G - popd +rem java must be at least version 21 +if %JAVA_VERSION% LSS 21 ( + call :warn JVM must be version 21 or greater + goto END ) +pushd "%KARAF_HOME%\lib\jdk9plus" + for %%G in (*.jar) do call:APPEND_TO_JDK9PLUS_CLASSPATH %%G +popd + :CheckRootInstance set ROOT_INSTANCE_RUNNING=false if exist "%KARAF_HOME%\instances\instance.properties" ( diff --git a/jaas/command/src/main/java/org/apache/karaf/jaas/command/WhoamiCommand.java b/jaas/command/src/main/java/org/apache/karaf/jaas/command/WhoamiCommand.java index c587f166ed5..f2cbfdbfb55 100644 --- a/jaas/command/src/main/java/org/apache/karaf/jaas/command/WhoamiCommand.java +++ b/jaas/command/src/main/java/org/apache/karaf/jaas/command/WhoamiCommand.java @@ -16,8 +16,6 @@ package org.apache.karaf.jaas.command; -import java.security.AccessControlContext; -import java.security.AccessController; import java.security.Principal; import java.util.Set; diff --git a/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/ldap/GSSAPILdapLoginModule.java b/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/ldap/GSSAPILdapLoginModule.java index dd365e0fa05..06634c4c98a 100644 --- a/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/ldap/GSSAPILdapLoginModule.java +++ b/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/ldap/GSSAPILdapLoginModule.java @@ -29,8 +29,6 @@ import javax.security.auth.login.LoginContext; import javax.security.auth.login.LoginException; import java.io.IOException; -import java.security.PrivilegedActionException; -import java.security.PrivilegedExceptionAction; import java.util.HashMap; import java.util.HashSet; import java.util.Map; @@ -67,6 +65,10 @@ public boolean login() throws LoginException { succeeded = Subject.callAs(context.getSubject(), (Callable) this::doLogin); return succeeded; } catch (CompletionException pExcp) { + // callAs wraps unchecked exceptions too; rethrow them like doAs did instead of reporting a failed login + if (pExcp.getCause() instanceof RuntimeException runtimeException) { + throw runtimeException; + } logger.error("error with delegated authentication", pExcp); throw new LoginException(pExcp.getMessage()); } diff --git a/management/server/src/main/java/org/apache/karaf/management/internal/BulkRequestContext.java b/management/server/src/main/java/org/apache/karaf/management/internal/BulkRequestContext.java index ce6f8f796cb..410ebb6dd93 100644 --- a/management/server/src/main/java/org/apache/karaf/management/internal/BulkRequestContext.java +++ b/management/server/src/main/java/org/apache/karaf/management/internal/BulkRequestContext.java @@ -17,8 +17,6 @@ package org.apache.karaf.management.internal; import java.io.IOException; -import java.security.AccessControlContext; -import java.security.AccessController; import java.security.Principal; import java.util.ArrayList; import java.util.Dictionary; @@ -48,7 +46,7 @@ public class BulkRequestContext { private ConfigurationAdmin configAdmin; - // if there's AccessControlContext or subject, we can fail fast + // if there's no subject, we can fail fast private boolean anonymous = false; // otherwise we can cache current subject's principals for faster access private Set principals = new HashSet<>(); diff --git a/services/eventadmin/src/main/java/org/apache/felix/eventadmin/impl/handler/EventAdminImpl.java b/services/eventadmin/src/main/java/org/apache/felix/eventadmin/impl/handler/EventAdminImpl.java index 04188de856b..b44c66b6267 100644 --- a/services/eventadmin/src/main/java/org/apache/felix/eventadmin/impl/handler/EventAdminImpl.java +++ b/services/eventadmin/src/main/java/org/apache/felix/eventadmin/impl/handler/EventAdminImpl.java @@ -18,7 +18,6 @@ */ package org.apache.felix.eventadmin.impl.handler; -import java.security.AccessController; import java.util.HashMap; import javax.security.auth.Subject; diff --git a/shell/console/src/main/java/org/apache/karaf/shell/security/impl/SecuredCommandProcessorImpl.java b/shell/console/src/main/java/org/apache/karaf/shell/security/impl/SecuredCommandProcessorImpl.java index 6b882ec9002..2602b54ac75 100644 --- a/shell/console/src/main/java/org/apache/karaf/shell/security/impl/SecuredCommandProcessorImpl.java +++ b/shell/console/src/main/java/org/apache/karaf/shell/security/impl/SecuredCommandProcessorImpl.java @@ -34,8 +34,6 @@ import javax.security.auth.Subject; -import java.security.AccessControlContext; -import java.security.AccessController; import java.util.ArrayList; import java.util.List; import java.util.Set; diff --git a/shell/console/src/main/java/org/apache/karaf/shell/util/ShellUtil.java b/shell/console/src/main/java/org/apache/karaf/shell/util/ShellUtil.java index 4d75d3fa4a6..1cafec8eb36 100644 --- a/shell/console/src/main/java/org/apache/karaf/shell/util/ShellUtil.java +++ b/shell/console/src/main/java/org/apache/karaf/shell/util/ShellUtil.java @@ -23,8 +23,6 @@ import static org.apache.karaf.shell.commands.ansi.SimpleAnsi.INTENSITY_BOLD; import static org.apache.karaf.shell.commands.ansi.SimpleAnsi.INTENSITY_NORMAL; -import java.security.AccessControlContext; -import java.security.AccessController; import java.util.Arrays; import javax.security.auth.Subject; diff --git a/shell/core/src/main/java/org/apache/karaf/shell/impl/console/osgi/secured/SecuredCommand.java b/shell/core/src/main/java/org/apache/karaf/shell/impl/console/osgi/secured/SecuredCommand.java index 9e48966b0b7..0ae3c3ad3a1 100644 --- a/shell/core/src/main/java/org/apache/karaf/shell/impl/console/osgi/secured/SecuredCommand.java +++ b/shell/core/src/main/java/org/apache/karaf/shell/impl/console/osgi/secured/SecuredCommand.java @@ -72,8 +72,13 @@ public Object execute(Session session, List arguments) throws Exception // Gogo may dispatch this command on a pool thread that never had the session's // subject bound (Subject.callAs()'s ScopedValue binding does not cross an // ExecutorService task boundary), so re-bind it here from the session before - // checking permissions or running the command. - Subject subject = (Subject) session.get(Subject.class.getName()); + // checking permissions or running the command. A subject that is already bound + // takes precedence: it may differ from the session's (e.g. jaas:sudo), and the + // session variable can be reassigned from the shell. + Subject subject = Subject.current(); + if (subject == null) { + subject = (Subject) session.get(Subject.class.getName()); + } try { return JaasHelper.doAs(subject, (PrivilegedExceptionAction) () -> { factory.checkSecurity(getScope(), getName(), arguments); diff --git a/shell/core/src/main/java/org/apache/karaf/shell/impl/console/osgi/secured/SecuredSessionFactoryImpl.java b/shell/core/src/main/java/org/apache/karaf/shell/impl/console/osgi/secured/SecuredSessionFactoryImpl.java index 77a8d8568d0..e43b26c8bf0 100644 --- a/shell/core/src/main/java/org/apache/karaf/shell/impl/console/osgi/secured/SecuredSessionFactoryImpl.java +++ b/shell/core/src/main/java/org/apache/karaf/shell/impl/console/osgi/secured/SecuredSessionFactoryImpl.java @@ -19,8 +19,6 @@ package org.apache.karaf.shell.impl.console.osgi.secured; import java.nio.file.Path; -import java.security.AccessControlContext; -import java.security.AccessController; import java.security.Principal; import java.util.ArrayList; import java.util.Arrays; diff --git a/shell/core/src/main/java/org/apache/karaf/shell/support/ShellUtil.java b/shell/core/src/main/java/org/apache/karaf/shell/support/ShellUtil.java index d2d6340f2ff..fc64f37a8da 100644 --- a/shell/core/src/main/java/org/apache/karaf/shell/support/ShellUtil.java +++ b/shell/core/src/main/java/org/apache/karaf/shell/support/ShellUtil.java @@ -23,8 +23,6 @@ import java.io.PrintWriter; import java.io.StringWriter; import java.nio.file.Paths; -import java.security.AccessControlContext; -import java.security.AccessController; import java.util.Arrays; import java.util.Collection; import java.util.Map; diff --git a/webconsole/gogo/src/main/java/org/apache/karaf/webconsole/gogo/GogoPlugin.java b/webconsole/gogo/src/main/java/org/apache/karaf/webconsole/gogo/GogoPlugin.java index fb56645cabd..ddd0563b566 100644 --- a/webconsole/gogo/src/main/java/org/apache/karaf/webconsole/gogo/GogoPlugin.java +++ b/webconsole/gogo/src/main/java/org/apache/karaf/webconsole/gogo/GogoPlugin.java @@ -33,8 +33,6 @@ import java.io.PrintWriter; import java.net.URI; import java.net.URL; -import java.security.AccessControlContext; -import java.security.AccessController; import java.util.zip.GZIPOutputStream; import javax.security.auth.Subject; From 812413452e4aa30573a679015f22ead701335808 Mon Sep 17 00:00:00 2001 From: Holger Friedrich Date: Fri, 30 Oct 2026 23:28:13 +0100 Subject: [PATCH 13/23] Cleanup, addresses AI review - Propagate session subject on JDK 25, fix jaas:sudo - Fix GogoPlugin user lookup, KarafTestSupport unwrap - java_home 21+, ${javaVersion} in archetype pom --- archetypes/bundle/pom.xml | 6 +++--- .../main/filtered-resources/resources/bin/inc | 2 +- .../apache/karaf/itests/KarafTestSupport.java | 8 +++++++- .../apache/karaf/jaas/command/SuCommand.java | 3 +-- .../apache/karaf/jaas/command/SudoCommand.java | 10 +++++++++- .../shell/impl/console/ConsoleSessionImpl.java | 18 ++++++++++++++++++ .../impl/console/osgi/LocalConsoleManager.java | 5 ++--- .../console/osgi/secured/SecuredCommand.java | 16 ++++++++-------- .../karaf/shell/ssh/ShellFactoryImpl.java | 6 ++---- .../karaf/webconsole/gogo/GogoPlugin.java | 2 +- 10 files changed, 52 insertions(+), 24 deletions(-) diff --git a/archetypes/bundle/pom.xml b/archetypes/bundle/pom.xml index 0cb6128f97a..7d4ecef397e 100644 --- a/archetypes/bundle/pom.xml +++ b/archetypes/bundle/pom.xml @@ -57,9 +57,9 @@ org.apache.maven.plugins maven-compiler-plugin - 21 - 21 - 21 + ${javaVersion} + ${javaVersion} + ${javaVersion} 256M diff --git a/assemblies/features/base/src/main/filtered-resources/resources/bin/inc b/assemblies/features/base/src/main/filtered-resources/resources/bin/inc index b4f69655b7e..d95ac412733 100644 --- a/assemblies/features/base/src/main/filtered-resources/resources/bin/inc +++ b/assemblies/features/base/src/main/filtered-resources/resources/bin/inc @@ -190,7 +190,7 @@ locateJava() { fi if [ "x${JAVA_HOME}" = "x" ] && [ "${darwin}" = "true" ]; then - JAVA_HOME="`/usr/libexec/java_home -v 21`" + JAVA_HOME="`/usr/libexec/java_home -v 21+`" fi if [ "x${JAVA_HOME}" = "x" ] && [ -r /etc/gentoo-release ] ; then JAVA_HOME=`java-config --jre-home` diff --git a/itests/common/src/main/java/org/apache/karaf/itests/KarafTestSupport.java b/itests/common/src/main/java/org/apache/karaf/itests/KarafTestSupport.java index f97c5c8df27..d1ba36f5c39 100644 --- a/itests/common/src/main/java/org/apache/karaf/itests/KarafTestSupport.java +++ b/itests/common/src/main/java/org/apache/karaf/itests/KarafTestSupport.java @@ -35,6 +35,7 @@ import java.util.Hashtable; import java.util.Set; import java.util.concurrent.Callable; +import java.util.concurrent.CompletionException; import java.util.concurrent.ExecutionException; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; @@ -424,7 +425,12 @@ private String executeCommand(final String command, final Long timeout, final Lo Subject subject = new Subject(); subject.getPrincipals().addAll(Arrays.asList(principals)); session.put(Subject.class.getName(), subject); - return Subject.callAs(subject, (Callable) commandCallable::call); + try { + return Subject.callAs(subject, (Callable) commandCallable::call); + } catch (CompletionException e) { + // unwrap like doAs did + throw e.getCause() instanceof RuntimeException runtimeException ? runtimeException : e; + } }); } diff --git a/jaas/command/src/main/java/org/apache/karaf/jaas/command/SuCommand.java b/jaas/command/src/main/java/org/apache/karaf/jaas/command/SuCommand.java index 5bdfcca7c2d..7f49dad7407 100644 --- a/jaas/command/src/main/java/org/apache/karaf/jaas/command/SuCommand.java +++ b/jaas/command/src/main/java/org/apache/karaf/jaas/command/SuCommand.java @@ -67,12 +67,11 @@ public Object execute() throws Exception { JaasHelper.doAs(subject, (PrivilegedExceptionAction) () -> { final Session newSession = session.getFactory().create( System.in, System.out, System.err, SuCommand.this.session.getTerminal(), null, null); - newSession.put(Subject.class.getName(), subject); Object oldIgnoreInterrupts = session.get(Session.IGNORE_INTERRUPTS); try { session.put(Session.IGNORE_INTERRUPTS, Boolean.TRUE); String name = "Karaf local console user " + ShellUtil.getCurrentUserName(); - Thread thread = new Thread(() -> JaasHelper.runAs(subject, newSession), name); + Thread thread = new Thread(newSession, name); thread.start(); thread.join(); } finally { diff --git a/jaas/command/src/main/java/org/apache/karaf/jaas/command/SudoCommand.java b/jaas/command/src/main/java/org/apache/karaf/jaas/command/SudoCommand.java index 18e57e56fba..11d26b9c3c9 100644 --- a/jaas/command/src/main/java/org/apache/karaf/jaas/command/SudoCommand.java +++ b/jaas/command/src/main/java/org/apache/karaf/jaas/command/SudoCommand.java @@ -74,7 +74,15 @@ public Object execute() throws Exception { } sb.append(s); } - JaasHelper.doAs(subject, (PrivilegedExceptionAction) () -> session.execute(sb)); + // Gogo runs the command on pool threads that do not inherit the doAs binding; + // SecuredCommand falls back to the session's subject there, so switch it too. + Object previous = session.get(Subject.class.getName()); + session.put(Subject.class.getName(), subject); + try { + JaasHelper.doAs(subject, (PrivilegedExceptionAction) () -> session.execute(sb)); + } finally { + session.put(Subject.class.getName(), previous); + } loginContext.logout(); return null; diff --git a/shell/core/src/main/java/org/apache/karaf/shell/impl/console/ConsoleSessionImpl.java b/shell/core/src/main/java/org/apache/karaf/shell/impl/console/ConsoleSessionImpl.java index 32e2cb65061..e9a4fdd9a7a 100644 --- a/shell/core/src/main/java/org/apache/karaf/shell/impl/console/ConsoleSessionImpl.java +++ b/shell/core/src/main/java/org/apache/karaf/shell/impl/console/ConsoleSessionImpl.java @@ -39,6 +39,8 @@ import java.util.regex.Pattern; import java.util.stream.Collectors; +import javax.security.auth.Subject; + import org.apache.felix.gogo.jline.ParsedLineImpl; import org.apache.felix.gogo.jline.Shell; import org.apache.felix.gogo.runtime.CommandSessionImpl; @@ -64,6 +66,7 @@ import org.apache.karaf.shell.support.completers.FileOrUriCompleter; import org.apache.karaf.shell.support.completers.UriCompleter; import org.apache.karaf.util.filesstream.FilesStream; +import org.apache.karaf.util.jaas.JaasHelper; import org.jline.builtins.Completers; import org.jline.reader.*; import org.jline.terminal.Size; @@ -219,6 +222,12 @@ public ConsoleSessionImpl(SessionFactory factory, session.put(Session.COMPLETION_MODE, loadCompletionMode()); session.put(Session.DISABLE_EOF_EXIT, loadDisableEofExit()); session.put("USER", ShellUtil.getCurrentUserName()); + // Remember the creator's subject: Subject.callAs() bindings are not inherited by the + // session thread or Gogo's pool threads, see run() and SecuredCommand. + Subject subject = Subject.current(); + if (subject != null) { + session.put(Subject.class.getName(), subject); + } session.put("TERM", terminal.getType()); session.put("APPLICATION", System.getProperty("karaf.name", "root")); session.put("#LINES", (Function) (session, arguments) -> Integer.toString(terminal.getHeight())); @@ -368,6 +377,15 @@ public void close() { } public void run() { + Subject subject = (Subject) session.get(Subject.class.getName()); + if (subject != null) { + JaasHelper.runAs(subject, this::doRun); + } else { + doRun(); + } + } + + private void doRun() { try { threadIO.setStreams(session.getKeyboard(), out, err); thread = Thread.currentThread(); diff --git a/shell/core/src/main/java/org/apache/karaf/shell/impl/console/osgi/LocalConsoleManager.java b/shell/core/src/main/java/org/apache/karaf/shell/impl/console/osgi/LocalConsoleManager.java index 4632cf1204c..8a423b1c495 100644 --- a/shell/core/src/main/java/org/apache/karaf/shell/impl/console/osgi/LocalConsoleManager.java +++ b/shell/core/src/main/java/org/apache/karaf/shell/impl/console/osgi/LocalConsoleManager.java @@ -91,15 +91,14 @@ public void close() { encoding, LocalConsoleManager.this::close); session.put(Session.IS_LOCAL, true); - session.put(Subject.class.getName(), subject); registration = bundleContext.registerService(Session.class, session, null); String name = "Karaf local console user " + ShellUtil.getCurrentUserName(); boolean delayconsole = Boolean.parseBoolean(System.getProperty(KARAF_DELAY_CONSOLE)); if (delayconsole) { watcher = new DelayedStarted(session, name, bundleContext, System.in); - new Thread(() -> JaasHelper.runAs(subject, watcher), name).start(); + new Thread(watcher, name).start(); } else { - new Thread(() -> JaasHelper.runAs(subject, session), name).start(); + new Thread(session, name).start(); } return session; }); diff --git a/shell/core/src/main/java/org/apache/karaf/shell/impl/console/osgi/secured/SecuredCommand.java b/shell/core/src/main/java/org/apache/karaf/shell/impl/console/osgi/secured/SecuredCommand.java index 0ae3c3ad3a1..4e304c31306 100644 --- a/shell/core/src/main/java/org/apache/karaf/shell/impl/console/osgi/secured/SecuredCommand.java +++ b/shell/core/src/main/java/org/apache/karaf/shell/impl/console/osgi/secured/SecuredCommand.java @@ -69,15 +69,15 @@ public Parser getParser() { @Override public Object execute(Session session, List arguments) throws Exception { - // Gogo may dispatch this command on a pool thread that never had the session's - // subject bound (Subject.callAs()'s ScopedValue binding does not cross an - // ExecutorService task boundary), so re-bind it here from the session before - // checking permissions or running the command. A subject that is already bound - // takes precedence: it may differ from the session's (e.g. jaas:sudo), and the - // session variable can be reassigned from the shell. - Subject subject = Subject.current(); + // Gogo runs commands on its session's pool threads. Those threads either have no + // subject bound (JDK 24+: Subject.callAs() uses a ScopedValue, which does not cross + // an ExecutorService task boundary) or one inherited from whatever thread created + // them (JDK 21: AccessControlContext inheritance, possibly from an earlier + // jaas:sudo). So the session's subject is authoritative; jaas:sudo switches it while + // its command runs. Subject.current() is only a fallback for sessions without one. + Subject subject = (Subject) session.get(Subject.class.getName()); if (subject == null) { - subject = (Subject) session.get(Subject.class.getName()); + subject = Subject.current(); } try { return JaasHelper.doAs(subject, (PrivilegedExceptionAction) () -> { diff --git a/shell/ssh/src/main/java/org/apache/karaf/shell/ssh/ShellFactoryImpl.java b/shell/ssh/src/main/java/org/apache/karaf/shell/ssh/ShellFactoryImpl.java index accaaa22fe8..54487b71447 100644 --- a/shell/ssh/src/main/java/org/apache/karaf/shell/ssh/ShellFactoryImpl.java +++ b/shell/ssh/src/main/java/org/apache/karaf/shell/ssh/ShellFactoryImpl.java @@ -24,7 +24,6 @@ import java.io.OutputStream; import java.io.PrintStream; import java.nio.charset.Charset; -import java.security.PrivilegedAction; import java.util.Map; import javax.security.auth.Subject; @@ -110,9 +109,8 @@ public void start(ChannelSession channelSession, Environment environment) throws shell.put(e.getKey(), e.getValue()); } shell.put(Subject.class.getName(), subject); - String threadName = "Karaf ssh console user " - + JaasHelper.doAs(subject, (PrivilegedAction) ShellUtil::getCurrentUserName); - new Thread(() -> JaasHelper.runAs(subject, shell), threadName).start(); + JaasHelper.runAs(subject, () -> + new Thread(shell, "Karaf ssh console user " + ShellUtil.getCurrentUserName()).start()); } catch (Exception e) { throw new IOException("Unable to start shell", e); } diff --git a/webconsole/gogo/src/main/java/org/apache/karaf/webconsole/gogo/GogoPlugin.java b/webconsole/gogo/src/main/java/org/apache/karaf/webconsole/gogo/GogoPlugin.java index ddd0563b566..535df9f93bb 100644 --- a/webconsole/gogo/src/main/java/org/apache/karaf/webconsole/gogo/GogoPlugin.java +++ b/webconsole/gogo/src/main/java/org/apache/karaf/webconsole/gogo/GogoPlugin.java @@ -201,7 +201,7 @@ public SessionTerminal() throws IOException { private String getCurrentUserName() { final Subject subject = Subject.current(); - if (subject != null && subject.getPrincipals().iterator().hasNext()) { + if (subject != null && subject.getPrincipals(UserPrincipal.class).iterator().hasNext()) { return subject.getPrincipals(UserPrincipal.class).iterator().next().getName(); } else { return null; From aa17c3165a4b2bb30ceb0ad88a5b83e891fa366d Mon Sep 17 00:00:00 2001 From: Holger Friedrich Date: Sat, 14 Nov 2026 09:23:36 +0100 Subject: [PATCH 14/23] Define JRE/EE capabilities for Java 21 to 27 only Java 21 is the minimum now, so drop the jre-1.8..20 and eecap-1.8..20 definitions. Add eecap-22..27 and jre-27, and align the instance and test templates (they stopped at eecap-18). java.applet (JEP 504) and netscape.javascript (jdk.jsobject) are gone from Java 26, so jre-26 and later no longer export them. --- .../resources/etc/config.properties | 106 +++----- .../resources/etc/jre.properties | 250 ++---------------- .../instance/resources/etc/config.properties | 88 +++--- .../filtered-resources/etc/config.properties | 92 +++---- .../test-karaf-home/etc/config.properties | 92 +++---- 5 files changed, 163 insertions(+), 465 deletions(-) diff --git a/assemblies/features/base/src/main/filtered-resources/resources/etc/config.properties b/assemblies/features/base/src/main/filtered-resources/resources/etc/config.properties index f480c801bec..4c60823afa2 100644 --- a/assemblies/features/base/src/main/filtered-resources/resources/etc/config.properties +++ b/assemblies/features/base/src/main/filtered-resources/resources/etc/config.properties @@ -129,84 +129,48 @@ equinox-capabilities= \ osgi.service;objectClass:List=org.eclipse.osgi.service.security.TrustEngine;osgi.signedcontent.trust.engine=org.eclipse.osgi, \ osgi.service;objectClass:List=org.eclipse.osgi.service.urlconversion.URLConverter;protocol:List="bundleentry,bundleresource" -eecap-21 = osgi.ee; osgi.ee="OSGi/Minimum"; version:List="1.0,1.1,1.2", \ - osgi.ee; osgi.ee="JavaSE"; version:List="1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0", \ - osgi.ee; osgi.ee="JRE"; version:List="1.0,1.1", \ - osgi.ee; osgi.ee="JavaSE/compact1"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0", \ - osgi.ee; osgi.ee="JavaSE/compact2"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0", \ - osgi.ee; osgi.ee="JavaSE/compact3"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0" -eecap-20 = osgi.ee; osgi.ee="OSGi/Minimum"; version:List="1.0,1.1,1.2", \ - osgi.ee; osgi.ee="JavaSE"; version:List="1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0", \ - osgi.ee; osgi.ee="JRE"; version:List="1.0,1.1", \ - osgi.ee; osgi.ee="JavaSE/compact1"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0", \ - osgi.ee; osgi.ee="JavaSE/compact2"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0", \ - osgi.ee; osgi.ee="JavaSE/compact3"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0" -eecap-19 = osgi.ee; osgi.ee="OSGi/Minimum"; version:List="1.0,1.1,1.2", \ - osgi.ee; osgi.ee="JavaSE"; version:List="1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0", \ - osgi.ee; osgi.ee="JRE"; version:List="1.0,1.1", \ - osgi.ee; osgi.ee="JavaSE/compact1"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0", \ - osgi.ee; osgi.ee="JavaSE/compact2"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0", \ - osgi.ee; osgi.ee="JavaSE/compact3"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0" -eecap-18 = osgi.ee; osgi.ee="OSGi/Minimum"; version:List="1.0,1.1,1.2", \ - osgi.ee; osgi.ee="JavaSE"; version:List="1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0", \ +eecap-27 = osgi.ee; osgi.ee="OSGi/Minimum"; version:List="1.0,1.1,1.2", \ + osgi.ee; osgi.ee="JavaSE"; version:List="1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0,22.0,23.0,24.0,25.0,26.0,27.0", \ osgi.ee; osgi.ee="JRE"; version:List="1.0,1.1", \ - osgi.ee; osgi.ee="JavaSE/compact1"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0", \ - osgi.ee; osgi.ee="JavaSE/compact2"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0", \ - osgi.ee; osgi.ee="JavaSE/compact3"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0" -eecap-17 = osgi.ee; osgi.ee="OSGi/Minimum"; version:List="1.0,1.1,1.2", \ - osgi.ee; osgi.ee="JavaSE"; version:List="1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0", \ + osgi.ee; osgi.ee="JavaSE/compact1"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0,22.0,23.0,24.0,25.0,26.0,27.0", \ + osgi.ee; osgi.ee="JavaSE/compact2"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0,22.0,23.0,24.0,25.0,26.0,27.0", \ + osgi.ee; osgi.ee="JavaSE/compact3"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0,22.0,23.0,24.0,25.0,26.0,27.0" +eecap-26 = osgi.ee; osgi.ee="OSGi/Minimum"; version:List="1.0,1.1,1.2", \ + osgi.ee; osgi.ee="JavaSE"; version:List="1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0,22.0,23.0,24.0,25.0,26.0", \ osgi.ee; osgi.ee="JRE"; version:List="1.0,1.1", \ - osgi.ee; osgi.ee="JavaSE/compact1"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0", \ - osgi.ee; osgi.ee="JavaSE/compact2"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0", \ - osgi.ee; osgi.ee="JavaSE/compact3"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0" -eecap-16 = osgi.ee; osgi.ee="OSGi/Minimum"; version:List="1.0,1.1,1.2", \ - osgi.ee; osgi.ee="JavaSE"; version:List="1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0", \ + osgi.ee; osgi.ee="JavaSE/compact1"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0,22.0,23.0,24.0,25.0,26.0", \ + osgi.ee; osgi.ee="JavaSE/compact2"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0,22.0,23.0,24.0,25.0,26.0", \ + osgi.ee; osgi.ee="JavaSE/compact3"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0,22.0,23.0,24.0,25.0,26.0" +eecap-25 = osgi.ee; osgi.ee="OSGi/Minimum"; version:List="1.0,1.1,1.2", \ + osgi.ee; osgi.ee="JavaSE"; version:List="1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0,22.0,23.0,24.0,25.0", \ osgi.ee; osgi.ee="JRE"; version:List="1.0,1.1", \ - osgi.ee; osgi.ee="JavaSE/compact1"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0", \ - osgi.ee; osgi.ee="JavaSE/compact2"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0", \ - osgi.ee; osgi.ee="JavaSE/compact3"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0" -eecap-15 = osgi.ee; osgi.ee="OSGi/Minimum"; version:List="1.0,1.1,1.2", \ - osgi.ee; osgi.ee="JavaSE"; version:List="1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,9.0,10.0,11.0,13.0,14.0,15.0", \ + osgi.ee; osgi.ee="JavaSE/compact1"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0,22.0,23.0,24.0,25.0", \ + osgi.ee; osgi.ee="JavaSE/compact2"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0,22.0,23.0,24.0,25.0", \ + osgi.ee; osgi.ee="JavaSE/compact3"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0,22.0,23.0,24.0,25.0" +eecap-24 = osgi.ee; osgi.ee="OSGi/Minimum"; version:List="1.0,1.1,1.2", \ + osgi.ee; osgi.ee="JavaSE"; version:List="1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0,22.0,23.0,24.0", \ osgi.ee; osgi.ee="JRE"; version:List="1.0,1.1", \ - osgi.ee; osgi.ee="JavaSE/compact1"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0", \ - osgi.ee; osgi.ee="JavaSE/compact2"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0", \ - osgi.ee; osgi.ee="JavaSE/compact3"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0" -eecap-14 = osgi.ee; osgi.ee="OSGi/Minimum"; version:List="1.0,1.1,1.2", \ - osgi.ee; osgi.ee="JavaSE"; version:List="1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,9.0,10.0,11.0,13.0,14.0", \ + osgi.ee; osgi.ee="JavaSE/compact1"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0,22.0,23.0,24.0", \ + osgi.ee; osgi.ee="JavaSE/compact2"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0,22.0,23.0,24.0", \ + osgi.ee; osgi.ee="JavaSE/compact3"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0,22.0,23.0,24.0" +eecap-23 = osgi.ee; osgi.ee="OSGi/Minimum"; version:List="1.0,1.1,1.2", \ + osgi.ee; osgi.ee="JavaSE"; version:List="1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0,22.0,23.0", \ osgi.ee; osgi.ee="JRE"; version:List="1.0,1.1", \ - osgi.ee; osgi.ee="JavaSE/compact1"; version:List="1.8,9.0,10.0,11.0,13.0,14.0", \ - osgi.ee; osgi.ee="JavaSE/compact2"; version:List="1.8,9.0,10.0,11.0,13.0,14.0", \ - osgi.ee; osgi.ee="JavaSE/compact3"; version:List="1.8,9.0,10.0,11.0,13.0,14.0" -eecap-13 = osgi.ee; osgi.ee="OSGi/Minimum"; version:List="1.0,1.1,1.2", \ - osgi.ee; osgi.ee="JavaSE"; version:List="1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,9.0,10.0,11.0,13.0", \ + osgi.ee; osgi.ee="JavaSE/compact1"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0,22.0,23.0", \ + osgi.ee; osgi.ee="JavaSE/compact2"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0,22.0,23.0", \ + osgi.ee; osgi.ee="JavaSE/compact3"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0,22.0,23.0" +eecap-22 = osgi.ee; osgi.ee="OSGi/Minimum"; version:List="1.0,1.1,1.2", \ + osgi.ee; osgi.ee="JavaSE"; version:List="1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0,22.0", \ osgi.ee; osgi.ee="JRE"; version:List="1.0,1.1", \ - osgi.ee; osgi.ee="JavaSE/compact1"; version:List="1.8,9.0,10.0,11.0,13.0", \ - osgi.ee; osgi.ee="JavaSE/compact2"; version:List="1.8,9.0,10.0,11.0,13.0", \ - osgi.ee; osgi.ee="JavaSE/compact3"; version:List="1.8,9.0,10.0,11.0,13.0" -eecap-11= osgi.ee; osgi.ee="OSGi/Minimum"; version:List="1.0,1.1,1.2", \ - osgi.ee; osgi.ee="JavaSE"; version:List="1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,9.0,10.0,11.0", \ - osgi.ee; osgi.ee="JRE"; version:List="1.0,1.1", \ - osgi.ee; osgi.ee="JavaSE/compact1"; version:List="1.8,9.0,10.0,11.0", \ - osgi.ee; osgi.ee="JavaSE/compact2"; version:List="1.8,9.0,10.0,11.0", \ - osgi.ee; osgi.ee="JavaSE/compact3"; version:List="1.8,9.0,10.0,11.0" -eecap-10= osgi.ee; osgi.ee="OSGi/Minimum"; version:List="1.0,1.1,1.2", \ - osgi.ee; osgi.ee="JavaSE"; version:List="1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,9.0,10.0", \ - osgi.ee; osgi.ee="JRE"; version:List="1.0,1.1", \ - osgi.ee; osgi.ee="JavaSE/compact1"; version:List="1.8,9.0,10.0", \ - osgi.ee; osgi.ee="JavaSE/compact2"; version:List="1.8,9.0,10.0", \ - osgi.ee; osgi.ee="JavaSE/compact3"; version:List="1.8,9.0,10.0" -eecap-9= osgi.ee; osgi.ee="OSGi/Minimum"; version:List="1.0,1.1,1.2", \ - osgi.ee; osgi.ee="JavaSE"; version:List="1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,9.0", \ - osgi.ee; osgi.ee="JRE"; version:List="1.0,1.1", \ - osgi.ee; osgi.ee="JavaSE/compact1"; version:List="1.8,9.0", \ - osgi.ee; osgi.ee="JavaSE/compact2"; version:List="1.8,9.0", \ - osgi.ee; osgi.ee="JavaSE/compact3"; version:List="1.8,9.0" -eecap-1.8= osgi.ee; osgi.ee="OSGi/Minimum"; version:List="1.0,1.1,1.2", \ - osgi.ee; osgi.ee="JavaSE"; version:List="1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8", \ + osgi.ee; osgi.ee="JavaSE/compact1"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0,22.0", \ + osgi.ee; osgi.ee="JavaSE/compact2"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0,22.0", \ + osgi.ee; osgi.ee="JavaSE/compact3"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0,22.0" +eecap-21 = osgi.ee; osgi.ee="OSGi/Minimum"; version:List="1.0,1.1,1.2", \ + osgi.ee; osgi.ee="JavaSE"; version:List="1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0", \ osgi.ee; osgi.ee="JRE"; version:List="1.0,1.1", \ - osgi.ee; osgi.ee="JavaSE/compact1"; version:List="1.8", \ - osgi.ee; osgi.ee="JavaSE/compact2"; version:List="1.8", \ - osgi.ee; osgi.ee="JavaSE/compact3"; version:List="1.8" + osgi.ee; osgi.ee="JavaSE/compact1"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0", \ + osgi.ee; osgi.ee="JavaSE/compact2"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0", \ + osgi.ee; osgi.ee="JavaSE/compact3"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0" # # javax.transaction is needed ONLY for com.sun.corba.se.impl.javax.rmi.CORBA.Util.mapSystemException(). diff --git a/assemblies/features/base/src/main/filtered-resources/resources/etc/jre.properties b/assemblies/features/base/src/main/filtered-resources/resources/etc/jre.properties index 3fa24cba646..bc54234a1e2 100644 --- a/assemblies/features/base/src/main/filtered-resources/resources/etc/jre.properties +++ b/assemblies/features/base/src/main/filtered-resources/resources/etc/jre.properties @@ -23,7 +23,6 @@ # Contains java.* packages provided by the JDK (and so system packages) jre-base= \ - java.applet, \ java.awt, \ java.awt.color, \ java.awt.datatransfer, \ @@ -122,208 +121,7 @@ jre-base= \ # - mandatory "partial" attribute is added to javax.transaction.xa export (all JDKs) to satisfy DBCP2 # -jre-1.8= \ - ${jre-base}, \ - javax.accessibility, \ - javax.activity, \ - javax.annotation;version="1.0", \ - javax.annotation.processing;version="1.0", \ - javax.crypto, \ - javax.crypto.interfaces, \ - javax.crypto.spec, \ - javax.imageio, \ - javax.imageio.event, \ - javax.imageio.metadata, \ - javax.imageio.plugins.bmp, \ - javax.imageio.plugins.jpeg, \ - javax.imageio.spi, \ - javax.imageio.stream, \ - javax.jws, \ - javax.jws.soap, \ - javax.lang.model, \ - javax.lang.model.element, \ - javax.lang.model.type, \ - javax.lang.model.util, \ - javax.management, \ - javax.management.loading, \ - javax.management.modelmbean, \ - javax.management.monitor, \ - javax.management.openmbean, \ - javax.management.relation, \ - javax.management.remote, \ - javax.management.remote.rmi, \ - javax.management.timer, \ - javax.naming, \ - javax.naming.directory, \ - javax.naming.event, \ - javax.naming.ldap, \ - javax.naming.spi, \ - javax.net, \ - javax.net.ssl, \ - javax.print, \ - javax.print.attribute, \ - javax.print.attribute.standard, \ - javax.print.event, \ - javax.rmi, \ - javax.rmi.CORBA, \ - javax.rmi.ssl, \ - javax.script, \ - javax.security.auth, \ - javax.security.auth.callback, \ - javax.security.auth.kerberos, \ - javax.security.auth.login, \ - javax.security.auth.spi, \ - javax.security.auth.x500, \ - javax.security.cert, \ - javax.security.sasl, \ - javax.sound.midi, \ - javax.sound.midi.spi, \ - javax.sound.sampled, \ - javax.sound.sampled.spi, \ - javax.sql, \ - javax.sql.rowset, \ - javax.sql.rowset.serial, \ - javax.sql.rowset.spi, \ - javax.swing, \ - javax.swing.border, \ - javax.swing.colorchooser, \ - javax.swing.event, \ - javax.swing.filechooser, \ - javax.swing.plaf, \ - javax.swing.plaf.basic, \ - javax.swing.plaf.metal, \ - javax.swing.plaf.multi, \ - javax.swing.plaf.synth, \ - javax.swing.table, \ - javax.swing.text, \ - javax.swing.text.html, \ - javax.swing.text.html.parser, \ - javax.swing.text.rtf, \ - javax.swing.tree, \ - javax.swing.undo, \ - javax.tools, \ - javax.transaction;partial=true;mandatory:=partial, \ - javax.transaction.xa;version="1.1";partial=true;mandatory:=partial, \ - javax.transaction.xa;version="1.1", \ - javax.transaction.xa;version="1.2", \ - javax.transaction.xa;version="1.3", \ - javax.xml, \ - javax.xml.bind;version="2.2.8", \ - javax.xml.bind.annotation;version="2.2.8", \ - javax.xml.bind.annotation.adapters;version="2.2.8", \ - javax.xml.bind.attachment;version="2.2.8", \ - javax.xml.bind.helpers;version="2.2.8", \ - javax.xml.bind.util;version="2.2.8", \ - javax.xml.crypto, \ - javax.xml.crypto.dom, \ - javax.xml.crypto.dsig, \ - javax.xml.crypto.dsig.dom, \ - javax.xml.crypto.dsig.keyinfo, \ - javax.xml.crypto.dsig.spec, \ - javax.xml.datatype, \ - javax.xml.namespace, \ - javax.xml.parsers, \ - javax.xml.stream;version="1.2", \ - javax.xml.stream.events;version="1.2", \ - javax.xml.stream.util;version="1.2", \ - javax.xml.transform, \ - javax.xml.transform.dom, \ - javax.xml.transform.sax, \ - javax.xml.transform.stax, \ - javax.xml.transform.stream, \ - javax.xml.validation, \ - javax.xml.ws;version="2.2", \ - javax.xml.ws.handler;version="2.2", \ - javax.xml.ws.handler.soap;version="2.2", \ - javax.xml.ws.http;version="2.2", \ - javax.xml.ws.soap;version="2.2", \ - javax.xml.ws.spi;version="2.2", \ - javax.xml.ws.wsaddressing;version="2.2", \ - javax.xml.ws.spi.http;version="2.2", \ - javax.xml.xpath, \ - javafx.animation, \ - javafx.application, \ - javafx.beans, \ - javafx.beans.binding, \ - javafx.beans.property, \ - javafx.beans.property.adapter, \ - javafx.beans.value, \ - javafx.collections, \ - javafx.collections.transform, \ - javafx.concurrent, \ - javafx.css, \ - javafx.embed.swing, \ - javafx.embed.swt, \ - javafx.event, \ - javafx.fxml, \ - javafx.geometry, \ - javafx.print, \ - javafx.scene, \ - javafx.scene.canvas, \ - javafx.scene.chart, \ - javafx.scene.control, \ - javafx.scene.control.cell, \ - javafx.scene.effect, \ - javafx.scene.image, \ - javafx.scene.input, \ - javafx.scene.layout, \ - javafx.scene.media, \ - javafx.scene.paint, \ - javafx.scene.shape, \ - javafx.scene.text, \ - javafx.scene.transform, \ - javafx.scene.web, \ - javafx.stage, \ - javafx.util, \ - javafx.util.converter, \ - netscape.javascript, \ - org.ietf.jgss, \ - org.omg.CORBA, \ - org.omg.CORBA_2_3, \ - org.omg.CORBA_2_3.portable, \ - org.omg.CORBA.DynAnyPackage, \ - org.omg.CORBA.ORBPackage, \ - org.omg.CORBA.portable, \ - org.omg.CORBA.TypeCodePackage, \ - org.omg.CosNaming, \ - org.omg.CosNaming.NamingContextExtPackage, \ - org.omg.CosNaming.NamingContextPackage, \ - org.omg.Dynamic, \ - org.omg.DynamicAny, \ - org.omg.DynamicAny.DynAnyFactoryPackage, \ - org.omg.DynamicAny.DynAnyPackage, \ - org.omg.IOP, \ - org.omg.IOP.CodecFactoryPackage, \ - org.omg.IOP.CodecPackage, \ - org.omg.Messaging, \ - org.omg.PortableInterceptor, \ - org.omg.PortableInterceptor.ORBInitInfoPackage, \ - org.omg.PortableServer, \ - org.omg.PortableServer.CurrentPackage, \ - org.omg.PortableServer.POAManagerPackage, \ - org.omg.PortableServer.POAPackage, \ - org.omg.PortableServer.portable, \ - org.omg.PortableServer.ServantLocatorPackage, \ - org.omg.SendingContext, \ - org.omg.stub.java.rmi, \ - org.omg.stub.javax.management.remote.rmi, \ - org.w3c.dom, \ - org.w3c.dom.bootstrap, \ - org.w3c.dom.css, \ - org.w3c.dom.events, \ - org.w3c.dom.html, \ - org.w3c.dom.ls, \ - org.w3c.dom.ranges, \ - org.w3c.dom.stylesheets, \ - org.w3c.dom.traversal, \ - org.w3c.dom.views, \ - org.w3c.dom.xpath, \ - org.xml.sax, \ - org.xml.sax.ext, \ - org.xml.sax.helpers, \ - com.sun.nio.sctp - -jre-9= \ +jre-21-core= \ ${jre-base}, \ java.lang.module, \ java.net.spi, \ @@ -473,7 +271,6 @@ jre-9= \ jdk.jfr, \ jdk.jfr.consumer, \ jdk.management.jfr, \ - netscape.javascript, \ org.ietf.jgss, \ org.w3c.dom, \ org.w3c.dom.bootstrap, \ @@ -492,36 +289,35 @@ jre-9= \ com.sun.security.sasl, \ com.sun.security.sasl.digest, \ com.sun.security.sasl.ntlm, \ - com.sun.security.sasl.util - -jre-10 = ${jre-9} -jre-11 = ${jre-9}, \ + com.sun.security.sasl.util, \ java.net.http, \ - jdk.nio -jre-12 = ${jre-11}, \ + jdk.nio, \ java.lang.constant, \ - javax.naming.ldap.spi -jre-13 = ${jre-12} -jre-14 = ${jre-12}, \ - jdk.nio.mapmode -jre-15 = ${jre-14} -jre-16 = ${jre-14}, \ - java.lang.runtime -jre-17 = ${jre-16}, \ + javax.naming.ldap.spi, \ + jdk.nio.mapmode, \ + java.lang.runtime, \ java.util.random -jre-18 = ${jre-17} -jre-19 = ${jre-17} -jre-20 = ${jre-17} -jre-21 = ${jre-17} -jre-22 = ${jre-17}, \ + +# Removed in Java 26: java.applet (JEP 504) and netscape.javascript (jdk.jsobject) +jre-legacy-desktop = \ + java.applet, \ + netscape.javascript + +jre-22-core = ${jre-21-core}, \ java.lang.foreign -jre-23 = ${jre-22} -jre-24 = ${jre-22}, \ +jre-24-core = ${jre-22-core}, \ java.lang.classfile, \ java.lang.classfile.attribute, \ java.lang.classfile.constantpool, \ java.lang.classfile.instruction, \ jdk.management -jre-25 = ${jre-24}, \ +jre-25-core = ${jre-24-core}, \ javax.sound -jre-26 = ${jre-25} + +jre-21 = ${jre-21-core}, ${jre-legacy-desktop} +jre-22 = ${jre-22-core}, ${jre-legacy-desktop} +jre-23 = ${jre-22} +jre-24 = ${jre-24-core}, ${jre-legacy-desktop} +jre-25 = ${jre-25-core}, ${jre-legacy-desktop} +jre-26 = ${jre-25-core} +jre-27 = ${jre-26} diff --git a/instance/src/main/resources/org/apache/karaf/instance/resources/etc/config.properties b/instance/src/main/resources/org/apache/karaf/instance/resources/etc/config.properties index f59a2950eb4..132c4fbe995 100644 --- a/instance/src/main/resources/org/apache/karaf/instance/resources/etc/config.properties +++ b/instance/src/main/resources/org/apache/karaf/instance/resources/etc/config.properties @@ -129,66 +129,48 @@ equinox-capabilities= \ osgi.service;objectClass:List=org.eclipse.osgi.service.security.TrustEngine;osgi.signedcontent.trust.engine=org.eclipse.osgi, \ osgi.service;objectClass:List=org.eclipse.osgi.service.urlconversion.URLConverter;protocol:List="bundleentry,bundleresource" -eecap-18 = osgi.ee; osgi.ee="OSGi/Minimum"; version:List="1.0,1.1,1.2", \ - osgi.ee; osgi.ee="JavaSE"; version:List="1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0", \ +eecap-27 = osgi.ee; osgi.ee="OSGi/Minimum"; version:List="1.0,1.1,1.2", \ + osgi.ee; osgi.ee="JavaSE"; version:List="1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0,22.0,23.0,24.0,25.0,26.0,27.0", \ osgi.ee; osgi.ee="JRE"; version:List="1.0,1.1", \ - osgi.ee; osgi.ee="JavaSE/compact1"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0", \ - osgi.ee; osgi.ee="JavaSE/compact2"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0", \ - osgi.ee; osgi.ee="JavaSE/compact3"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0" -eecap-17 = osgi.ee; osgi.ee="OSGi/Minimum"; version:List="1.0,1.1,1.2", \ - osgi.ee; osgi.ee="JavaSE"; version:List="1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0", \ + osgi.ee; osgi.ee="JavaSE/compact1"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0,22.0,23.0,24.0,25.0,26.0,27.0", \ + osgi.ee; osgi.ee="JavaSE/compact2"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0,22.0,23.0,24.0,25.0,26.0,27.0", \ + osgi.ee; osgi.ee="JavaSE/compact3"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0,22.0,23.0,24.0,25.0,26.0,27.0" +eecap-26 = osgi.ee; osgi.ee="OSGi/Minimum"; version:List="1.0,1.1,1.2", \ + osgi.ee; osgi.ee="JavaSE"; version:List="1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0,22.0,23.0,24.0,25.0,26.0", \ osgi.ee; osgi.ee="JRE"; version:List="1.0,1.1", \ - osgi.ee; osgi.ee="JavaSE/compact1"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0", \ - osgi.ee; osgi.ee="JavaSE/compact2"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0", \ - osgi.ee; osgi.ee="JavaSE/compact3"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0" -eecap-16 = osgi.ee; osgi.ee="OSGi/Minimum"; version:List="1.0,1.1,1.2", \ - osgi.ee; osgi.ee="JavaSE"; version:List="1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0", \ + osgi.ee; osgi.ee="JavaSE/compact1"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0,22.0,23.0,24.0,25.0,26.0", \ + osgi.ee; osgi.ee="JavaSE/compact2"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0,22.0,23.0,24.0,25.0,26.0", \ + osgi.ee; osgi.ee="JavaSE/compact3"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0,22.0,23.0,24.0,25.0,26.0" +eecap-25 = osgi.ee; osgi.ee="OSGi/Minimum"; version:List="1.0,1.1,1.2", \ + osgi.ee; osgi.ee="JavaSE"; version:List="1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0,22.0,23.0,24.0,25.0", \ osgi.ee; osgi.ee="JRE"; version:List="1.0,1.1", \ - osgi.ee; osgi.ee="JavaSE/compact1"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0", \ - osgi.ee; osgi.ee="JavaSE/compact2"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0", \ - osgi.ee; osgi.ee="JavaSE/compact3"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0" -eecap-15= osgi.ee; osgi.ee="OSGi/Minimum"; version:List="1.0,1.1,1.2", \ - osgi.ee; osgi.ee="JavaSE"; version:List="1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,9.0,10.0,11.0,13.0,15.0", \ + osgi.ee; osgi.ee="JavaSE/compact1"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0,22.0,23.0,24.0,25.0", \ + osgi.ee; osgi.ee="JavaSE/compact2"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0,22.0,23.0,24.0,25.0", \ + osgi.ee; osgi.ee="JavaSE/compact3"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0,22.0,23.0,24.0,25.0" +eecap-24 = osgi.ee; osgi.ee="OSGi/Minimum"; version:List="1.0,1.1,1.2", \ + osgi.ee; osgi.ee="JavaSE"; version:List="1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0,22.0,23.0,24.0", \ osgi.ee; osgi.ee="JRE"; version:List="1.0,1.1", \ - osgi.ee; osgi.ee="JavaSE/compact1"; version:List="1.8,9.0,10.0,11.0,13.0,15.0", \ - osgi.ee; osgi.ee="JavaSE/compact2"; version:List="1.8,9.0,10.0,11.0,13.0,15.0", \ - osgi.ee; osgi.ee="JavaSE/compact3"; version:List="1.8,9.0,10.0,11.0,13.0,15.0" -eecap-14= osgi.ee; osgi.ee="OSGi/Minimum"; version:List="1.0,1.1,1.2", \ - osgi.ee; osgi.ee="JavaSE"; version:List="1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,9.0,10.0,11.0,13.0,14.0", \ + osgi.ee; osgi.ee="JavaSE/compact1"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0,22.0,23.0,24.0", \ + osgi.ee; osgi.ee="JavaSE/compact2"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0,22.0,23.0,24.0", \ + osgi.ee; osgi.ee="JavaSE/compact3"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0,22.0,23.0,24.0" +eecap-23 = osgi.ee; osgi.ee="OSGi/Minimum"; version:List="1.0,1.1,1.2", \ + osgi.ee; osgi.ee="JavaSE"; version:List="1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0,22.0,23.0", \ osgi.ee; osgi.ee="JRE"; version:List="1.0,1.1", \ - osgi.ee; osgi.ee="JavaSE/compact1"; version:List="1.8,9.0,10.0,11.0,13.0,14.0", \ - osgi.ee; osgi.ee="JavaSE/compact2"; version:List="1.8,9.0,10.0,11.0,13.0,14.0", \ - osgi.ee; osgi.ee="JavaSE/compact3"; version:List="1.8,9.0,10.0,11.0,13.0,14.0" -eecap-13= osgi.ee; osgi.ee="OSGi/Minimum"; version:List="1.0,1.1,1.2", \ - osgi.ee; osgi.ee="JavaSE"; version:List="1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,9.0,10.0,11.0,13.0", \ + osgi.ee; osgi.ee="JavaSE/compact1"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0,22.0,23.0", \ + osgi.ee; osgi.ee="JavaSE/compact2"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0,22.0,23.0", \ + osgi.ee; osgi.ee="JavaSE/compact3"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0,22.0,23.0" +eecap-22 = osgi.ee; osgi.ee="OSGi/Minimum"; version:List="1.0,1.1,1.2", \ + osgi.ee; osgi.ee="JavaSE"; version:List="1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0,22.0", \ osgi.ee; osgi.ee="JRE"; version:List="1.0,1.1", \ - osgi.ee; osgi.ee="JavaSE/compact1"; version:List="1.8,9.0,10.0,11.0,13.0", \ - osgi.ee; osgi.ee="JavaSE/compact2"; version:List="1.8,9.0,10.0,11.0,13.0", \ - osgi.ee; osgi.ee="JavaSE/compact3"; version:List="1.8,9.0,10.0,11.0,13.0" -eecap-11= osgi.ee; osgi.ee="OSGi/Minimum"; version:List="1.0,1.1,1.2", \ - osgi.ee; osgi.ee="JavaSE"; version:List="1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,9.0,10.0,11.0", \ + osgi.ee; osgi.ee="JavaSE/compact1"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0,22.0", \ + osgi.ee; osgi.ee="JavaSE/compact2"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0,22.0", \ + osgi.ee; osgi.ee="JavaSE/compact3"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0,22.0" +eecap-21 = osgi.ee; osgi.ee="OSGi/Minimum"; version:List="1.0,1.1,1.2", \ + osgi.ee; osgi.ee="JavaSE"; version:List="1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0", \ osgi.ee; osgi.ee="JRE"; version:List="1.0,1.1", \ - osgi.ee; osgi.ee="JavaSE/compact1"; version:List="1.8,9.0,10.0,11.0", \ - osgi.ee; osgi.ee="JavaSE/compact2"; version:List="1.8,9.0,10.0,11.0", \ - osgi.ee; osgi.ee="JavaSE/compact3"; version:List="1.8,9.0,10.0,11.0" -eecap-10= osgi.ee; osgi.ee="OSGi/Minimum"; version:List="1.0,1.1,1.2", \ - osgi.ee; osgi.ee="JavaSE"; version:List="1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,9.0,10.0", \ - osgi.ee; osgi.ee="JRE"; version:List="1.0,1.1", \ - osgi.ee; osgi.ee="JavaSE/compact1"; version:List="1.8,9.0,10.0", \ - osgi.ee; osgi.ee="JavaSE/compact2"; version:List="1.8,9.0,10.0", \ - osgi.ee; osgi.ee="JavaSE/compact3"; version:List="1.8,9.0,10.0" -eecap-9= osgi.ee; osgi.ee="OSGi/Minimum"; version:List="1.0,1.1,1.2", \ - osgi.ee; osgi.ee="JavaSE"; version:List="1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,9.0", \ - osgi.ee; osgi.ee="JRE"; version:List="1.0,1.1", \ - osgi.ee; osgi.ee="JavaSE/compact1"; version:List="1.8,9.0", \ - osgi.ee; osgi.ee="JavaSE/compact2"; version:List="1.8,9.0", \ - osgi.ee; osgi.ee="JavaSE/compact3"; version:List="1.8,9.0" -eecap-1.8= osgi.ee; osgi.ee="OSGi/Minimum"; version:List="1.0,1.1,1.2", \ - osgi.ee; osgi.ee="JavaSE"; version:List="1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8", \ - osgi.ee; osgi.ee="JRE"; version:List="1.0,1.1", \ - osgi.ee; osgi.ee="JavaSE/compact1"; version:List="1.8", \ - osgi.ee; osgi.ee="JavaSE/compact2"; version:List="1.8", \ - osgi.ee; osgi.ee="JavaSE/compact3"; version:List="1.8" + osgi.ee; osgi.ee="JavaSE/compact1"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0", \ + osgi.ee; osgi.ee="JavaSE/compact2"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0", \ + osgi.ee; osgi.ee="JavaSE/compact3"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0" # # javax.transaction is needed ONLY for com.sun.corba.se.impl.javax.rmi.CORBA.Util.mapSystemException(). JDK8 and earlier diff --git a/itests/test/src/test/filtered-resources/etc/config.properties b/itests/test/src/test/filtered-resources/etc/config.properties index 9db63e2fd1e..c32fb0a397c 100644 --- a/itests/test/src/test/filtered-resources/etc/config.properties +++ b/itests/test/src/test/filtered-resources/etc/config.properties @@ -104,70 +104,48 @@ org.osgi.framework.system.capabilities= \ osgi.service;effective:=active;objectClass=org.osgi.service.url.URLHandlers, \ osgi.contract;osgi.contract=JavaAnnotation;uses:="javax.annotation,javax.annotation.security,javax.annotation.sql";version:List="1.3,1.2,1.1,1" -eecap-18 = osgi.ee; osgi.ee="OSGi/Minimum"; version:List="1.0,1.1,1.2", \ - osgi.ee; osgi.ee="JavaSE"; version:List="1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0", \ +eecap-27 = osgi.ee; osgi.ee="OSGi/Minimum"; version:List="1.0,1.1,1.2", \ + osgi.ee; osgi.ee="JavaSE"; version:List="1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0,22.0,23.0,24.0,25.0,26.0,27.0", \ osgi.ee; osgi.ee="JRE"; version:List="1.0,1.1", \ - osgi.ee; osgi.ee="JavaSE/compact1"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0", \ - osgi.ee; osgi.ee="JavaSE/compact2"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0", \ - osgi.ee; osgi.ee="JavaSE/compact3"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0" -eecap-17 = osgi.ee; osgi.ee="OSGi/Minimum"; version:List="1.0,1.1,1.2", \ - osgi.ee; osgi.ee="JavaSE"; version:List="1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0", \ + osgi.ee; osgi.ee="JavaSE/compact1"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0,22.0,23.0,24.0,25.0,26.0,27.0", \ + osgi.ee; osgi.ee="JavaSE/compact2"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0,22.0,23.0,24.0,25.0,26.0,27.0", \ + osgi.ee; osgi.ee="JavaSE/compact3"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0,22.0,23.0,24.0,25.0,26.0,27.0" +eecap-26 = osgi.ee; osgi.ee="OSGi/Minimum"; version:List="1.0,1.1,1.2", \ + osgi.ee; osgi.ee="JavaSE"; version:List="1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0,22.0,23.0,24.0,25.0,26.0", \ osgi.ee; osgi.ee="JRE"; version:List="1.0,1.1", \ - osgi.ee; osgi.ee="JavaSE/compact1"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0", \ - osgi.ee; osgi.ee="JavaSE/compact2"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0", \ - osgi.ee; osgi.ee="JavaSE/compact3"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0" -eecap-16 = osgi.ee; osgi.ee="OSGi/Minimum"; version:List="1.0,1.1,1.2", \ - osgi.ee; osgi.ee="JavaSE"; version:List="1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0", \ + osgi.ee; osgi.ee="JavaSE/compact1"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0,22.0,23.0,24.0,25.0,26.0", \ + osgi.ee; osgi.ee="JavaSE/compact2"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0,22.0,23.0,24.0,25.0,26.0", \ + osgi.ee; osgi.ee="JavaSE/compact3"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0,22.0,23.0,24.0,25.0,26.0" +eecap-25 = osgi.ee; osgi.ee="OSGi/Minimum"; version:List="1.0,1.1,1.2", \ + osgi.ee; osgi.ee="JavaSE"; version:List="1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0,22.0,23.0,24.0,25.0", \ osgi.ee; osgi.ee="JRE"; version:List="1.0,1.1", \ - osgi.ee; osgi.ee="JavaSE/compact1"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0", \ - osgi.ee; osgi.ee="JavaSE/compact2"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0", \ - osgi.ee; osgi.ee="JavaSE/compact3"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0" -eecap-15= osgi.ee; osgi.ee="OSGi/Minimum"; version:List="1.0,1.1,1.2", \ - osgi.ee; osgi.ee="JavaSE"; version:List="1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,9.0,10.0,11.0,13.0,14.0,15.0", \ + osgi.ee; osgi.ee="JavaSE/compact1"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0,22.0,23.0,24.0,25.0", \ + osgi.ee; osgi.ee="JavaSE/compact2"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0,22.0,23.0,24.0,25.0", \ + osgi.ee; osgi.ee="JavaSE/compact3"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0,22.0,23.0,24.0,25.0" +eecap-24 = osgi.ee; osgi.ee="OSGi/Minimum"; version:List="1.0,1.1,1.2", \ + osgi.ee; osgi.ee="JavaSE"; version:List="1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0,22.0,23.0,24.0", \ osgi.ee; osgi.ee="JRE"; version:List="1.0,1.1", \ - osgi.ee; osgi.ee="JavaSE/compact1"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0", \ - osgi.ee; osgi.ee="JavaSE/compact2"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0", \ - osgi.ee; osgi.ee="JavaSE/compact3"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0" -eecap-14= osgi.ee; osgi.ee="OSGi/Minimum"; version:List="1.0,1.1,1.2", \ - osgi.ee; osgi.ee="JavaSE"; version:List="1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,9.0,10.0,11.0,13.0,14.0", \ + osgi.ee; osgi.ee="JavaSE/compact1"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0,22.0,23.0,24.0", \ + osgi.ee; osgi.ee="JavaSE/compact2"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0,22.0,23.0,24.0", \ + osgi.ee; osgi.ee="JavaSE/compact3"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0,22.0,23.0,24.0" +eecap-23 = osgi.ee; osgi.ee="OSGi/Minimum"; version:List="1.0,1.1,1.2", \ + osgi.ee; osgi.ee="JavaSE"; version:List="1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0,22.0,23.0", \ osgi.ee; osgi.ee="JRE"; version:List="1.0,1.1", \ - osgi.ee; osgi.ee="JavaSE/compact1"; version:List="1.8,9.0,10.0,11.0,13.0,14.0", \ - osgi.ee; osgi.ee="JavaSE/compact2"; version:List="1.8,9.0,10.0,11.0,13.0,14.0", \ - osgi.ee; osgi.ee="JavaSE/compact3"; version:List="1.8,9.0,10.0,11.0,13.0,14.0" -eecap-13= osgi.ee; osgi.ee="OSGi/Minimum"; version:List="1.0,1.1,1.2", \ - osgi.ee; osgi.ee="JavaSE"; version:List="1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,9.0,10.0,11.0,13.0", \ + osgi.ee; osgi.ee="JavaSE/compact1"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0,22.0,23.0", \ + osgi.ee; osgi.ee="JavaSE/compact2"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0,22.0,23.0", \ + osgi.ee; osgi.ee="JavaSE/compact3"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0,22.0,23.0" +eecap-22 = osgi.ee; osgi.ee="OSGi/Minimum"; version:List="1.0,1.1,1.2", \ + osgi.ee; osgi.ee="JavaSE"; version:List="1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0,22.0", \ osgi.ee; osgi.ee="JRE"; version:List="1.0,1.1", \ - osgi.ee; osgi.ee="JavaSE/compact1"; version:List="1.8,9.0,10.0,11.0,13.0", \ - osgi.ee; osgi.ee="JavaSE/compact2"; version:List="1.8,9.0,10.0,11.0,13.0", \ - osgi.ee; osgi.ee="JavaSE/compact3"; version:List="1.8,9.0,10.0,11.0,13.0" -eecap-11= osgi.ee; osgi.ee="OSGi/Minimum"; version:List="1.0,1.1,1.2", \ - osgi.ee; osgi.ee="JavaSE"; version:List="1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,9.0,10.0,11.0", \ + osgi.ee; osgi.ee="JavaSE/compact1"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0,22.0", \ + osgi.ee; osgi.ee="JavaSE/compact2"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0,22.0", \ + osgi.ee; osgi.ee="JavaSE/compact3"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0,22.0" +eecap-21 = osgi.ee; osgi.ee="OSGi/Minimum"; version:List="1.0,1.1,1.2", \ + osgi.ee; osgi.ee="JavaSE"; version:List="1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0", \ osgi.ee; osgi.ee="JRE"; version:List="1.0,1.1", \ - osgi.ee; osgi.ee="JavaSE/compact1"; version:List="1.8,9.0,10.0,11.0", \ - osgi.ee; osgi.ee="JavaSE/compact2"; version:List="1.8,9.0,10.0,11.0", \ - osgi.ee; osgi.ee="JavaSE/compact3"; version:List="1.8,9.0,10.0,11.0" -eecap-10= osgi.ee; osgi.ee="OSGi/Minimum"; version:List="1.0,1.1,1.2", \ - osgi.ee; osgi.ee="JavaSE"; version:List="1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,9.0,10.0", \ - osgi.ee; osgi.ee="JRE"; version:List="1.0,1.1", \ - osgi.ee; osgi.ee="JavaSE/compact1"; version:List="1.8,9.0,10.0", \ - osgi.ee; osgi.ee="JavaSE/compact2"; version:List="1.8,9.0,10.0", \ - osgi.ee; osgi.ee="JavaSE/compact3"; version:List="1.8,9.0,10.0" -eecap-9= osgi.ee; osgi.ee="OSGi/Minimum"; version:List="1.0,1.1,1.2", \ - osgi.ee; osgi.ee="JavaSE"; version:List="1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,9" -eecap-1.8= osgi.ee; osgi.ee="OSGi/Minimum"; version:List="1.0,1.1,1.2", \ - osgi.ee; osgi.ee="JavaSE"; version:List="1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8" -eecap-1.7= osgi.ee; osgi.ee="OSGi/Minimum"; version:List="1.0,1.1,1.2", \ - osgi.ee; osgi.ee="JavaSE"; version:List="1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7" -eecap-1.6= osgi.ee; osgi.ee="OSGi/Minimum"; version:List="1.0,1.1,1.2", \ - osgi.ee; osgi.ee="JavaSE"; version:List="1.0,1.1,1.2,1.3,1.4,1.5,1.6" -eecap-1.5= osgi.ee; osgi.ee="OSGi/Minimum"; version:List="1.0,1.1,1.2", \ - osgi.ee; osgi.ee="JavaSE"; version:List="1.0,1.1,1.2,1.3,1.4,1.5" -eecap-1.4= osgi.ee; osgi.ee="OSGi/Minimum"; version:List="1.0,1.1,1.2", \ - osgi.ee; osgi.ee="JavaSE"; version:List="1.0,1.1,1.2,1.3,1.4" -eecap-1.3= osgi.ee; osgi.ee="OSGi/Minimum"; version:List="1.0,1.1", \ - osgi.ee; osgi.ee="JavaSE"; version:List="1.0,1.1,1.2,1.3" -eecap-1.2= osgi.ee; osgi.ee="OSGi/Minimum"; version:List="1.0,1.1", \ - osgi.ee; osgi.ee="JavaSE"; version:List="1.0,1.1,1.2" + osgi.ee; osgi.ee="JavaSE/compact1"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0", \ + osgi.ee; osgi.ee="JavaSE/compact2"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0", \ + osgi.ee; osgi.ee="JavaSE/compact3"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0" # # javax.transaction is needed to avoid class loader constraint violation when using javax.sql diff --git a/main/src/test/resources/test-karaf-home/etc/config.properties b/main/src/test/resources/test-karaf-home/etc/config.properties index eb723102b2e..f26b3b3206a 100755 --- a/main/src/test/resources/test-karaf-home/etc/config.properties +++ b/main/src/test/resources/test-karaf-home/etc/config.properties @@ -76,68 +76,46 @@ org.osgi.framework.system.packages= \ org.osgi.framework.system.capabilities= \ ${eecap-${java.specification.version}} -eecap-18 = osgi.ee; osgi.ee="OSGi/Minimum"; version:List="1.0,1.1,1.2", \ - osgi.ee; osgi.ee="JavaSE"; version:List="1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0", \ +eecap-27 = osgi.ee; osgi.ee="OSGi/Minimum"; version:List="1.0,1.1,1.2", \ + osgi.ee; osgi.ee="JavaSE"; version:List="1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0,22.0,23.0,24.0,25.0,26.0,27.0", \ osgi.ee; osgi.ee="JRE"; version:List="1.0,1.1", \ - osgi.ee; osgi.ee="JavaSE/compact1"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0", \ - osgi.ee; osgi.ee="JavaSE/compact2"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0", \ - osgi.ee; osgi.ee="JavaSE/compact3"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0" -eecap-17 = osgi.ee; osgi.ee="OSGi/Minimum"; version:List="1.0,1.1,1.2", \ - osgi.ee; osgi.ee="JavaSE"; version:List="1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0", \ + osgi.ee; osgi.ee="JavaSE/compact1"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0,22.0,23.0,24.0,25.0,26.0,27.0", \ + osgi.ee; osgi.ee="JavaSE/compact2"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0,22.0,23.0,24.0,25.0,26.0,27.0", \ + osgi.ee; osgi.ee="JavaSE/compact3"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0,22.0,23.0,24.0,25.0,26.0,27.0" +eecap-26 = osgi.ee; osgi.ee="OSGi/Minimum"; version:List="1.0,1.1,1.2", \ + osgi.ee; osgi.ee="JavaSE"; version:List="1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0,22.0,23.0,24.0,25.0,26.0", \ osgi.ee; osgi.ee="JRE"; version:List="1.0,1.1", \ - osgi.ee; osgi.ee="JavaSE/compact1"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0", \ - osgi.ee; osgi.ee="JavaSE/compact2"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0", \ - osgi.ee; osgi.ee="JavaSE/compact3"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0" -eecap-16 = osgi.ee; osgi.ee="OSGi/Minimum"; version:List="1.0,1.1,1.2", \ - osgi.ee; osgi.ee="JavaSE"; version:List="1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0", \ + osgi.ee; osgi.ee="JavaSE/compact1"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0,22.0,23.0,24.0,25.0,26.0", \ + osgi.ee; osgi.ee="JavaSE/compact2"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0,22.0,23.0,24.0,25.0,26.0", \ + osgi.ee; osgi.ee="JavaSE/compact3"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0,22.0,23.0,24.0,25.0,26.0" +eecap-25 = osgi.ee; osgi.ee="OSGi/Minimum"; version:List="1.0,1.1,1.2", \ + osgi.ee; osgi.ee="JavaSE"; version:List="1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0,22.0,23.0,24.0,25.0", \ osgi.ee; osgi.ee="JRE"; version:List="1.0,1.1", \ - osgi.ee; osgi.ee="JavaSE/compact1"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0", \ - osgi.ee; osgi.ee="JavaSE/compact2"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0", \ - osgi.ee; osgi.ee="JavaSE/compact3"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0" -eecap-15= osgi.ee; osgi.ee="OSGi/Minimum"; version:List="1.0,1.1,1.2", \ - osgi.ee; osgi.ee="JavaSE"; version:List="1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,9.0,10.0,11.0,13.0,14.0,15.0", \ + osgi.ee; osgi.ee="JavaSE/compact1"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0,22.0,23.0,24.0,25.0", \ + osgi.ee; osgi.ee="JavaSE/compact2"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0,22.0,23.0,24.0,25.0", \ + osgi.ee; osgi.ee="JavaSE/compact3"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0,22.0,23.0,24.0,25.0" +eecap-24 = osgi.ee; osgi.ee="OSGi/Minimum"; version:List="1.0,1.1,1.2", \ + osgi.ee; osgi.ee="JavaSE"; version:List="1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0,22.0,23.0,24.0", \ osgi.ee; osgi.ee="JRE"; version:List="1.0,1.1", \ - osgi.ee; osgi.ee="JavaSE/compact1"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0", \ - osgi.ee; osgi.ee="JavaSE/compact2"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0", \ - osgi.ee; osgi.ee="JavaSE/compact3"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0" -eecap-14= osgi.ee; osgi.ee="OSGi/Minimum"; version:List="1.0,1.1,1.2", \ - osgi.ee; osgi.ee="JavaSE"; version:List="1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,9.0,10.0,11.0,13.0,14.0", \ + osgi.ee; osgi.ee="JavaSE/compact1"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0,22.0,23.0,24.0", \ + osgi.ee; osgi.ee="JavaSE/compact2"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0,22.0,23.0,24.0", \ + osgi.ee; osgi.ee="JavaSE/compact3"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0,22.0,23.0,24.0" +eecap-23 = osgi.ee; osgi.ee="OSGi/Minimum"; version:List="1.0,1.1,1.2", \ + osgi.ee; osgi.ee="JavaSE"; version:List="1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0,22.0,23.0", \ osgi.ee; osgi.ee="JRE"; version:List="1.0,1.1", \ - osgi.ee; osgi.ee="JavaSE/compact1"; version:List="1.8,9.0,10.0,11.0,13.0,14.0", \ - osgi.ee; osgi.ee="JavaSE/compact2"; version:List="1.8,9.0,10.0,11.0,13.0,14.0", \ - osgi.ee; osgi.ee="JavaSE/compact3"; version:List="1.8,9.0,10.0,11.0,13.0,14.0" -eecap-13= osgi.ee; osgi.ee="OSGi/Minimum"; version:List="1.0,1.1,1.2", \ - osgi.ee; osgi.ee="JavaSE"; version:List="1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,9.0,10.0,11.0,13.0", \ + osgi.ee; osgi.ee="JavaSE/compact1"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0,22.0,23.0", \ + osgi.ee; osgi.ee="JavaSE/compact2"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0,22.0,23.0", \ + osgi.ee; osgi.ee="JavaSE/compact3"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0,22.0,23.0" +eecap-22 = osgi.ee; osgi.ee="OSGi/Minimum"; version:List="1.0,1.1,1.2", \ + osgi.ee; osgi.ee="JavaSE"; version:List="1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0,22.0", \ osgi.ee; osgi.ee="JRE"; version:List="1.0,1.1", \ - osgi.ee; osgi.ee="JavaSE/compact1"; version:List="1.8,9.0,10.0,11.0,13.0", \ - osgi.ee; osgi.ee="JavaSE/compact2"; version:List="1.8,9.0,10.0,11.0,13.0", \ - osgi.ee; osgi.ee="JavaSE/compact3"; version:List="1.8,9.0,10.0,11.0,13.0" -eecap-11= osgi.ee; osgi.ee="OSGi/Minimum"; version:List="1.0,1.1,1.2", \ - osgi.ee; osgi.ee="JavaSE"; version:List="1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,9.0,10.0,11.0", \ + osgi.ee; osgi.ee="JavaSE/compact1"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0,22.0", \ + osgi.ee; osgi.ee="JavaSE/compact2"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0,22.0", \ + osgi.ee; osgi.ee="JavaSE/compact3"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0,22.0" +eecap-21 = osgi.ee; osgi.ee="OSGi/Minimum"; version:List="1.0,1.1,1.2", \ + osgi.ee; osgi.ee="JavaSE"; version:List="1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0", \ osgi.ee; osgi.ee="JRE"; version:List="1.0,1.1", \ - osgi.ee; osgi.ee="JavaSE/compact1"; version:List="1.8,9.0,10.0,11.0", \ - osgi.ee; osgi.ee="JavaSE/compact2"; version:List="1.8,9.0,10.0,11.0", \ - osgi.ee; osgi.ee="JavaSE/compact3"; version:List="1.8,9.0,10.0,11.0" -eecap-10= osgi.ee; osgi.ee="OSGi/Minimum"; version:List="1.0,1.1,1.2", \ - osgi.ee; osgi.ee="JavaSE"; version:List="1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,9.0,10.0", \ - osgi.ee; osgi.ee="JRE"; version:List="1.0,1.1", \ - osgi.ee; osgi.ee="JavaSE/compact1"; version:List="1.8,9.0,10.0", \ - osgi.ee; osgi.ee="JavaSE/compact2"; version:List="1.8,9.0,10.0", \ - osgi.ee; osgi.ee="JavaSE/compact3"; version:List="1.8,9.0,10.0" -eecap-9= osgi.ee; osgi.ee="OSGi/Minimum"; version:List="1.0,1.1,1.2", \ - osgi.ee; osgi.ee="JavaSE"; version:List="1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,1.9" -eecap-1.8= osgi.ee; osgi.ee="OSGi/Minimum"; version:List="1.0,1.1,1.2", \ - osgi.ee; osgi.ee="JavaSE"; version:List="1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8" -eecap-1.7= osgi.ee; osgi.ee="OSGi/Minimum"; version:List="1.0,1.1,1.2", \ - osgi.ee; osgi.ee="JavaSE"; version:List="1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7" -eecap-1.6= osgi.ee; osgi.ee="OSGi/Minimum"; version:List="1.0,1.1,1.2", \ - osgi.ee; osgi.ee="JavaSE"; version:List="1.0,1.1,1.2,1.3,1.4,1.5,1.6" -eecap-1.5= osgi.ee; osgi.ee="OSGi/Minimum"; version:List="1.0,1.1,1.2", \ - osgi.ee; osgi.ee="JavaSE"; version:List="1.0,1.1,1.2,1.3,1.4,1.5" -eecap-1.4= osgi.ee; osgi.ee="OSGi/Minimum"; version:List="1.0,1.1,1.2", \ - osgi.ee; osgi.ee="JavaSE"; version:List="1.0,1.1,1.2,1.3,1.4" -eecap-1.3= osgi.ee; osgi.ee="OSGi/Minimum"; version:List="1.0,1.1", \ - osgi.ee; osgi.ee="JavaSE"; version:List="1.0,1.1,1.2,1.3" -eecap-1.2= osgi.ee; osgi.ee="OSGi/Minimum"; version:List="1.0,1.1", \ - osgi.ee; osgi.ee="JavaSE"; version:List="1.0,1.1,1.2" + osgi.ee; osgi.ee="JavaSE/compact1"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0", \ + osgi.ee; osgi.ee="JavaSE/compact2"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0", \ + osgi.ee; osgi.ee="JavaSE/compact3"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0" From c10c32b8c30f7dd0571b80ca5c8d691088e6daea Mon Sep 17 00:00:00 2001 From: Holger Friedrich Date: Tue, 17 Nov 2026 17:57:35 +0100 Subject: [PATCH 15/23] Replace {8,11,17}-jre by 21-jre --- assemblies/docker/Dockerfile | 2 +- assemblies/docker/README.md | 4 ++-- assemblies/docker/build.sh | 2 +- .../karaf/docker/internal/DockerServiceImpl.java | 12 ++++++------ .../apache/karaf/docker/DockerClientTest.java | 2 +- docker/src/test/resources/Dockerfile | 6 +++--- docker/src/test/resources/docker-build.sh | 2 +- examples/karaf-docker-example/README.md | 4 ++-- .../karaf-docker-example-dynamic-dist/pom.xml | 2 +- .../karaf-docker-example-static-dist/pom.xml | 2 +- .../developer-guide/karaf-maven-plugin.adoc | 2 +- manual/src/main/asciidoc/user-guide/docker.adoc | 2 +- .../src/it/test-dockerfile/verify.bsh | 2 +- .../org/apache/karaf/tooling/DockerfileMojo.java | 2 +- .../apache/karaf/tooling/DockerfileMojoTest.java | 16 ++++++++-------- 15 files changed, 31 insertions(+), 31 deletions(-) diff --git a/assemblies/docker/Dockerfile b/assemblies/docker/Dockerfile index 6abd52fd5a7..989ecb60bc3 100644 --- a/assemblies/docker/Dockerfile +++ b/assemblies/docker/Dockerfile @@ -16,7 +16,7 @@ # limitations under the License. ################################################################################ -FROM eclipse-temurin:11-jre +FROM eclipse-temurin:21-jre # Karaf environment variables ENV KARAF_INSTALL_PATH /opt diff --git a/assemblies/docker/README.md b/assemblies/docker/README.md index 74aab6051f2..7935cd439e0 100644 --- a/assemblies/docker/README.md +++ b/assemblies/docker/README.md @@ -32,7 +32,7 @@ On macOS, an easy way to install `buildx` is to install [Docker Desktop Edge](ht ## Build -Images are based on the Docker official [Eclipse Temurin 11 JRE](https://hub.docker.com/_/eclipse-temurin/tags?page=1&name=11-jre) image. If you want to +Images are based on the Docker official [Eclipse Temurin 21 JRE](https://hub.docker.com/_/eclipse-temurin/tags?page=1&name=21-jre) image. If you want to build the Karaf image you have the following choices: 1. Create the docker image from a local distribution package @@ -50,7 +50,7 @@ Usage: If the --image-name flag is not used the built image name will be 'karaf'. Check the supported build platforms; you can verify with this command: docker buildx ls - The supported platforms (OS/Arch) depend on the build's base image, in this case [eclipse-temurin:11-jre](https://hub.docker.com/_/eclipse-temurin). + The supported platforms (OS/Arch) depend on the build's base image, in this case [eclipse-temurin:21-jre](https://hub.docker.com/_/eclipse-temurin). ``` To create the docker image from local distribution) you can execute the command diff --git a/assemblies/docker/build.sh b/assemblies/docker/build.sh index 034f96c9328..a606af9d4dc 100755 --- a/assemblies/docker/build.sh +++ b/assemblies/docker/build.sh @@ -27,7 +27,7 @@ Usage: If the --image-name flag is not used the built image name will be 'karaf'. Check the supported build platforms; you can verify with this command: docker buildx ls - The supported platforms (OS/Arch) depend on the build's base image, in this case [eclipse-temurin:11-jre](https://hub.docker.com/_/eclipse-temurin). + The supported platforms (OS/Arch) depend on the build's base image, in this case [eclipse-temurin:21-jre](https://hub.docker.com/_/eclipse-temurin). HERE exit 1 diff --git a/docker/src/main/java/org/apache/karaf/docker/internal/DockerServiceImpl.java b/docker/src/main/java/org/apache/karaf/docker/internal/DockerServiceImpl.java index ca4315c3818..7eaf724a100 100644 --- a/docker/src/main/java/org/apache/karaf/docker/internal/DockerServiceImpl.java +++ b/docker/src/main/java/org/apache/karaf/docker/internal/DockerServiceImpl.java @@ -73,9 +73,9 @@ public Version version(String url) throws Exception { @Override public void create(String name, String url) throws Exception { - // pull the java:8-jre-alpine image + // pull the java:21-jre-alpine image // TODO it should be changed to the official karaf image as soon as it's available on Docker HUB - pull("java", "8-jre-alpine", true, url); + pull("java", "21-jre-alpine", true, url); // create a default Karaf docker container configuration ContainerConfig config = new ContainerConfig(); @@ -84,7 +84,7 @@ public void create(String name, String url) throws Exception { config.setAttachStderr(true); config.setAttachStdout(true); // TODO it should be changed to the official karaf image as soon as it's available on Docker HUB - config.setImage("java:8-jre-alpine"); + config.setImage("java:21-jre-alpine"); config.setHostname(""); config.setUser(""); config.setCmd(new String[]{ "/opt/apache-karaf/bin/karaf" }); @@ -158,8 +158,8 @@ public void create(String name, String url, ContainerConfig config) throws Excep @Override public void provision(String name, String sshPort, String jmxRmiPort, String jmxRmiRegistryPort, String httpPort, boolean copy, String url) throws Exception { - // pull the java:8-jre-alpine image - pull("java", "8-jre-alpine", true, url); + // pull the java:21-jre-alpine image + pull("java", "21-jre-alpine", true, url); // use Karaf instance as base File karafBase = new File(System.getProperty("karaf.base")); @@ -188,7 +188,7 @@ public void provision(String name, String sshPort, String jmxRmiPort, String jmx config.setAttachStdout(true); config.setAttachStderr(true); config.setAttachStdin(true); - config.setImage("java:8-jre-alpine"); + config.setImage("java:21-jre-alpine"); config.setHostname(""); config.setUser(""); config.setCmd(new String[]{ "/opt/apache-karaf/bin/karaf" }); diff --git a/docker/src/test/java/org/apache/karaf/docker/DockerClientTest.java b/docker/src/test/java/org/apache/karaf/docker/DockerClientTest.java index 43a8ca71e29..86f98ec7cea 100644 --- a/docker/src/test/java/org/apache/karaf/docker/DockerClientTest.java +++ b/docker/src/test/java/org/apache/karaf/docker/DockerClientTest.java @@ -154,7 +154,7 @@ public void testContainers() throws Exception { @Ignore("Need a running Docker daemon") public void testCreateContainer() throws Exception { ContainerConfig config = new ContainerConfig(); - config.setImage("java:8-jre-alpine"); + config.setImage("java:21-jre-alpine"); config.setAttachStderr(true); config.setAttachStdin(true); config.setAttachStdout(true); diff --git a/docker/src/test/resources/Dockerfile b/docker/src/test/resources/Dockerfile index dca77554a6c..5ccf5aa53e3 100644 --- a/docker/src/test/resources/Dockerfile +++ b/docker/src/test/resources/Dockerfile @@ -16,13 +16,13 @@ # limitations under the License. ############################################################################### -FROM java:8-jre +FROM java:21-jre MAINTAINER dev@karaf.apache.org -ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64 +ENV JAVA_HOME /usr/lib/jvm/java-21-openjdk-amd64 -ENV KARAF_VERSION=4.2.0 +ENV KARAF_VERSION=4.5.0 RUN cd /opt; \ wget http://www-us.apache.org/dist/karaf/${KARAF_VERSION}/apache-karaf-${KARAF_VERSION}.tar.gz; \ diff --git a/docker/src/test/resources/docker-build.sh b/docker/src/test/resources/docker-build.sh index 079c2c9a83a..3a92c35f5bc 100644 --- a/docker/src/test/resources/docker-build.sh +++ b/docker/src/test/resources/docker-build.sh @@ -15,4 +15,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -docker build --cache-from openjdk:8-jre --tag karaf/karaf-docker:4.2.0 . \ No newline at end of file +docker build --cache-from openjdk:21-jre --tag karaf/karaf-docker:4.2.0 . \ No newline at end of file diff --git a/examples/karaf-docker-example/README.md b/examples/karaf-docker-example/README.md index 322e665423a..4485ab06820 100644 --- a/examples/karaf-docker-example/README.md +++ b/examples/karaf-docker-example/README.md @@ -123,7 +123,7 @@ You can build the docker image using the generated `Dockerfile`: $ cd karaf-docker-example-static-dist/target $ docker build -t mykaraf . Sending build context to Docker daemon 78.08MB -Step 1/7 : FROM eclipse-temurin:17-jre +Step 1/7 : FROM eclipse-temurin:21-jre ---> d60154a7d9b2 Step 2/7 : ENV KARAF_INSTALL_PATH /opt ---> Using cache @@ -259,7 +259,7 @@ You can build the docker image using the generated `Dockerfile`: $ cd karaf-docker-example-dynamic-dist/target $ docker build -t mykaraf . Sending build context to Docker daemon 102.5MB -Step 1/7 : FROM eclipse-temurin:17-jre +Step 1/7 : FROM eclipse-temurin:21-jre ---> 19c48cc84cc6 Step 2/7 : ENV KARAF_INSTALL_PATH /opt ---> Running in 8a9a42db2395 diff --git a/examples/karaf-docker-example/karaf-docker-example-dynamic-dist/pom.xml b/examples/karaf-docker-example/karaf-docker-example-dynamic-dist/pom.xml index 634aaab1618..942b2f5c161 100644 --- a/examples/karaf-docker-example/karaf-docker-example-dynamic-dist/pom.xml +++ b/examples/karaf-docker-example/karaf-docker-example-dynamic-dist/pom.xml @@ -101,7 +101,7 @@ dockerfile - eclipse-temurin:17-jre + eclipse-temurin:21-jre ["karaf"] diff --git a/examples/karaf-docker-example/karaf-docker-example-static-dist/pom.xml b/examples/karaf-docker-example/karaf-docker-example-static-dist/pom.xml index 91a3fe1d3e7..75c9c3d6ba3 100644 --- a/examples/karaf-docker-example/karaf-docker-example-static-dist/pom.xml +++ b/examples/karaf-docker-example/karaf-docker-example-static-dist/pom.xml @@ -97,7 +97,7 @@ dockerfile - eclipse-temurin:17-jre + eclipse-temurin:21-jre diff --git a/manual/src/main/asciidoc/developer-guide/karaf-maven-plugin.adoc b/manual/src/main/asciidoc/developer-guide/karaf-maven-plugin.adoc index 4f1eac6c245..245e46397cc 100644 --- a/manual/src/main/asciidoc/developer-guide/karaf-maven-plugin.adoc +++ b/manual/src/main/asciidoc/developer-guide/karaf-maven-plugin.adoc @@ -1001,7 +1001,7 @@ The `karaf:dockerfile` goal creates a ready to use Dockerfile for a given Karaf |`image` |`String` -|The base Docker image (FROM instruction) to use. Default value: `eclipse-temurin:11-jre` +|The base Docker image (FROM instruction) to use. Default value: `eclipse-temurin:21-jre` |=== ===== Docker diff --git a/manual/src/main/asciidoc/user-guide/docker.adoc b/manual/src/main/asciidoc/user-guide/docker.adoc index 42dec798edc..a53f073a3fa 100644 --- a/manual/src/main/asciidoc/user-guide/docker.adoc +++ b/manual/src/main/asciidoc/user-guide/docker.adoc @@ -197,7 +197,7 @@ dwolla/java │ Dwolla’s custom Java image The `docker:pull` command (or `pull()` operation on the `DockerMBean`) pull a image from Docker HUB: ---- -karaf@root()> docker:pull -v java:8-jre-alpine +karaf@root()> docker:pull -v java:21-jre-alpine {"status":"Pulling from library/java","id":"latest"} {"status":"Pulling fs layer","progressDetail":{},"id":"5040bd298390"} {"status":"Pulling fs layer","progressDetail":{},"id":"fce5728aad85"} diff --git a/tooling/karaf-maven-plugin/src/it/test-dockerfile/verify.bsh b/tooling/karaf-maven-plugin/src/it/test-dockerfile/verify.bsh index e96f6587028..60f6909c636 100644 --- a/tooling/karaf-maven-plugin/src/it/test-dockerfile/verify.bsh +++ b/tooling/karaf-maven-plugin/src/it/test-dockerfile/verify.bsh @@ -28,4 +28,4 @@ if (!generated.exists()) { BufferedReader reader = new BufferedReader(new FileReader(generated)); String line = reader.readLine(); reader.close(); -return line != null && line.startsWith("FROM eclipse-temurin:11-jre"); \ No newline at end of file +return line != null && line.startsWith("FROM eclipse-temurin:21-jre"); \ No newline at end of file diff --git a/tooling/karaf-maven-plugin/src/main/java/org/apache/karaf/tooling/DockerfileMojo.java b/tooling/karaf-maven-plugin/src/main/java/org/apache/karaf/tooling/DockerfileMojo.java index b8d809e97f3..4eecfae2266 100644 --- a/tooling/karaf-maven-plugin/src/main/java/org/apache/karaf/tooling/DockerfileMojo.java +++ b/tooling/karaf-maven-plugin/src/main/java/org/apache/karaf/tooling/DockerfileMojo.java @@ -31,7 +31,7 @@ @Mojo(name = "dockerfile", defaultPhase = LifecyclePhase.PACKAGE) public class DockerfileMojo extends MojoSupport { - private static final String DEFAULT_IMAGE = "eclipse-temurin:11-jre"; + private static final String DEFAULT_IMAGE = "eclipse-temurin:21-jre"; private static final String DEFAULT_COMMAND = "[\"karaf\", \"run\"]"; @Parameter(defaultValue = "${project.build.directory}") diff --git a/tooling/karaf-maven-plugin/src/test/java/org/apache/karaf/tooling/DockerfileMojoTest.java b/tooling/karaf-maven-plugin/src/test/java/org/apache/karaf/tooling/DockerfileMojoTest.java index 15e52b7c1e2..2b90d225033 100644 --- a/tooling/karaf-maven-plugin/src/test/java/org/apache/karaf/tooling/DockerfileMojoTest.java +++ b/tooling/karaf-maven-plugin/src/test/java/org/apache/karaf/tooling/DockerfileMojoTest.java @@ -44,7 +44,7 @@ public void testDefaultDockerfileGeneration() throws Exception { setPrivateField(mojo, "destDir", destDir); setPrivateField(mojo, "assembly", assembly); setPrivateField(mojo, "command", "[\"karaf\", \"run\"]"); - setPrivateField(mojo, "image", "eclipse-temurin:11-jre"); + setPrivateField(mojo, "image", "eclipse-temurin:21-jre"); mojo.execute(); @@ -52,7 +52,7 @@ public void testDefaultDockerfileGeneration() throws Exception { assertTrue("Dockerfile should be created", dockerfile.exists()); List lines = Files.readAllLines(dockerfile.toPath()); - assertEquals("FROM eclipse-temurin:11-jre", lines.get(0)); + assertEquals("FROM eclipse-temurin:21-jre", lines.get(0)); assertEquals("ENV KARAF_INSTALL_PATH /opt", lines.get(1)); assertEquals("ENV KARAF_HOME $KARAF_INSTALL_PATH/apache-karaf", lines.get(2)); assertEquals("ENV KARAF_EXEC exec", lines.get(3)); @@ -71,7 +71,7 @@ public void testCustomImageAndCommand() throws Exception { setPrivateField(mojo, "destDir", destDir); setPrivateField(mojo, "assembly", assembly); setPrivateField(mojo, "command", "[\"karaf\", \"server\"]"); - setPrivateField(mojo, "image", "eclipse-temurin:17-jre"); + setPrivateField(mojo, "image", "eclipse-temurin:21-jre"); mojo.execute(); @@ -79,7 +79,7 @@ public void testCustomImageAndCommand() throws Exception { assertTrue("Dockerfile should be created", dockerfile.exists()); List lines = Files.readAllLines(dockerfile.toPath()); - assertEquals("FROM eclipse-temurin:17-jre", lines.get(0)); + assertEquals("FROM eclipse-temurin:21-jre", lines.get(0)); assertEquals("COPY custom-dist $KARAF_HOME", lines.get(5)); assertEquals("CMD [\"karaf\", \"server\"]", lines.get(7)); } @@ -103,7 +103,7 @@ public void testBlankOrNullImageFallsBackToDefault() throws Exception { assertTrue("Dockerfile should be created", dockerfile.exists()); List lines = Files.readAllLines(dockerfile.toPath()); - assertEquals("FROM eclipse-temurin:11-jre", lines.get(0)); + assertEquals("FROM eclipse-temurin:21-jre", lines.get(0)); } } @@ -118,7 +118,7 @@ public void testBlankOrNullCommandFallsBackToDefault() throws Exception { setPrivateField(mojo, "destDir", destDir); setPrivateField(mojo, "assembly", assembly); setPrivateField(mojo, "command", blankCommands[i]); - setPrivateField(mojo, "image", "eclipse-temurin:11-jre"); + setPrivateField(mojo, "image", "eclipse-temurin:21-jre"); mojo.execute(); @@ -139,7 +139,7 @@ public void testImageWithNewlineThrowsException() throws Exception { setPrivateField(mojo, "destDir", destDir); setPrivateField(mojo, "assembly", assembly); setPrivateField(mojo, "command", "[\"karaf\", \"run\"]"); - setPrivateField(mojo, "image", "eclipse-temurin:11-jre\nRUN rm -rf /"); + setPrivateField(mojo, "image", "eclipse-temurin:21-jre\nRUN rm -rf /"); mojo.execute(); } @@ -153,7 +153,7 @@ public void testCommandWithNewlineThrowsException() throws Exception { setPrivateField(mojo, "destDir", destDir); setPrivateField(mojo, "assembly", assembly); setPrivateField(mojo, "command", "[\"karaf\", \"run\"]\nRUN rm -rf /"); - setPrivateField(mojo, "image", "eclipse-temurin:11-jre"); + setPrivateField(mojo, "image", "eclipse-temurin:21-jre"); mojo.execute(); } From aa9ad9d5ec0c48f829c39ddcd1a41e8db8fc4144 Mon Sep 17 00:00:00 2001 From: Holger Friedrich Date: Tue, 17 Nov 2026 18:24:13 +0100 Subject: [PATCH 16/23] Remove JavaSecurityTest, #2082 No replacement intended: the SecurityManager is permanently disabled since JDK 24 (JEP 486), so there is nothing left to test. Felix dropped its Security Manager support as well, see FELIX-6833. Also remove the felix.framework.security test dependency and the test-only framework-security feature. --- itests/test/pom.xml | 5 - .../test/filtered-resources/etc/feature.xml | 4 - .../apache/karaf/itests/JavaSecurityTest.java | 97 ------------------- 3 files changed, 106 deletions(-) delete mode 100644 itests/test/src/test/java/org/apache/karaf/itests/JavaSecurityTest.java diff --git a/itests/test/pom.xml b/itests/test/pom.xml index f76a90493ed..9c90856b0c9 100644 --- a/itests/test/pom.xml +++ b/itests/test/pom.xml @@ -183,11 +183,6 @@ org.apache.karaf.bundle.core - - org.apache.felix - org.apache.felix.framework.security - - org.bouncycastle bcprov-jdk18on diff --git a/itests/test/src/test/filtered-resources/etc/feature.xml b/itests/test/src/test/filtered-resources/etc/feature.xml index 62e9d13f4b3..6dce10e5680 100644 --- a/itests/test/src/test/filtered-resources/etc/feature.xml +++ b/itests/test/src/test/filtered-resources/etc/feature.xml @@ -20,10 +20,6 @@ mvn:org.ops4j.pax.web/pax-web-features/${pax.web.version}/xml/features - - mvn:org.apache.felix/org.apache.felix.framework.security/${felix.framework.security.version} - - jaas-boot aries-proxy diff --git a/itests/test/src/test/java/org/apache/karaf/itests/JavaSecurityTest.java b/itests/test/src/test/java/org/apache/karaf/itests/JavaSecurityTest.java deleted file mode 100644 index d2cfa7a59e1..00000000000 --- a/itests/test/src/test/java/org/apache/karaf/itests/JavaSecurityTest.java +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.karaf.itests; - -import org.apache.karaf.bundle.core.BundleInfo; -import org.apache.karaf.bundle.core.BundleService; -import org.apache.karaf.bundle.core.BundleState; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.ops4j.pax.exam.Configuration; -import org.ops4j.pax.exam.MavenUtils; -import org.ops4j.pax.exam.Option; -import org.ops4j.pax.exam.junit.PaxExam; -import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy; -import org.ops4j.pax.exam.spi.reactors.PerClass; -import org.osgi.framework.Bundle; - -import java.io.IOException; -import java.io.InputStream; -import java.net.URL; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.StandardCopyOption; -import java.util.*; - -import static org.junit.Assert.fail; -import static org.ops4j.pax.exam.CoreOptions.maven; -import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.*; - -@RunWith(PaxExam.class) -@ExamReactorStrategy(PerClass.class) -public class JavaSecurityTest extends BaseTest { - - @Configuration - public Option[] config() { - String version = MavenUtils.getArtifactVersion("org.apache.felix", "org.apache.felix.framework.security"); - String url = maven("org.apache.felix", "org.apache.felix.framework.security", version).getURL(); - Path temp; - try { - temp = Files.createTempFile("org.apache.felix.framework.security-" + version + "-", ".jar"); - System.setProperty("java.protocol.handler.pkgs", "org.ops4j.pax.url"); - try (InputStream is = new URL(url).openStream()) { - Files.copy(is, temp, StandardCopyOption.REPLACE_EXISTING); - } - } catch (IOException e) { - throw new RuntimeException(e); - } - - - List