Skip to content

Migrate Java 8 to Java 21: POM dependency and plugin updates (Steps 1-5)#3

Open
devin-ai-integration[bot] wants to merge 1 commit intomasterfrom
devin/1776249403-java8-to-java21-migration
Open

Migrate Java 8 to Java 21: POM dependency and plugin updates (Steps 1-5)#3
devin-ai-integration[bot] wants to merge 1 commit intomasterfrom
devin/1776249403-java8-to-java21-migration

Conversation

@devin-ai-integration
Copy link
Copy Markdown

@devin-ai-integration devin-ai-integration Bot commented Apr 15, 2026

Summary

Implements the first 5 steps of the Java 8 to Java 21 migration plan. All changes are POM-only — no source code changes are included; those will follow in subsequent steps.

Step Change File
1 Compiler source/target 1.821 pom.xml
2 javax.servlet-api 3.1.0 → jakarta.servlet-api 6.0.0; cdi-api 1.2 → jakarta.enterprise.cdi-api 4.0.1 (removed obsolete javax.el exclusion) jetty-maven-cdi/pom.xml
3 Jetty Maven plugin 9.2.5 → Jetty ee10 plugin 12.0.14 (groupId/artifactId changed) jetty-maven-cdi/pom.xml
4 weld-servlet 2.2.7 → weld-servlet-shaded 5.1.2 jetty-maven-cdi/pom.xml
5 maven-war-plugin 2.5 → 3.4.0 jetty-maven-cdi/pom.xml

Review & Testing Checklist for Human

  • Source files still use javax.* imports — this PR will intentionally break compilation until subsequent migration steps update the Java source to jakarta.*. Confirm this is acceptable as a staged migration.
  • Jetty 12 ee10 plugin configuration compatibility — the existing <contextXml> and <webApp><overrideDescriptor> config was kept as-is. Verify these config elements are still valid for jetty-ee10-maven-plugin:12.0.14.
  • Weld 5.x shaded artifact — confirm weld-servlet-shaded (vs the non-shaded weld-servlet-core) is the correct choice for the Jetty embedded use case.
  • Build verification on Java 21 — this was not build-tested against a Java 21 JDK. Recommend running mvn validate (or a full mvn compile after source migration) with JDK 21 locally.

Notes

  • The javax.el:javax.el-api exclusion was removed from the CDI dependency since it's no longer relevant in the Jakarta namespace.
  • Existing Jetty XML configuration files (jetty-context.xml, web-overwrite.xml) under src/main/webapp/WEB-INF/ may also need updates in a later step to align with Jetty 12 / Jakarta Servlet 6.

Link to Devin session: https://app.devin.ai/sessions/3e9efb42bb974fb3b1e09dab71b8ad67
Requested by: @tfaro52


Open with Devin

Step 1: Update maven.compiler.source/target from 1.8 to 21 in parent POM
Step 2: Migrate javax.servlet and javax.enterprise deps to jakarta equivalents
Step 3: Upgrade Jetty Maven plugin from 9.x to 12.x (ee10)
Step 4: Upgrade Weld from 2.x to 5.x (weld-servlet-shaded)
Step 5: Upgrade maven-war-plugin from 2.5 to 3.4.0

Co-Authored-By: tristan.farough <tfarough@gmail.com>
@devin-ai-integration
Copy link
Copy Markdown
Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

Copy link
Copy Markdown
Author

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 2 potential issues.

View 3 additional findings in Devin Review.

Open in Devin Review

Comment thread jetty-maven-cdi/pom.xml
Comment on lines +42 to +44
<groupId>org.eclipse.jetty.ee10</groupId>
<artifactId>jetty-ee10-maven-plugin</artifactId>
<version>12.0.14</version>
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 Jetty 12 ee10 plugin upgrade without updating XML configs that reference non-existent Jetty 9 classes

The Jetty plugin was upgraded from jetty-maven-plugin (Jetty 9) to jetty-ee10-maven-plugin (Jetty 12), but the XML configuration files still reference Jetty 9 class paths that don't exist in Jetty 12. Specifically, jetty-maven-cdi/src/main/webapp/WEB-INF/jetty-context.xml:3 and jetty-maven-cdi/src/main/webapp/WEB-INF/jetty-env.xml:3 both reference org.eclipse.jetty.webapp.WebAppContext, which in Jetty 12 ee10 has been relocated to org.eclipse.jetty.ee10.webapp.WebAppContext. Additionally, jetty-context.xml:6 references org.eclipse.jetty.servlet.ServletContextHandler.Decorator which has also been restructured. Both XML files also use the configure_9_0.dtd DOCTYPE which is obsolete in Jetty 12. This will cause the Jetty server to fail at startup with a ClassNotFoundException when processing these configuration files.

