11plugins {
22 id ' java'
3- id ' org.springframework.boot' version ' 3.3.6 '
3+ id ' org.springframework.boot' version ' 3.5.9 '
44 id ' io.spring.dependency-management' version ' 1.1.7'
5+ id ' com.diffplug.spotless' version ' 6.25.0'
56}
67
78group = ' inha'
89version = ' 0.0.1-SNAPSHOT'
910
10- /* ===== Java Toolchain ===== */
1111java {
1212 toolchain {
13- languageVersion = JavaLanguageVersion . of(17 )
13+ languageVersion = JavaLanguageVersion . of(21 )
1414 }
1515}
1616
17- /* ===== Configurations ===== */
1817configurations {
1918 compileOnly {
2019 extendsFrom annotationProcessor
2120 }
2221}
2322
24- /* ===== Repositories ===== */
2523repositories {
2624 mavenCentral()
2725}
2826
29- /* ===== Dependencies ===== */
27+ /* ===== Version Pins (필요한 것만) ===== */
28+ ext {
29+ awspringBomVersion = ' 3.4.2'
30+ springdocVersion = ' 2.8.15'
31+ flywayVersion = ' 11.19.0'
32+ postgresVersion = ' 42.7.3'
33+ hibernateTypes60 = ' 2.21.1'
34+ dotenvVersion = ' 5.2.2'
35+ querydslVersion = ' 6.10.1'
36+ jjwtVersion = ' 0.13.0'
37+ googleApiClientVersion = ' 2.6.0'
38+ }
39+
40+ /* ===== Vulnerability Pins (정확한 CVE 기반 대응) ===== */
41+ configurations. configureEach {
42+ resolutionStrategy {
43+ // CVE-2024-47554 대응 (commons-compress 체인 영향 → commons-lang3 3.18.0 필요)
44+ force ' org.apache.commons:commons-lang3:3.18.0'
45+ // springdoc transitive classgraph 취약점 대응 버전으로 상향
46+ force ' io.github.classgraph:classgraph:4.8.179'
47+ }
48+ }
49+
3050dependencies {
3151 // --- Spring Boot Starters ---
3252 implementation ' org.springframework.boot:spring-boot-starter-web'
@@ -35,62 +55,77 @@ dependencies {
3555 implementation ' org.springframework.boot:spring-boot-starter-oauth2-client'
3656 implementation ' org.springframework.boot:spring-boot-starter-mail'
3757
38- // --- DB & JPA Utils ---
39- implementation ' com.vladmihalcea:hibernate-types-60:2.21.1'
40- implementation ' org.postgresql:postgresql:42.7.3'
41- runtimeOnly ' com.h2database:h2' // 테스트/로컬용 인메모리 DB
58+ // --- Swagger / OpenAPI (springdoc) ---
59+ implementation(" org.springdoc:springdoc-openapi-starter-webmvc-ui:${ springdocVersion} " ) {
60+ exclude group : " org.apache.commons" , module : " commons-lang3"
61+ }
62+ implementation " org.apache.commons:commons-lang3:3.18.0"
63+
64+ // --- DB & JPA Utils (Boot 관리 버전과 동기화 필요) ---
65+ implementation " com.vladmihalcea:hibernate-types-60:${ hibernateTypes60} "
66+ implementation " org.postgresql:postgresql:${ postgresVersion} "
67+ testRuntimeOnly ' com.h2database:h2' // 테스트 환경 전용, 운영 패키지에서는 제외
68+
69+ // --- Cache / Redis ---
70+ implementation ' org.springframework.boot:spring-boot-starter-data-redis'
71+
72+ // --- Querydsl (OpenFeign fork) ---
73+ implementation " io.github.openfeign.querydsl:querydsl-jpa:${ querydslVersion} "
74+ annotationProcessor " io.github.openfeign.querydsl:querydsl-apt:${ querydslVersion} :jakarta"
75+ annotationProcessor " org.springframework.boot:spring-boot-configuration-processor"
4276
43- // --- QueryDSL ---
44- implementation ' com.querydsl:querydsl-jpa:5.0.0:jakarta'
45- annotationProcessor ' com.querydsl:querydsl-apt:5.0.0:jakarta'
46- annotationProcessor ' jakarta.annotation:jakarta.annotation-api'
47- annotationProcessor ' jakarta.persistence:jakarta.persistence-api'
77+ // Querydsl APT helper APIs (컴파일 타임만)
78+ compileOnly ' jakarta.annotation:jakarta.annotation-api'
79+ compileOnly ' jakarta.persistence:jakarta.persistence-api'
4880
49- // --- JWT (JJWT 0.9.x, 레거시 패키지) ---
50- implementation ' io.jsonwebtoken:jjwt:0.9.1'
81+ // --- JWT ---
82+ implementation " io.jsonwebtoken:jjwt-api:${ jjwtVersion} "
83+ runtimeOnly " io.jsonwebtoken:jjwt-impl:${ jjwtVersion} "
84+ runtimeOnly " io.jsonwebtoken:jjwt-jackson:${ jjwtVersion} "
5185
5286 // --- AWS (S3) ---
5387 implementation ' io.awspring.cloud:spring-cloud-aws-starter-s3'
5488
55- // --- Flyway (DB Migration) ---
56- implementation " org.flywaydb:flyway-core:10.21.0 "
57- implementation " org.flywaydb:flyway-database-postgresql:10.21.0 "
89+ // --- Flyway ---
90+ implementation " org.flywaydb:flyway-core:${ flywayVersion } "
91+ implementation " org.flywaydb:flyway-database-postgresql:${ flywayVersion } "
5892
5993 // --- 환경변수(.env) ---
60- implementation ' io.github.cdimascio:java-dotenv:5.2.2 '
94+ implementation " io.github.cdimascio:java-dotenv:${ dotenvVersion } "
6195
6296 // --- Lombok ---
63- compileOnly ' org.projectlombok:lombok'
97+ compileOnly ' org.projectlombok:lombok'
6498 annotationProcessor ' org.projectlombok:lombok'
6599
66100 // --- Test ---
67101 testImplementation ' org.springframework.boot:spring-boot-starter-test'
68102 testImplementation ' org.mockito:mockito-core:5.6.0'
69103 testImplementation ' org.mockito:mockito-junit-jupiter:5.6.0'
70104 testImplementation ' org.assertj:assertj-core:3.24.2'
71- testRuntimeOnly ' org.junit.platform:junit-platform-launcher'
105+ testRuntimeOnly ' org.junit.platform:junit-platform-launcher'
72106
73- // swagger
74- implementation ' org.springdoc:springdoc-openapi-starter-webmvc-ui:2.6.0 '
107+ // Google API Client
108+ implementation " com.google.api-client:google-api-client: ${ googleApiClientVersion } "
75109}
76110
77111dependencyManagement {
78112 imports {
79- mavenBom " io.awspring.cloud:spring-cloud-aws-dependencies:3.1.1"
80- // ↑ 3.x 대 사용 (프로젝트에 맞는 최신 3.x 가능)
113+ mavenBom " io.awspring.cloud:spring-cloud-aws-dependencies:${ awspringBomVersion} "
81114 }
82115}
83116
84- /* ===== Tasks ===== */
117+ spotless {
118+ java {
119+ googleJavaFormat(' 1.22.0' )
120+ target ' src/**/*.java'
121+ }
122+ }
85123
86- // 테스트: 프로필과 JUnit 플랫폼 한 곳에서 설정
87124tasks. test {
88125 useJUnitPlatform()
89126 systemProperty " spring.profiles.active" , " test"
90127}
91128
92- // QueryDSL 생성물 경로 고정
93129tasks. withType(JavaCompile ). configureEach {
94- options. annotationProcessorGeneratedSourcesDirectory = file(" build/generated/sources/annotationProcessor/java/main" )
130+ options. generatedSourceOutputDirectory . set( file(" build/generated/sources/annotationProcessor/java/main" ) )
95131}
96-
0 commit comments