-
Notifications
You must be signed in to change notification settings - Fork 0
Upgrade to Java 21 #5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
f02b67b
2e40954
5892f17
afd7300
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| FROM openjdk:8-jre-alpine | ||
| FROM eclipse-temurin:21-jre-alpine | ||
|
|
||
| WORKDIR /swagger-petstore | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| FROM openjdk:11-jre-slim | ||
| FROM eclipse-temurin:21-jre | ||
|
|
||
| WORKDIR /swagger-petstore | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -39,18 +39,22 @@ | |
| <directory>target</directory> | ||
| <finalName>${project.artifactId}-${project.version}</finalName> | ||
| <plugins> | ||
| <plugin> | ||
| <groupId>org.apache.maven.plugins</groupId> | ||
| <artifactId>maven-war-plugin</artifactId> | ||
| <version>3.4.0</version> | ||
| </plugin> | ||
| <plugin> | ||
| <artifactId>maven-compiler-plugin</artifactId> | ||
| <version>3.11.0</version> | ||
| <configuration> | ||
| <source>1.8</source> | ||
| <target>1.8</target> | ||
| <release>21</release> | ||
| </configuration> | ||
| </plugin> | ||
| <plugin> | ||
| <groupId>org.codehaus.mojo</groupId> | ||
| <artifactId>build-helper-maven-plugin</artifactId> | ||
| <version>1.12</version> | ||
| <version>3.6.0</version> | ||
| <executions> | ||
| <execution> | ||
| <id>add-source</id> | ||
|
|
@@ -92,7 +96,7 @@ | |
| <plugin> | ||
| <groupId>org.apache.maven.plugins</groupId> | ||
| <artifactId>maven-jar-plugin</artifactId> | ||
| <version>2.6</version> | ||
| <version>3.4.1</version> | ||
| <configuration> | ||
| <excludes> | ||
| <exclude>**/logback.xml</exclude> | ||
|
|
@@ -149,7 +153,7 @@ | |
| </plugin> | ||
| <plugin> | ||
| <artifactId>maven-resources-plugin</artifactId> | ||
| <version>2.4.3</version> | ||
| <version>3.3.1</version> | ||
| <executions> | ||
| <execution> | ||
| <id>copy-resources</id> | ||
|
|
@@ -244,6 +248,7 @@ | |
| </dependencies> | ||
| <properties> | ||
| <maven-plugin-version>1.0.0</maven-plugin-version> | ||
| <maven.compiler.release>21</maven.compiler.release> | ||
| <swagger-parser-version>2.1.21</swagger-parser-version> | ||
| <swagger-core-version>2.2.17</swagger-core-version> | ||
| <jackson-version>2.16.1</jackson-version> | ||
|
Comment on lines
+251
to
254
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔴 Jetty 9.4 is not supported on Java 21, risking runtime failures from strong module encapsulation The PR upgrades the JDK from 8/11 to 21 in both Dockerfiles ( (Refers to lines 251-256) Prompt for agentsWas this helpful? React with 👍 or 👎 to provide feedback.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks — I investigated this concrete runtime claim empirically on JDK 21 before merging, and Jetty 9.4.53 runs cleanly here. Test (OpenJDK 21.0.11,
Server log contained no On the upgrade path: Jetty can't be bumped here without replacing the framework. The app is built on |
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚩 swagger-inflector 2.0.11 depends on javax.servlet which may conflict with Java 21
The
swagger-inflectorat version 2.0.11 (pom.xml:255) is built on thejavax.servletAPI. While the servlet API is bundled by Jetty/the WAR container (not the JDK), a future upgrade of Jetty to 11+ or 12 would require migrating tojakarta.servlet, which would in turn require a newer swagger-inflector or a different framework. This dependency chain makes the Jetty upgrade (needed for Java 21 compat) non-trivial.(Refers to line 255)
Was this helpful? React with 👍 or 👎 to provide feedback.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed on the analysis, and this is exactly why the PR intentionally stays on
javax.swagger-inflector2.0.11 isjavax.servlet/javax.ws.rs-only with no jakarta release, so the whole servlet stack (inflector + Jersey + Jetty) has to move together — which would mean replacing the core framework, not just bumping a dependency. That's a separate migration, out of scope for a Java-version upgrade.For Java 21 specifically it isn't required: the
javaxservlet stack on Jetty 9.4.53 builds and runs on JDK 21 (verified — see the runtime test in the sibling thread). The Java-EE modules that were actually removed from the JDK (JAXB) are already provided as explicitjavax.xml.bind/com.sun.xml.binddeps, so nothing is missing at runtime. Leaving this as a documented known follow-up rather than expanding this PR's scope.