파란하늘의 지식창고
Spring Boot가 2.3.x 이후 build tool을 Gradle로 바꾸다.
Study/Java 2020. 7. 14. 08:45

spring-framework project는 이미 오랜 기간 동안 Gradle을 사용하였다. (그전에 Ivy를 쓴 적도 있던 것으로 기억한다.) spring-boot project의 경우 줄곧 maven을 사용하였다. (이것도 무슨 이유였는지 찾아보진 않았다...) 그런데 이번 2.3.x 버전 이후 spring-boot project도 build tool을 gradle로 변경하였다. https://github.com/spring-projects/spring-boot/issues/19608 Port the build to Gradle · Issue #19608 · spring-projects/spring-boot Dismiss Join GitHub today GitHub is home to over 50..

Spring Boot Dynamic Bean 등록
Study/Java 2020. 6. 25. 07:14

Spring Boot는 설정을 자동화해주어 많은 부분에서 편리하지만 datasource 설정 같은 것들은 단일 설정에 대해서 자동화를 제공해주어 여러 datasource를 사용하는 경우 개별 설정해야 한다. 비슷한 설정을 반복 선언하여 사용하는 것도 불편하여 properties에 설정이 있으면 자동으로 빈을 생성해주는 처리가 있었으면 하는 요구사항이 생기게 된다. 예를 들어 mongo를 사용하는 경우 Spring이 제공하는 기본 설정은 다음과 같다. spring.data.mongodb.host=127.0.0.1 spring.data.mongodb.port=27017 spring.data.mongodb.authentication-database=admin spring.data.mongodb.username..

[troubleshooting] 아직 명확한 해결법을 찾지 못한 Spring Boot web No ServletContext set 에러 현상
Study/Java 2020. 6. 5. 19:57

spring boot 2.3.0에서 아무것도 없이 빈 web을 띄울 때 아래 에러가 발생했다. 자체 구현한 autoConfigure 모듈을 사용한 아무것도 없는 빈 프로젝트 구축의 경우였다. org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'resourceHandlerMapping' defined in class path resource [org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfiguration$EnableWebMvcConfiguration.class]: Bean instantiation via factory method ..

Spring Boot 2.3 Release Notes
Study/Java 2020. 5. 26. 15:10

전체 Release Notes 목록은 이 곳에서 확인할 수 있습니다. https://luvstudy.tistory.com/tag/Release%20Notes Spring Boot 2.3 Release Notes spring-projects/spring-boot Spring Boot. Contribute to spring-projects/spring-boot development by creating an account on GitHub. github.com Spring Boot 2.3이 지난 5월 15일 Release 되었다. Upgrading from Spring Boot 2.2 Deprecations from Spring Boot 2.2 deprecated 상태였던 상당 수의 class, method..

article thumbnail
Spring Custom HandlerExceptionResolver 사용하기
Study/Java 2020. 2. 18. 09:33

Spring Framework 5.2.3.RELEASE, Spring Boot 2.2.4.RELEASE 기준으로 작성됨 Spring webmvc를 사용하는 경우에 대한 설명 Spring Framework를 쓰면 @ExceptionHandler를 사용하여 전역 에러 처리를 한다. (기존 작성한 글 참조) 2019/04/30 - [Study/Java] - Spring Boot 전역 에러 처리 Spring Boot 전역 에러 처리 Spring 5.1.6, Spring Boot 2.1.4 기준 문서 정리 Spring framework는 전역 에러를 처리하기 위해 아래의 인터페이스를 제공한다. 제공되는 interface servlet (webmvc) HandlerExceptionResolver reacitve (..

Spring Boot @PropertySource 호출 순서 지정하기
Study/Java 2020. 1. 9. 14:58

multi module 환경에서 @PropertySource를 사용하는 방법에 대해 소개한 적이 있다. 2018/12/10 - [Study/Java] - Spring Boot multi module, multi profile 환경에서 @PropertySouce 사용하기 이런 multi module 환경에서 상위 모듈에 지정된 property 값을 특정 모듈에서는 다른 값을 재 지정해서 쓰고 싶은 경우가 있다. @PropertySource에 order 기능이 있으면 쉽겠지만 아쉽게도 그런 기능은 아직 제공하지 않는다. 따라서 이런 경우 environment에 등록된 propertySource 목록에 대해 순서를 재 지정해 우선순위를 조절해야 한다. 물론 java 내에서 application start 시점..

article thumbnail
Spring Boot 2.2 Release Notes
Study/Java 2019. 10. 18. 06:03

Spring Boot 2.2 Release Notes Upgrading from Spring Boot 2.1 Deprecations from Spring Boot 2.1 2.1에 deprecated 선언되었던 class, method, properties가 삭제되었다. Spring Framework 5.2 Spring Framework가 5.2로 업그레이드 되었다. JMX now disabled by default JMX 기본 설정이 disabled 로 변경되었다. 해당 기능을 활성화 하려면 spring.jmx.enabled=true 설정을 사용한다. IDE 특징을 사용하여 applicatio을 관리하는 경우 해당 flag도 활성화 할 수 있다. Jakarta EE dependencies javax. 를..

Spring Boot servlet filter 사용하기
Study/Java 2019. 7. 3. 10:20

ServletContext와 ApplicationContext의 연동 filter를 설명하기 전 기본적인 설명 servlet은 ServletContext를 사용한다. java.servlet.Filter는 javax.servlet-api나 tomcat-embed-core를 사용하면 제공되는 servlet filter interface이다. spring은 ApplicationContext를 사용한다. servlet에서 spring을 사용하기 위해선 servlet의 ServletContext에 spring의 ApplicationContext를 연동해야 한다. Spring은 ApplicationContext를 servlet에서 사용하기 위한 ServletWebServerApplicationContext를 제공하..