파란하늘의 지식창고
반응형

2.0 마일스톤 버전 나올 때마다 조금씩 체크했던 내용.

현재는 Spring Boot 2.0 Migration Guide 를 참고하면 됨

마일스톤 별로 바뀐거 찾을 일이 있을까 싶어 기록용으로 남겨둠

spring-Boot와 spring-cloud 간 연동 버전 관련 정보는 spring cloud Release Note를 참고

properties가 변경된 내용은 Spring Boot 2.0 Configuration Changelog 를 참고

Property Binding in Spring Boot 2.0


RelaxedPropertyResolver, PropertySourceUtils 가 제거되고 Binder 를 제공함 (org.springframework.boot.bind 패키지가 없어짐)

Spring-boot-actuator 내에 autoconfigure를 관리하던 부분이 spring-boot-actuator-autoconfigure로 관리가 분리됨.

M1

HikariCP 가 기본으로 지정됨

M4 변경 부분

DataSourceBuilder 위치 org.springframework.boot.autoconfigure.jdbc -> org.springframework.boot.jdbc로 이동 

management.security.enabled 속성 deprecated 된 부분 확인 필요

A global security auto-configuration 으로 설정이 변경되었다네?

Actuator 설정이 endpoints.*로 활성화 됨

@EndPoint 어노테이션 추가

endpoints.default.web.enabled=true 로 웹 접근 처리 

Spring boot-actuator-autoconfigure 

Management.endpoints.cors.* 기능 추가

M5 변경 부분

Spring Boot 2.0.0 M5 available now

Spring security oauth2 처리가 변경됨

Hibernate validator groupId 변경됨

org.hibernate. -> org.hibernate.validator

@NotEmpty, @NotBlank, @Email이 hibernate -> validation-api 2.0으로 변경됨 (hibernate쪽은 deprecated 선언됨)

그 밖의 validation annotation 관련 변경 사항들이 있음 

M6 변경 부분

Spring Boot 2.0.0 M6 Release Notes

Spring Boot 2.0.0 M6 Configuration Changelog

Actuator 설정 변수 management -> management.server 로 변경됨

에러 처리를 위한 WebExceptionHandler 를 제공 (에러 처리에 대해 신규 기능 검토 필요)

https://docs.spring.io/spring-boot/docs/2.0.0.M6/reference/html/boot-features-developing-web-applications.html#boot-features-webflux-error-handling

ConfigurationProperties에 validation 기능이 추가되었다고 함.

spring.jpa.open-in-view, spring.jpa.mapping-resources 역할은 무엇인지 확인 필요

M7 변경 부분

Spring Boot 2.0.0 M7 Release Notes

Spring Boot 2.0.0 M7 Configuration Changelog

Actuator endpoint 주소 변경

/application -> /actuator

Actuator Status 속성 제거, health 속성으로 사용

노출 처리 설정 enabled 제거, expose, exclude로 지정 처리로 변경

actuator에서 Auto configuration report 확인 기능 변경 (기존 설정 주소 변경 및 기능 추가)

Jackson 기본 설정 처리 변경 (ISO-8603 문자열 직렬화 처리가 기본 처리)

spring.jackson.serialization.write-dates-as-timestamps=false 가 기본이 됨.

commons-digester 관리 제외됨.

Spring social auto configuration 대상 제외

RC1 변경 부분

Spring Boot 2.0.0 RC1 Release Notes

HikariCP 버전 변경 이후 DataSource build를 통해 data jpa의 generate ddl 처리는 정상 동작함.

이후 다시 DataSource의 setPassword를 호출하면서 sealed 체크에서 exception 발생함.

  1. HikariCP sealed처리로 인해 Builder와 @ConfigurationProperties를 조합한 사용이 불가능 (Binder에서 property bind하는 시점과 initializingBean 처리의 afterpropertyset 의 중복 수행 시 오류 발생
  2. JdbcProperties를 분리 생성시 DataSource Bean 등록에 @ConfigurationProperties 사용 하면 안됨. (마찬가지로 property bind 중복 실행으로 인해 sealed 호출 에러 발생 (Spring 레퍼런스 문서에 설명이 잘못 된 듯)
  3. JdbcProperties를 사용시 HikariDataSource 설정인 jdbc-url은 사용하지 않음. url로 사용해야함.
    • Db마다 설정 변수나 속성이 다른 부분에 대해 boot에서 1.2.0 이후 DataSourcePoolMetadataProvidersConfiguration를 제공하기 시작함. Url사용이유는 JdbcProperties 속성 종속이기 때문

기존

@Bean
@ConfigurationProperties(prefix = "datasource.bbs")
public DataSource bbsDataSource() {
	return DataSourceBuilder.create().build();
}


변경

@Bean
@ConfigurationProperties("datasource.bbs")
public DataSourceProperties bbsDataSourceProperties() {
	return new DataSourceProperties();
}

@Bean
public DataSource bbsDataSource(DataSourceProperties bbsDataSourceProperties) {
	return bbsDataSourceProperties.initializeDataSourceBuilder().build();
}


RC2 변경 부분

Spring Boot 2.0.0 RC2 Release Notes

RELEASE 변경 부분

Spring Boot 2.0 Release Notes

management.endpoints.web: expose

-> management.endpoints.web.exposure.include=*

반응형
profile

파란하늘의 지식창고

@Bluesky_

내용이 유익했다면 광고 배너를 클릭 해주세요