Prompt for agents
The Jetty plugin was upgraded to jetty-ee10-maven-plugin 12.0.14 but the XML configuration files were not updated for Jetty 12 compatibility.

Files that need updating:

1. jetty-maven-cdi/src/main/webapp/WEB-INF/jetty-context.xml:
   - Change Configure class from org.eclipse.jetty.webapp.WebAppContext to org.eclipse.jetty.ee10.webapp.WebAppContext
   - Update the DOCTYPE from configure_9_0.dtd to the Jetty 12 equivalent
   - The serverClasses / org.eclipse.jetty.servlet.ServletContextHandler.Decorator pattern needs to be updated for Jetty 12's new architecture (server class filtering works differently in Jetty 12)

2. jetty-maven-cdi/src/main/webapp/WEB-INF/jetty-env.xml:
   - Change Configure class from org.eclipse.jetty.webapp.WebAppContext to org.eclipse.jetty.ee10.webapp.WebAppContext
   - Update the DOCTYPE from configure_9_0.dtd to the Jetty 12 equivalent
   - Update javax.enterprise.inject.spi.BeanManager reference to jakarta.enterprise.inject.spi.BeanManager
   - Update the JNDI Resource class from org.eclipse.jetty.plus.jndi.Resource to the Jetty 12 equivalent

Refer to the Jetty 12 migration guide for the correct class paths and configuration format.
Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Acknowledged — this is intentionally deferred. The migration plan explicitly states to keep the existing <configuration> block as-is for now. The Jetty XML config file updates (jetty-context.xml, jetty-env.xml) — including class path relocations (org.eclipse.jetty.webapporg.eclipse.jetty.ee10.webapp), DOCTYPE updates, and javaxjakarta references — will be addressed in subsequent migration steps that handle source and configuration file changes.

Comment thread jetty-maven-cdi/pom.xml
Comment on lines +18 to +20
<groupId>jakarta.servlet</groupId>
<artifactId>jakarta.servlet-api</artifactId>
<version>6.0.0</version>
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 Jakarta Servlet 6.0 dependency without updating web.xml namespace from Java EE to Jakarta EE

The servlet dependency was upgraded to jakarta.servlet-api:6.0.0 (Jakarta EE 10), but jetty-maven-cdi/src/main/webapp/WEB-INF/web.xml:2-5 and jetty-maven-cdi/src/main/webapp/WEB-INF/web-overwrite.xml:2-5 still declare the old Java EE namespace (http://java.sun.com/xml/ns/javaee with version="3.0"). Jakarta EE 10 requires the namespace https://jakarta.ee/xml/ns/jakartaee with version="6.0". With the Jetty 12 ee10 environment, the old namespace may cause the web application descriptor to be rejected or misinterpreted at deployment time. Additionally, web-overwrite.xml:15 references javax.enterprise.inject.spi.BeanManager which should be jakarta.enterprise.inject.spi.BeanManager.

Prompt for agents
The servlet API was upgraded to Jakarta Servlet 6.0 but the web descriptor XML files still use the old Java EE namespace.

Files that need updating:

1. jetty-maven-cdi/src/main/webapp/WEB-INF/web.xml:
   - Change xmlns from http://java.sun.com/xml/ns/javaee to https://jakarta.ee/xml/ns/jakartaee
   - Change xsi:schemaLocation to reference https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/web-app_6_0.xsd
   - Change version from 3.0 to 6.0

2. jetty-maven-cdi/src/main/webapp/WEB-INF/web-overwrite.xml:
   - Same namespace and version updates as web.xml
   - Change javax.enterprise.inject.spi.BeanManager to jakarta.enterprise.inject.spi.BeanManager in the resource-env-ref-type element
Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Acknowledged — this is intentionally deferred. This PR implements only the first 5 steps of a staged migration plan, which are scoped to POM file changes only. The web descriptor XML namespace updates (web.xml, web-overwrite.xml) and the javax.enterprisejakarta.enterprise reference updates will be addressed in subsequent migration steps that cover the source/config file changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants