gnodet commented on PR #13602:
URL: https://github.com/apache/maven/pull/13602#issuecomment-6533911981

   <!-- hermes-bot -->
   
   ## CI fix pushed
   
   Three ITs were failing with "Maven dependency injection failed for at least 
one of the registered core extension":
   - `MavenITmng8655SettingsParserTest.coreRealmParserReadsBootstrapSettings`
   - `MavenITmng8220ExtensionWithDITest.testitModel`
   - `MavenITmng8385PropertyContributoSPITest.testIt`
   
   **Root cause:** `InjectorImpl.discover()` was changed from:
   ```java
   URLConnection connection = url.openConnection();
   connection.setUseCaches(false);  // JDK-8239054: closing stream releases JAR
   try (InputStream is = connection.getInputStream();
   ```
   to:
   ```java
   try (InputStream is = url.openStream();
   ```
   
   With JVM URL caching enabled (the default), `openStream()` on a `jar:` URL 
shares a cached `ZipFile` handle across all callers. The ITs run in parallel 
and share extension JARs from the same local repository path (notably Mimir's 
extension). When one thread closes the stream, the cached connection is 
returned to the pool and another thread's read from the same handle fails with 
`ZipException: zip file closed` — which propagates up as a `DIException`, 
caught by `configure()`, and reported as a DI failure (Maven exit code 2).
   
   **Fix:** Restored `setUseCaches(false)` with an uncached `URLConnection` 
(39c952afa2b3). This ensures each `discover()` call gets its own independent 
JAR stream, consistent with the original code and JDK-8239054.


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