flow icon indicating copy to clipboard operation
flow copied to clipboard

Gradle plugin 24.8+ not take Vaadin configuration in build.gradle

Open WilliamFreau opened this issue 5 months ago • 1 comments

Description of the bug

I am using Vaadin with Gradle 8.12 and the com.vaadin gradle plugin.

Since I move the plugin to version 24.8 up to 24.9.5, the configuration in build.gradle is not read. Everything work with plugin version 24.7.X

plugins {
	....
	id 'java'
	id 'com.vaadin'
}

 ....

vaadin {
    nodeVersion = 'v24.4.1'    // Vaadin 24 requires at least 18
    nodeDownloadRoot = "https://otherrepo.example.com/org/nodejs/node/"
}

Log when I execute the VaadinPrepareFrontend

Couldn't find node.exe. Installing Node and npm to C:\Users\my-user\.vaadin.
Installing node version v22.17.0
Downloading https://nodejs.org/dist/v22.17.0/node-v22.17.0-win-x64.zip to C:\Users\my-user\.vaadin\node-v22.17.0-win-x64.zip

As you can see the nodeVersion and nodeDownloadRoot is not used.

Expected behavior

I am expecting the vaadin-plugin should download the correct nodeVersion from the correct nodeDownloadRoot

Minimal reproducible example

To ensure the behaviour is not link to my project, I have clone: https://github.com/vaadin/base-starter-spring-gradle

and add into the build.gradle:

vaadin {
    nodeVersion = 'v24.4.1'
}

Then run the gradle task: vaadinPrepareFrontend --info With the folowing result:

Couldn't find node.exe. Installing Node and npm to C:\Users\my-user\.vaadin.
Installing node version v22.17.0
Downloading https://nodejs.org/dist/v22.17.0/node-v22.17.0-win-x64.zip to C:\Users\my-user\.vaadin\node-v22.17.0-win-x64.zip

Versions

  • Vaadin Gradle Plugin: 24.8+
  • Java version: 21
  • OS version: W10
  • Gradle: 8.7+

WilliamFreau avatar Nov 27 '25 09:11 WilliamFreau

I can confirm the bug. The problem seems to be in VaadinFlowPluginExtension.toolsSettings

    public val toolsSettings: Provider<FrontendToolsSettings> = npmFolder.map {
        FrontendToolsSettings(it.absolutePath) {
            FrontendUtils.getVaadinHomeDirectory()
                .absolutePath
        }
    }

The FrontendToolsSettings instance but configuration properties are not initialized.

mcollovati avatar Nov 27 '25 09:11 mcollovati