Merge pull request #1272 from arjantijms/master

Make master 4.0.0
diff --git a/bom/pom.xml b/bom/pom.xml
index be0d0b6..20460a9 100644
--- a/bom/pom.xml
+++ b/bom/pom.xml
@@ -1,6 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
 
+    Copyright (c) 2022, 2026 Contributors to Eclipse Foundation.
     Copyright (c) 2013, 2020 Oracle and/or its affiliates. All rights reserved.
     COpyright (c) 2020 Payara Services Ltd.
 
@@ -30,7 +31,7 @@
 
     <groupId>org.glassfish.hk2</groupId>
     <artifactId>hk2-bom</artifactId>
-    <version>3.1.2-SNAPSHOT</version>
+    <version>4.0.0-SNAPSHOT</version>
     <packaging>pom</packaging>
 
     <name>HK2 Bom Pom</name>
@@ -43,8 +44,8 @@
     <properties>
         <asm.version>9.9.1</asm.version>
         <jakarta-inject.version>2.0.1</jakarta-inject.version>
-        <jakarta-annotation.version>2.1.1</jakarta-annotation.version>
-        <project.build.outputTimestamp>2023-04-09T08:38:05Z</project.build.outputTimestamp>
+        <jakarta-annotation.version>3.0.0</jakarta-annotation.version>
+        <project.build.outputTimestamp>2025-04-09T08:38:05Z</project.build.outputTimestamp>
     </properties>
 
     <dependencyManagement>
diff --git a/class-model/pom.xml b/class-model/pom.xml
index abb0fa8..b1e6601 100644
--- a/class-model/pom.xml
+++ b/class-model/pom.xml
@@ -24,7 +24,7 @@
     <parent>
         <groupId>org.glassfish.hk2</groupId>
         <artifactId>hk2-parent</artifactId>
-        <version>3.1.2-SNAPSHOT</version>
+        <version>4.0.0-SNAPSHOT</version>
     </parent>
 
     <groupId>org.glassfish.hk2</groupId>
diff --git a/examples/caching/pom.xml b/examples/caching/pom.xml
index 0f97c8b..15a108b 100644
--- a/examples/caching/pom.xml
+++ b/examples/caching/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.glassfish.hk2</groupId>
         <artifactId>examples</artifactId>
-        <version>3.1.2-SNAPSHOT</version>
+        <version>4.0.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>caching-aop-example</artifactId>
diff --git a/examples/caching/runner/pom.xml b/examples/caching/runner/pom.xml
index 81e4489..2be0719 100644
--- a/examples/caching/runner/pom.xml
+++ b/examples/caching/runner/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.glassfish.hk2</groupId>
         <artifactId>caching-aop-example</artifactId>
-        <version>3.1.2-SNAPSHOT</version>
+        <version>4.0.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>caching-aop-example-runner</artifactId>
diff --git a/examples/caching/system/pom.xml b/examples/caching/system/pom.xml
index e4902c4..697d037 100644
--- a/examples/caching/system/pom.xml
+++ b/examples/caching/system/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.glassfish.hk2</groupId>
         <artifactId>caching-aop-example</artifactId>
-        <version>3.1.2-SNAPSHOT</version>
+        <version>4.0.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>caching-aop-example-system</artifactId>
diff --git a/examples/configuration/pom.xml b/examples/configuration/pom.xml
index dec6419..bc766a0 100644
--- a/examples/configuration/pom.xml
+++ b/examples/configuration/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.glassfish.hk2</groupId>
         <artifactId>examples</artifactId>
-        <version>3.1.2-SNAPSHOT</version>
+        <version>4.0.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>configuration-examples</artifactId>
diff --git a/examples/configuration/webserver/pom.xml b/examples/configuration/webserver/pom.xml
index 1d012a6..97682db 100644
--- a/examples/configuration/webserver/pom.xml
+++ b/examples/configuration/webserver/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.glassfish.hk2</groupId>
         <artifactId>configuration-examples</artifactId>
-        <version>3.1.2-SNAPSHOT</version>
+        <version>4.0.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>webserver-configuration-example</artifactId>
diff --git a/examples/configuration/xml/pom.xml b/examples/configuration/xml/pom.xml
index 9010d0a..e3ba210 100644
--- a/examples/configuration/xml/pom.xml
+++ b/examples/configuration/xml/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.glassfish.hk2</groupId>
         <artifactId>configuration-examples</artifactId>
-        <version>3.1.2-SNAPSHOT</version>
+        <version>4.0.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>xml-configuration-example</artifactId>
diff --git a/examples/custom-resolver/pom.xml b/examples/custom-resolver/pom.xml
index c08468c..cc703c0 100644
--- a/examples/custom-resolver/pom.xml
+++ b/examples/custom-resolver/pom.xml
@@ -24,7 +24,7 @@
     <parent>
         <groupId>org.glassfish.hk2</groupId>
         <artifactId>examples</artifactId>
-        <version>3.1.2-SNAPSHOT</version>
+        <version>4.0.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>custom-resolver-example</artifactId>
diff --git a/examples/events/pom.xml b/examples/events/pom.xml
index fab1201..faf0784 100644
--- a/examples/events/pom.xml
+++ b/examples/events/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.glassfish.hk2</groupId>
         <artifactId>examples</artifactId>
-        <version>3.1.2-SNAPSHOT</version>
+        <version>4.0.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>event-examples</artifactId>
diff --git a/examples/events/threaded/pom.xml b/examples/events/threaded/pom.xml
index c4dd5b5..a14e62b 100644
--- a/examples/events/threaded/pom.xml
+++ b/examples/events/threaded/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.glassfish.hk2</groupId>
         <artifactId>event-examples</artifactId>
-        <version>3.1.2-SNAPSHOT</version>
+        <version>4.0.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>threading-event-example</artifactId>
diff --git a/examples/operations/pom.xml b/examples/operations/pom.xml
index 0d6a7be..760339a 100644
--- a/examples/operations/pom.xml
+++ b/examples/operations/pom.xml
@@ -24,7 +24,7 @@
     <parent>
         <groupId>org.glassfish.hk2</groupId>
         <artifactId>examples</artifactId>
-        <version>3.1.2-SNAPSHOT</version>
+        <version>4.0.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>operations-example</artifactId>
diff --git a/examples/pom.xml b/examples/pom.xml
index dadf83b..8584384 100644
--- a/examples/pom.xml
+++ b/examples/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.glassfish.hk2</groupId>
         <artifactId>hk2-parent</artifactId>
-        <version>3.1.2-SNAPSHOT</version>
+        <version>4.0.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>examples</artifactId>
diff --git a/examples/security-lockdown/alice/pom.xml b/examples/security-lockdown/alice/pom.xml
index eb8febc..6b27d82 100644
--- a/examples/security-lockdown/alice/pom.xml
+++ b/examples/security-lockdown/alice/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.glassfish.hk2</groupId>
         <artifactId>security-lockdown-example</artifactId>
-        <version>3.1.2-SNAPSHOT</version>
+        <version>4.0.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>security-lockdown-example-alice</artifactId>
diff --git a/examples/security-lockdown/mallory/pom.xml b/examples/security-lockdown/mallory/pom.xml
index 4cf5126..6a90413 100644
--- a/examples/security-lockdown/mallory/pom.xml
+++ b/examples/security-lockdown/mallory/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.glassfish.hk2</groupId>
         <artifactId>security-lockdown-example</artifactId>
-        <version>3.1.2-SNAPSHOT</version>
+        <version>4.0.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>security-lockdown-example-mallory</artifactId>
diff --git a/examples/security-lockdown/pom.xml b/examples/security-lockdown/pom.xml
index 85a6e1f..9447b19 100644
--- a/examples/security-lockdown/pom.xml
+++ b/examples/security-lockdown/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.glassfish.hk2</groupId>
         <artifactId>examples</artifactId>
-        <version>3.1.2-SNAPSHOT</version>
+        <version>4.0.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>security-lockdown-example</artifactId>
diff --git a/examples/security-lockdown/runner/pom.xml b/examples/security-lockdown/runner/pom.xml
index 301fc68..7a667ab 100644
--- a/examples/security-lockdown/runner/pom.xml
+++ b/examples/security-lockdown/runner/pom.xml
@@ -24,7 +24,7 @@
     <parent>
         <groupId>org.glassfish.hk2</groupId>
         <artifactId>security-lockdown-example</artifactId>
