Repository: avaje/avaje-inject
Pull request #789 (2025-03-31 14:33:10)

Fix Jex Request-Scoped Context
As the title says

SentryMan: @rbygrave you'll have to change the branch protection rule
rbygrave: > you'll have to change the branch protection rule

Meaning that you can't do something and you need it to change.

What can't you do?
How do you need it to change?
SentryMan: So that JDK 11 is not required 


Patch:
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 5298286b..19998b3c 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -12,7 +12,7 @@ jobs:
     strategy:
       fail-fast: false
       matrix:
-        java_version: [11,17,21]
+        java_version: [21]
         os: [ubuntu-latest]
 
     steps:
diff --git a/inject-generator/pom.xml b/inject-generator/pom.xml
index 70ddba09..9c2dc480 100644
--- a/inject-generator/pom.xml
+++ b/inject-generator/pom.xml
@@ -43,7 +43,7 @@
     <dependency>
       <groupId>io.avaje</groupId>
       <artifactId>avaje-http-api</artifactId>
-      <version>3.1</version>
+      <version>3.2</version>
       <optional>true</optional>
       <scope>provided</scope>
     </dependency>
@@ -59,7 +59,7 @@
     <dependency>
       <groupId>io.avaje</groupId>
       <artifactId>avaje-http-client</artifactId>
-      <version>3.1</version>
+      <version>3.2</version>
       <scope>test</scope>
     </dependency>
 
diff --git a/inject-generator/src/main/java/io/avaje/inject/generator/RequestScope.java b/inject-generator/src/main/java/io/avaje/inject/generator/RequestScope.java
index 674caf80..b18faa72 100644
--- a/inject-generator/src/main/java/io/avaje/inject/generator/RequestScope.java
+++ b/inject-generator/src/main/java/io/avaje/inject/generator/RequestScope.java
@@ -8,7 +8,7 @@ import java.util.Map;
  */
 final class RequestScope {
 
-  private static final String JEX_CONTEXT = "io.avaje.jex.Context";
+  private static final String JEX_CONTEXT = "io.avaje.jex.http.Context";
   private static final String JAVALIN_CONTEXT = "io.javalin.http.Context";
   private static final String HELIDON_REQ = "io.helidon.webserver.ServerRequest";
   private static final String HELIDON_RES = "io.helidon.webserver.ServerResponse";


Test patch:
diff --git a/inject-test/pom.xml b/inject-test/pom.xml
index 3b64dbad..88656fce 100644
--- a/inject-test/pom.xml
+++ b/inject-test/pom.xml
@@ -77,21 +77,28 @@
     <dependency>
       <groupId>io.avaje</groupId>
       <artifactId>avaje-http-api</artifactId>
-      <version>3.1</version>
+      <version>3.2</version>
       <scope>test</scope>
     </dependency>
 
     <dependency>
       <groupId>io.avaje</groupId>
       <artifactId>avaje-http-client</artifactId>
-      <version>3.1</version>
+      <version>3.2</version>
       <scope>test</scope>
     </dependency>
 
     <dependency>
       <groupId>io.avaje</groupId>
       <artifactId>avaje-jex</artifactId>
-      <version>2.5</version>
+      <version>3.0</version>
+      <scope>test</scope>
+    </dependency>
+    
+    <dependency>
+      <groupId>io.avaje</groupId>
+      <artifactId>avaje-jsonb</artifactId>
+      <version>3.2</version>
       <scope>test</scope>
     </dependency>
 
diff --git a/inject-test/src/test/java/org/example/custom/CustomScopeTest.java b/inject-test/src/test/java/org/example/custom/CustomScopeTest.java
index 83c80409..cf2d67b6 100644
--- a/inject-test/src/test/java/org/example/custom/CustomScopeTest.java
+++ b/inject-test/src/test/java/org/example/custom/CustomScopeTest.java
@@ -1,18 +1,19 @@
 package org.example.custom;
 
-import io.avaje.inject.BeanEntry;
-import io.avaje.inject.BeanScope;
+import static java.util.stream.Collectors.toList;
+import static org.assertj.core.api.Assertions.assertThat;
+
+import java.util.List;
+import java.util.Optional;
+
 import org.example.MyCustomScope;
 import org.example.coffee.CoffeeMaker;
 import org.example.custom.loc.LocalExternal;
 import org.junit.jupiter.api.Test;
 import org.mockito.Mockito;
 
-import java.util.List;
-import java.util.Optional;
-
-import static java.util.stream.Collectors.toList;
-import static org.assertj.core.api.Assertions.assertThat;
+import io.avaje.inject.BeanEntry;
+import io.avaje.inject.BeanScope;
 
 class CustomScopeTest {
 
@@ -80,7 +81,7 @@ class CustomScopeTest {
 
       // includes the 2 supplied beans
       final List<BeanEntry> all = beanScope.all();
-      assertThat(all).hasSize(7);
+      assertThat(all).hasSize(8);
 
       final CustomBean customBean = beanScope.get(CustomBean.class);
 
diff --git a/inject-test/src/test/java/org/example/request/JexController.java b/inject-test/src/test/java/org/example/request/JexController.java
index ae97d57f..8cc8a9c5 100644
--- a/inject-test/src/test/java/org/example/request/JexController.java
+++ b/inject-test/src/test/java/org/example/request/JexController.java
@@ -2,8 +2,7 @@ package org.example.request;
 
 
 import io.avaje.http.api.Controller;
-import io.avaje.jex.Context;
-
+import io.avaje.jex.http.Context;
 import jakarta.inject.Inject;
 
 @Controller
diff --git a/inject-test/src/test/java/org/example/request/JexControllerTest.java b/inject-test/src/test/java/org/example/request/JexControllerTest.java
index 33f71514..adedce41 100644
--- a/inject-test/src/test/java/org/example/request/JexControllerTest.java
+++ b/inject-test/src/test/java/org/example/request/JexControllerTest.java
@@ -1,7 +1,7 @@
 package org.example.request;
 
 import io.avaje.inject.xtra.ApplicationScope;
-import io.avaje.jex.Context;
+import io.avaje.jex.http.Context;
 import org.junit.jupiter.api.Test;
 import org.mockito.Mockito;