slachiewicz opened a new pull request, #13736: URL: https://github.com/apache/maven/pull/13736
`InjectorImpl.discover`, `CoreExtensionEntry.discoverFrom` and `PluginDescriptor.getLifecycleMappings` read resources from plugin and extension jars with `URL.openStream()`. That leaves each jar open in the JVM-wide `jar:` cache after its class realm is disposed ([JDK-8239054](https://bugs.openjdk.org/browse/JDK-8239054)), so under mvnd a plugin rebuilt in the reactor is read stale or, on Windows, cannot be overwritten. `discover` runs for every plugin realm, so this covers every Maven 4 DI plugin. The connections are now uncached, so closing the stream closes the jar. Verified: `InjectorImplTest.discoverReadsRewrittenJar` fails on master with `EOFException: Unexpected end of ZLIB input stream` and passes here. The 3.x part (`PluginDescriptor` and `CoreExtensionEntry`) goes to maven-3.10.x in a separate PR; please also backport this to maven-4.0.x. --- To make clear that you license your contribution under the [Apache License Version 2.0, January 2004](https://www.apache.org/licenses/LICENSE-2.0) check one of the following: - [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) - [x] I hereby declare that I have filed an [Apache Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf). -- 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]
