Upgrade to Java 21, Spring Security 7.0.4, Spring Framework 7.0.6 with Jakarta EE migration#1
Draft
Copilot wants to merge 4 commits into
Draft
Conversation
…karta namespace - Update Spring Framework BOM to 7.0.6 - Update Spring Security BOM to 7.0.4 - Update Java source/target to 21 - Migrate from javax.* to jakarta.* namespace - Vendor spring-security-oauth2 classes in openid-connect-oauth2-compat module - Replace log4j with logback - Update various dependency versions for compatibility - Update JUnit 4 to JUnit 5 (Jupiter) - Update Mockito to 5.x - Update Bouncy Castle to bcprov-jdk18on - Update HikariCP to 5.x - Update EclipseLink to 4.x (Jakarta EE 10) - Update nimbus-jose-jwt to 9.47 - Update Jackson to 2.17.2 - Update maven-compiler-plugin to 3.13.0 with release configuration Compat module compiles successfully. Additional fixes needed for: - HandlerInterceptorAdapter migration (Spring 6+ removed it) - Old Jackson 1 serializer annotations - HttpClient API updates - Remaining Spring Security 7 API changes Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Fix 'restTemplate = restTemplate {' → 'restTemplate = new RestTemplate() {'
- Fix self-assignment to 'restTemplate = new RestTemplate()'
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…stgresql to 42.7.2 Co-authored-by: trijeron <16278092+trijeron@users.noreply.github.com> Agent-Logs-Url: https://github.com/trijeron/OpenID-Connect-Java-Spring-Server/sessions/61f9e4ac-25a0-423e-aa73-dc89f62eabae
Copilot
AI
changed the title
[WIP] Upgrade project to Java 21 and Spring Security 7.0.4
Upgrade to Java 21, Spring Security 7.0.4, Spring Framework 7.0.6 with Jakarta EE migration
Mar 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Upgrades the full stack from Java 11 / Spring Security 5.5.2 / Spring Framework 5.3.9 to Java 21 / Spring Security 7.0.4 / Spring Framework 7.0.6, migrating all
javax.*→jakarta.*and replacing the abandonedspring-security-oauth2library. Project remains Maven multi-module, non-Boot.Build & Java
java-version11 → 21; all module compiler plugins switched to<release>flag.travis.ymlupdated tooraclejdk21Spring
spring-framework-bom5.3.9 → 7.0.6spring-security-bom5.5.2 → 7.0.4 (now bundlesspring-security-oauth2-authorization-server:7.0.4)Legacy OAuth2 migration
Removed
org.springframework.security.oauth:spring-security-oauth2:2.1.0.RELEASE(incompatible with Spring Security 6+). Created new moduleopenid-connect-oauth2-compatthat vendors the required interfaces and models fromspring-security-oauth2:2.5.2(ClientDetails, OAuth2Authentication, token services, approval handler, redirect resolver, etc.), updated for Jakarta namespace. All modules now depend on this compat module instead of the legacy artifact.Jakarta EE namespace
javax.servlet.*→jakarta.servlet.*,javax.persistence.*→jakarta.persistence.*,javax.annotation.*→jakarta.annotation.*javax.servlet:servlet-api→jakarta.servlet:jakarta.servlet-api:6.1.0,javax.servlet.jsp:jsp-api→jakarta.servlet.jsp:jakarta.servlet.jsp-api:4.0.0,org.eclipse.persistence:javax.persistence→jakarta.persistence:jakarta.persistence-api:3.2.0Dependency version bumps (security & compatibility)
com.google.code.gson:gsonmysql:mysql-connector-javacom.mysql:mysql-connector-j:8.2.0(multiple CVEs)org.postgresql:postgresqlbcprov-jdk15onbcprov-jdk18on:1.78.1mockito-all:1.9.5mockito-core:5.12.0Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
www.puppycrawl.com/opt/hostedtoolcache/CodeQL/2.24.3/x64/codeql/tools/linux64/java/bin/java /opt/hostedtoolcache/CodeQL/2.24.3/x64/codeql/tools/linux64/java/bin/java -jar /opt/hostedtoolcache/CodeQL/2.24.3/x64/codeql/xml/tools/xml-extractor.jar --fileList=/tmp/codeql-scratch-75eda6ce78446d68/dbs/java/working/files-to-index11750778231083057622.list --sourceArchiveDir=/tmp/codeql-scratch-75eda6ce78446d68/dbs/java/src --outputDir=/tmp/codeql-scratch-75eda6ce78446d68/dbs/java/trap/java k/OpenID-Connect-Java-Spring-Server/OpenID-Connect-Java-Spring-Server/openid-con-s p/bin/bash .java k/OpenID-Connectshow k/OpenID-Connectd074573de0c8b8e339add89a17a2bd000a1c6378:openid-connect-oauth2-compat/src/main/java/org/springframework/security/oauth2/common/util/Jackson2JsonParser.java k/OpenID-Connect-Java-Spring-Server/OpenID-Connect-Java-Spring-Server/openid-connect-common/src/main/java/org/mitre/openid/connect/service/OIDCTokenService.java k/Op�� ompat/src/main/java/org/springframework/security/oauth2/common/exceptions/UnauthorizedClientExceuname k/OpenID-Connect-Java-Spring-Server/OpenID-Connect-Java-Spring-Server/openid-connect-common/src/main/java/org/mishow de/node/bin/git dTokenException.bash ct/client/servic--norc ct/client/servic--noprofile sed(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
You are working in the forked repository
trijeron/OpenID-Connect-Java-Spring-Server(default branch:master, current head commit:d074573de0c8b8e339add89a17a2bd000a1c6378).Goal: Upgrade the project to:
Constraints:
Work items:
pom.xmlproperty<java-version>from 11 to 21.maven.compiler.release(21) where possible; otherwise ensure source/target are 21..travis.yml) to build with Java 21.pom.xmldependencyManagement:org.springframework:spring-framework-bomfrom 5.3.9 to a Spring Framework 6.1.x version compatible with Spring Security 7.org.springframework.security:spring-security-bomfrom 5.5.2 to 7.0.4.pom.xmlcurrently managesorg.springframework.security.oauth:spring-security-oauth2:2.1.0.RELEASE.spring-security-oauth2across modules (dependency declarations and code/config usage).jakarta.*APIs.javax.servlet.*,javax.*APIs that must becomejakarta.*equivalents (e.g., servlet, jsp, jstl, persistence where required), while keeping the project deployable as a traditional WAR.Key files already identified:
pom.xmlat commitd074573de0c8b8e339add89a17a2bd000a1c6378(blob sha3c223dae63b64ada2681676015bc2b6c4764028c).openid-connect-client/pom.xmlopenid-connect-common/pom.xmlDeliverable:
upgrade-spring-security-7-java21) intomasterwith all necessary changes and a clear description of what was upgraded and what was migrated.The following is the prior conversation context from the user's chat exploration (may be truncated):
User: I need coding agent to fork @mitreid-connect/OpenID-Connect-Java-Spring-Server into https://github.com/trijeron/connect-mitre/settings and then upgrade to spring-security 7.0.4 java 21. Project should stay as maven and spring-non-boot
Assistant: I can’t directly fork repos or change repository settings (like creating a fork under a different repo name via the GitHub UI), and I also can’t start code changes until the destination repository is unambiguous.
What I need from you (one-time clarifications)
trijeron/connect-mitre(i.e.,https://github.com/trijeron/connect-mitre)?/settings, which is a settings page, not the repo root.trijeron/connect-mitre, then I’ll create a branch and push upgrade commits.owner/repo.Once you confirm, I’ll do this
trijeron/connect-mitrepom.xmldependency versions (and plugin/toolchain config as needed)Reply with
owner/nameformat (likelytrijeron/connect-mitre)Then I’ll start by inspecting the repo contents and current Spring/Security versions.
User: @trijeron/connect-mitre and You fork it in the GitHub UI
Assistant: I can proceed with the Spring Security 7.0.4 + Java 21 upgrade, but I currently can’t access
trijeron/connect-mitrevia the GitHub tools (“resource not found or no access”). That usually means one of these is true:This pull request was created from Copilot chat.
💬 Send tasks to Copilot coding agent from Slack and Teams to turn conversations into code. Copilot posts an update in your thread when it's finished.