-        <version>3.1.2-SNAPSHOT</version>
+        <version>4.0.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>security-lockdown-example-runner</artifactId>
diff --git a/examples/security-lockdown/system/pom.xml b/examples/security-lockdown/system/pom.xml
index 7efbb5d..0475739 100644
--- a/examples/security-lockdown/system/pom.xml
+++ b/examples/security-lockdown/system/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.glassfish.hk2</groupId>
         <artifactId>security-lockdown-example</artifactId>
-        <version>3.1.2-SNAPSHOT</version>
+        <version>4.0.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>security-lockdown-example-system</artifactId>
diff --git a/external/aopalliance/pom.xml b/external/aopalliance/pom.xml
index b7d1682..5c958c0 100644
--- a/external/aopalliance/pom.xml
+++ b/external/aopalliance/pom.xml
@@ -24,7 +24,7 @@
     <parent>
         <groupId>org.glassfish.hk2</groupId>
         <artifactId>external</artifactId>
-        <version>3.1.2-SNAPSHOT</version>
+        <version>4.0.0-SNAPSHOT</version>
     </parent>
 
     <groupId>org.glassfish.hk2.external</groupId>
diff --git a/external/pom.xml b/external/pom.xml
index 31e4b66..53ec194 100644
--- a/external/pom.xml
+++ b/external/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.glassfish.hk2</groupId>
         <artifactId>hk2-parent</artifactId>
-        <version>3.1.2-SNAPSHOT</version>
+        <version>4.0.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>external</artifactId>
diff --git a/guice-bridge/pom.xml b/guice-bridge/pom.xml
index 09a91c5..a94b493 100644
--- a/guice-bridge/pom.xml
+++ b/guice-bridge/pom.xml
@@ -24,7 +24,7 @@
     <parent>
         <groupId>org.glassfish.hk2</groupId>
         <artifactId>hk2-parent</artifactId>
-        <version>3.1.2-SNAPSHOT</version>
+        <version>4.0.0-SNAPSHOT</version>
     </parent>
 
     <groupId>org.glassfish.hk2</groupId>
diff --git a/hk2-api/pom.xml b/hk2-api/pom.xml
index e236e6b..e3cf9d7 100644
--- a/hk2-api/pom.xml
+++ b/hk2-api/pom.xml
@@ -25,7 +25,7 @@
     <parent>
         <groupId>org.glassfish.hk2</groupId>
         <artifactId>hk2-parent</artifactId>
-        <version>3.1.2-SNAPSHOT</version>
+        <version>4.0.0-SNAPSHOT</version>
     </parent>
 
     <groupId>org.glassfish.hk2</groupId>
diff --git a/hk2-configuration/hk2-integration/pom.xml b/hk2-configuration/hk2-integration/pom.xml
index 981b488..26ffe23 100644
--- a/hk2-configuration/hk2-integration/pom.xml
+++ b/hk2-configuration/hk2-integration/pom.xml
@@ -24,7 +24,7 @@
     <parent>
         <groupId>org.glassfish.hk2</groupId>
         <artifactId>hk2-configuration</artifactId>
-        <version>3.1.2-SNAPSHOT</version>
+        <version>4.0.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>hk2-configuration-integration</artifactId>
diff --git a/hk2-configuration/manager/pom.xml b/hk2-configuration/manager/pom.xml
index 03e0052..dbfb144 100644
--- a/hk2-configuration/manager/pom.xml
+++ b/hk2-configuration/manager/pom.xml
@@ -24,7 +24,7 @@
     <parent>
         <groupId>org.glassfish.hk2</groupId>
         <artifactId>hk2-configuration</artifactId>
-        <version>3.1.2-SNAPSHOT</version>
+        <version>4.0.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>hk2-configuration-hub</artifactId>
diff --git a/hk2-configuration/persistence/hk2-xml/hk2-json/pom.xml b/hk2-configuration/persistence/hk2-xml/hk2-json/pom.xml
index cf57256..68a5333 100644
--- a/hk2-configuration/persistence/hk2-xml/hk2-json/pom.xml
+++ b/hk2-configuration/persistence/hk2-xml/hk2-json/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.glassfish.hk2</groupId>
         <artifactId>hk2-xml-parent</artifactId>
-        <version>3.1.2-SNAPSHOT</version>
+        <version>4.0.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>hk2-json</artifactId>
diff --git a/hk2-configuration/persistence/hk2-xml/hk2-pbuf/pom.xml b/hk2-configuration/persistence/hk2-xml/hk2-pbuf/pom.xml
index 9a8fbe9..08ef968 100644
--- a/hk2-configuration/persistence/hk2-xml/hk2-pbuf/pom.xml
+++ b/hk2-configuration/persistence/hk2-xml/hk2-pbuf/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.glassfish.hk2</groupId>
         <artifactId>hk2-xml-parent</artifactId>
-        <version>3.1.2-SNAPSHOT</version>
+        <version>4.0.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>hk2-pbuf</artifactId>
diff --git a/hk2-configuration/persistence/hk2-xml/integration-test/pom.xml b/hk2-configuration/persistence/hk2-xml/integration-test/pom.xml
index b57caa7..1c8d2bc 100644
--- a/hk2-configuration/persistence/hk2-xml/integration-test/pom.xml
+++ b/hk2-configuration/persistence/hk2-xml/integration-test/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.glassfish.hk2</groupId>
         <artifactId>hk2-xml-parent</artifactId>
-        <version>3.1.2-SNAPSHOT</version>
+        <version>4.0.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>hk2-xml-integration-test</artifactId>
diff --git a/hk2-configuration/persistence/hk2-xml/main/pom.xml b/hk2-configuration/persistence/hk2-xml/main/pom.xml
index c469b19..64ff14b 100644
--- a/hk2-configuration/persistence/hk2-xml/main/pom.xml
+++ b/hk2-configuration/persistence/hk2-xml/main/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.glassfish.hk2</groupId>
         <artifactId>hk2-xml-parent</artifactId>
-        <version>3.1.2-SNAPSHOT</version>
+        <version>4.0.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>hk2-xml</artifactId>
diff --git a/hk2-configuration/persistence/hk2-xml/pom.xml b/hk2-configuration/persistence/hk2-xml/pom.xml
index 84448db..34c7104 100644
--- a/hk2-configuration/persistence/hk2-xml/pom.xml
+++ b/hk2-configuration/persistence/hk2-xml/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.glassfish.hk2</groupId>
         <artifactId>hk2-configuration-persistence</artifactId>
-        <version>3.1.2-SNAPSHOT</version>
+        <version>4.0.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>hk2-xml-parent</artifactId>
diff --git a/hk2-configuration/persistence/hk2-xml/schema/pom.xml b/hk2-configuration/persistence/hk2-xml/schema/pom.xml
index 38a864b..58392ac 100644
--- a/hk2-configuration/persistence/hk2-xml/schema/pom.xml
+++ b/hk2-configuration/persistence/hk2-xml/schema/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.glassfish.hk2</groupId>
         <artifactId>hk2-xml-parent</artifactId>
-        <version>3.1.2-SNAPSHOT</version>
+        <version>4.0.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>hk2-xml-schema</artifactId>
diff --git a/hk2-configuration/persistence/hk2-xml/test1/pom.xml b/hk2-configuration/persistence/hk2-xml/test1/pom.xml
index c1b35b9..c6ee736 100644
--- a/hk2-configuration/persistence/hk2-xml/test1/pom.xml
+++ b/hk2-configuration/persistence/hk2-xml/test1/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.glassfish.hk2</groupId>
         <artifactId>hk2-xml-parent</artifactId>
-        <version>3.1.2-SNAPSHOT</version>
+        <version>4.0.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>hk2-xml-test</artifactId>
diff --git a/hk2-configuration/persistence/pom.xml b/hk2-configuration/persistence/pom.xml
index 1ca69e2..a8fc9e4 100644
--- a/hk2-configuration/persistence/pom.xml
+++ b/hk2-configuration/persistence/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.glassfish.hk2</groupId>
         <artifactId>hk2-configuration</artifactId>
