fix: delete flow-build-info.json after Maven session via AbstractMavenLifecycleParticipant#23945
Open
mcollovati wants to merge 1 commit intomainfrom
Open
fix: delete flow-build-info.json after Maven session via AbstractMavenLifecycleParticipant#23945mcollovati wants to merge 1 commit intomainfrom
mcollovati wants to merge 1 commit intomainfrom
Conversation
…nLifecycleParticipant `BuildFrontendUtil.updateBuildFile()` calls `deleteOnExit()` on the production token file, but this never fires when using the Maven Daemon (mvnd) because the JVM stays alive between builds. As a result, `flow-build-info.json` with `productionMode: true` persists in `target/classes/META-INF/VAADIN/config/` and causes incorrect production-mode behavior when starting the app from the IDE. Adds `FlowLifecycleParticipant`, an `AbstractMavenLifecycleParticipant` that hooks into `afterSessionEnd()` to delete the token file after every build session. `BuildFrontendMojo` stores the resolved token file path in a Maven project property so the participant always uses the correct path even when `resourceOutputDirectory` is user-configured. `AbstractMavenLifecycleParticipant` only activates when the plugin is declared as a Maven extension, so users must add `<extensions>true</extensions>` to the plugin declaration in their `pom.xml` to benefit from this fix. The existing `deleteOnExit()` call acts as a transparent fallback for projects that do not opt in. Fixes #21021
c51d5b5 to
5fbab14
Compare
|
caalador
approved these changes
Mar 20, 2026
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.



BuildFrontendUtil.updateBuildFile()callsdeleteOnExit()on the production token file, but this never fires when using the Maven Daemon (mvnd) because the JVM stays alive between builds. As a result,flow-build-info.jsonwithproductionMode: truepersists intarget/classes/META-INF/VAADIN/config/and causes incorrect production-mode behavior when starting the app from the IDE.Adds
FlowLifecycleParticipant, anAbstractMavenLifecycleParticipantthat hooks intoafterSessionEnd()to delete the token file after every build session.BuildFrontendMojostores the resolved token file path in a Maven project property so the participant always uses the correct path even whenresourceOutputDirectoryis user-configured.AbstractMavenLifecycleParticipantonly activates when the plugin is declared as a Maven extension, so users must add<extensions>true</extensions>to the plugin declaration in theirpom.xmlto benefit from this fix. The existingdeleteOnExit()call acts as a transparent fallback for projects that do not opt in.Fixes #21021