melloware opened a new pull request, #1144: URL: https://github.com/apache/myfaces/pull/1144
## Summary [MYFACES-4784](https://issues.apache.org/jira/browse/MYFACES-4784) Faces 5.0 targets Jakarta EE 12. This PR: 1. Moves the Quarkus extension to **Quarkus 4.0.0** (GA, EE12-based). 2. Compiles MyFaces against **CDI 5.0.0**. 3. Fixes `DefaultELResolverBuilder`, which called `BeanManager.getELResolver()`. **CDI 5.0 removed that method.** 4. Raises the minimum Java version to **21** across the build and CI. Both Quarkus 4 and Jakarta EE 12 require it. ## 1. `BeanManager.getELResolver()` was removed in CDI 5.0 Quarkus 4 depends on CDI 5.0.0 (`jakarta.cdi:jakarta.cdi-api`). In CDI 5.0, `BeanManager` no longer has any EL methods. EL integration is now only in the separate `jakarta.cdi:jakarta.cdi-el-api` artifact, through `jakarta.enterprise.inject.spi.el.ELAwareBeanManager`. The package name hasn't changed since 4.1. `DefaultELResolverBuilder.getCDIELResolver()` had a latent bug. It checked `instanceof ELAwareBeanManager` but then called `beanManager.getELResolver()` on the plain `BeanManager` type anyway, and called it again unconditionally on the last line. Against the CDI 5 API that does not compile, and on a CDI 5 runtime it would throw `NoSuchMethodError`. **New behaviour** (`impl/src/main/java/org/apache/myfaces/el/DefaultELResolverBuilder.java`): - If `ELAwareBeanManager` is on the classpath and the bean manager implements it, the method casts to it and calls `getELResolver()` (pattern-matching `instanceof`). - Otherwise it calls `getELResolver()` reflectively. This covers older CDI containers whose `BeanManager` still has the deprecated method. - If neither works, it throws an `IllegalStateException` with a clear message instead of a `NoSuchMethodError`. **Quarkus impact:** `QuarkusELResolverBuilder` already overrides `getCDIELResolver()` with its own `QuarkusCdiELResolver`, so this code path isn't used on Quarkus. The only change there is a javadoc `{@link}` that pointed at the removed method. ### Points for review - **The reflective fallback.** It is only for CDI < 4.1 runtimes, and it only matters if we still want to run on CDI 4.0. If Faces 5.0 formally requires CDI 5 (EE12), we could delete the fallback and the `ExternalSpecifications.isCDI41Available()` check. Removing them would make `jakarta.cdi-el-api` a hard runtime requirement for the CDI resolver. - **The README's "CDI 4.0+" minimum.** I left it alone, because the fallback keeps CDI 4.0 working. ## 2. CDI API 5.0.0 The CDI API's Maven coordinates moved. The old `jakarta.enterprise:jakarta.enterprise.cdi-api:5.0.0` is only a relocation pom. | Before | After | |---|---| | `jakarta.enterprise:jakarta.enterprise.cdi-api:4.1.0` | `jakarta.cdi:jakarta.cdi-api:5.0.0` | | `jakarta.enterprise:jakarta.enterprise.cdi-el-api:4.1.0` | `jakarta.cdi:jakarta.cdi-el-api:5.0.0` | Updated in `parent/pom.xml` (dependencyManagement), `api`, `impl`, `bundle`, and `integration-tests`. Because MyFaces now compiles against the EE12 API, any remaining use of a removed CDI method would fail the build. Apart from `getELResolver()` there were none. **Not changed:** `benchmark/pom.xml` keeps CDI 4.1.0. It runs on Weld 6, which implements CDI 4.1, and it isn't part of the reactor. Only its Java release was raised to 21. ## 3. Quarkus 3.27.1 → 4.0.0 | File | Change | |---|---| | `extensions/quarkus/pom.xml` | `quarkus.version` 3.27.1 → 4.0.0 | | `extensions/quarkus/showcase/pom.xml` | `quarkus-junit5` → `quarkus-junit` (renamed in Quarkus 4) | | `extensions/quarkus/showcase/pom.xml` | Override `junit-jupiter-api` to 6.1.3. The parent pom pins 5.13.4, and that direct dependencyManagement entry wins over the imported Quarkus BOM, which caused a JUnit 5/6 mismatch (`NoClassDefFoundError`) when surefire started. | | `extensions/quarkus/showcase/pom.xml` | surefire/failsafe 3.2.5 → 3.5.4 | | `extensions/quarkus/showcase/pom.xml` | `quarkus-maven-plugin` gets `<extensions>true</extensions>`, as in Quarkus 4 app projects | | `extensions/quarkus/showcase/pom.xml` | Native profile: removed `quarkus.package.type=native` → `quarkus.native.enabled=true` | | `showcase/.../application.properties` | `quarkus.log.file.enable` → `quarkus.log.file.enabled`. Quarkus 4 ignores the old name and logs a warning. | I checked the runtime and deployment modules against the other Quarkus 4 breaking changes, and none apply: - `QuarkusUnitTest` → `QuarkusExtensionTest`: not used. - Dev UI `JsonRPCProvidersBuildItem` package move: not used. - Jackson 3: not used. - Legacy `META-INF/native-image/*-config.json`: none shipped. - Regex resource patterns → globs: `NativeImageResourceBuildItem` only uses literal paths. - `query*` reflection flags and `lambdaCapturingTypes`: not used. ## 4. Java 21 - `pom.xml`, `parent/pom.xml`, `integration-tests/pom.xml`: `java.version` 17 → 21. - `benchmark/pom.xml`: `maven.compiler.release` 17 → 21. - `extensions/quarkus/showcase/pom.xml`: `java.version` 17 → 21. - `README.md`: minimum requirement "Java 17+" → "Java 21+". - CI: - `.github/workflows/myfaces-ci.yml`: JDK 17 → 21. - `.github/workflows/codeql-analysis.yml`: JDK 17 → 21. - `Jenkinsfile`: `jdk_17_latest` → `jdk_21_latest` (build matrix and deploy stage). ## Testing Run locally with Temurin 25, compiling for release 21: | What | Result | |---|---| | `mvn clean install`, all reactor modules | ✅ Build | | `impl` tests | ✅ 1787 run, 0 failures, 2 skipped | | Quarkus showcase tests (`@QuarkusTest`) on Quarkus 4.0.0 | ✅ 3 pass, 1 skipped (already `@Disabled`, HtmlUnit websocket) | | `integration-tests` (`test-compile`) | ✅ Compiles | | Native image (`-Dnative`, mandrel container build) | ⚠️ **Not run.** Docker wasn't available locally. Quarkus 4 requires a Mandrel/GraalVM 25 builder, which the container build picks automatically. Please check the native build in CI or by hand. | 🤖 Generated with [Claude Code](https://claude.com/claude-code) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
