Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix class and resource loading in maven plugin (#20465) (CP: 24.5) #20518

Merged
merged 1 commit into from
Nov 20, 2024

Conversation

mcollovati
Copy link
Collaborator

Run Flow mojos using an isolated class loader that includes both project and plugin dependencies, with project dependencies taking precedence. This ensures that classes are always loaded from the same class loader at runtime, preventing errors where a class might be loaded by the plugin's class loader while one of its parent classes is only available in the project’s class loader (see #19616).

Additionally, this approach prevents the retrieval of resources from plugin dependencies when the same artifact is defined within the project (see #19009).

This refactoring also introduces caching for ClassFinder instances per execution phase, allowing multiple goals configured for the same phase to reuse the same ClassFinder. It also removes the need to instantiate a ClassFinder solely for Hilla class checks, reducing the number of scans performed during the build.

Fixes #19616
Fixes #19009
Fixes #20385

Run Flow mojos using an isolated class loader that includes both project and
plugin dependencies, with project dependencies taking precedence. This ensures
that classes are always loaded from the same class loader at runtime, preventing
errors where a class might be loaded by the plugin's class loader while one of
its parent classes is only available in the project’s class loader (see #19616).

Additionally, this approach prevents the retrieval of resources from plugin
dependencies when the same artifact is defined within the project (see #19009).

This refactoring also introduces caching for ClassFinder instances per
execution phase, allowing multiple goals configured for the same phase to reuse
the same ClassFinder. It also removes the need to instantiate a ClassFinder
solely for Hilla class checks, reducing the number of scans performed during
the build.

Fixes #19616
Fixes #19009
Fixes #20385
Copy link

sonarcloud bot commented Nov 20, 2024

Copy link

Test Results

1 147 files  + 1  1 147 suites  +1   1h 27m 43s ⏱️ + 1m 45s
7 480 tests + 4  7 430 ✅ + 4  50 💤 ±0  0 ❌ ±0 
7 856 runs  +36  7 796 ✅ +36  60 💤 ±0  0 ❌ ±0 

Results for commit 7e26f8f. ± Comparison against base commit 3c49893.

@mcollovati mcollovati merged commit 233a222 into 24.5 Nov 20, 2024
26 checks passed
@mcollovati mcollovati deleted the cherry/cherrypick-20465-to-24.5 branch November 20, 2024 10:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants