Quick start to Spring Boot 4, Java 25, and Vaadin 25

Hi all,

Just tested that if you have an existing standard Spring Boot 3 and Vaadin 24 project, the steps upgrading that to Spring Boot 4 ( Spring Framework 7) and the latest Vaadin/Java versions are pretty simple.:

Start by updating the Spring Boot version by updating the project parent:

<parent> 
    <groupId>org.springframework.boot</groupId> 
    <artifactId>spring-boot-starter-parent</artifactId> 
    <version>4.0.0</version> 
   <relativePath/> <!-- lookup parent from repository -->
</parent>

Update Java and Vaadin versions to 25 (latest beta for Vaadin):

<java.version>25</java.version>
<vaadin.version>25.0.0-beta8</vaadin.version>

Add back Vaadin development mode and Copilot for local development:

<dependency>
    <groupId>com.vaadin</groupId>
    <artifactId>vaadin-dev</artifactId>
    <optional>true</optional> 
</dependency>

Use the Lumo stylesheet annotation in your Application.java :

@StyleSheet(Lumo.STYLESHEET)

In IntelliJ IDEA you should also use jbr-25 to run your application locally to get the HotSwap benefits.

Now if we only could use the compact class for main :slight_smile:

3 Likes

I saw different strategies to include vaadin-dev for the upcoming next major version - either with or without optional=true.

Why did you choose not to apply optional=true?

<optional>true</optional> is the official way and also what you get from e.g. start.vaadin.com if you choose Vaadin 25 there.

1 Like

Wait, Copilot works with Java 25 now? I thought it only worked with Java 21.

You mean the hot swap (dcevm) features? For those Copilot requires JBR and it wasn’t long ago when Java 25 version of that was released.

1 Like