slachiewicz opened a new pull request, #2340:
URL: https://github.com/apache/maven-resolver/pull/2340

   Follow-up to #2339 (same one-line fix, this time for `master`).
   
   Surefire sets `java.io.tmpdir` to `${project.build.directory}/surefire-tmp`, 
but `mvn clean` deletes that directory and nothing recreates it before tests 
run. The 1.9.x line hits a hard JDK 8 failure because 
`Files.createTempDirectory` resolves `java.io.tmpdir` at call time there 
(`#2339`); on master (JDK 21+) the JVM caches the default temp dir at startup, 
so the misconfiguration is latent rather than fatal.
   
   It is still a real problem on master: the tests contain many local 
workarounds, e.g. `Files.createDirectories(...) // hack for Surefire`, and 
`OriginScopedHeadersListenerTest` spells out the cause: *"Surefire sets it to 
target/surefire-tmp which is deleted by mvn clean"*, with a `mkdirs()` before 
starting Jetty's HttpClient so Brotli4j can extract its native library.
   
   Setting Surefire's `tempDir` to the same name makes Surefire create the 
directory it points `java.io.tmpdir` at. No change to where test temp files 
live; the existing workarounds are left intact and can be removed in a separate 
cleanup.
   
   Verified locally: `mvn -B -q clean verify -DskipITs` on JDK 21 (2419 test 
cases, 100 skipped) — green. (`mvn test` alone fails in 
`maven-resolver-transport-jdk` with the pre-existing MDEP-98 reactor-packaging 
issue, hence `verify`.)
   
   The failsafe config has the same pattern (`java.io.tmpdir` → 
`failsafe-tmp`); deliberately left out of this PR to keep it limited to the 
proven fix.


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