파란하늘의 지식창고
Published 2018. 10. 31. 16:26
Spring Boot 2.1.0 Release Study/Java
반응형

Spring Boot 2.1.0 이 릴리즈 되었다.

이전 버전은 2.0.6.RELEASE 였다.

Spring Framework 5.1 기반이다.

Spring Boot 2.1.0 Blog

Spring Boot 2.1 Release Notes

Upgrading to Spring Framework 5.x

마이너 버전이 변경되어서 판올림 시 변경해줘야 하는 부분이 있다.

Spring Boot 2.1.0 Configuration Changelog


변경 작업을 하면서 확인한 부분

Servlet Path

기존 server.servlet.path 가 spring.mvc.servlet.path로 변경

Spring Version POM Property

pom에서 사용하던 spring.version 속성이 spring-framework.verision으로 변경

네이밍을 맞추기 위한 변경인 듯.

Thymeleaf Spring Security Extras

thymeleaf-extras-springsecurity4 -> thymeleaf-extras-springsecurity5 변경

(2.0.X 에서는 thymeleaf5를 쓰면서 thymeleaf-extras-springsecurity4를 사용하였음)

이와 관련해서 기존에 사용하던 네임스페이스가 버전마다 관리할 필요 없도록 통합된 버전으로 변경이 되었다.

<html xmlns:sec="http://www.thymeleaf.org/extras/spring-security">

기존엔 spring-security4로 선언하여 사용하였다.

MySql JDBC Driver

MySql driver가 5.1.x에서 8.0.x로 버전이 변경되었다.

이와 관련해서 서버 실행 시 아래의 오류가 발생하는 경우가 있다.

The server time zone value '´ëÇѹα¹ Ç¥ÁؽÃ' is unrecognized or represents more than one time zone. You must configure either the server or JDBC driver (via the serverTimezone configuration property) to use a more specifc time zone value if you want to utilize time zone support.

왜인지는 모르겠지만 8.0.x로 변경되면서 timezone 값을 올바르게 가져와서 인식하지 못해서 발생하는 오류이다.

에러가 발생한 서버는 window 에 설치된 mysql 서버였고 아래와 같이 확인시 올바르지 못한 문자열로 조회 되었다.

SELECT @@system_time_zone

KST로 설정되어 있는 경우도 해당 오류가 발생한다고 한다.

이 경우 jdbc connection string에 timezone 정보를 명시해주면 된다.

jdbc:mysql://localhost:3306/somedb?serverTimezone=Asia/Seoul

Environment acceptsProfiles

기존 boolean acceptsProfiles(String... profiles) 메소드는 deprecated 선언되었고 boolean acceptsProfiles(Profiles profiles) 메소드가 추가되었다.

기존에는 "A", "!B" 와 같이 배열로 넘겨받고 !만 사용 가능하여 or 조건으로 여러 개의 변수를 체크하던 제약에서 벗어나 and 조건도 혼용해서 다양한 프로파일 조건을 체크할 수 있게 되었다.

예를 들면 다음과 같다.

environment.acceptsProfiles(Profiles.of("a & !b"))

LocaleChangeInterceptor languageTagCompliant deprecated

기존엔 locale 변경시 ko_KR (java toString 형태), ko-KR (BCP 47 형태)과 같은 요청에 대해 둘 중 하나만 선택해서 사용해야했다.

5.1 이후엔 두 유형 모두 융통성 있게 처리하게 되어 둘 중 어떤걸 사용할지 선택하던 선언 설정 항목이 제거되었다.

Content Negotiation for Error Responses

기존엔 @RequestMapping에 produce를 선언하면 에러가 발생해도 해당 선언을 따라 응답을 처리했다.

spring 5.1.0 이 후엔 client에서 요청 시 content-type을 명확하게 보내거나 확장자를 사용하는 경우 .json과 같은 형태로 보내야 에러에 대해 해당 유형으로 응답을 처리하게 변경되었다.

이로 인해 기존에 설정한 ajax 요청에 대해 확인이 필요하다.

이 외에 눈에 띄는 내용

Third-party Library Upgrades

Tomcat 9, Undertow 2, Hibernate 5.3, JUnit 5.2, Micrometer 1.1

Java 11 Support

STS가 아직 11 지원이 안나와서 좀더 기다려보고 변경해봐야겠다.

DataSize Support

property 속성으로 단위를 지정하기 편하도록 DataSize를 제공

Logging Groups

로깅 대상을 그룹핑해서 로그 레벨을 지정하는 기능

Spring Data JDBC Support

이것도 한번 써봄직 하다

반응형
profile

파란하늘의 지식창고

@Bluesky_

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