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.4) #20519

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 119 files  +1  1 119 suites  +1   1h 19m 7s ⏱️ - 2m 0s
7 093 tests +4  7 044 ✅ +4  49 💤 ±0  0 ❌ ±0 
7 466 runs  +4  7 405 ✅ +4  61 💤 ±0  0 ❌ ±0 

Results for commit e508abf. ± Comparison against base commit 8597ecf.

@mcollovati mcollovati merged commit a9819c2 into 24.4 Nov 20, 2024
26 checks passed
@mcollovati mcollovati deleted the cherry/cherrypick-20465-to-24.4 branch November 20, 2024 10:19
@vaadin-bot
Copy link
Collaborator

This ticket/PR has been released with Vaadin 24.4.18.

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