Bundle jersey-cdi-rs-inject to allow @Inject of Jakarta REST artifacts#26079
Bundle jersey-cdi-rs-inject to allow @Inject of Jakarta REST artifacts#26079renatsaf wants to merge 4 commits into
Conversation
The module was removed in the past because it made GlassFish fail the CDI TCK test ProcessBeanAttributesNotFiredForBuiltinBean (jakartaee/cdi-tck#474). That test was fixed by jakartaee/cdi-tck#475 to only assert on beans with the @default qualifier, so the module can be restored. The rest_cdi TCK war now uses the server-provided module instead of bundling its own copy. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The Jakarta REST TCK 4.0.0 artifact is built for JUnit 5. Since the GlassFish parent moved dependency management to JUnit 6, test discovery in this module fails with NoClassDefFoundError (jupiter-api 5.10.2 mixed with engine 6.x). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
@dmatej , @arjantijms , can you verify that this PR passes the Jakarta EE TCK (at least CDI and REST), and also MP REST Client TCK? |
| <glassfish.home>${glassfish.root}/glassfish8</glassfish.home> | ||
| </properties> | ||
|
|
||
| <!-- The Jakarta REST TCK 4.0.0 is built for JUnit 5. Pin all JUnit artifacts to JUnit 5 |
There was a problem hiding this comment.
Is this really needed, @dmatej ? Do we use this runner nowadays?
| @@ -1,3 +1,19 @@ | |||
| // | |||
There was a problem hiding this comment.
We don't add copyright headers to adoc files, please remove this header.
| @@ -1,3 +1,19 @@ | |||
| // | |||
There was a problem hiding this comment.
We don't add copyright headers to adoc files, please remove this header.
| * xref:embedded-server-guide.adoc#running-from-command-line[Runnable Embedded GlassFish JAR] (since {productName} 7.0.18) | ||
| * xref:administration-guide.adoc#log-executed-admin-commands[Admin Command Logger] (since {productName} 7.0.16) | ||
| * https://github.com/eclipse-ee4j/glassfish/discussions/25343[SSH nodes on Windows] via the native Windows SSH service (since {productName} 7.0.23) | ||
| * xref:application-development-guide.adoc#injecting-jakarta-rest-artifacts-with-cdi[CDI injection of Jakarta REST artifacts] using `@Inject` via the bundled Jersey `jersey-cdi-rs-inject` extension (since {productName} {product-majorVersion}.0.4) |
There was a problem hiding this comment.
Version 8.0.4 should never change, while {product-majorVersion} will change when Glassfish 9 is released.
| * xref:application-development-guide.adoc#injecting-jakarta-rest-artifacts-with-cdi[CDI injection of Jakarta REST artifacts] using `@Inject` via the bundled Jersey `jersey-cdi-rs-inject` extension (since {productName} {product-majorVersion}.0.4) | |
| * xref:application-development-guide.adoc#injecting-jakarta-rest-artifacts-with-cdi[CDI injection of Jakarta REST artifacts] using `@Inject` via the bundled Jersey `jersey-cdi-rs-inject` extension (since {productName} 8.0.4) |
…se notes Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
I believe it is not required, the issue was created for a milestone, while 8.0 0 already passed all tck tests without this. Also we already use later junit if I remember well. EDIT: aha, I read the description why this, I will check tomorrow, now I read this on a cell phone. |
Restores the Jersey module
org.glassfish.jersey.ext.cdi:jersey-cdi-rs-injectin the web featureset, so Jakarta REST artifacts (UriInfo,Sse,SecurityContext, ...) can be injected with the standard CDI@Injectannotation — including constructor injection, which@Contextcannot offer for CDI/EJB-managed resources.As discussed with @OndroMih in #25323, the original reason for removing the module is gone:
@JerseyContext-qualifiedHttpServletRequestproducer tripped the CDI TCK testProcessBeanAttributesNotFiredForBuiltinBean.@Default-qualified beans). GlassFish runs CDI TCK 4.1.0, which includes the fix.Changes
jersey-cdi-rs-injectinappserver/featuresets/web/pom.xml(uncommented; the stale comment now explains the history). The module lands inmodules/of both the full and web-profile distributions.providedscope, so the test WAR exercises the server-bundled module instead of shipping its own copy (verified: the deployed WAR has noWEB-INF/lib).appserver/tests/tck/rest/pom.xml. The Jakarta REST TCK 4.0.0 artifact is built for JUnit 5; after the parent moved dependency management to JUnit 6, test discovery in this module failed withNoClassDefFoundErrorbefore any test ran. This pin was needed to be able to run the suite for this PR at all.TCK verification (local, Windows, JDK 21)
ProcessBeanAttributesNotFiredForBuiltinBean), model + signature passedFixes #25323
🤖 Generated with Claude Code