Skip to content

[Java 25] Upgrade to Java 25 and Spring Boot 4.1.2 - #392

Open
shayanshafii wants to merge 15 commits into
DevOpsfrom
devin/java25-springboot-bankapp
Open

shayanshafii wants to merge 15 commits into
DevOpsfrom
devin/java25-springboot-bankapp

Conversation

@shayanshafii

@shayanshafii shayanshafii commented Nov 19, 2026 •

Copy link
Copy Markdown

Summary

Upgrades the whole app from Java 17 / Spring Boot 3.3.3 to Java 25 (latest LTS) / Spring Boot 4.1.2: build, source, persistence, Docker, CI, tests and docs. No intended behavior change (same URLs, views, model attributes, security rules, DB schema).

Work was split across 6 parallel child PRs into this branch (#386 docs, #387 build/CI, #388 parity tests, #389 service/controller, #390 persistence, #391 Docker), after one serialized core commit.

Changes that are not obvious from the diff:

  • pom.xml: the old maven-compiler-plugin override forced source/target 1.8, so the app was effectively compiled as Java 8. It is removed; java.version=25. mysql:mysql-connector-java → com.mysql:mysql-connector-j. Maven enforcer now requires JDK 25 and Maven 3.9+.
  • application.properties: removed hibernate.dialect=org.hibernate.dialect.MySQL8Dialect. Hibernate 7 deleted that class and startup failed; the dialect is now auto-detected. useSSL=false → sslMode=DISABLED (same meaning, current Connector/J option name).
  • SecurityConfig: logoutRequestMatcher(new AntPathRequestMatcher("/logout")) → logoutUrl("/logout") (AntPathRequestMatcher was removed in Spring Security 7).
  • Service/controller: constructor injection, var, List.of, a currentAccount() helper. Public signatures unchanged.
  • Dockerfile: maven:3.9-eclipse-temurin-25 builder, eclipse-temurin:25-jre-alpine runtime (busybox wget still present for the e2e health probe).
  • Maven wrapper 3.9.7 → 3.9.16; Jenkins vars/ and new .github/workflows/build.yml use JDK 25.
  • New tests: AccountServiceTest, BankControllerWebTest, RepositoryJpaTest (1 → 45 tests). They pin current behavior, including quirks.

Parity (before = DevOps, after = this branch)

Check Before (Java 17 / Boot 3.3.3) After (Java 25 / Boot 4.1.2)
./mvnw clean verify pass pass
Tests run / passed 1 / 1 45 / 45
Cypress e2e (Docker stack) 13 / 13 13 / 13
MySQL 8 generated schema baseline identical (tables, columns, FK names)
Endpoints exercised on MySQL 8 — /register, /login, /dashboard, /deposit, /withdraw, /transactions, /logout all return the same redirects/views; balance and transaction history correct
Mismatches — none

Not changed

  • Root docker-compose.yml healthcheck still calls curl /actuator/health; it was already broken before this PR (no curl in alpine, no actuator). The e2e override uses a wget probe of /login.
  • Spring Security logs a warning about the explicit AuthenticationProvider bean; left as is to avoid changing auth behavior.

Security / license (Snyk)

  • pom.xml overrides jackson-bom.version=3.1.8 and logback.version=1.6.5 to clear a critical Jackson deserialization CVE and 2 logback CVEs in the Boot 4.1.2-managed versions. Snyk open issues: 153 on DevOps → 1 here (jaxb-core XXE via Hibernate, also on DevOps, no fixed version yet).
  • license/snyk fails on com.mysql:mysql-connector-j (GPL-2.0, issue snyk:lic:maven:com.mysql:mysql-connector-j:GPL-2.0). DevOps already ships the same driver and license at 8.0.33; this PR only bumps it to the Boot-managed 9.7.0. Clearing it needs a Snyk license ignore/policy, or swapping the JDBC driver.

Link to Devin session: https://devin-gtm.devinenterprise.com/sessions/a72362687cf642a7bd474c482f63756d
Open in Devin Desktop: https://devin-gtm.devinenterprise.com/desktop/session/a72362687cf642a7bd474c482f63756d?variant=devin
Requested by: @shayanshafii


Devin Review

devin-ai-integration Bot and others added 14 commits November 19, 2026 22:38
Co-Authored-By: shayan <shayan@cognition.ai>
Co-Authored-By: shayan <shayan@cognition.ai>
…ons build

Co-Authored-By: shayan <shayan@cognition.ai>
…y config

Constructor injection instead of field @Autowired, var, List.of, method
references for Spring Security configurers, and a currentAccount() helper
in BankController. No behavior changes.

Co-Authored-By: shayan <shayan@cognition.ai>
Co-Authored-By: shayan <shayan@cognition.ai>
Co-Authored-By: shayan <shayan@cognition.ai>
Co-Authored-By: shayan <shayan@cognition.ai>
@devin-ai-integration

Copy link
Copy Markdown

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

Co-Authored-By: shayan <shayan@cognition.ai>

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Note

Newer findings are available below. Devin Review posted a newer report on this PR, in addition to the findings presented here.

Devin Review found 1 potential issue.

Custom reviewers

  • ✨ Blast Radius Reviewer: no findings · View
  • 🛡️ API Security Reviewer: no findings · View
  • 🔒 Sparta Review Guardrails (from top PR comments): no findings · View

Devin Review

Comment thread mvnw.cmd
Comment on lines +91 to +96
$MAVEN_WRAPPER_DISTS = $null
if ((Get-Item $MAVEN_M2_PATH).Target[0] -eq $null) {
$MAVEN_WRAPPER_DISTS = "$MAVEN_M2_PATH/wrapper/dists"
} else {
$MAVEN_WRAPPER_DISTS = (Get-Item $MAVEN_M2_PATH).Target[0] + "/wrapper/dists"
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Misplaced Windows cache with relative symlinks

When Maven's cache directory is a relative symlink, Target[0] redirects the wrapper cache relative to the working directory. PowerShell returns the stored relative target, not a resolved path. Different checkouts download separate Maven installations instead of sharing the configured cache.

Learn more

The wrapper stores its downloaded Maven installation below the Maven user directory. A directory symlink can store a target relative to its own parent, but extracting that target loses the parent directory needed to interpret it. Subsequent filesystem commands interpret the extracted target relative to the process working directory instead. Keeping the original directory path lets Windows resolve the symlink correctly.

Example: C:\Users\alice\.m2 links to maven-cache, meaning C:\Users\alice\maven-cache. Running the wrapper from C:\work\bankapp instead places Maven below C:\work\bankapp\maven-cache. Running from another checkout downloads Maven again.

Recommended fix: Construct $MAVEN_WRAPPER_DISTS directly from $MAVEN_M2_PATH, preserving filesystem symlink resolution. Validate both ordinary cache directories and relative directory symlinks from two different working directories.

Suggested change
$MAVEN_WRAPPER_DISTS = $null
if ((Get-Item $MAVEN_M2_PATH).Target[0] -eq $null) {
$MAVEN_WRAPPER_DISTS = "$MAVEN_M2_PATH/wrapper/dists"
} else {
$MAVEN_WRAPPER_DISTS = (Get-Item $MAVEN_M2_PATH).Target[0] + "/wrapper/dists"
}
$MAVEN_WRAPPER_DISTS = "$MAVEN_M2_PATH/wrapper/dists"

Devin Review


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

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Devin Review found 1 potential issue.

Custom reviewers

  • ✨ Blast Radius Reviewer: no findings · View
  • 🛡️ API Security Reviewer: no findings · View
  • 🔒 Sparta Review Guardrails (from top PR comments): no findings · View

Devin Review

Comment on lines +59 to +63
void findByUsernameIsEmptyForUnknownUser() {
persistAccount("alice", "0");

assertThat(accountRepository.findByUsername("bob")).isEmpty();
assertThat(accountRepository.findByUsername("ALICE")).isEmpty();

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔍 Database-dependent username case assertion

Under case-insensitive MySQL collations, findByUsername("ALICE") finds the stored alice account, unlike this H2 assertion. Passing tests do not establish production parity for mixed-case username lookups.

Devin Review


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

This branch has not been deployed

No deployments
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.

1 participant