-        <version>3.1.2-SNAPSHOT</version>
+        <version>4.0.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>hk2-configuration-persistence</artifactId>
diff --git a/hk2-configuration/persistence/property-file/pom.xml b/hk2-configuration/persistence/property-file/pom.xml
index 0736985..71492d6 100644
--- a/hk2-configuration/persistence/property-file/pom.xml
+++ b/hk2-configuration/persistence/property-file/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.glassfish.hk2</groupId>
         <artifactId>hk2-configuration-persistence</artifactId>
-        <version>3.1.2-SNAPSHOT</version>
+        <version>4.0.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>hk2-property-file</artifactId>
diff --git a/hk2-configuration/pom.xml b/hk2-configuration/pom.xml
index 07a302e..5d40ffa 100644
--- a/hk2-configuration/pom.xml
+++ b/hk2-configuration/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.glassfish.hk2</groupId>
         <artifactId>hk2-parent</artifactId>
-        <version>3.1.2-SNAPSHOT</version>
+        <version>4.0.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>hk2-configuration</artifactId>
diff --git a/hk2-core/pom.xml b/hk2-core/pom.xml
index d45a239..d85f31a 100644
--- a/hk2-core/pom.xml
+++ b/hk2-core/pom.xml
@@ -24,7 +24,7 @@
     <parent>
         <groupId>org.glassfish.hk2</groupId>
         <artifactId>hk2-parent</artifactId>
-        <version>3.1.2-SNAPSHOT</version>
+        <version>4.0.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>hk2-core</artifactId>
diff --git a/hk2-extras/pom.xml b/hk2-extras/pom.xml
index bd4043e..e47fab0 100644
--- a/hk2-extras/pom.xml
+++ b/hk2-extras/pom.xml
@@ -24,7 +24,7 @@
     <parent>
         <groupId>org.glassfish.hk2</groupId>
         <artifactId>hk2-parent</artifactId>
-        <version>3.1.2-SNAPSHOT</version>
+        <version>4.0.0-SNAPSHOT</version>
     </parent>
 
     <groupId>org.glassfish.hk2</groupId>
diff --git a/hk2-jmx/pom.xml b/hk2-jmx/pom.xml
index 9029593..49a5c2c 100644
--- a/hk2-jmx/pom.xml
+++ b/hk2-jmx/pom.xml
@@ -24,7 +24,7 @@
     <parent>
         <groupId>org.glassfish.hk2</groupId>
         <artifactId>hk2-parent</artifactId>
-        <version>3.1.2-SNAPSHOT</version>
+        <version>4.0.0-SNAPSHOT</version>
     </parent>
 
     <groupId>org.glassfish.hk2</groupId>
diff --git a/hk2-locator/pom.xml b/hk2-locator/pom.xml
index fd492dc..1bccc4b 100644
--- a/hk2-locator/pom.xml
+++ b/hk2-locator/pom.xml
@@ -25,7 +25,7 @@
     <parent>
         <groupId>org.glassfish.hk2</groupId>
         <artifactId>hk2-parent</artifactId>
-        <version>3.1.2-SNAPSHOT</version>
+        <version>4.0.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>hk2-locator</artifactId>
diff --git a/hk2-metadata-generator/main/pom.xml b/hk2-metadata-generator/main/pom.xml
index f04c802..68ba85a 100644
--- a/hk2-metadata-generator/main/pom.xml
+++ b/hk2-metadata-generator/main/pom.xml
@@ -24,7 +24,7 @@
     <parent>
         <groupId>org.glassfish.hk2</groupId>
         <artifactId>hk2-metadata-generator-parent</artifactId>
-        <version>3.1.2-SNAPSHOT</version>
+        <version>4.0.0-SNAPSHOT</version>
     </parent>
 
     <groupId>org.glassfish.hk2</groupId>
diff --git a/hk2-metadata-generator/pom.xml b/hk2-metadata-generator/pom.xml
index e35c3f7..a0b10e6 100644
--- a/hk2-metadata-generator/pom.xml
+++ b/hk2-metadata-generator/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.glassfish.hk2</groupId>
         <artifactId>hk2-parent</artifactId>
-        <version>3.1.2-SNAPSHOT</version>
+        <version>4.0.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>hk2-metadata-generator-parent</artifactId>
diff --git a/hk2-metadata-generator/test1/pom.xml b/hk2-metadata-generator/test1/pom.xml
index 0570c19..683be62 100644
--- a/hk2-metadata-generator/test1/pom.xml
+++ b/hk2-metadata-generator/test1/pom.xml
@@ -24,7 +24,7 @@
     <parent>
         <groupId>org.glassfish.hk2</groupId>
         <artifactId>hk2-metadata-generator-parent</artifactId>
-        <version>3.1.2-SNAPSHOT</version>
+        <version>4.0.0-SNAPSHOT</version>
     </parent>
 
     <groupId>org.glassfish.hk2</groupId>
diff --git a/hk2-runlevel/pom.xml b/hk2-runlevel/pom.xml
index cb028f4..9a88730 100644
--- a/hk2-runlevel/pom.xml
+++ b/hk2-runlevel/pom.xml
@@ -24,7 +24,7 @@
     <parent>
         <groupId>org.glassfish.hk2</groupId>
         <artifactId>hk2-parent</artifactId>
-        <version>3.1.2-SNAPSHOT</version>
+        <version>4.0.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>hk2-runlevel</artifactId>
diff --git a/hk2-testing/ant/pom.xml b/hk2-testing/ant/pom.xml
index 5b69364..7387b56 100644
--- a/hk2-testing/ant/pom.xml
+++ b/hk2-testing/ant/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.glassfish.hk2</groupId>
         <artifactId>hk2-parent</artifactId>
-        <version>3.1.2-SNAPSHOT</version>
+        <version>4.0.0-SNAPSHOT</version>
         <relativePath>../../pom.xml</relativePath>
     </parent>
 
diff --git a/hk2-testing/collections/pom.xml b/hk2-testing/collections/pom.xml
index f8a1cd6..f5907e5 100644
--- a/hk2-testing/collections/pom.xml
+++ b/hk2-testing/collections/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.glassfish.hk2</groupId>
         <artifactId>hk2-testing</artifactId>
-        <version>3.1.2-SNAPSHOT</version>
+        <version>4.0.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>hk2-collections-tests</artifactId>
diff --git a/hk2-testing/di-tck/pom.xml b/hk2-testing/di-tck/pom.xml
index 8c0e674..fab6d9e 100644
--- a/hk2-testing/di-tck/pom.xml
+++ b/hk2-testing/di-tck/pom.xml
@@ -22,7 +22,7 @@
     <parent>
         <groupId>org.glassfish.hk2</groupId>
         <artifactId>hk2-testing</artifactId>
-        <version>3.1.1</version>
+        <version>4.0.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>hk2-di-tck-runner</artifactId>
diff --git a/hk2-testing/hk2-junitrunner/pom.xml b/hk2-testing/hk2-junitrunner/pom.xml
index fe3791a..5e05c49 100644
--- a/hk2-testing/hk2-junitrunner/pom.xml
+++ b/hk2-testing/hk2-junitrunner/pom.xml
@@ -24,7 +24,7 @@
     <parent>
         <groupId>org.glassfish.hk2</groupId>
         <artifactId>hk2-parent</artifactId>
-        <version>3.1.2-SNAPSHOT</version>
+        <version>4.0.0-SNAPSHOT</version>
         <relativePath>../../pom.xml</relativePath>
     </parent>
 
diff --git a/hk2-testing/hk2-locator-extras/pom.xml b/hk2-testing/hk2-locator-extras/pom.xml
index 6917064..d23b435 100644
--- a/hk2-testing/hk2-locator-extras/pom.xml
+++ b/hk2-testing/hk2-locator-extras/pom.xml
@@ -24,7 +24,7 @@
     <parent>
         <groupId>org.glassfish.hk2</groupId>
         <artifactId>hk2-parent</artifactId>
-        <version>3.1.2-SNAPSHOT</version>
+        <version>4.0.0-SNAPSHOT</version>
         <relativePath>../../pom.xml</relativePath>
     </parent>
 
diff --git a/hk2-testing/hk2-locator-no-proxies/pom.xml b/hk2-testing/hk2-locator-no-proxies/pom.xml
index e664ef2..dc9188b 100644
--- a/hk2-testing/hk2-locator-no-proxies/pom.xml
+++ b/hk2-testing/hk2-locator-no-proxies/pom.xml
@@ -24,7 +24,7 @@
     <parent>
         <groupId>org.glassfish.hk2</groupId>
         <artifactId>hk2-parent</artifactId>
