gnodet opened a new pull request, #13652:
URL: https://github.com/apache/maven/pull/13652
Fix Windows-only CI failures where jvm.config options were silently dropped,
causing `MavenITmng4559MultipleJvmArgsTest`,
`MavenITmng4559SpacesInJvmOptsTest`,
`MavenITmng6255FixConcatLines.testJvmConfigFileLF` and related tests to fail
with `expected: <ok> but was: <${prop}>`.
## Root cause
After commit b28f385ca5 (precompiled `JvmConfigParser`), the startup latency
dropped from ~450 ms (source-launch JVM) to ~30 ms. This made the Windows
Defender real-time scan lock race far more likely to be hit:
1. `JvmConfigParser` writes its output to a temp `.txt` file.
2. Windows Defender briefly holds a read lock on the new file.
3. `set /p JVM_CONFIG_MAVEN_OPTS=<"%JVM_CONFIG_TEMP%"` fails silently (or
emits
a "system cannot find the file" error) and leaves the variable empty.
4. The retry guard `if not defined JVM_CONFIG_MAVEN_OPTS` never fires because
`SET JVM_CONFIG_MAVEN_OPTS=` (earlier in the script) assigns an **empty
string**, and in cmd.exe an empty-string assignment counts as *defined*.
The net result: jvm.config options are dropped, `-D` properties never reach
the
Maven JVM, and tests that assert a property value see the unresolved literal
`${prop.name}`.
## Fix
Replace `if not defined JVM_CONFIG_MAVEN_OPTS` with
`if "%JVM_CONFIG_MAVEN_OPTS%"==""` — a string comparison that correctly
identifies the empty case and triggers the retry.
Also isolate the `MavenITmng6255FixConcatLines` test variants so each
line-ending variant (LF, CRLF, CR) writes its `.mvn/jvm.config` into its own
project copy (`mng-6255-lf/`, `mng-6255-crlf/`, etc.) rather than sharing a
single directory, preventing cross-contamination between sequential (and
future
parallel) test runs.
- [x] I hereby declare this contribution to be licensed under the [Apache
License Version 2.0, January 2004](https://www.apache.org/licenses/LICENSE-2.0)
--
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]