flow icon indicating copy to clipboard operation
flow copied to clipboard

clean-frontend goal should not create shared Reflector instance

Open mcollovati opened this issue 5 months ago • 0 comments
trafficstars

To improve performance, FlowModeAbstractMojo creates shared reflector instances for each maven phase the goals are bound. For example, if prepare-frontend is bound to process-resources and build-frontend to compile two Reflectors are created, because the dependency resolution between the two phases might be different. However, if both goals are bound to the same phase (e.g. compile) they can safely re-use a shared instance.

But if clean-frontend is for some reason bound to the same phase of the other goals, it will potentially break the build, because CleanFrontendMojo does not define requiresDependencyResolution , causing the Reflector instance to miss all project dependencies.

Mojos extending FlowModeAbstractMojo should be able to define if they should create/reuse a shared reflector or not. At the moment only CleanFrontendMojo should opt-out.

For reference: https://vaadin.com/forum/t/cannot-deploy-vaadin-24-6-6-with-maven/168513/20

mcollovati avatar May 27 '25 06:05 mcollovati