Skip to content

fix: keep the development frontend token out of production archives - #25071

Merged
caalador merged 1 commit into
mainfrom
fix/25070-prepare-frontend-task-wiring
Jul 30, 2026
Merged

fix: keep the development frontend token out of production archives#25071
caalador merged 1 commit into
mainfrom
fix/25070-prepare-frontend-task-wiring

Conversation

@mcollovati

Copy link
Copy Markdown
Collaborator

vaadinPrepareFrontend writes a development flow-build-info.json into resourceOutputDirectory, and the plugin registered that folder as a resources source folder unconditionally. Invoking the task explicitly then caused two failures:

  • processResources consumed the folder without any ordering against the task producing it, so Gradle failed with an implicit dependency validation error.
  • In a production build the development token was copied into build/resources/main while vaadinBuildFrontend wrote its own token into its task-owned output directory, so the archive ended up with two conflicting copies of META-INF/VAADIN/config/flow-build-info.json and the jar/war task failed. A folder left behind by an earlier development build was enough to trigger this, without the two tasks ever sharing a task graph.

Register resourceOutputDirectory as a resources source folder only in development mode - in production vaadinBuildFrontend generates the whole META-INF/VAADIN tree into its own output directory - and declare the ordering that processResources and vaadinBuildFrontend need relative to vaadinPrepareFrontend, without adding a dependency that would make the task execute on every build.

Fixes #25070

vaadinPrepareFrontend writes a development flow-build-info.json into
resourceOutputDirectory, and the plugin registered that folder as a
resources source folder unconditionally. Invoking the task explicitly
then caused two failures:

- processResources consumed the folder without any ordering against the
  task producing it, so Gradle failed with an implicit dependency
  validation error.
- In a production build the development token was copied into
  build/resources/main while vaadinBuildFrontend wrote its own token
  into its task-owned output directory, so the archive ended up with two
  conflicting copies of META-INF/VAADIN/config/flow-build-info.json and
  the jar/war task failed. A folder left behind by an earlier
  development build was enough to trigger this, without the two tasks
  ever sharing a task graph.

Register resourceOutputDirectory as a resources source folder only in
development mode - in production vaadinBuildFrontend generates the whole
META-INF/VAADIN tree into its own output directory - and declare the
ordering that processResources and vaadinBuildFrontend need relative to
vaadinPrepareFrontend, without adding a dependency that would make the
task execute on every build.

Fixes #25070
@sonarqubecloud

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown
Contributor

Test Results

 1 444 files  ±0   1 444 suites  ±0   1h 41m 56s ⏱️ - 3m 18s
10 316 tests ±0  10 249 ✅ ±0  67 💤 ±0  0 ❌ ±0 
10 770 runs  ±0  10 702 ✅ ±0  68 💤 ±0  0 ❌ ±0 

Results for commit e60aa82. ± Comparison against base commit d1d5f14.

@mcollovati

Copy link
Copy Markdown
Collaborator Author

Build cache still working with this change https://github.com/mcollovati/vaadin-gradle-build-cache-tests/actions/runs/30459315650

@caalador
caalador added this pull request to the merge queue Jul 30, 2026
Merged via the queue into main with commit 9ff6928 Jul 30, 2026
35 checks passed
@caalador
caalador deleted the fix/25070-prepare-frontend-task-wiring branch July 30, 2026 04:50
vaadin-bot added a commit that referenced this pull request Jul 30, 2026
…25071) (CP: 25.2) (#25073)

This PR cherry-picks changes from the original PR #25071 to branch 25.2.
---
#### Original PR description
> vaadinPrepareFrontend writes a development flow-build-info.json into
resourceOutputDirectory, and the plugin registered that folder as a
resources source folder unconditionally. Invoking the task explicitly
then caused two failures:
> 
> - processResources consumed the folder without any ordering against
the task producing it, so Gradle failed with an implicit dependency
validation error.
> - In a production build the development token was copied into
build/resources/main while vaadinBuildFrontend wrote its own token into
its task-owned output directory, so the archive ended up with two
conflicting copies of META-INF/VAADIN/config/flow-build-info.json and
the jar/war task failed. A folder left behind by an earlier development
build was enough to trigger this, without the two tasks ever sharing a
task graph.
> 
> Register resourceOutputDirectory as a resources source folder only in
development mode - in production vaadinBuildFrontend generates the whole
META-INF/VAADIN tree into its own output directory - and declare the
ordering that processResources and vaadinBuildFrontend need relative to
vaadinPrepareFrontend, without adding a dependency that would make the
task execute on every build.
> 
> Fixes #25070

Co-authored-by: Marco Collovati <marco@vaadin.com>
@vaadin-bot

Copy link
Copy Markdown
Collaborator

This ticket/PR has been released with Vaadin 25.3.0-alpha8.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

3 participants