-        <version>3.1.2-SNAPSHOT</version>
+        <version>4.0.0-SNAPSHOT</version>
         <relativePath>../../pom.xml</relativePath>
     </parent>
 
diff --git a/hk2-testing/hk2-locator-no-proxies2/pom.xml b/hk2-testing/hk2-locator-no-proxies2/pom.xml
index 7de7a37..f604426 100644
--- a/hk2-testing/hk2-locator-no-proxies2/pom.xml
+++ b/hk2-testing/hk2-locator-no-proxies2/pom.xml
@@ -24,7 +24,7 @@
     <parent>
         <groupId>org.glassfish.hk2</groupId>
         <artifactId>hk2-parent</artifactId>
-        <version>3.1.2-SNAPSHOT</version>
+        <version>4.0.0-SNAPSHOT</version>
         <relativePath>../../pom.xml</relativePath>
     </parent>
 
diff --git a/hk2-testing/hk2-mockito/pom.xml b/hk2-testing/hk2-mockito/pom.xml
index b2c3dfc..aa404b4 100644
--- a/hk2-testing/hk2-mockito/pom.xml
+++ b/hk2-testing/hk2-mockito/pom.xml
@@ -24,7 +24,7 @@
     <parent>
         <groupId>org.glassfish.hk2</groupId>
         <artifactId>hk2-testing</artifactId>
-        <version>3.1.2-SNAPSHOT</version>
+        <version>4.0.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>hk2-mockito</artifactId>
diff --git a/hk2-testing/hk2-runlevel-extras/pom.xml b/hk2-testing/hk2-runlevel-extras/pom.xml
index 31f248d..149851d 100644
--- a/hk2-testing/hk2-runlevel-extras/pom.xml
+++ b/hk2-testing/hk2-runlevel-extras/pom.xml
@@ -24,7 +24,7 @@
     <parent>
         <groupId>org.glassfish.hk2</groupId>
         <artifactId>hk2-parent</artifactId>
-        <version>3.1.2-SNAPSHOT</version>
+        <version>4.0.0-SNAPSHOT</version>
         <relativePath>../../pom.xml</relativePath>
     </parent>
 
diff --git a/hk2-testing/hk2-testng/pom.xml b/hk2-testing/hk2-testng/pom.xml
index 748be54..5f47e77 100644
--- a/hk2-testing/hk2-testng/pom.xml
+++ b/hk2-testing/hk2-testng/pom.xml
@@ -24,7 +24,7 @@
     <parent>
         <groupId>org.glassfish.hk2</groupId>
         <artifactId>hk2-parent</artifactId>
-        <version>3.1.2-SNAPSHOT</version>
+        <version>4.0.0-SNAPSHOT</version>
         <relativePath>../../pom.xml</relativePath>
     </parent>
 
diff --git a/hk2-testing/interceptor-events/pom.xml b/hk2-testing/interceptor-events/pom.xml
index fd2b971..0555ef5 100644
--- a/hk2-testing/interceptor-events/pom.xml
+++ b/hk2-testing/interceptor-events/pom.xml
@@ -24,7 +24,7 @@
     <parent>
         <groupId>org.glassfish.hk2</groupId>
         <artifactId>hk2-testing</artifactId>
-        <version>3.1.2-SNAPSHOT</version>
+        <version>4.0.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>interceptor-events</artifactId>
diff --git a/hk2-testing/jersey/jersey-guice/form-param/pom.xml b/hk2-testing/jersey/jersey-guice/form-param/pom.xml
index 2d99edc..43c0c3b 100644
--- a/hk2-testing/jersey/jersey-guice/form-param/pom.xml
+++ b/hk2-testing/jersey/jersey-guice/form-param/pom.xml
@@ -24,7 +24,7 @@
     <parent>
         <groupId>org.glassfish.hk2</groupId>
         <artifactId>hk2-parent</artifactId>
-        <version>3.1.2-SNAPSHOT</version>
+        <version>4.0.0-SNAPSHOT</version>
         <relativePath>../../../../pom.xml</relativePath>
     </parent>
 
diff --git a/hk2-testing/jersey/jersey-guice/pom.xml b/hk2-testing/jersey/jersey-guice/pom.xml
index 05ae42d..773e470 100644
--- a/hk2-testing/jersey/jersey-guice/pom.xml
+++ b/hk2-testing/jersey/jersey-guice/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.glassfish.hk2</groupId>
         <artifactId>hk2-parent</artifactId>
-        <version>3.1.2-SNAPSHOT</version>
+        <version>4.0.0-SNAPSHOT</version>
         <relativePath>../../../pom.xml</relativePath>
     </parent>
 
diff --git a/hk2-testing/jersey/pom.xml b/hk2-testing/jersey/pom.xml
index 6941770..9bb9aee 100644
--- a/hk2-testing/jersey/pom.xml
+++ b/hk2-testing/jersey/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.glassfish.hk2</groupId>
         <artifactId>hk2-parent</artifactId>
-        <version>3.1.2-SNAPSHOT</version>
+        <version>4.0.0-SNAPSHOT</version>
         <relativePath>../../pom.xml</relativePath>
     </parent>
 
diff --git a/hk2-testing/pom.xml b/hk2-testing/pom.xml
index 914e913..b6edea6 100644
--- a/hk2-testing/pom.xml
+++ b/hk2-testing/pom.xml
@@ -24,7 +24,7 @@
     <parent>
         <groupId>org.glassfish.hk2</groupId>
         <artifactId>hk2-parent</artifactId>
-        <version>3.1.2-SNAPSHOT</version>
+        <version>4.0.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>hk2-testing</artifactId>
diff --git a/hk2-utils/pom.xml b/hk2-utils/pom.xml
index eb1d2f5..3c4270f 100644
--- a/hk2-utils/pom.xml
+++ b/hk2-utils/pom.xml
@@ -24,7 +24,7 @@
     <parent>
         <groupId>org.glassfish.hk2</groupId>
         <artifactId>hk2-parent</artifactId>
-        <version>3.1.2-SNAPSHOT</version>
+        <version>4.0.0-SNAPSHOT</version>
     </parent>
 
     <groupId>org.glassfish.hk2</groupId>
diff --git a/hk2/pom.xml b/hk2/pom.xml
index fe51a28..c0c08df 100644
--- a/hk2/pom.xml
+++ b/hk2/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.glassfish.hk2</groupId>
         <artifactId>hk2-parent</artifactId>
-        <version>3.1.2-SNAPSHOT</version>
+        <version>4.0.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>hk2</artifactId>
diff --git a/javadocs/pom.xml b/javadocs/pom.xml
index 998f228..b7de4fc 100644
--- a/javadocs/pom.xml
+++ b/javadocs/pom.xml
@@ -22,7 +22,11 @@
     <parent>
         <groupId>org.glassfish.hk2</groupId>
         <artifactId>hk2-parent</artifactId>
+<<<<<<< HEAD
         <version>3.1.1</version>
+=======
+        <version>4.0.0-M3</version>
+>>>>>>> refs/heads/4.0.0-M3
     </parent>
     <artifactId>hk2-javadocs</artifactId>
     <name>HK2 Javadocs</name>
diff --git a/maven-plugins/consolidatedbundle-maven-plugin/pom.xml b/maven-plugins/consolidatedbundle-maven-plugin/pom.xml
index e10d585..6128123 100644
--- a/maven-plugins/consolidatedbundle-maven-plugin/pom.xml
+++ b/maven-plugins/consolidatedbundle-maven-plugin/pom.xml
@@ -25,7 +25,7 @@
     <parent>
         <groupId>org.glassfish.hk2</groupId>
         <artifactId>maven-plugins</artifactId>
-        <version>3.1.2-SNAPSHOT</version>
+        <version>4.0.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>consolidatedbundle-maven-plugin</artifactId>
diff --git a/maven-plugins/hk2-inhabitant-generator/pom.xml b/maven-plugins/hk2-inhabitant-generator/pom.xml
index 6f59db8..b37ce09 100644
--- a/maven-plugins/hk2-inhabitant-generator/pom.xml
+++ b/maven-plugins/hk2-inhabitant-generator/pom.xml
@@ -24,7 +24,7 @@
     <parent>
         <groupId>org.glassfish.hk2</groupId>
         <artifactId>maven-plugins</artifactId>
