Repository navigation
[Java 25] Build tooling & CI: Maven 3.9.16 wrapper, enforcer, GitHub Actions build - #387
Conversation
…ons build Co-Authored-By: shayan <shayan@cognition.ai>
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
| 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.
🟡 Relative Maven cache links resolve incorrectly
With a relative symbolic link for .m2, $MAVEN_WRAPPER_DISTS resolves against the project directory instead of the link’s parent. Existing Maven installations are missed, and offline builds fail even when the linked cache contains Maven.
Learn more
Windows symbolic links can store relative targets. The Target property exposes that stored target, which must be interpreted relative to the directory containing the link. Concatenating it directly with /wrapper/dists leaves a relative path that subsequent filesystem operations interpret from the build's working directory. The previous implementation retained the .m2 path and let Windows follow the link correctly. This also affects symbolic links supplied through MAVEN_USER_HOME.
Example: A developer creates C:\Users\Alice\.m2 pointing to the relative target maven-cache, with Maven already installed under C:\Users\Alice\maven-cache\wrapper\dists. Running the wrapper from C:\work\bankapp instead looks under C:\work\bankapp\maven-cache\wrapper\dists and attempts another download. Without network access, that build fails despite the existing installation.
Recommended fix: Resolve relative targets against the parent directory of $MAVEN_M2_PATH before constructing $MAVEN_WRAPPER_DISTS, while preserving absolute targets. Alternatively, retain the original Maven user directory path and let filesystem operations traverse its symbolic link. Validate both relative and absolute directory links on Windows PowerShell.
Was this helpful? React with 👍 or 👎 to provide feedback.
584bea7
into
devin/java25-springboot-bankapp
Summary
Build/CI slice of the Java 25 upgrade (targets the integration branch
devin/java25-springboot-bankapp).maven-wrapper-plugin:3.3.4:wrapper -Dmaven=3.9.16 -Dtype=only-script→ wrapper 3.3.4, Maven 3.9.16 (latest 3.9.x).mvnw/mvnw.cmdare the stock generated scripts.<build><plugins>only: addedmaven-enforcer-plugin(version managed by Spring Boot parent, resolves to 3.6.3) withrequireJavaVersion [25,)andrequireMavenVersion [3.9,). Dependencies/properties/parent untouched..github/workflows/build.yml:./mvnw -B clean verifyon Temurin 25 with Maven cache, on push toDevOpsand onpull_request.e2e.ymluntouched.Jenkinsfile,GitOps/Jenkinsfile,vars/*.groovy): no Java/JDK version references exist (Sonar/OWASP use named tool installations only), so no changes needed.Verification
./mvnw clean teston JDK 25./mvnw clean verifyon JDK 25./mvnw validateon JDK 21No functional/application changes; no endpoints affected.
Link to Devin session: https://devin-gtm.devinenterprise.com/sessions/78dcaa087d74417ea914c881e2088023
Open in Devin Desktop: https://devin-gtm.devinenterprise.com/desktop/session/78dcaa087d74417ea914c881e2088023?variant=devin
Requested by: @shayanshafii