elharo opened a new pull request, #281:
URL: https://github.com/apache/maven-remote-resources-plugin/pull/281

   Closes #273
   
   ## Test-first
   Added `RemoteResourcesMojoTest.testClassLoaderIsClosedAfterExecution()`, 
which executes the mojo against a bundle and then asserts that the plugin's 
`RemoteResourcesClassLoader` no longer serves resources from the bundle jars 
(i.e. it has been closed).
   
   Before the fix the mojo never even kept a reference to close, so the test 
fails.
   
   ## Fix
   `AbstractProcessRemoteResourcesMojo` now stores the 
`RemoteResourcesClassLoader` it creates and closes it in the `finally` block of 
`execute()` (after restoring the original context classloader), releasing the 
bundle jar file handles instead of leaking them per execution. The 
`initalizeClassloader` return type was narrowed to `RemoteResourcesClassLoader` 
to match.
   
   ## Verification
   - New test fails before the fix, passes after.
   - `mvn verify` passes (11 unit tests, RAT, checkstyle).
   - `mvn spotless:apply` reports no formatting changes.


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