Did spring initializr stop support for spring boot 2.X?

3.3k Views Asked by At

I started a project using spring boot 2.7.16 couple of weeks ago. I generated the pom.xml file using spring initilizr (https://start.spring.io/). But today when I try to create another project with 2.7.16, I couldn't see any of the spring boot 2.x versions, it displays only 3.x. My question is, going forward, can't we use spring initializr for old version for spring boot project?

Just I want to know is there any alternate to generate pom files for Spring boot 2.x.

1

There are 1 best solutions below

0
On

The current version of Java on the market is 21, and a new version, version 22, is expected to be released shortly. Java versions are released every 6 months, with long-term support provided for versions 8, 11, 17, and 21.

Moving forward, Spring Boot is also keeping pace with frequent updates. Dependencies for older versions of Spring, specifically 2.x, have been removed from the Spring Initializr. As a result, you will no longer be able to select these older versions when generating a new project.

Answering your question: There may be various reasons for choosing an older version of Spring Boot, such as project requirements or hardware limitations. You can manage Spring Boot dependencies by downloading the project from the Spring Initializr. Afterward, you can modify the Spring Boot version by adjusting the following dependency:

<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>2.7.13</version>  <!-- Use the version you want -->
    <relativePath/>
</parent>

Ensure to update the Java version accordingly:

<properties>
    <java.version>1.8</java.version>
</properties>

Make sure to build your project afterwards, using

mvn clean install

Remove all the version tags apart from the above dependency so that when you build your project maven can automatically download the suitable dependencies for your project.

You can find information about compatible versions of Spring and Java on this link

I hope this answers your question.

Though I would suggest to use the latest version of the spring boot.