Skip to content

fix: skip vaadinBuildFrontend in development mode - #25002

Merged
mcollovati merged 1 commit into
mainfrom
fix/25000-skip-buildfrontend-dev-mode
Jul 20, 2026
Merged

fix: skip vaadinBuildFrontend in development mode#25002
mcollovati merged 1 commit into
mainfrom
fix/25000-skip-buildfrontend-dev-mode

Conversation

@mcollovati

Copy link
Copy Markdown
Collaborator

The Gradle vaadinBuildFrontend task is now skipped when Vaadin production
mode is not enabled. This prevents development and multi-module builds from
failing when the task is part of the build graph, and avoids producing a
production configuration while running in development mode.

Fixes #25000

The vaadinBuildFrontend task builds the production bundle and writes a
flow-build-info.json token with productionMode=true, so it is only
meaningful for production builds. When it is wired into the build graph
in development mode (e.g. jar.dependsOn('vaadinBuildFrontend')) the build
failed with a task validation error, because the production-only token
build service is registered by FlowPlugin only in production mode.
Running it in development mode would also overwrite the development token
and make the running application behave as in production.

Guard the task with onlyIf so it is skipped unless production mode is
enabled.

Fixes #25000
@mcollovati

mcollovati commented Jul 17, 2026

Copy link
Copy Markdown
Collaborator Author

The task is guarded with Gradle's onlyIf rather than by marking the token
service reference @Optional. This is intentional: onlyIf is evaluated before
Gradle's task input validation, so skipping in development mode avoids the
validation failure reported in #25000 (the mandatory @ServiceReference
"vaadinBuildFrontendToken" has no value because FlowPlugin registers that
build service only in production mode).

Skipping also matters beyond the crash: running vaadinBuildFrontend in
development mode would write flow-build-info.json with productionMode=true and
replace the development token, causing the running application to behave as in
production.

Verified against the issue's reproducer: with the released 25.2.2 plugin the
build fails at vaadinBuildFrontend validation; with this change the task is
SKIPPED and the jar build succeeds, with productionMode=false and the
reporter's jar.dependsOn('vaadinBuildFrontend') wiring unchanged.

@mcollovati
mcollovati marked this pull request as ready for review July 17, 2026 09:16
@github-actions

Copy link
Copy Markdown
Contributor

Test Results

 1 456 files  ±0   1 456 suites  ±0   1h 38m 2s ⏱️ - 2m 58s
10 306 tests ±0  10 238 ✅ ±0  68 💤 ±0  0 ❌ ±0 
10 778 runs  ±0  10 709 ✅ ±0  69 💤 ±0  0 ❌ ±0 

Results for commit eab02f5. ± Comparison against base commit 43f0ec7.

@sonarqubecloud

Copy link
Copy Markdown

@mcollovati
mcollovati added this pull request to the merge queue Jul 20, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jul 20, 2026
@mcollovati
mcollovati added this pull request to the merge queue Jul 20, 2026
Merged via the queue into main with commit 4b2299c Jul 20, 2026
35 checks passed
@mcollovati
mcollovati deleted the fix/25000-skip-buildfrontend-dev-mode branch July 20, 2026 08:46
vaadin-bot added a commit that referenced this pull request Jul 20, 2026
…#25006)

This PR cherry-picks changes from the original PR #25002 to branch 25.2.
---
#### Original PR description
> The Gradle vaadinBuildFrontend task is now skipped when Vaadin
production
> mode is not enabled. This prevents development and multi-module builds
from
> failing when the task is part of the build graph, and avoids producing
a
> production configuration while running in development mode.
> 
> Fixes #25000

Co-authored-by: Marco Collovati <marco@vaadin.com>
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.

Gradle multi module build is broken for Vaadin 25.2.x

3 participants