gnodet opened a new pull request, #12465:
URL: https://github.com/apache/maven/pull/12465

   ## Summary
   
   - In `bin/mvn`, gate `$MAVEN_ARGS` inclusion on `MAVEN_MAIN_CLASS` equaling 
the default `MavenCling`. When `--up`, `--enc`, or `--shell` is used, the 
`handle_args` function sets `MAVEN_MAIN_CLASS` to a different class — skip 
`MAVEN_ARGS` in that case to avoid passing unrecognized build-specific flags 
(e.g. `-ntp`, `-T4`, `-U`) to sub-commands.
   - Apply the same fix in `bin/mvn.cmd` by clearing `MAVEN_ARGS` when the main 
class is not `MavenCling` (safe because the script runs inside `@setlocal`).
   - Debug logging (`MAVEN_DEBUG_SCRIPT`) is also updated to reflect the 
conditional behavior.
   
   Closes #12464
   
   ## Test plan
   
   - [x] Module builds successfully (`mvn verify -pl apache-maven`)
   - [ ] Run `MAVEN_ARGS="-ntp -T4" mvn --up check` — should no longer fail 
with unrecognized option errors
   - [ ] Run `MAVEN_ARGS="-ntp -T4" mvn clean install` — should still pass 
MAVEN_ARGS as before
   - [ ] Run `MAVEN_ARGS="-ntp" mvn --enc` — should not fail on `-ntp`
   - [ ] Verify `MAVEN_DEBUG_SCRIPT=1 mvn --up check` does not print MAVEN_ARGS 
in debug output
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)


-- 
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]

Reply via email to