Updated June 13, 2023
Introduction to Spring Boot Versions
Spring boot releases various versions, but the latest spring boot version is v2.2, with many new features. As we all know, it is an open-source framework. It is used to create production-ready applications and microservices.
Versions of Spring Boot
Given below are the different versions of Spring Boot:
Older Versions:
- v1.1
- v1.2
- v1.3
- v1.4
Current Version:
- v2.0
- v2.1
- v2.2
1. v1.1
In this version test, POM, i.e., spring-boot-starter-test, will not add automatically to the parent class, i.e., spring-boot-starter-parent. They have added default-test dependencies to parent POM, but we cannot remove or change them easily.
- Multipart Configuration: They have renamed some classes like MultiPartConfigFactory has been renamed to MultipartConfigFactory.
- Error Controller: They have moved some interfaces and classes related to error handlings like errorController-related classes, and interfaces classes moved to spring-boot-autoconfigure before they are available in spring-boot-actuator. These changes are clear to the end-users; they have renamed some packages.
- Spring data auto-configuration packages: Auto-configuration files moved to sub-packages. They cannot be used directly if we want to reference them using annotation @EnableAutoConfiguration with its exclude attribute; in this case, we may require to change the imports.
- Running our spring boot application using maven: Spring boot now provides a spring-boot run to run our application from the command line with no command-line argument we need to mention.
2. v1.2
- Severs: In this version, spring boot uses some embedded servers: Tomcat 8 and Jetty 9. If you want, you can also use Tomcat 7 and Jetty 8.
- Loggers: In spring 1.2they have updated the default configuration for logging; we do not need to write log files. But we can still customize our loggers by adding logback.xml
- Configuration Property: Rename some of the property like spring.data.mongodb.repositories.enabled.. which was before spring.data.mongo.repositories.enabled.
- @SpringBootApplication: They have added one new annotation i.e. @SpringBootApplication which is the combination of some of the annotations like @ComponentScan + @configuration + @EnableAutoConfiguration. Now we only need to use this single annotation instead of these three.
- Email: They have added a new POM to support email, i.e., spring-boot-starter-mail. We can use this by just injecting ‘JavaMailSender’ into our service. Also, we can use the spring.mail.* property to customize items such as SMTP.
- Undertow: One more embedded server is added, i.e., Undertow, in addition to Tomcat and Jetty.
3. v1.3
- Developers Tool: In this spring boot version, they must include a dev tool, i.e., spring-boot-dev tools which will improve the development time experience.
This module provides us with the following:
- Automatic start of the application.
- Disable template caches.
- Support remote development.
- It also persists in HTTP sessions on restarts.
- Auto-configuration for Cache: They have provided auto-configuration for a various point
Given below are auto-configuration for various points:
- Redis
- Infinispan
- EhCache
- Guava
- JSR 107
- Hazelcast
- Apart from this, it also provides support for in-memory map-based. When we use @configuration with @EnableCaching, our application will automatically configure caching.
- Cassandra: They have also provided support for Cassandra.
4. v1.4
Third-party library upgrades:
- tomcat
- jetty
- Jackson
- spring session
- spring integration
- hibernate
- jersy
- spring rest docs
- Ehcache
- Hazelcast
- Elasticsearch etc.
- Couchbase Support: They have provided auto-configuration for Couchbase.
- Neo4J Support: They have also offered auto-configuration for Neo4J. We can now connect to the remote server; also, we can run a Neo4J server.
- Redis Spring Data Repositories: We can now use Redis with the spring data repository.
- Analysis of Startup Failure: spring now provides us with the analysis of startup failures and valuable diagnostic information.
5. v2.0
- Spring boot v2.0 needs java 8.0 as the minimum version of java. So java 8 has come across many new features like lambda expression, functional interface, stream apis, time API, default method in interfaces, etc., so many existing applications are updating themselves to use these java8 features.
Third-party library updates :
- Hibernate
- tomcat
- Thymeleaf
- Flyway
- Property Binding Configuration: This process binds our environment process to @ConfigurationProperties.
- Netty Server: Offer support for Netty as an embedded server. For his spring-boot-starter-webflux, POM will pull the netty for us.
- Kotlin: In this version, Spring Boot also provides support for Kotlin.
- Actuator Improvements: They have provided all HHTP endpoints to the actuator; also, the JSON payloads are improved. They also have so many improvements tit the actuator endpoints in this version.
- Hypermedia: Now, the actuator endpoint is available in link format.
- Actuator Endpoint: Now, we can use @Endpoint annotation with @DeleteOperation, @ReadOperation, and @WriteOperation to develop our endpoint.
6. v2.1
Third-party library :
- Micrometer
- Tomcat
- Hibernate
- Undertow
- JUnit
- Data Size Support: With this release, they support metadata and easy format. If a property wants to declare its size, it can use org.springframework.util.unit.data size.
- Logging: They have configured loggers in the one-shot. We can configure the Tomcat group, which will do Catalina, coyote, and Tomcat logger in one single shot.
- Task Scheduling: We can customize the task scheduler using spring.task.scheduling. Spring boot configures the task scheduling when we use the @EnableScheduling annotation in our application. Now TaskSchedulerBuilder is the default.
- Task Execution: We can create a custom ThreadPoolTaskExecutor by using TaskExecutorBuilder. This version of spring provides auto-configuration for task executors.
- Kafka Streams Support: They now provide auto-configuration for Kafka support by declaring org.apache.Kafka:Kafka-streams dependency.
- Spring JDBC Support: Now, spring boot will automatically configure JDBC when we provide the necessary dependencies on the classpath. Or we can also include them by using a single dependency spring-boot-starter-data-jdbc.
7. v2.2
- Performance Improvements: In this version, there are performance improvements by adding proxyBeanMethods into the class, which contains @configuration annotation. We need to set this property as false, like proxyBeanMethods=false; it is the new attribute of the @configuration annotation.
- They have disabled the Tomcat registry by default. Also, they have reduced the tomcat memory by 2MB.
- They have reduced the time taken by the @configuration property.
- Now the beans related to the Actuator endpoint only be created if the given endpoint is exposed and enabled.
- They also improved the condition for auto-configuration; now, code will no longer be configured if it is not used.
- Kubernetes: Now, they can detect whether the application is running on Kubernetes or not.
- Lazy Initialization: Now we can also enable the global lazy-initialization; for this, we need to use some property, i.e., spring.main.lazy-initialization.
Conclusion
So spring boot runs on the latest version, v2.2, with all new features to make our application a small service, says microservices.
Recommended Articles
This is a guide to Spring Boot Versions. Here we discuss the introduction and different versions of Spring Boot in detail. You may also have a look at the following articles to learn more –