> Markdown version of [Maven](https://vaadin.com/docs/v24/flow/configuration/maven). Section index: [llms.txt](https://vaadin.com/docs/v24/flow/llms.txt)

# Maven Configuration Properties

The Vaadin Maven plugin contains configuration for most configurable properties. These can be set either as [system properties](https://vaadin.com/docs/v24/flow/configuration/properties.md#system-properties) or configuration parameters for the plugin.

## <a id="using-maven-plugin-configuration"></a>Using Maven Plugin Configuration

The best way to set persistent configuration properties for a Maven project is to set them in the plugin.

Enabling Node.js auto-update

```xml
<plugin>
    <groupId>com.vaadin</groupId>
    <artifactId>vaadin-maven-plugin</artifactId>
    <version>${vaadin.version}</version>
    <executions>
        <execution>
            <goals>
                <goal>prepare-frontend</goal>
            </goals>
        </execution>
    </executions>
    <configuration>
        <nodeAutoUpdate>true</nodeAutoUpdate>
    </configuration>
</plugin>
```

See the [full list of properties](#properties).

## <a id="properties"></a>Plugin Configuration Options

The following list shows all the configuration options and their default values:

- `applicationProperties`

  Location of the `application.properties` file in a Spring project. Defaults to `${project.basedir}/src/main/resources/application.properties`.

- `eagerServerLoad`

  Whether to insert the initial User Interface Definition Language (UIDL) object in the bootstrap `index.html`. Defaults to `false`.

- `frontendDirectory`

  The directory with the project’s frontend source files. Defaults to `"${project.basedir}/src/main/frontend"`. The legacy location `"${project.basedir}/frontend"` is used if the default location doesn’t exist and this parameter isn’t set.

- `generatedTsFolder`

  The folder where Flow puts TypeScript API files for client projects. Defaults to `"${project.basedir}/src/main/frontend/generated"`. The legacy location `"${project.basedir}/frontend/generated"` is used if the default location doesn’t exist and this parameter isn’t set.

- `javaSourceFolder`

  Java source folders for scanning. Defaults to `"${project.basedir}/src/main/java"`.

- `javaResourceFolder`

  Java resource folder. Defaults to `"${project.basedir}/src/main/resources"`.

- `nodeDownloadRoot`

  URL to use for downloading Node.js. In environments behind a firewall, the Node.js download can be provided from an intranet mirror. Defaults to `null`, which downloads Node.js from `https://nodejs.org/dist/`.

- `nodeVersion`

  The Node.js version to be used when Node.js is installed automatically. Should be in the format `"v16.0.0"`. Defaults to `FrontendTools.DEFAULT_NODE_VERSION`.

- `nodeAutoUpdate`

  Flag to enable automatic update of the Node.js version installed in `~/.vaadin` if it’s older than the default or defined `nodeVersion`. Note: any installed version below `should work` is automatically updated regardless of this flag. Defaults to `false`.

- `npmExcludeWebComponents`

  Excludes all Vaadin professional and core components from the `package.json`. Material and Lumo themes are preserved. Excluded packages aren’t installed by npm, which makes development bundles smaller. This property alone doesn’t remove any Maven dependencies. See [Optimize Bundle](https://vaadin.com/docs/v24/flow/configuration/development-mode.md#exclude-vaadin-components) for more information. Defaults to `false`.

- `npmFolder`

  The folder where the `package.json` file is located. Defaults to `${project.basedir}`.

- `openApiJsonFile`

  Default generated path of the OpenAPI JSON. Defaults to `${project.build.directory}/generated-resources/openapi.json`.

- `pnpmEnable`

  Specifies to use `pnpm` to install `npm` frontend resources. Defaults to `true`.

- `useGlobalPnpm`

  Specifies to use the globally installed `pnpm` tool or the default supported `pnpm` version. Defaults to `false`.

- `productionMode`

  Define whether the application is running in production mode. Defaults to `false`. For production, the frontend is bundled and optimized, as described in [Deploying to Production](https://vaadin.com/docs/v24/flow/production.md).

- `projectBasedir`

  The folder where the `package.json` file is located. Defaults to `${project.basedir}`.

- `reactEnable`

  Whether to use React Router, add React core dependencies, React integration helpers and Vaadin’s provided React components (i.e., `@vaadin/react-components`). Fallbacks to `vaadin-router`, excludes all React dependencies and adds `Lit` dependencies, if set to `false` — default is `true`. Configuration property `vaadin.react.enable` needs to be set to match this value. See [Hilla & React Dependencies](https://vaadin.com/docs/v24/upgrading.md#hilla-react-dependencies) for more information.

- `requireHomeNodeExec`

  Whether Vaadin home node executable usage is forced. If it’s set to `true`, the Vaadin home 'node' is checked, and installed if absent. This is then used instead of a globally or locally installed 'node'. Defaults to `false`.

- `resourceOutputDirectory`

  Defines the output directory for generated non-served resources, such as the token file. Defaults to `${project.build.outputDirectory}/vaadin-generated`.

- `useDeprecatedV14Bootstrapping`

  Optionally use the legacy V14 bootstrap mode. Defaults to `false`.

- `frontendBundleOutput`

  The folder where Vite (the default frontend build tool) should output `index.js` and other generated files. Defaults to `${project.build.outputDirectory}/META-INF/VAADIN/webapp/`.

- `projectBuildDir`

  Build directory for the project. Defaults to `${project.build.directory}`.

- `skipDevBundleRebuild`

  Prevents frontend development bundle from being re-built even if Vaadin decides to use an existing compiled development bundle. This is mainly needed when re-bundling checker in Flow has issues leading to false re-bundling and one needs a workaround while the problem is being resolved. Defaults to `false`.

- `cleanFrontendFiles`

  Clears the generated frontend files after building a project for production. It keeps the generated files if they existed before the build, or if this parameter is set to `false`. When building a bundle in development mode, the generated files are removed unless they existed before the build. Defaults to `true`.

- `frontendExtraFileExtensions`

  Parameter for adding file extensions to a handle when generating bundles.

- `frontendScanner`

  Allows fine-tuning of frontend resource detection by specifying which artifacts should be included or excluded during the class scanning process. This includes resource-related annotations like `@JsModule`, `@JavaScript`, `@CssImport`, and `@NpmPackage`, UI annotations such as `@Route` and `@Layout`, as well as Vaadin-related implementations like `UIInitListener`, `VaadinServiceInitListener`, `AppShellConfigurator`, `HasErrorParameter`, `WebComponentExporter`, and others.

  Inclusion and exclusion are configured by setting filtering patterns on artifact coordinates (`groupId` and `artifactId`). Patterns can use the wildcard `*`, but only at the beginning or end of the rule. Valid examples include `org.example.*`, `*.example`, and `*.example.*`, while `org.*.example` is invalid. Exclusions take precedence and are evaluated first—if an artifact matches an exclusion rule, it is not scanned. If no exclusion rule applies, inclusion rules are then checked. If an artifact matches an inclusion rule, it is scanned; otherwise, it is skipped. Use **inclusion rules** when you want to scan only specific artifacts and exclude everything else (e.g., scanning 10% and skipping 90%). Use **exclusion rules** when you want to scan most artifacts while omitting a few (e.g., scanning 90% and skipping 10%). **Vaadin artifacts are included by default and cannot be excluded**.

  Project classes are included by default, but can be excluded setting `includeOutputDirectory` to `false`. If the main Maven module has no classes referencing frontend resources, Vaadin components, or add-ons, it makes sense to exclude it from scanning to optimize performance.

  Filtering can be completely skipped by setting `enabled` to `false`.

  Configuring frontend scanner

  ```xml
  <frontendScanner>
      <enabled>true</enabled>
      <includeOutputDirectory>true</includeOutputDirectory>
      <!-- Only scan for company artifacts -->
      <includes>
          <include>
              <groupId>com.mycompany.*</groupId>
              <artifactId>*</artifactId>
          </include>
      </includes>
      <!--
          But ignore backed artifacts, since they do not
          contain frontend related classes
      -->
      <excludes>
          <exclude>
              <groupId>com.mycompany.backend</groupId>
              <artifactId>*</artifactId>
          </exclude>
      </excludes>
  </frontendScanner>
  ```

- `frontendIgnoreVersionChecks`

  Makes Flow skip node and npm/pnpm/bun version checks during bundle build and development server startup. Note that disabling frontend tools version checking can cause failing builds and other issues that are difficult to debug.

### <a id="build-frontend-goal-parameters"></a>Build Frontend Goal Parameters

The following parameters are used with the `build-frontend` goal, in addition to the parameters described above.

- `generateBundle`

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

- `runNpmInstall`

  Whether to run the `npm install` task after updating dependencies. This doesn’t necessarily execute `npm install` if everything seems to be up to date. Defaults to `true`.

- `generateEmbeddableWebComponents`

  Whether to generate embeddable web components from `WebComponentExporter` inheritors. Defaults to `true`.

- `frontendResourcesDirectory`

  Defines the project frontend directory from where resources should be copied to use with Vite. Defaults to `${project.basedir}/src/main/resources/META-INF/resources/frontend`.

- `optimizeBundle`

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

- `ciBuild`

  Defines whether `npm ci` is run instead of `npm i` in production frontend builds. If you use pnpm, the install command is run with the `--frozen-lockfile` parameter. The build fails if the `package.json` and `package-lock.json` files have mismatching versions. Defaults to `false`.

- `forceProductionBuild`

  Forces Vaadin to create a new production bundle even if a pre-compiled one can be used. Usually needed to create an optimized production bundle and to load components sources to the browser on demand, i.e. once one opens a route where these components are used. Defaults to `false`.

`CD6D2FC7-ED44-442C-B32F-FABA5AF7294F`
