Skip to content

Commit ae31eec

Browse files
whqtkersukangpunch
andauthored
refactor: spring boot 버전 업에 관한 레거시 변경 및 제거 (#710)
* refactor: Java, SpringBoot 버전 업 & JJWT 버전 업 (#702) * refactor: Spring Boot, Java 및 주요 의존성 버전업, commons-lang3 추가 - SpringBoot 버전업 (-> 3.5.11) - Java 버전업 (-> 21) - JJWT 버전업 (-> 0.12.6) - 기존 EnumUtils deprecate 대응을 위해 org.apache.commons:commons-lang3 의존성 추가 * refactor: JJWT deprecated API를 신규 API로 마이그레이션 * chore: ci/cd 파일 및 도커파일Java 17 → 21, Spring Boot 버전 업 반영 * test: @MockBean, @spybean을 @MockitoBean, @MockitoSpyBean으로 마이그레이션 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * fix: 누락된 변경사항 추가 * refactor: 코드래빗 리뷰사항 적용 - 테스트에서 Token 생성 시, TTL을 30초로 수정 - TTL이 너무 짧으면 테스트가 간헐적으로 꺠질 위험 존재 * refactor: ANT_PATH_MATCHER 삭제 * refactor: min-spare 잘못된 prefix 변경 * refactor: spring.jpa.database 설정 삭제 * refactor: spring.datasource.driverClassName 삭제 * refactor: JJWT 버전 업에 따른 패키지 임포트 변경 * refactor: cloud.aws.stack.auto 제거 * refactor: parameter store 의존성 버전 제거 * refactor: redis deprecated 생성자 교체 * test: 테스트 환경에서 파라미터 스토어 구성 비활성화 * docs: 스프링부트 버전 수정 --------- Co-authored-by: hyungjun <115551339+sukangpunch@users.noreply.github.com>
1 parent 3fae55e commit ae31eec

File tree

9 files changed

+23
-37
lines changed

9 files changed

+23
-37
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ dependencies {
6868
// Etc
6969
implementation platform('software.amazon.awssdk:bom:2.41.4')
7070
implementation 'software.amazon.awssdk:s3'
71-
implementation 'io.awspring.cloud:spring-cloud-aws-starter-parameter-store:3.0.4'
71+
implementation 'io.awspring.cloud:spring-cloud-aws-starter-parameter-store:3.4.2'
7272
implementation 'org.hibernate.validator:hibernate-validator'
7373
implementation 'org.springframework.boot:spring-boot-starter-websocket'
7474
implementation 'org.apache.commons:commons-lang3'

claude.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ public class UserCreateResponse { ... }
167167

168168
### Core Framework
169169

170-
- **Spring Boot 3.1.5**: 스프링 부트
170+
- **Spring Boot 3.5.11**: 스프링 부트
171171
- **Spring Security**: JWT 기반 인증
172172
- **Spring Data JPA**: ORM
173173
- **QueryDSL**: 동적 쿼리 생성

src/main/java/com/example/solidconnection/common/config/redis/RedisConfig.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import static com.example.solidconnection.redis.RedisConstants.CREATE_CHANNEL;
44

55
import com.example.solidconnection.cache.CacheUpdateListener;
6+
import com.fasterxml.jackson.databind.ObjectMapper;
67
import org.springframework.beans.factory.annotation.Value;
78
import org.springframework.context.annotation.Bean;
89
import org.springframework.context.annotation.Configuration;
@@ -49,7 +50,7 @@ public RedisTemplate<String, String> redisTemplate() {
4950
public RedisTemplate<String, Object> objectRedisTemplate() {
5051
RedisTemplate<String, Object> redisTemplate = new RedisTemplate<>();
5152
redisTemplate.setKeySerializer(new StringRedisSerializer());
52-
redisTemplate.setValueSerializer(new Jackson2JsonRedisSerializer<>(Object.class));
53+
redisTemplate.setValueSerializer(new Jackson2JsonRedisSerializer<>(new ObjectMapper(), Object.class));
5354
redisTemplate.setConnectionFactory(redisConnectionFactory());
5455
return redisTemplate;
5556
}

src/main/java/com/example/solidconnection/common/filter/HttpLoggingFilter.java

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,20 @@
1313
import org.slf4j.MDC;
1414
import org.springframework.http.HttpStatus;
1515
import org.springframework.stereotype.Component;
16-
import org.springframework.util.AntPathMatcher;
16+
import org.springframework.http.server.PathContainer;
1717
import org.springframework.web.filter.OncePerRequestFilter;
18+
import org.springframework.web.util.pattern.PathPattern;
19+
import org.springframework.web.util.pattern.PathPatternParser;
1820

1921
@Slf4j
2022
@RequiredArgsConstructor
2123
@Component
2224
public class HttpLoggingFilter extends OncePerRequestFilter {
2325

24-
private static final AntPathMatcher PATH_MATCHER = new AntPathMatcher();
25-
private static final List<String> EXCLUDE_PATTERNS = List.of("/actuator/**");
26+
private static final PathPatternParser PATH_PATTERN_PARSER = new PathPatternParser();
27+
private static final List<PathPattern> EXCLUDE_PATTERNS = List.of(
28+
PATH_PATTERN_PARSER.parse("/actuator/**")
29+
);
2630
private static final List<String> EXCLUDE_QUERIES = List.of("token");
2731
private static final String MASK_VALUE = "****";
2832

@@ -60,9 +64,9 @@ protected void doFilterInternal(
6064
}
6165

6266
private boolean isExcluded(HttpServletRequest req) {
63-
String path = req.getRequestURI();
64-
for (String p : EXCLUDE_PATTERNS) {
65-
if (PATH_MATCHER.match(p, path)) {
67+
PathContainer path = PathContainer.parsePath(req.getRequestURI());
68+
for (PathPattern p : EXCLUDE_PATTERNS) {
69+
if (p.matches(path)) {
6670
return true;
6771
}
6872
}

src/main/java/com/example/solidconnection/score/repository/custom/LanguageTestScoreFilterRepositoryImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import static com.example.solidconnection.score.domain.QLanguageTestScore.languageTestScore;
44
import static com.example.solidconnection.siteuser.domain.QSiteUser.siteUser;
5-
import static io.jsonwebtoken.lang.Strings.hasText;
5+
import static org.springframework.util.StringUtils.hasText;
66

77
import com.example.solidconnection.admin.dto.LanguageTestResponse;
88
import com.example.solidconnection.admin.dto.LanguageTestScoreSearchResponse;

src/main/resources/application.yml

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,15 @@ spring:
99
- optional:classpath:/config/application-variable.yml
1010
- aws-parameterstore:/solid-connection/common/
1111

12-
tomcat:
13-
threads:
14-
min-spare: 20 # default 10
15-
1612
servlet:
1713
multipart:
1814
max-file-size: 10MB
1915
max-request-size: 10MB
2016

21-
mvc:
22-
path match:
23-
matching-strategy: ANT_PATH_MATCHER
17+
server:
18+
tomcat:
19+
threads:
20+
min-spare: 20 # default 10
2421

2522
management:
2623
endpoints:

src/main/resources/config/application-cloud.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,3 @@ spring:
22
config:
33
activate:
44
on-profile: local, dev, prod, loadtest
5-
6-
cloud:
7-
aws:
8-
stack:
9-
auto: false

src/main/resources/config/application-db.yml

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,8 @@ spring:
99
ddl-auto: none
1010
generate-ddl: false
1111
show-sql: false
12-
database: mysql
1312
defer-datasource-initialization: false
1413

15-
datasource:
16-
driverClassName: com.mysql.cj.jdbc.Driver
17-
1814
flyway:
1915
enabled: true
2016
locations: classpath:db/migration
@@ -31,12 +27,8 @@ spring:
3127
ddl-auto: validate
3228
generate-ddl: false
3329
show-sql: false
34-
database: mysql
3530
defer-datasource-initialization: false
3631

37-
datasource:
38-
driverClassName: com.mysql.cj.jdbc.Driver
39-
4032
flyway:
4133
enabled: true
4234
locations: classpath:db/migration
@@ -53,7 +45,6 @@ spring:
5345
ddl-auto: create
5446
generate-ddl: true
5547
show-sql: true
56-
database: mysql
5748
defer-datasource-initialization: true
5849
properties:
5950
hibernate:
@@ -63,8 +54,5 @@ spring:
6354
init:
6455
mode: always
6556

66-
datasource:
67-
driverClassName: com.mysql.cj.jdbc.Driver
68-
6957
flyway:
7058
enabled: false

src/test/resources/application.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
spring:
2+
cloud:
3+
aws:
4+
parameterstore:
5+
enabled: false
26

37
# db
48
data:
@@ -10,7 +14,6 @@ spring:
1014
ddl-auto: create
1115
generate-ddl: true
1216
show-sql: true
13-
database: mysql
1417
properties:
1518
hibernate:
1619
format_sql: true
@@ -25,8 +28,6 @@ cloud:
2528
secret-key: access-key
2629
region:
2730
static: ap-northeast-2
28-
stack:
29-
auto: false
3031
s3:
3132
bucket: solid-connection-uploaded
3233
url:

0 commit comments

Comments
 (0)