Class VaadinFlowPluginExtension

    • Constructor Detail

      • VaadinFlowPluginExtension

        VaadinFlowPluginExtension(Project project)
    • Method Detail

      • getProductionMode

         abstract Property<Boolean> getProductionMode()

        Whether we are running in productionMode or not. Defaults to true when run with bootJar or bootBuildImage task, otherwise false. Responds to the -Pvaadin.productionMode property.

      • getWebpackOutputDirectory

         abstract Property<File> getWebpackOutputDirectory()

        The folder where the frontend build tool should output index.js and other generated files. Defaults to null which will use the auto-detected value of resoucesDir of the main SourceSet, usually build/resources/main/META-INF/VAADIN/webapp/.

      • getFrontendOutputDirectory

         abstract Property<File> getFrontendOutputDirectory()

        The folder where the frontend build tool should output index.js and other generated files. Defaults to null which will use the auto-detected value of resoucesDir of the main SourceSet, usually build/resources/main/META-INF/VAADIN/webapp/.

      • getResourcesOutputDirectory

         abstract Property<File> getResourcesOutputDirectory()

        The folder where the META-INF/resources files are copied. Used for finding the StyleSheet referenced css files. Defaults to null which will use the auto-detected value of resoucesDir of the main SourceSet, usually build/resources/main/META-INF/resources/.

      • getNpmFolder

         abstract Property<File> getNpmFolder()

        The folder where package.json file is located. Default is project root dir.

      • getFrontendDirectory

         abstract Property<File> getFrontendDirectory()

        A directory with project's frontend source files.

        Defaults to frontend

      • getGenerateBundle

         abstract Property<Boolean> getGenerateBundle()

        Whether to generate a bundle from the project frontend sources or not. Defaults to true.

      • getRunNpmInstall

         abstract Property<Boolean> getRunNpmInstall()

        Whether to run npm install after updating dependencies. Defaults to true.

      • getFrontendResourcesDirectory

         abstract Property<File> getFrontendResourcesDirectory()

        Defines the project frontend directory from where resources should be copied from for use with webpack. Defaults to Constants.LOCAL_FRONTEND_RESOURCES_PATH

      • getOptimizeBundle

         abstract Property<Boolean> getOptimizeBundle()

        Whether to use byte code scanner strategy to discover frontend components. Defaults to true.

      • getPnpmEnable

         abstract Property<Boolean> getPnpmEnable()

        Instructs to use pnpm for installing npm frontend resources. Default is Constants.ENABLE_PNPM_DEFAULT

        pnpm, a.k.a. performant npm, is a better front-end dependency management option. With pnpm, packages are cached locally by default and linked (instead of downloaded) for every project. This results in reduced disk space usage and faster recurring builds when compared to npm.

      • getBunEnable

         abstract Property<Boolean> getBunEnable()

        Instructs to use bun for installing npm frontend resources. Default is false.

        bun, is a better front-end dependency management option. With bun, packages are cached locally by default and linked (instead of downloaded) for every project. This results in reduced disk space usage and faster recurring builds when compared to npm.

      • getUseGlobalPnpm

         abstract Property<Boolean> getUseGlobalPnpm()

        Whether the globally installed pnpm tool is used. By default, the pinned supported version of pnpm is used, see FrontendTools.DEFAULT_PNPM_VERSION.

      • getRequireHomeNodeExec

         abstract Property<Boolean> getRequireHomeNodeExec()

        Whether vaadin home node executable usage is forced. If it's set to true then vaadin home 'node' is checked and installed if it's absent. Then it will be used instead of globally 'node' or locally installed installed 'node'.

        Defaults to false.

      • getNodeFolder

         abstract Property<String> getNodeFolder()

        The folder containing the Node.js executable to use.

        When specified, Node.js will be exclusively used from this folder. If the binary is not found, the build will fail with no fallback.

        Example: "/usr/local/custom-node" or "C:\custom\node"

        Defaults to null (use default node resolution).

      • getEagerServerLoad

         abstract Property<Boolean> getEagerServerLoad()

        Whether or not insert the initial Uidl object in the bootstrap index.html. Defaults to false. Responds to the -Pvaadin.eagerServerLoad property.

      • getApplicationProperties

         abstract Property<File> getApplicationProperties()

        Application properties file in Spring project. Defaults to src/main/resources/application.properties

      • getOpenApiJsonFile

         abstract Property<File> getOpenApiJsonFile()

        Default generated path of the OpenAPI json.

        Defaults to generated-resources/openapi.json.

      • getGeneratedTsFolder

         abstract Property<File> getGeneratedTsFolder()

        The folder where flow will put TS API files for client projects.

      • getNodeVersion

         abstract Property<String> getNodeVersion()

        The node.js version to be used when node.js is installed automatically by Vaadin, for example "v16.0.0". Defaults to FrontendTools.DEFAULT_NODE_VERSION.

      • getNodeDownloadRoot

         abstract Property<String> getNodeDownloadRoot()

        Download node.js from this URL. Handy in heavily firewalled corporate environments where the node.js download can be provided from an intranet mirror. Defaults to NodeInstaller.DEFAULT_NODEJS_DOWNLOAD_ROOT.

        Example: "https://nodejs.org/dist/".

      • getResourceOutputDirectory

         abstract Property<File> getResourceOutputDirectory()

        Defines the output directory for generated non-served resources, such as the token file. Defaults to build/vaadin-generated folder.

        The plugin will automatically register this as an additional resource folder, which should then be picked up by the IDE. That will allow the app to run for example in Intellij with Tomcat. Generating files into build/resources/main wouldn't work since Intellij+Tomcat ignores that folder.

        The flow-build-info.json file is generated here.

      • getProjectBuildDir

         abstract Property<String> getProjectBuildDir()

        Defines the output folder used by the project.

        Default value is the project.buildDir and should not need to be changed.

      • getExcludePostinstallPackages

         abstract ListProperty<String> getExcludePostinstallPackages()

        Defines the npm packages to exclude from running postinstall scripts. Used to skip built-in entries (e.g. esbuild) when their postinstall step is known to fail or is not needed.

      • getSourceSetName

         abstract Property<String> getSourceSetName()

        The name of the SourceSet to scan for Vaadin components - i.e. the classes that are annoated with Vaadin annotations.

        Defaults to "main"

      • getDependencyScope

         abstract Property<String> getDependencyScope()

        The Gradle scope the Vaadin dependencies have been added to. Defaults to 'runtimeClasspath' if no sourceSetName has been specified, or '<code>sourceSetName</code>RuntimeClasspath' if a non-main sourceset has been set.

      • getProcessResourcesTaskName

         abstract Property<String> getProcessResourcesTaskName()

        The Gradle task that the vaadinPrepareFrontend task must run before. The target task should run before or be the task that copies the files from the resources directories of the specified SourceSet to the relevant output directory for that SourceSet. Defaults to 'processResources' if no sourceSetName has been specified, or 'process<code>SourceSetName</code>Resources' if a non-main sourceset has been specified.

      • getFrontendHotdeploy

         abstract Property<Boolean> getFrontendHotdeploy()

        Parameter to control if frontend development server should be used in development mode or not.

        Defaults to false.

      • getCiBuild

         abstract Property<Boolean> getCiBuild()

        Setting this to true will run {@code npm ci} instead of {@code npm install} when using npm.

        If using pnpm, the install will be run with {@code --frozen-lockfile} parameter.

        This makes sure that the versions in package lock file will not be overwritten and production builds are reproducible.

      • getSkipDevBundleBuild

         abstract Property<Boolean> getSkipDevBundleBuild()

        Enable skip of dev bundle rebuild if a dev bundle exists. Defaults to false.

      • getForceProductionBuild

         abstract Property<Boolean> getForceProductionBuild()

        Setting this to true will force a build of the production build even if there is a default production bundle that could be used.

        Created production bundle optimization is defined by optimizeBundle parameter.

        Defaults to false.

      • getAlwaysExecutePrepareFrontend

         abstract Property<Boolean> getAlwaysExecutePrepareFrontend()

        Prevents tracking state of the vaadinPrepareFrontend task, so that it will re-run every time it is called.

        Setting this to true allows to always execute vaadinPrepareFrontend.

        Defaults to false, meaning that the task execution is skipped when its outcomes are up-to-date, improving the overall build time.

      • getFrontendExtraFileExtensions

         abstract ListProperty<String> getFrontendExtraFileExtensions()

        The list of extra file extensions that are considered project files. Hashes are calculated for these files as part of detecting if a new bundle should be generated.

      • getMinimumFrontendPackageAgeDays

         abstract Property<Integer> getMinimumFrontendPackageAgeDays()

        Minimum age (in days) a frontend (npm) package version must have before npm, pnpm or bun is allowed to install it. Mitigates supply-chain attacks where a compromised version is briefly available on the registry. Defaults to {@code 0} (disabled); set to a positive value to enable. Requires pnpm >= 10.16.0 or bun >= 1.3.0 when those tools are used.

      • getCommercialWithBanner

         abstract Property<Boolean> getCommercialWithBanner()

        Allows building a version of the application with a commercial banner when commercial components are used without a license key.