ascheman commented on PR #13269: URL: https://github.com/apache/maven/pull/13269#issuecomment-5828683788
Looks good, and it lines up with the dev@ consensus on the "Print usage when no arguments are given" thread — POM present → the default goal (if any) still runs, otherwise print usage. Keying the Java check on POM presence rather than trying to detect a default goal also neatly side-steps the "detecting a default goal needs the built model, very early in startup" concern raised there. 👍 One cross-platform gap: the `[ERROR]` reformatting of the `-f`/`--file` messages landed in the Unix `mvn` script but not in the Windows launcher `mvn.cmd`, which carries the same two messages (`:process_file_arg`): ```bat echo POM file "%FILE_ARG%" specified the -f/--file command-line argument does not exist >&2 echo Directory "%POM_DIR%" extracted from the -f/--file command-line argument "%FILE_ARG%" does not exist >&2 ``` So Windows users still get the un-prefixed form. Those should become: ```bat echo [ERROR] POM file "%FILE_ARG%" specified with the -f/--file command-line argument does not exist >&2 echo [ERROR] Directory "%POM_DIR%" extracted from the -f/--file command-line argument "%FILE_ARG%" does not exist >&2 ``` (also fixes a stray `specified the` → `specified with the`, matching the Unix wording). I'd have made these one-click `suggestion`s, but `mvn.cmd` isn't part of this PR's diff, so GitHub won't let me anchor a suggestion there — if you add the file they can be applied directly. The harder half of your Unix change needs no Windows counterpart, though: the subshell-exit propagation (so a bad `-f` aborts instead of continuing and printing the error twice) has nothing to fix in `mvn.cmd` — it already aborts on a bad `-f` via `goto error`, so it never had the double-error behavior. Only the `[ERROR]` prefix is missing there. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
