From 23e8b4e6ac59785e3c700c7bcbc43c2d2335be98 Mon Sep 17 00:00:00 2001 From: Tomi Virtanen Date: Tue, 18 Nov 2025 14:28:41 +0200 Subject: [PATCH 1/7] docs: update articles for moved vaadin-dev vaadin-dev dependency is moved from vaadin-core to vaadin-spring-boot-starter. Jakarta EE starters are updated for production ready builds with 'mvn clean package'. PartOf: vaadin/flow#22715 --- .../flow/production/production-build.adoc | 38 +------------------ articles/upgrading/index.adoc | 27 +++++++++++++ 2 files changed, 29 insertions(+), 36 deletions(-) diff --git a/articles/flow/production/production-build.adoc b/articles/flow/production/production-build.adoc index 23fb47ba30..7fd8d869a6 100644 --- a/articles/flow/production/production-build.adoc +++ b/articles/flow/production/production-build.adoc @@ -9,20 +9,13 @@ order: 10 = Production Build -To create a production build, run the following from the command-line for application using Spring Boot: +To create a production build, run the following from the command-line: [source,terminal] ---- mvn clean package ---- -For other applications, e.g., Jakarta EE or plain Java, and for better backwards compatibility, run same with a production profile: - -[source,terminal] ----- -mvn clean package -Pproduction ----- - Executing this line builds a `JAR` or `WAR` file, with all of the dependencies and bundled frontend resources, ready to be deployed. You can find the file in the `target` folder after the build is finished. If no add-ons or frontend files are used in the application, the previous command uses a pre-compiled production bundle to eliminate the need to run frontend tools like `npm` and Vite. However, frontend tools are still used to generate an application-specific bundle in the following situations: @@ -177,34 +170,7 @@ If you're using a 64-bit operating system, be sure to use a 64-bit JDK installat == Excluding Development Server Module -The Vite server integration and live reload features -- which are available only in development builds -- are contained in the `com.vaadin:vaadin-dev-server` module. You should exclude this module when building a production application. You can do this by adding the following dependency exclusion to the `` section in the `production` profile: - -.`pom.xml` -[source,xml] ----- - - - production - - - - - - com.vaadin - vaadin - - - com.vaadin - vaadin-dev - - - - - - ----- - -Or when building Spring Boot 4 application, add `vaadin-dev` dependency as a `optional` scope in project ``. Spring Boot 4 `spring-boot-maven-plugin` automatically excludes optional dependencies from the final build: +The Vite server integration and live reload features -- which are available only in development builds -- are contained in the `com.vaadin:vaadin-dev-server` module. You should exclude this module when building a production package. `vaadin-spring-boot-starter` dependency adds it transitively. You can exclude it by adding `vaadin-dev` dependency as a `optional` scope in project ``. Spring Boot 4 `spring-boot-maven-plugin` automatically excludes optional dependencies from the final build: .`pom.xml` [source,xml] diff --git a/articles/upgrading/index.adoc b/articles/upgrading/index.adoc index d811acfe78..ab6e149f78 100644 --- a/articles/upgrading/index.adoc +++ b/articles/upgrading/index.adoc @@ -172,6 +172,33 @@ If you're using a Gradle wrapper, update it to version 8.14 by executing the fol For Java 21 compatibility, you may need to update the `sourceCompatibility` setting in your project's build file to version 21. Check your project's build file and make any necessary changes. +== Development Tools + +Development tools are opt-in feature in Vaadin 25. `vaadin-dev` module isn't included transitively by default anymore via `vaadin` or `vaadin-core` dependencies. To include it, add following dependency to your build configuration: + +[.example] +-- +[source,xml] +---- + + + com.vaadin + vaadin-dev + true + +---- + +[source,groovy] +---- + +dependencies { + implementation('com.vaadin:vaadin-dev') +} +---- +-- + +Vaadin Spring Boot starter module `vaadin-spring-boot-starter` still includes `vaadin-dev` by default. + == Hilla Vaadin Spring Boot Starter no longer includes Hilla by default. In case you have react views, add `hilla-spring-boot-starter` to work together with `hilla-spring-boot-starter` in your build configuration. From 8b6c40b1ad39d06b1f4645212fccc3a3e80e3dc8 Mon Sep 17 00:00:00 2001 From: Tomi Virtanen Date: Tue, 18 Nov 2025 14:50:55 +0200 Subject: [PATCH 2/7] Fixed wrong module name --- articles/upgrading/index.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/articles/upgrading/index.adoc b/articles/upgrading/index.adoc index d4b31221be..732ed703f4 100644 --- a/articles/upgrading/index.adoc +++ b/articles/upgrading/index.adoc @@ -200,7 +200,7 @@ dependencies { Vaadin Spring Boot starter module `vaadin-spring-boot-starter` still includes `vaadin-dev` by default. == Hilla -Vaadin Spring Boot Starter no longer includes Hilla by default. In case you have react views, add `hilla-spring-boot-starter` to work together with `hilla-spring-boot-starter` in your build configuration. +Vaadin Spring Boot Starter no longer includes Hilla by default. In case you have react views, add `hilla-spring-boot-starter` to work together with `vaadin-spring-boot-starter` in your build configuration. .pom.xml [source,xml] From f92206d43974519b7cfbeebd932bac76c4a286b0 Mon Sep 17 00:00:00 2001 From: Tomi Virtanen Date: Fri, 21 Nov 2025 11:42:44 +0200 Subject: [PATCH 3/7] Clarify vaadin-dev requirement for Spring apps --- articles/upgrading/index.adoc | 1 + 1 file changed, 1 insertion(+) diff --git a/articles/upgrading/index.adoc b/articles/upgrading/index.adoc index 732ed703f4..bac30998ab 100644 --- a/articles/upgrading/index.adoc +++ b/articles/upgrading/index.adoc @@ -198,6 +198,7 @@ dependencies { -- Vaadin Spring Boot starter module `vaadin-spring-boot-starter` still includes `vaadin-dev` by default. +Spring Boot applications that don't use `vaadin-spring-boot-starter` dependency, but have e.g. direct dependency to `vaadin-spring` instead, has to add `vaadin-dev` as described above. == Hilla Vaadin Spring Boot Starter no longer includes Hilla by default. In case you have react views, add `hilla-spring-boot-starter` to work together with `vaadin-spring-boot-starter` in your build configuration. From 68ed4906a18a304244028c8062de220071f43d07 Mon Sep 17 00:00:00 2001 From: Tomi Virtanen Date: Tue, 25 Nov 2025 12:22:13 +0200 Subject: [PATCH 4/7] changed for vaadin-dev changes vaadin-dev is not included transitively by any Vaadin dependency. --- articles/flow/production/production-build.adoc | 2 +- articles/upgrading/index.adoc | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/articles/flow/production/production-build.adoc b/articles/flow/production/production-build.adoc index 7fd8d869a6..b4352c77eb 100644 --- a/articles/flow/production/production-build.adoc +++ b/articles/flow/production/production-build.adoc @@ -170,7 +170,7 @@ If you're using a 64-bit operating system, be sure to use a 64-bit JDK installat == Excluding Development Server Module -The Vite server integration and live reload features -- which are available only in development builds -- are contained in the `com.vaadin:vaadin-dev-server` module. You should exclude this module when building a production package. `vaadin-spring-boot-starter` dependency adds it transitively. You can exclude it by adding `vaadin-dev` dependency as a `optional` scope in project ``. Spring Boot 4 `spring-boot-maven-plugin` automatically excludes optional dependencies from the final build: +The Vite server integration and live reload features -- which are available only in development builds -- are contained in the `com.vaadin:vaadin-dev-server` module. You should exclude this module when building a production package. You can exclude it by adding `vaadin-dev` dependency as a `optional` scope in project ``. Spring Boot 4 `spring-boot-maven-plugin` automatically excludes optional dependencies from the final build: .`pom.xml` [source,xml] diff --git a/articles/upgrading/index.adoc b/articles/upgrading/index.adoc index e5f13af5dd..56a7607895 100644 --- a/articles/upgrading/index.adoc +++ b/articles/upgrading/index.adoc @@ -174,7 +174,7 @@ For Java 21 compatibility, you may need to update the `sourceCompatibility` sett == Development Tools -Development tools are opt-in feature in Vaadin 25. `vaadin-dev` module isn't included transitively by default anymore via `vaadin` or `vaadin-core` dependencies. To include it, add following dependency to your build configuration: +Development tools are opt-in feature in Vaadin 25. `vaadin-dev` module isn't included transitively by default anymore via `vaadin` or `vaadin-core` or any other Vaadin dependencies. To include it, add following dependency to your build configuration: [.example] -- @@ -197,9 +197,6 @@ dependencies { ---- -- -Vaadin Spring Boot starter module `vaadin-spring-boot-starter` still includes `vaadin-dev` by default. -Spring Boot applications that don't use `vaadin-spring-boot-starter` dependency, but have e.g. direct dependency to `vaadin-spring` instead, has to add `vaadin-dev` as described above. - == Hilla Vaadin Spring Boot Starter no longer includes Hilla by default. In case you have react views, add `hilla-spring-boot-starter` to work together with `vaadin-spring-boot-starter` in your build configuration. From 98a6b0b84f2b43050e96b84435358406a651a1e4 Mon Sep 17 00:00:00 2001 From: Tomi Virtanen Date: Wed, 26 Nov 2025 15:41:12 +0200 Subject: [PATCH 5/7] Removed production profile usage from native --- articles/flow/production/native.adoc | 4 ++-- articles/hilla/guides/production/native.adoc | 4 ++-- articles/hilla/lit/guides/production/native.adoc | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/articles/flow/production/native.adoc b/articles/flow/production/native.adoc index 1732ab08fa..5fcbc80865 100644 --- a/articles/flow/production/native.adoc +++ b/articles/flow/production/native.adoc @@ -63,9 +63,9 @@ With the annotation, it works as expected. Without it, you would get an empty gr Compile your Vaadin application into a native image using Maven by executing the following command in the project root directory: [source,bash] -mvn -Pproduction -Pnative native:compile +mvn -Pnative native:compile -This command compiles the application with the production and native profiles enabled. The native profile instructs Maven to use the GraalVM native image compiler for the compilation process. +This command compiles the application with the native profile enabled. The native profile instructs Maven to use the GraalVM native image compiler for the compilation process. Now run the application. The compilation creates the native image in the target directory. To run it, execute the following command: diff --git a/articles/hilla/guides/production/native.adoc b/articles/hilla/guides/production/native.adoc index d18579a035..0c46984604 100644 --- a/articles/hilla/guides/production/native.adoc +++ b/articles/hilla/guides/production/native.adoc @@ -39,9 +39,9 @@ To compile your Hilla application into a native image, follow these steps: . *Compile your application* using Maven by executing the following command in the project root directory: + [source,bash] -mvn -Pproduction -Pnative native:compile +mvn -Pnative native:compile + -This command compiles your application with the production and native profiles enabled. The native profile instructs Maven to use the GraalVM native image compiler for the compilation process. +This command compiles your application with the native profile enabled. The native profile instructs Maven to use the GraalVM native image compiler for the compilation process. . *Run the application*. The compilation creates the native image in the target directory. To run the application, execute the following command: + diff --git a/articles/hilla/lit/guides/production/native.adoc b/articles/hilla/lit/guides/production/native.adoc index e45387cfba..9c9ffa0132 100644 --- a/articles/hilla/lit/guides/production/native.adoc +++ b/articles/hilla/lit/guides/production/native.adoc @@ -39,9 +39,9 @@ To compile your Hilla application into a native image, follow these steps: . *Compile your application* using Maven by executing the following command in the project root directory: + [source,bash] -mvn -Pproduction -Pnative native:compile +mvn -Pnative native:compile + -This command compiles your application with the production and native profiles enabled. The native profile instructs Maven to use the GraalVM native image compiler for the compilation process. +This command compiles your application with the native profile enabled. The native profile instructs Maven to use the GraalVM native image compiler for the compilation process. . *Run the application*. The compilation creates the native image in the target directory. To run the application, execute the following command: + From f8a5a4620de8b8a8242fa9bcf4677287ab8a740d Mon Sep 17 00:00:00 2001 From: Tomi Virtanen Date: Thu, 27 Nov 2025 11:23:00 +0200 Subject: [PATCH 6/7] Rewrote a chapter --- articles/flow/production/production-build.adoc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/articles/flow/production/production-build.adoc b/articles/flow/production/production-build.adoc index b4352c77eb..ae3b85f7a0 100644 --- a/articles/flow/production/production-build.adoc +++ b/articles/flow/production/production-build.adoc @@ -170,7 +170,11 @@ If you're using a 64-bit operating system, be sure to use a 64-bit JDK installat == Excluding Development Server Module -The Vite server integration and live reload features -- which are available only in development builds -- are contained in the `com.vaadin:vaadin-dev-server` module. You should exclude this module when building a production package. You can exclude it by adding `vaadin-dev` dependency as a `optional` scope in project ``. Spring Boot 4 `spring-boot-maven-plugin` automatically excludes optional dependencies from the final build: +The Vite server integration and live reload features -- available only in development builds -- are provided by the `com.vaadin:vaadin-dev-server` module, which is included in the `vaadin-dev` module. + +When you use `vaadin-dev` in your Maven configuration to run in development mode -- within the same Maven profile or project dependencies -- you should exclude this module from the production package. + +You can do this by declaring the `vaadin-dev` dependency `optional` in your project ``. Maven automatically excludes optional dependencies from the final production package: .`pom.xml` [source,xml] From ce1e7ff90afbf55e9b1c2a413fde43a3fc2e1e0c Mon Sep 17 00:00:00 2001 From: Tomi Virtanen Date: Fri, 28 Nov 2025 12:00:07 +0200 Subject: [PATCH 7/7] Updated development-mode page and added a link --- .../configuration/development-mode/index.adoc | 49 ++++++++++++++++--- articles/upgrading/index.adoc | 2 + 2 files changed, 45 insertions(+), 6 deletions(-) diff --git a/articles/flow/configuration/development-mode/index.adoc b/articles/flow/configuration/development-mode/index.adoc index 2d0d9ee27d..cfb757e223 100644 --- a/articles/flow/configuration/development-mode/index.adoc +++ b/articles/flow/configuration/development-mode/index.adoc @@ -15,6 +15,49 @@ Development mode is designed to make it easier to build applications. Changes yo The amount of data sent when in Development mode, though, is not optimized to be small. Conversely, <<{articles}/flow/production#, Production mode>> sends as little data as possible to the end user's browser. It optimizes performance wherever possible. In this mode, no development tools are used, and debugging information is disabled. +Development mode is opt-in feature. To enable it, add following dependency to your build configuration: + +[.example] +-- +[source,xml] +---- + + + com.vaadin + vaadin-dev + + + true + +---- + +[source,groovy] +---- + +// In general, enable by adding vaadin-dev in dependencies. +dependencies { + implementation('com.vaadin:vaadin-dev') +} + + +// For production configurations, add vaadin-dev dependency only +// for runtimeClasspath. +configurations { + developmentOnly + runtimeClasspath { + extendsFrom developmentOnly + } +} + +dependencies { + developmentOnly('com.vaadin:vaadin-dev') +} + +---- +-- == Development Mode Methods @@ -178,10 +221,6 @@ Here's an example that excludes both professional and core components by adding com.vaadin vaadin-core-components - - com.vaadin - copilot - com.vaadin vaadin-icons-flow @@ -190,8 +229,6 @@ Here's an example that excludes both professional and core components by adding ---- -Also, `copilot` is excluded. This is recommended because Copilot depends on core components and won't work without them. - Vaadin's Lumo theme isn't excluded. `vaadin-icons-flow` is excluded in the example because it's otherwise included by Lumo theme dependency. To also exclude theme, add `vaadin-lumo-theme` exclusions and use <<../../../styling/advanced/disabling-default-theme.adoc#,NoTheme annotation>> to disable the default theme. Set `vaadin.npm.excludeWebComponents` <<../properties.adoc#,configuration property>> to `true` to exclude professional and core components, including `hilla-auto-crud`, from [filename]`package.json`. Lumo theme is not excluded. diff --git a/articles/upgrading/index.adoc b/articles/upgrading/index.adoc index c02be2e56e..19021433a8 100644 --- a/articles/upgrading/index.adoc +++ b/articles/upgrading/index.adoc @@ -197,6 +197,8 @@ dependencies { ---- -- +More detailed instructions can be found in <<{articles}/flow/configuration/development-mode#development-mode, Development Mode>>. + == Hilla Vaadin Spring Boot Starter no longer includes Hilla by default. In case you have react views, add `hilla-spring-boot-starter` to work together with `vaadin-spring-boot-starter` in your build configuration.