Repository navigation
[Java 25] Upgrade to Java 25 and Spring Boot 4.1.2 - #392
shayanshafii wants to merge 15 commits into
Conversation
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>
…evin/java25-springboot-bankapp
…n/java25-springboot-bankapp
…devin/java25-springboot-bankapp
Co-Authored-By: shayan <shayan@cognition.ai>
…r' into devin/java25-springboot-bankapp
Co-Authored-By: shayan <shayan@cognition.ai>
…evin/java25-springboot-bankapp
…vin/java25-springboot-bankapp
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
Co-Authored-By: shayan <shayan@cognition.ai>
There was a problem hiding this comment.
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
| $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" | ||
| } |
There was a problem hiding this comment.
🟡 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.
| $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" | |
Was this helpful? React with 👍 or 👎 to provide feedback.
| void findByUsernameIsEmptyForUnknownUser() { | ||
| persistAccount("alice", "0"); | ||
|
|
||
| assertThat(accountRepository.findByUsername("bob")).isEmpty(); | ||
| assertThat(accountRepository.findByUsername("ALICE")).isEmpty(); |
There was a problem hiding this comment.
🔍 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.
Was this helpful? React with 👍 or 👎 to provide feedback.
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 oldmaven-compiler-pluginoverride forcedsource/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: removedhibernate.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")(AntPathRequestMatcherwas removed in Spring Security 7).var,List.of, acurrentAccount()helper. Public signatures unchanged.Dockerfile:maven:3.9-eclipse-temurin-25builder,eclipse-temurin:25-jre-alpineruntime (busyboxwgetstill present for the e2e health probe).vars/and new.github/workflows/build.ymluse JDK 25.AccountServiceTest,BankControllerWebTest,RepositoryJpaTest(1 → 45 tests). They pin current behavior, including quirks.Parity (before =
DevOps, after = this branch)./mvnw clean verify/register,/login,/dashboard,/deposit,/withdraw,/transactions,/logoutall return the same redirects/views; balance and transaction history correctNot changed
docker-compose.ymlhealthcheck still callscurl /actuator/health; it was already broken before this PR (no curl in alpine, no actuator). The e2e override uses awgetprobe of/login.AuthenticationProviderbean; left as is to avoid changing auth behavior.Security / license (Snyk)
pom.xmloverridesjackson-bom.version=3.1.8andlogback.version=1.6.5to clear a critical Jackson deserialization CVE and 2 logback CVEs in the Boot 4.1.2-managed versions. Snyk open issues: 153 onDevOps→ 1 here (jaxb-core XXE via Hibernate, also onDevOps, no fixed version yet).license/snykfails oncom.mysql:mysql-connector-j(GPL-2.0, issuesnyk:lic:maven:com.mysql:mysql-connector-j:GPL-2.0).DevOpsalready 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