fix: Prevent stale JAR cache in Reflector under Maven daemon (mvnd)#23863
Draft
mcollovati wants to merge 1 commit intoissue/15458-gradle_plugin_scan_jars_issuefrom
Draft
fix: Prevent stale JAR cache in Reflector under Maven daemon (mvnd)#23863mcollovati wants to merge 1 commit intoissue/15458-gradle_plugin_scan_jars_issuefrom
Reflector under Maven daemon (mvnd)#23863mcollovati wants to merge 1 commit intoissue/15458-gradle_plugin_scan_jars_issuefrom
Conversation
Mirror the Gradle daemon fix (33fa374) in the Maven plugin's `Reflector` and `ReflectorClassLoader`/`CombinedClassLoader`: - Extract `ReflectionsClassFinder.disableJarCaching()` as a public utility so both plugins can reuse it. - Wrap `jar:` URLs in `ReflectorClassLoader.getResource()` and `getResources()` (flow-maven-plugin) and `CombinedClassLoader` (flow-dev-bundle-plugin) with `useCaches(false)` to prevent stale `JarFileFactory` entries across daemon builds. - Make `Reflector` implement `Closeable` with a `close()` method that releases the `URLClassLoader` file handles, and register a `Cleaner` action for best-effort GC cleanup of abandoned instances. - Close the temporary `Reflector` in `FlowModeAbstractMojo.isHillaAvailable(MavenProject)` via try-with-resources. Releated to #15458
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Mirror the Gradle daemon fix (33fa374) in the Maven plugin's
ReflectorandReflectorClassLoader/CombinedClassLoader:ReflectionsClassFinder.disableJarCaching()as a public utility so both plugins can reuse it.jar:URLs inReflectorClassLoader.getResource()andgetResources()(flow-maven-plugin) andCombinedClassLoader(flow-dev-bundle-plugin) withuseCaches(false)to prevent staleJarFileFactoryentries across daemon builds.ReflectorimplementCloseablewith aclose()method that releases theURLClassLoaderfile handles, and register aCleaneraction for best-effort GC cleanup of abandoned instances.ReflectorinFlowModeAbstractMojo.isHillaAvailable(MavenProject)via try-with-resources.Related to #15458