slachiewicz opened a new issue, #338:
URL: https://github.com/apache/maven-remote-resources-plugin/issues/338

   `process` reads the bundle manifests with `url.openStream()` 
([`AbstractProcessRemoteResourcesMojo.java`](https://github.com/apache/maven-remote-resources-plugin/blob/master/src/main/java/org/apache/maven/plugin/resources/remote/AbstractProcessRemoteResourcesMojo.java#L1071))
 and plain bundle resources with `FileUtils.copyURLToFile(url, ...)`. Both go 
through `JarURLConnection` with the default URL cache, so each bundle jar stays 
open in the JVM after the mojo finishes, even though the plugin's class loader 
is now closed (#281).
   
   Two consequences:
   
   - On Windows the jars are locked for the life of the JVM. In a plain build 
that is the rest of the build; with mvnd it is the daemon's lifetime, so a 
bundle in `~/.m2` cannot be replaced or deleted while the daemon runs. The 
JUnit 5 test migration (#336) hits this when JUnit deletes the temporary local 
repository.
   - A bundle jar rewritten at the same path during the JVM's life is read 
through the stale cached handle. Two unit tests that built the same bundle 
version failed with `java.io.EOFException: Unexpected end of ZLIB input stream`.
   
   Opening these URLs with `URLConnection.setUseCaches(false)` closes the jar 
together with the stream.
   


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