-        <version>3.1.2-SNAPSHOT</version>
+        <version>4.0.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>hk2-inhabitant-generator</artifactId>
diff --git a/maven-plugins/osgiversion-maven-plugin/pom.xml b/maven-plugins/osgiversion-maven-plugin/pom.xml
index 775838f..96af82d 100644
--- a/maven-plugins/osgiversion-maven-plugin/pom.xml
+++ b/maven-plugins/osgiversion-maven-plugin/pom.xml
@@ -24,7 +24,7 @@
     <parent>
         <groupId>org.glassfish.hk2</groupId>
         <artifactId>maven-plugins</artifactId>
-        <version>3.1.2-SNAPSHOT</version>
+        <version>4.0.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>osgiversion-maven-plugin</artifactId>
diff --git a/maven-plugins/pom.xml b/maven-plugins/pom.xml
index 85daf05..bb6d2aa 100644
--- a/maven-plugins/pom.xml
+++ b/maven-plugins/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.glassfish.hk2</groupId>
         <artifactId>hk2-parent</artifactId>
-        <version>3.1.2-SNAPSHOT</version>
+        <version>4.0.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>maven-plugins</artifactId>
diff --git a/osgi/adapter-tests/contract-bundle/pom.xml b/osgi/adapter-tests/contract-bundle/pom.xml
index e5cf314..d23615e 100644
--- a/osgi/adapter-tests/contract-bundle/pom.xml
+++ b/osgi/adapter-tests/contract-bundle/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.glassfish.hk2</groupId>
         <artifactId>osgi-adapter-tests-parent</artifactId>
-        <version>3.1.2-SNAPSHOT</version>
+        <version>4.0.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>contract-bundle</artifactId>
diff --git a/osgi/adapter-tests/faux-sdp-bundle/pom.xml b/osgi/adapter-tests/faux-sdp-bundle/pom.xml
index 345db37..114cdcf 100644
--- a/osgi/adapter-tests/faux-sdp-bundle/pom.xml
+++ b/osgi/adapter-tests/faux-sdp-bundle/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.glassfish.hk2</groupId>
         <artifactId>osgi-adapter-tests-parent</artifactId>
-        <version>3.1.2-SNAPSHOT</version>
+        <version>4.0.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>faux-sdp-bundle</artifactId>
diff --git a/osgi/adapter-tests/no-hk2-bundle/pom.xml b/osgi/adapter-tests/no-hk2-bundle/pom.xml
index 0a41f0a..a79bc55 100644
--- a/osgi/adapter-tests/no-hk2-bundle/pom.xml
+++ b/osgi/adapter-tests/no-hk2-bundle/pom.xml
@@ -24,7 +24,7 @@
     <parent>
         <groupId>org.glassfish.hk2</groupId>
         <artifactId>osgi-adapter-tests-parent</artifactId>
-        <version>3.1.2-SNAPSHOT</version>
+        <version>4.0.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>no-hk2-bundle</artifactId>
diff --git a/osgi/adapter-tests/osgi-adapter-test/pom.xml b/osgi/adapter-tests/osgi-adapter-test/pom.xml
index f23f45e..1ebe01a 100644
--- a/osgi/adapter-tests/osgi-adapter-test/pom.xml
+++ b/osgi/adapter-tests/osgi-adapter-test/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.glassfish.hk2</groupId>
         <artifactId>osgi-adapter-tests-parent</artifactId>
-        <version>3.1.2-SNAPSHOT</version>
+        <version>4.0.0-SNAPSHOT</version>
     </parent>
     <groupId>org.glassfish.hk2</groupId>
     <artifactId>osgi-adapter-test</artifactId>
diff --git a/osgi/adapter-tests/pom.xml b/osgi/adapter-tests/pom.xml
index 07c7244..e4cbd24 100644
--- a/osgi/adapter-tests/pom.xml
+++ b/osgi/adapter-tests/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.glassfish.hk2</groupId>
         <artifactId>osgi</artifactId>
-        <version>3.1.2-SNAPSHOT</version>
+        <version>4.0.0-SNAPSHOT</version>
     </parent>
 
     <groupId>org.glassfish.hk2</groupId>
diff --git a/osgi/adapter-tests/sdp-management-bundle/pom.xml b/osgi/adapter-tests/sdp-management-bundle/pom.xml
index 7561014..978d244 100644
--- a/osgi/adapter-tests/sdp-management-bundle/pom.xml
+++ b/osgi/adapter-tests/sdp-management-bundle/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.glassfish.hk2</groupId>
         <artifactId>osgi-adapter-tests-parent</artifactId>
-        <version>3.1.2-SNAPSHOT</version>
+        <version>4.0.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>sdp-management-bundle</artifactId>
diff --git a/osgi/adapter-tests/test-module-startup/pom.xml b/osgi/adapter-tests/test-module-startup/pom.xml
index afeb065..e986e0b 100644
--- a/osgi/adapter-tests/test-module-startup/pom.xml
+++ b/osgi/adapter-tests/test-module-startup/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.glassfish.hk2</groupId>
         <artifactId>osgi-adapter-tests-parent</artifactId>
-        <version>3.1.2-SNAPSHOT</version>
+        <version>4.0.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>test-module-startup</artifactId>
diff --git a/osgi/adapter/pom.xml b/osgi/adapter/pom.xml
index 90017f0..83adef1 100644
--- a/osgi/adapter/pom.xml
+++ b/osgi/adapter/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.glassfish.hk2</groupId>
         <artifactId>osgi</artifactId>
-        <version>3.1.2-SNAPSHOT</version>
+        <version>4.0.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>osgi-adapter</artifactId>
diff --git a/osgi/adapter/src/main/java/org/jvnet/hk2/osgiadapter/AbstractOSGiModulesRegistryImpl.java b/osgi/adapter/src/main/java/org/jvnet/hk2/osgiadapter/AbstractOSGiModulesRegistryImpl.java
index 32f7e52..5ffaa4e 100755
--- a/osgi/adapter/src/main/java/org/jvnet/hk2/osgiadapter/AbstractOSGiModulesRegistryImpl.java
+++ b/osgi/adapter/src/main/java/org/jvnet/hk2/osgiadapter/AbstractOSGiModulesRegistryImpl.java
@@ -48,6 +48,7 @@
      * OSGi BundleContext - used to install/uninstall, start/stop bundles
      */
     BundleContext bctx;
+
     protected PackageAdmin pa;
     private Map<ModuleChangeListener, BundleListener> moduleChangeListeners = new HashMap<>();
     private Map<ModuleLifecycleListener, BundleListener> moduleLifecycleListeners = new HashMap<>();
@@ -60,6 +61,10 @@
         pa = PackageAdmin.class.cast(bctx.getService(ref));
     }
 
