Spring Boot 2.x
Categories
Composite Recipes
Recipes that include further recipes, often including the individual recipes below.
- Add
javax.validation-api
dependency - Migrate Spring Boot 2.x projects to JUnit 5 from JUnit 4
- Migrate Spring Boot properties to 2.0
- Migrate Spring Boot properties to 2.1
- Migrate Spring Boot properties to 2.2
- Migrate Spring Boot properties to 2.3
- Migrate Spring Boot properties to 2.4
- Migrate Spring Boot properties to 2.5
- Migrate Spring Boot properties to 2.6
- Migrate Spring Boot properties to 2.7
- Migrate flyway and liquibase credentials
- Migrate from Spring Boot 1.x to 2.0
- Migrate to Spring Boot 2.1
- Migrate to Spring Boot 2.2
- Migrate to Spring Boot 2.3
- Migrate to Spring Boot 2.4
- Migrate to Spring Boot 2.6
- Migrate to Spring Boot 2.7
- Spring Boot 2.x best practices
- Upgrade to Spring Boot 2.5
- Use
WebServerFactoryCustomizer
- Use
javax.validation.constraints
Recipes
- Add missing
@Configuration
annotation - Adds
@DependsOnDatabaseInitialization
to Spring Beans and Components depending onjavax.sql.DataSource
- Adjust configuration classes to use the
WebServerFactoryCustomizer
interface - Convert
HeadersConfigurer
chained calls into Lambda DSL - Convert
HttpSecurity
chained calls into Lambda DSL - Convert
ServerHttpSecurity
chained calls into Lambda DSL - Merge Spring
bootstrap.yml
withapplication.yml
- Migrate
@OutputCaptureRule
to@ExtendWith(OutputCaptureExtension.class)
- Migrate
RestTemplateBuilder
- Migrate deprecated
ActuatorMediaType
toApiVersion#getProducedMimeType
- Migrate deprecated Spring-Boot
EmbeddedDatabaseConnection.HSQL
- Migrate multi-condition
@ConditionalOnBean
annotations - Migrate to recommended constants in
LogbackLoggingSystemProperties
from deprecated values inLoggingSystemProperties
- Move SAML relying party identity provider property to asserting party
- Remove
@SpringExtension
- Remove obsolete Spring JUnit runners
- Remove unnecessary Spring
@RunWith
- Replace
@ExtendWith
and@ContextConfiguration
with@SpringJunitConfig
- Replace
EnvironmentTestUtils
withTestPropertyValues
- Use
AutoConfiguration#imports
- Use
DiskSpaceHealthIndicator(File, DataSize)
- Use
EnableConfigurationProperties.VALIDATOR_BEAN_NAME
- Use
ErrorAttributes#getErrorAttributes(WebRequest, ErrorAttributeOptions)
- Use
ErrorProperties#IncludeStacktrace.ON_PARAM
- Use
MultipartConfigFactory
withDataSize
arguments - Use
PingHealthIndicator
- Use
RestClientBuilderCustomizer
- Use
RestTemplateBuilder#basicAuthentication
- Use
RestTemplateBuilder#setConnectTimeout(Duration)
andRestTemplateBuilder#setReadTimeout(Duration)
- Use
WebTestClientBuilderCustomizer
- Use
isEagerFilterInit()
- Use
org.springframework.boot.autoconfigure.http.HttpMessageConverters
- Use
org.springframework.boot.web.server.LocalServerPort
- Use
org.springframework.boot.web.servlet.error.ErrorController
- Use
org.springframework.boot.web.servlet.support.SpringBootServletInitializer
- Use
setEagerFilterInit(boolean)
- Use
spring-boot.run.agents
configuration key inspring-boot-maven-plugin