flow icon indicating copy to clipboard operation
flow copied to clipboard

Vaadin-gradle-plugin must support Gradle Toolchains

Open mr-serjey opened this issue 3 months ago • 0 comments

Motivation

UI projects utilizing the vaadin-gradle-plugin should not be constrained by the Java version used to run Gradle. Otherwise, it becomes a significant obstacle for projects to upgrade.

Solution

The vaadin-gradle-plugin must leverage Gradle's toolchains for building UI projects. Gradle introduced the Java toolchain mechanism to prevent situations where Gradle or its plugins, such as vaadin-gradle-plugin, restrict the JDK version for project compilation and execution. Therefore, even if Gradle itself cannot run on the latest Java version, the Java toolchain enables the compilation and execution of project classes using the latest JDK.

Alternatives considered

There is no alternative to this, since UI project usually stays on top of the other modules in multitier architecture, and so can not consume the other modules if they have higher version of java classes.

Additional context

  • The vaadin-gradle-plugin that supports Vaadin v23 and v24 fails to process classes that compiled by java toolchain aware Gradle tasks.
  • Gradle Toolchains for plugin authors
  • Related issue https://github.com/vaadin/flow/issues/19338

mr-serjey avatar May 08 '24 15:05 mr-serjey