+    public BundleContext getBundleContext() {
+        return bctx;
+    }
+
     @Override
     public void shutdown() {
         modules.clear();
@@ -108,7 +113,7 @@
 
             DynamicConfiguration dcs = createDynamicConfiguration(serviceLocator);
             for (Descriptor descriptor : descriptors) {
-                
+
                 DescriptorImpl di = (descriptor instanceof DescriptorImpl) ? (DescriptorImpl) descriptor : new DescriptorImpl(descriptor) ;
 
                 // set the hk2loader
@@ -290,6 +295,7 @@
 
     public void addModuleChangeListener(final ModuleChangeListener listener, final OSGiModuleImpl module) {
         BundleListener bundleListener = new BundleListener() {
+            @Override
             public void bundleChanged(BundleEvent event) {
                 if ((event.getBundle() == module.getBundle()) &&
                         ((event.getType() & BundleEvent.UPDATED) == BundleEvent.UPDATED)) {
@@ -314,6 +320,7 @@
     public void register(final ModuleLifecycleListener listener) {
         // This is purposefully made an asynchronous bundle listener
         BundleListener bundleListener = new BundleListener() {
+            @Override
             public void bundleChanged(BundleEvent event) {
                 switch (event.getType()) {
                     case BundleEvent.INSTALLED:
@@ -349,47 +356,47 @@
     /*package*/ HK2Module getModule(Bundle bundle) {
         return modules.get(new OSGiModuleId(bundle));
     }
-    
+
     @Override
     public void remove(HK2Module module) {
         super.remove(module);
-        
+
         if (!(module instanceof OSGiModuleImpl)) {
             return;
         }
-        
+
         OSGiModuleImpl oModule = (OSGiModuleImpl) module;
         Bundle bundle = oModule.getBundle();
-        
+
         String bsn = bundle.getSymbolicName();
         String version = bundle.getVersion().toString();
-        
+
         Set<ServiceLocator> locators = getAllServiceLocators();
-        
+
         for (ServiceLocator locator : locators) {
             if (!ServiceLocatorState.RUNNING.equals(locator.getState())) continue;
-            
+
             ServiceLocatorUtilities.removeFilter(locator, new RemoveFilter(bsn, version));
         }
     }
-    
+
     private static class RemoveFilter implements Filter {
         private final String bsn;
         private final String version;
-        
+
         private RemoveFilter(String bsn, String version) {
             this.bsn = bsn;
             this.version = version;
         }
-        
+
         private static String getMetadataValue(Descriptor d, String key) {
             Map<String, List<String>> metadata = d.getMetadata();
-            
+
             List<String> values = metadata.get(key);
             if (values == null || values.size() <= 0) {
                 return null;
             }
-            
+
             return values.get(0);
         }
 
@@ -397,12 +404,12 @@
         public boolean matches(Descriptor d) {
             String dBSN = getMetadataValue(d, OsgiPopulatorPostProcessor.BUNDLE_SYMBOLIC_NAME);
             if (dBSN == null || !dBSN.equals(bsn)) return false;
-            
+
             String dVersion = getMetadataValue(d, OsgiPopulatorPostProcessor.BUNDLE_VERSION);
             if (dVersion == null) return false;
-            
+
             return dVersion.equals(version);
         }
-        
+
     }
 }
diff --git a/osgi/adapter/src/main/java/org/jvnet/hk2/osgiadapter/FelixPrettyPrinter.java b/osgi/adapter/src/main/java/org/jvnet/hk2/osgiadapter/FelixPrettyPrinter.java
new file mode 100644
index 0000000..cba598d
--- /dev/null
+++ b/osgi/adapter/src/main/java/org/jvnet/hk2/osgiadapter/FelixPrettyPrinter.java
@@ -0,0 +1,338 @@
+/*
+ * Copyright (c) 2022, 2026 Contributors to the Eclipse Foundation
+ * Copyright (c) 2008, 2021 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v. 2.0, which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * This Source Code may also be made available under the following Secondary
+ * Licenses when the conditions for such availability set forth in the
+ * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
+ * version 2 with the GNU Classpath Exception, which is available at
+ * https://www.gnu.org/software/classpath/license.html.
+ *
+ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
+ */
+
+package org.jvnet.hk2.osgiadapter;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Enumeration;
+import java.util.HashSet;
+import java.util.LinkedHashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.BundleException;
+import org.osgi.framework.wiring.BundleRevision;
+import org.osgi.resource.Capability;
+
+import static java.nio.charset.StandardCharsets.UTF_8;
+import static org.osgi.framework.namespace.PackageNamespace.PACKAGE_NAMESPACE;
+
+/**
+ * Tools for obtaining readable information from the {@link BundleException}
+ */
+public class FelixPrettyPrinter {
+
+    private static final Pattern BUNDLE_PATTERN = Pattern.compile("\\[(\\d+)\\]", Pattern.MULTILINE);
+
+    public static void main(String[] args) {
+        System.out.println(prettyPrintExceptionMessage("org.osgi.framework.BundleException: Unable to resolve org.glassfish.main.web.weld-integration [41](R 41.0): missing requirement [org.glassfish.main.web.weld-integration [41](R 41.0)] osgi.wiring.package; (&(osgi.wiring.package=jakarta.faces.application)(version>=4.1.0)(!(version>=5.0.0))) [caused by: Unable to resolve org.glassfish.jakarta.faces [291](R 291.0): missing requirement [org.glassfish.jakarta.faces [291](R 291.0)] osgi.wiring.package; (&(osgi.wiring.package=jakarta.enterprise.inject)(version>=4.1.0)(!(version>=5.0.0)))] Unresolved requirements: [[org.glassfish.main.web.weld-integration [41](R 41.0)] osgi.wiring.package; (&(osgi.wiring.package=jakarta.faces.application)(version>=4.1.0)(!(version>=5.0.0)))]"));
+    }
+
+    public static String prettyPrintFelixMessage(BundleContext context, final String bundleMessage) {
+        final String prettyMessage = prettyPrintExceptionMessage(bundleMessage);
+
+        final StringBuilder bundleBuilder = new StringBuilder(1024);
+        bundleBuilder.append(prettyMessage);
+
+        List<Long> bundleIDs = new ArrayList<>();
+
+        bundleIDs.addAll(addExportingBundles(context, prettyMessage, bundleBuilder));
+        bundleIDs.addAll(findBundleIds(prettyMessage));
+
+        if (!bundleIDs.isEmpty()) {
+            for (Long bundleId : bundleIDs) {
+                Bundle bundle = context.getBundle(bundleId);
+                if (bundle != null) {
+                    bundleBuilder.append('[').append(bundleId).append("] \n");
+                    bundleBuilder.append("jar = ").append(bundle.getLocation());
+                    tryAddPomProperties(bundle, bundleBuilder);
+                    bundleBuilder.append('\n');
+                }
+            }
+        }
+
+        return bundleBuilder.toString();
+    }
+
+    /**
+     * Prints exception messages from Felix bundle classloading in a more human readable way.
+     *
+     * @param message - error message from the exception
+     * @return multiline human readable string
+     */
+    public static String prettyPrintExceptionMessage(final String message) {
+        StringBuilder messageBuilder = new StringBuilder(256);
+        try {
+            int index = message.indexOf("Unable to resolve");
+            int indent = 0;
+            while (index >= 0) {
+                printLn(messageBuilder, indent, "Unable to resolve");
+                index += "Unable to resolve".length();
+
+                int index2 = message.indexOf("missing requirement", index);
+                if (index2 >= 0) {
+
+                    indent++;
+
+                    // Module name would be e.g.
+                    // org.glassfish.server.internal.batch.glassfish-batch-connector [103](R 103.0):
+                    String module = message.substring(index, index2);
+
+                    // Remove the duplicate number
+                    if (module.contains("(R")) {
+                        module = module.substring(0, module.indexOf("(R"));
+                    }
+
+                    printLn(messageBuilder, indent, module);
+                    printLn(messageBuilder, indent, "missing requirement");
+
+                    index = index2 + "missing requirement".length();
+
+                    // In GlassFish and in a classloader the search is always for package, so we can
+                    // use that as a delimiter here
+                    int indexPackage = message.indexOf("osgi.wiring.package; ", index);
+                    int indexHost = message.indexOf("osgi.wiring.host; ", index);
+
+                    boolean hasPackage = indexPackage >= 0;
+                    boolean hasHost = indexHost >= 0;
+
+                    boolean isPackage = false;
+                    if (hasPackage && (!hasHost || indexPackage < indexHost)) {
+                        index = indexPackage;
+                        isPackage = true;
+                    } else if (hasHost) {
+                        index = indexHost;
+                    } else {
+                        index = -1;
+                    }
+
+                    if (index >= 0) {
+
+                        indent++;
+
+                        if (isPackage) {
+
+                            // Remainder of input now looks like this:
+
+                            // osgi.wiring.package; (&(osgi.wiring.package=org.glassfish.grizzly)(version>=2.4.0)(!(version>=3.0.0)))
+
+                            // Skip over "osgi.wiring.package; ", we're always searching for this so
+                            // no need to print it.
+                            index += "osgi.wiring.package; ".length();
+
+                            // Now extracting this:
+                            // "(&(osgi.wiring.package=org.glassfish.grizzly)(version>=2.4.0)(!(version>=3.0.0)))"
+                            index2 = message.indexOf(" ", index);
+
+                            String packageAndVersion = null;
+                            if (index2 != -1) {
+                                packageAndVersion = message.substring(index, index2);
+                            } else {
+                                packageAndVersion = message.substring(index);
+                            }
+
+                            // Make it a little less "cramped"
+                            // "(&(package=org.glassfish.grizzly) (version>=2.4.0) (!(version>=3.0.0)))"
+                            packageAndVersion = packageAndVersion.replace("osgi.wiring.package", "package");
+                            packageAndVersion = packageAndVersion.replace(")(", ") (");
+                            packageAndVersion = packageAndVersion.replace("=", " = ");
+                            packageAndVersion = packageAndVersion.replace("> =", " >=");
+                            packageAndVersion = packageAndVersion.replace("< =", " <=");
+
+                            // Remove outer braces
+                            // "&(package=org.glassfish.grizzly) (version>=2.4.0) (!(version>=3.0.0))"
+                            if (packageAndVersion.startsWith("(")) {
+                                packageAndVersion = packageAndVersion.substring(1);
+                            }
+                            if (packageAndVersion.endsWith(")")) {
+                                packageAndVersion = packageAndVersion.substring(0, packageAndVersion.length() - 1);
+                            }
+
+                            printLn(messageBuilder, indent, packageAndVersion);
+                        } else {
+
+                            // Remainder of input now looks like this:
+
+                            // osgi.wiring.host; (&(osgi.wiring.host=org.hibernate.validator)(bundle-version>=0.0.0)
+
+                            // Skip over "osgi.wiring.host; ", we're already searching for this so
+                            // no need to print it.
+                            index += "osgi.wiring.host; ".length();
+
+                            index2 = message.indexOf("]", index);
+
+                            String remainder = null;
+                            if (index2 != -1) {
+                                remainder = message.substring(index, index2);
+                            } else {
+                                remainder = message.substring(index);
+                            }
+
+                            printLn(messageBuilder, indent, remainder);
+                        }
+
+                        // If there's a "caused by:", print it and increase the indent
+                        index = message.indexOf("caused by: ", index2);
+                        if (index >= 0) {
+
+                            printLn(messageBuilder, indent, "caused by:");
+
+                            indent++;
+                            index += "caused by: ".length();
+                        }
+
+                    }
+                }
+
+                if (index2 == -1) {
+                    index = -1;
+                } else {
+                    index = index2;
+                    index = message.indexOf("Unable to resolve", index);
+                }
+            }
+            return messageBuilder.toString();
+        } catch (Exception e) {
+            // Usually we are processing another exception - if we failed, better return original.
+            return message;
+        }
+    }
+
+    public static String addBundleInfo(Bundle bundle, String prettyMessage) {
+        final StringBuilder bundleBuilder = new StringBuilder(1024);
+        bundleBuilder.append("\n").append(prettyMessage);
+        if (bundle != null) {
+            bundleBuilder.append('[').append(bundle.getBundleId()).append("] \n");
+            bundleBuilder.append("jar = ").append(bundle.getLocation());
+            tryAddPomProperties(bundle, bundleBuilder);
+            bundleBuilder.append('\n');
+        }
+
+        return bundleBuilder.toString();
+    }
+
+    private static List<Long> addExportingBundles(BundleContext context, String prettyMessage, StringBuilder bundleBuilder) {
+        Set<Bundle> exportingBundles = new HashSet<>();
+        List<Long> bundleIDs = new ArrayList<>();
+
+        int lastPackageindex = prettyMessage.lastIndexOf("package = ");
+        if (lastPackageindex != -1) {
+            String lastPackage = prettyMessage.substring(lastPackageindex + "package = ".length(), prettyMessage.indexOf(")", lastPackageindex));
+
+            exportingBundles.addAll(findExporters(context, lastPackage));
+
+            if (exportingBundles.isEmpty()) {
+                bundleBuilder.append("\nNo bundles found to export " + lastPackage + "\n");
+            } else {
+                bundleBuilder.append("\nThe following bundles export \"" + lastPackage + "\"\n");
+                for (Bundle bundle : exportingBundles) {
+                    bundleIDs.add(bundle.getBundleId());
+
+                    bundleBuilder.append(bundle.getSymbolicName())
+                                 .append(" ")
+                                 .append(bundle.getVersion())
+                                 .append(" [")
+                                 .append(bundle.getBundleId())
+                                 .append("]")
+                                 .append("\n")
+                                 ;
+                }
+            }
+            bundleBuilder.append("\n");
+        }
+
+        return bundleIDs;
+    }
+
+    private static List<Bundle> findExporters(BundleContext ctx, String packageName) {
+        List<Bundle> exporters = new ArrayList<>();
+
+        for (Bundle b : ctx.getBundles()) {
+            BundleRevision rev = b.adapt(BundleRevision.class);
+            if (rev == null) {
+                continue;
+            }
+
+            List<Capability> caps = rev.getCapabilities(PACKAGE_NAMESPACE);
+            for (Capability cap : caps) {
+                Map<String, Object> attrs = cap.getAttributes();
+                Object exportedPkg = attrs.get(PACKAGE_NAMESPACE);
+
+                if (packageName.equals(exportedPkg)) {
+                    exporters.add(b);
+                    break; // one match is enough per bundle
+                }
+            }
+        }
+
+        return exporters;
+    }
+
+    private static void tryAddPomProperties(Bundle bundle, StringBuilder bundleBuilder) {
+        Enumeration<URL> entries = bundle.findEntries("META-INF/maven/", "pom.properties", true);
+        if (entries == null) {
+            return;
+        }
+
+        while (entries.hasMoreElements()) {
+            try (BufferedReader reader = new BufferedReader(new InputStreamReader(entries.nextElement().openStream(), UTF_8))) {
+                reader.lines()
+                      .filter(e -> !e.startsWith("#"))
+                      .forEach(e -> bundleBuilder.append('\n').append(e.replace("=", " = ")));
+            } catch (IOException e1) {
+                // Ignore
+            }
+            bundleBuilder.append('\n');
+        }
+    }
+
+
+    /**
+     * @param message - error message from the exception
+     * @return list of bundle ids (are in square brackets in the message)
+     */
+    public static List<Long> findBundleIds(final String message) {
+        if (message == null || message.isEmpty()) {
+            return Collections.emptyList();
+        }
+        Set<Long> bundleIds = new LinkedHashSet<>();
+        Matcher bundlePattern = BUNDLE_PATTERN.matcher(message);
+        while (bundlePattern.find()) {
+            String number = bundlePattern.group(1);
+            bundleIds.add(Long.valueOf(number));
+        }
+        return new ArrayList<>(bundleIds);
+    }
+
+
+    private static void printLn(StringBuilder messageBuilder, int indent, String message) {
+        for (int i = 0; i < (indent * 4); i++) {
+            messageBuilder.append(" ");
+        }
+        messageBuilder.append(message.trim()).append("\n");
+    }
+}
diff --git a/osgi/adapter/src/main/java/org/jvnet/hk2/osgiadapter/OSGiModuleImpl.java b/osgi/adapter/src/main/java/org/jvnet/hk2/osgiadapter/OSGiModuleImpl.java
index ae8b55c..d88addc 100755
--- a/osgi/adapter/src/main/java/org/jvnet/hk2/osgiadapter/OSGiModuleImpl.java
+++ b/osgi/adapter/src/main/java/org/jvnet/hk2/osgiadapter/OSGiModuleImpl.java
@@ -17,15 +17,12 @@
 
 package org.jvnet.hk2.osgiadapter;
 
+import static org.jvnet.hk2.osgiadapter.FelixPrettyPrinter.prettyPrintFelixMessage;
 import static org.jvnet.hk2.osgiadapter.Logger.logger;
 
 import java.io.*;
 import java.net.URI;
 import java.net.URL;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.security.PrivilegedActionException;
-import java.security.PrivilegedExceptionAction;
 import java.util.*;
 import java.util.concurrent.locks.ReentrantLock;
 import java.util.logging.Level;
@@ -177,29 +174,16 @@
                 return;
             }
             try {
-                SecurityManager sm = System.getSecurityManager();
-                if (sm != null) {
-                    try {
-                        AccessController.doPrivileged(new PrivilegedExceptionAction(){
-                            public Object run() throws BundleException
-                            {
-                                startBundle();
-                                return null;
-                            }
-                        });
-                    } catch (PrivilegedActionException e) {
-                        throw (BundleException)e.getException();
-                    }
-                } else {
-                    startBundle();
-                }
+                startBundle();
                 isTransientlyActive = true;
                 if (logger.isLoggable(Level.FINE)) {
                     logger.logp(Level.FINE, "OSGiModuleImpl",
                             "start", "Started bundle {0}", bundle);
                 }
             } catch (BundleException e) {
-                throw new ResolveError("Failed to start "+this,e);
+                throw new ResolveError(
+                        "Failed to start " + this + prettyPrintFelixMessage(registry.getBundleContext(), e.getMessage()),
+                        e);
             }
 
             // TODO(Sahoo): Remove this when hk2-apt generates equivalent BundleActivator
@@ -298,6 +282,7 @@
         }
     }
 
+    @Override
     public void detach() {
         if (bundle.getState() != Bundle.ACTIVE) {
             if (logger.isLoggable(Level.FINER)) {
@@ -400,7 +385,7 @@
 
     /**
      * Parses all the inhabitants descriptors of the given name in this module.
-     * @return 
+     * @return
      */
     List<ActiveDescriptor> parseInhabitants(String name, ServiceLocator serviceLocator, List<PopulatorPostProcessor> populatorPostProcessors) throws IOException, BootException {
 
@@ -414,7 +399,7 @@
             dff = new URLDescriptorFileFinder(entry);
         }
 
-        
+
         if (dff != null) {
 
         	final OSGiModuleImpl module = this;
@@ -426,7 +411,7 @@
             }
     	    this.activeDescriptors = HK2Populator.populate(serviceLocator, dff, allPostProcessors);
         }
-        
+
         return this.activeDescriptors;
     }
 
@@ -434,11 +419,7 @@
      * This method is used as the parent loader of the class loader that we return in {@link #getClassLoader}
      */
     private ClassLoader getParentLoader() {
-        return AccessController.doPrivileged(new PrivilegedAction<ClassLoader>() {
-            public ClassLoader run() {
-                return Bundle.class.getClassLoader();
-            }
-        });
+        return Bundle.class.getClassLoader();
     }
 
     @Override
@@ -457,20 +438,10 @@
         return new ClassLoader(getParentLoader()) {
             private final ReentrantLock lock = new ReentrantLock();
             @Override
-            protected Class<?> loadClass(final String name, boolean resolve) throws ClassNotFoundException {        	
+            protected Class<?> loadClass(final String name, boolean resolve) throws ClassNotFoundException {
                 lock.lock();
                 try {
-                    //doprivileged needed for running with SecurityManager
-                    return AccessController.doPrivileged(new PrivilegedExceptionAction<Class>() {
-                        public Class run() throws ClassNotFoundException {
-                        	
-                        	Class c = bundle.loadClass(name);
-                         
-                            return c;                         
-                        }
-                    });
-                } catch (PrivilegedActionException e) {
-                    throw (ClassNotFoundException)e.getException();
+                    return bundle.loadClass(name);
                 } finally {
                     lock.unlock();
                 }
@@ -480,7 +451,7 @@
             @Override
             public URL getResource(String name) {
                 URL result = bundle.getResource(name);
-                               
+
                 if (result != null) return result;
                 return null;
             }
@@ -589,11 +560,11 @@
                     "] is already associated with bundle [" + this.bundle + "]");
         } else {
             this.bundle = bundle;
-            
+
             logger.logp(Level.INFO, "OSGiModuleImpl", "setBundle", "module [{0}] is now associated with bundle [{1}]",
                     new Object[]{this, bundle});
         }
     }
-    
+
 }
 
diff --git a/osgi/pom.xml b/osgi/pom.xml
index 7f40aa9..ae41048 100644
--- a/osgi/pom.xml
+++ b/osgi/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.glassfish.hk2</groupId>
         <artifactId>hk2-parent</artifactId>
-        <version>3.1.2-SNAPSHOT</version>
+        <version>4.0.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>osgi</artifactId>
diff --git a/pom.xml b/pom.xml
index 8d57aae..7ad5508 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
 
-    Copyright (c) 2022, 2025 Contributors to Eclipse Foundation.
+    Copyright (c) 2022, 2026 Contributors to Eclipse Foundation.
     Copyright (c) 2020, 2021 Payara Services Ltd.
     Copyright (c) 2010, 2020 Oracle and/or its affiliates. All rights reserved.
 
@@ -31,7 +31,7 @@
 
     <groupId>org.glassfish.hk2</groupId>
     <artifactId>hk2-parent</artifactId>
-    <version>3.1.2-SNAPSHOT</version>
+    <version>4.0.0-SNAPSHOT</version>
     <packaging>pom</packaging>
 
     <name>GlassFish HK2</name>
@@ -145,17 +145,21 @@
         <project.build.outputTimestamp>2023-10-04T08:38:05Z</project.build.outputTimestamp>
 
         <jakarta.activation.version>2.1.4</jakarta.activation.version>
-        <jakarta.annotation.version>2.1.1</jakarta.annotation.version>
+        <jakarta.annotation.version>3.0.0</jakarta.annotation.version>
+        <jakarta.enterprise.cdi-api.version>4.1.0</jakarta.enterprise.cdi-api.version>
+        <jakarta.servlet.version>6.1.0</jakarta.servlet.version>
         <jakarta.json.version>2.1.3</jakarta.json.version>
+        <jakarta.validation.version>3.1.1</jakarta.validation.version>
+        <jakarta.ws.rs.version>4.0.0</jakarta.ws.rs.version>
+        <jakarta.el.version>6.0.0</jakarta.el.version>
+
         <parsson.version>1.1.7</parsson.version>
         <jaxb-api.version>4.0.5</jaxb-api.version>
         <jaxb-runtime.version>4.0.6</jaxb-runtime.version>
-        <java.net.username>${user.name}</java.net.username>
-        <jakarta.enterprise.cdi-api.version>4.1.0</jakarta.enterprise.cdi-api.version>
-        <hibernate-validator.version>8.0.3.Final</hibernate-validator.version>
-        <jakarta.validation.version>3.1.1</jakarta.validation.version>
+        <hibernate-validator.version>9.1.0.Final</hibernate-validator.version>
+
         <glassfish.jakarta.el.version>4.0.2</glassfish.jakarta.el.version>
-        <jakarta.el.version>5.0.1</jakarta.el.version>
+
         <jtype.version>0.1.3</jtype.version>
         <javassist.version>3.30.2-GA</javassist.version>
         <junit.version>4.13.2</junit.version>
@@ -171,10 +175,8 @@
         <jersey.version>3.1.11</jersey.version>
         <grizzly.version>4.0.2</grizzly.version>
         <hamcrest.version>1.3</hamcrest.version>
-        <jakarta.servlet.version>6.0.0</jakarta.servlet.version>
-        <jakarta.ws.rs.version>3.1.0</jakarta.ws.rs.version>
         <classmate.version>1.7.3</classmate.version>
-        <springcontext.version>5.3.39</springcontext.version>
+        <springcontext.version>6.1.10</springcontext.version>
         <guice.version>7.0.0</guice.version>
         <protobuf.version>3.25.8</protobuf.version>
 
@@ -186,8 +188,6 @@
         <release.arguments />
 
         <manifest.location>target/classes/META-INF/MANIFEST.MF</manifest.location>
-        
-        <activate.securitymanager></activate.securitymanager>
     </properties>
 
     <dependencyManagement>
@@ -677,7 +677,7 @@
                 <plugin>
                     <groupId>org.apache.maven.plugins</groupId>
                     <artifactId>maven-shade-plugin</artifactId>
-                    <version>3.6.1</version>
+                    <version>3.6.2</version>
                 </plugin>
                 <plugin>
                     <groupId>org.apache.maven.plugins</groupId>
@@ -788,6 +788,7 @@
                         <java.util.logging.config.file>logging.properties</java.util.logging.config.file>
                         <net.bytebuddy.experimental>true</net.bytebuddy.experimental>
                     </systemPropertyVariables>
+                    <rerunFailingTestsCount>3</rerunFailingTestsCount>
                 </configuration>
             </plugin>
             <plugin>
@@ -950,4 +951,4 @@
             </build>
         </profile>
     </profiles>
-</project>
+</project>
\ No newline at end of file
diff --git a/spring-bridge/pom.xml b/spring-bridge/pom.xml
index 4322f82..855d557 100644
--- a/spring-bridge/pom.xml
+++ b/spring-bridge/pom.xml
@@ -24,7 +24,7 @@
     <parent>
         <groupId>org.glassfish.hk2</groupId>
         <artifactId>hk2-parent</artifactId>
-        <version>3.1.2-SNAPSHOT</version>
+        <version>4.0.0-SNAPSHOT</version>
     </parent>
 
     <groupId>org.glassfish.hk2</groupId>