이전에는 spring-boot-starter-web 쓰면 무조건 Spring MVC 였는데, WebFlux 지원을 위해 spring-boot-starter-mustache, spring-boot-starter-freemarker and spring-boot-starter-thymeleaf 가 새로 나옴
또한 spring-boot-starter-web or spring-boot-starter-webflux 둘중에 하나 골라라
Template Engines
Thymeleaf
Thymeleaf 3 로 업그레이드
이제 thymeleaf-layout-dialect 이 기본적으로 포함 안됨. layout 을 원하면 직접 디펜던시 추가해라
Mustache Templates Default File Extension
Mustache templates 기본 확장자는 .html 인데 이제는 .mustache 다
@ConditionalOnBean(This.class)
static class ThisCondition {
}
@ConditionalOnBean(That.class)
static class ThatCondition {
}
}
# Spring Boot Actuator
## Build
* 기존에는 spring-boot-actuator 랑 spring-boot-actuator-autoconfigure 가 있었는데, 앞으로는 spring-boot-starter-actuator 만 추천
## Configuration Keys Structure
* property 이름이 바뀜. 원래 문서 참고
## Base Path
* `/actuator` 가 기본 endpoints
## Audit Event API Change
* 생략
## Endpoints
* HTTP actuator endpoint 를 사용하려면, enabled and exposed 둘다 필요하다
* Spring Security 와 관련없이 /health and /info 는 노출 됨
* /shutdown 을 제외한 모든 endpoints 활성화
* 모든 endpoints 노촐하기
## Endpoint Format
### Overhaul of the "/actuator/mappings" Actuator Endpoint
* 생략
### Overhaul of the "/actuator/httptrace" Actuator Endpoint
* 생략
## Migrate Custom Endpoints
* 생략. 필요하면 문서 보세요
# Metrics
## Setting up Micrometer
* Actuator 사용중이면 메트릭 자동구성 해줌.
* Prometheus, Atlas or Datadog 등을 위한 디펜던시 제공 함
## Migrating Custom Counters/Gauges
* 생략
## Spring Boot 1.5 Support
* 생략
# Developer Tools
## Hot swapping
* 제거됨. Devtools 쓰세요
## Devtools Remote Debug Tunnel
* tunnelling remote debugging over HTTP 가 제거됨
# Removed Features
* CRaSH support
* Auto-configuration and dependency management for Spring Mobile.
* Auto-configuration and dependency management for Spring Social. Please check the Spring Social project for more details.
* Dependency management for commons-digester.
* Test support in the CLI (i.e. spring test)
# Dependency Versions
The minimum supported version of the following libraries has changed:
* Elasticsearch 5.6
* Gradle 4
* Hibernate 5.2
* Jetty 9.4
* Spring Framework 5
* Spring Security 5
* Spring Integration 5 (see also their migration guide)
* Tomcat 8.5
https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-2.0-Migration-Guide
Before You Start
Upgrade to the latest 1.5.x version
Review dependencies
Review custom configuration
Review system requirements
Upgrade to Spring Boot 2
Configuration properties migration
spring-boot-properties-migrator
해봐라Next steps
Building Your Spring Boot Application
Spring Boot Gradle Plugin
Dependency Management
Building Executable Jars and Wars
bootRepackage
task 가bootJar
와bootWar
로 나눠짐Spring Boot Features
Default Proxying Strategy
SpringApplication
Web Environment
Spring Boot Application Events Changes
ApplicationStartedEvent
가 추가 됨Externalized Configuration
Relaxed Binding
@ConditionalOnProperty
에서 canonical format 만 써라 (acme.my-property and not acme.myProperty)Binding on static methods
@ConfigurationProperties Validation
@Validated
로 유효성 검사 해라Configuration Location
Developing Web Applications
Embedded containers package structure
Servlet-specific server properties
server.*
properties -> server.servletWeb Starter as a Transitive Dependency
Template Engines
Thymeleaf
Mustache Templates Default File Extension
Jackson / JSON Support
Spring MVC Path Matching Default Behavior Change
GET /projects/spring-boot.json
이렇게 쓰지마라. media-type 은 ACCEPT 헤더로 할것Servlet Filters
DipatcherType.REQUEST
RestTemplateBuilder
requestFactory(ClientHttpRequestFactory)
method ->requestFactory(Supplier<ClientHttpRequestFactory> requestFactorySupplier)
methodWebJars Locator
org.webjars:webjars-locator
->org.webjars:webjars-locator-core
Custom DispatcherServlet registration
Security
Default Security
Default User
AuthenticationManager Bean
@Bean
을 붙혀라OAuth2
Actuator Security
sensitive
flag 는 각 endpount 에서 명확하게 구성해라Working with SQL Databases
Configuring a DataSource
WARN Message for Implicit 'open-in-view'
spring.jpa.open-in-view
를 명시적으로 enable 안하면 startup 시 WARN 메시지 로그 뜸JPA
HibernateJpaAutoConfiguration
extend 지원 안함HibernatePropertiesCustomizer
로Id generator
Flyway
spring.flyway
namespace 로 옮김Liquibase
spring.liquibase
namespace 로 옮김Database Initialization
Updated Default 'create-drop' Handling
Working with NoSQL Technologies
Redis
Elasticsearch
Caching
Dedicated Hazelcast Auto-configuration for Caching
GuavaCacheManager
RedisCacheManager
CacheManager
implementation 이 많이 바뀌어서, 도큐먼트 보세요Batch
Testing
Mockito 1.x
EnvironmentTestUtils
Creating Your Own Auto-configuration
ConditionalOnBean semantic change
ConditionalOnBean 은 OR -> AND
ThisOrThatCondition() { super(ConfigurationPhase.REGISTER_BEAN); }
@ConditionalOnBean(This.class) static class ThisCondition {
}
@ConditionalOnBean(That.class) static class ThatCondition {
}
}
management.endpoints.web.exposure.include=*
management.endpoint.shutdown.enabled=true
management.endpoints.web.exposure.include=* management.endpoints.web.exposure.exclude=env