Skip to content

Discover Maven and JDK 25 when they are not on PATH - #695

Open
AMDphreak wants to merge 1 commit into
asciidocfx:masterfrom
AMDphreak:fix/afx-run-discover-maven
Open

Discover Maven and JDK 25 when they are not on PATH#695
AMDphreak wants to merge 1 commit into
asciidocfx:masterfrom
AMDphreak:fix/afx-run-discover-maven

Conversation

@AMDphreak

Copy link
Copy Markdown

Summary

Hi! On Windows, a PATH-only Maven lookup fails even when Maven is installed. This repo does not ship mvnw, and a packaged JDK 24 (Adoptium, for example) is often on PATH while the project wants JDK 25.

This PR tries to make scripts/afx-run.ps1 and scripts/afx-run.sh find tools for this project:

  • Wrapper in the repo (mvnw / mvnw.cmd), if someone adds one later
  • Project pins: mise which mvn when mise.toml exists and mise is installed; sdkman candidates when .sdkmanrc exists
  • Optional workstation tools hive (CODE_ROOT / C:\code / Z:\codetools/apache-maven-* and tools/jdk-25)
  • mvn on PATH last
  • Print Using: ... (and JAVA_HOME) so the next failure is obvious

Hive paths are a fallback, not a hard dependency. The scripts do not download Maven and do not add a wrapper binary tree.

Happy to adjust anything that doesn't fit the project's taste.

Fixes #694

How to try it

  1. Leave Maven off PATH (Get-Command mvn empty) and, if you have one, put Maven under tools/apache-maven-3.9.6 of your code hive — or rely on mise / sdkman / PATH.
  2. Run .\scripts\afx-run.ps1 or ./scripts/afx-run.sh.
  3. Confirm the first lines name the Maven binary and JDK 25 home you expected, then Ctrl+C before spring-boot:run finishes if you only wanted the lookup.

Made with Cursor

…tall when they are not on PATH.

Co-authored-by: Cursor <cursoragent@cursor.com>
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.

scripts/afx-run.ps1 fails with Maven not found when Maven is off PATH

1 participant