-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
148 lines (117 loc) · 4.3 KB
/
build.gradle
File metadata and controls
148 lines (117 loc) · 4.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
plugins {
id 'java'
id 'org.springframework.boot' version '3.5.3'
id 'io.spring.dependency-management' version '1.1.7'
}
group = 'com.mycompany'
version = '0.0.1-SNAPSHOT'
java {
toolchain {
languageVersion = JavaLanguageVersion.of(21)
}
}
configurations {
compileOnly {
extendsFrom annotationProcessor
}
// 로깅 충돌 방지
all {
exclude group: 'org.slf4j', module: 'slf4j-simple'
}
}
repositories {
mavenCentral()
}
dependencies {
// Spring Boot Starters
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-data-redis'
implementation 'org.springframework.boot:spring-boot-starter-webflux'
implementation 'org.springframework.boot:spring-boot-starter-actuator' // 헬스체크용 추가
implementation 'org.springframework.boot:spring-boot-starter-validation' // 검증용 추가
// 🤔 data-jdbc와 data-jpa 동시 사용 - 필요시에만 유지
implementation 'org.springframework.boot:spring-boot-starter-data-jdbc'
// 🤔 Thymeleaf - API 서버라면 불필요할 수 있음
implementation 'org.springframework.boot:spring-boot-starter-thymeleaf'
// API Documentation
implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.2.0'
// Database
runtimeOnly 'com.mysql:mysql-connector-j'
runtimeOnly 'com.h2database:h2' // 개발/테스트용
// AWS SDK - 🚨 버전 업데이트 권장
implementation 'com.amazonaws:aws-java-sdk-s3:1.12.565'
// 또는 AWS SDK v2 사용 권장:
// implementation 'software.amazon.awssdk:s3:2.20.0'
// JSON Processing (Spring Boot에 이미 포함되어 있지만 명시적 선언)
implementation 'com.fasterxml.jackson.core:jackson-databind'
// JWT - 🚨 버전 업데이트 권장
implementation 'io.jsonwebtoken:jjwt-api:0.12.3' // 0.11.5 → 0.12.3
runtimeOnly 'io.jsonwebtoken:jjwt-impl:0.12.3'
runtimeOnly 'io.jsonwebtoken:jjwt-jackson:0.12.3'
// Lombok
compileOnly 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'
// Development Tools
developmentOnly 'org.springframework.boot:spring-boot-devtools'
// Jakarta Annotations
implementation 'jakarta.annotation:jakarta.annotation-api:2.1.1'
// Environment Variables
implementation 'io.github.cdimascio:dotenv-java:3.0.0'
// Test Dependencies
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'org.testcontainers:junit-jupiter'
testImplementation 'org.testcontainers:mysql'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
// 테스트용 H2 (중복 제거)
testRuntimeOnly 'com.h2database:h2'
// 임베디드 Redis (테스트용)
testImplementation('it.ozimov:embedded-redis:0.7.3') {
exclude group: 'org.slf4j', module: 'slf4j-simple'
}
// 테스트용 Lombok
testCompileOnly 'org.projectlombok:lombok'
testAnnotationProcessor 'org.projectlombok:lombok'
}
// ✅ Spring Boot executable JAR 설정
tasks.named('bootJar') {
enabled = true
archiveFileName = 'app.jar'
// 메인 클래스 명시 (필요시)
// mainClass = 'com.mycompany.goormthonserver.GoormthonServerApplication'
}
// ✅ 일반 JAR 비활성화
tasks.named('jar') {
enabled = false
}
// ✅ 테스트 설정
tasks.named('test') {
useJUnitPlatform()
// 테스트용 프로파일 설정
systemProperty 'spring.profiles.active', 'test'
// 테스트 메모리 설정
maxHeapSize = '512m'
// 테스트 결과 보고서
testLogging {
events "passed", "skipped", "failed"
exceptionFormat "full"
}
}
// ✅ 프리티어용 실행 설정
tasks.named('bootRun') {
if (project.hasProperty('spring.profiles.active')) {
systemProperty 'spring.profiles.active', project.property('spring.profiles.active')
}
jvmArgs = [
'-Xms128m',
'-Xmx256m',
'-XX:+UseG1GC',
'-XX:MaxGCPauseMillis=200',
'-XX:+UseStringDeduplication' // JDK 21에서 더 효율적
]
}
// ✅ Gradle 래퍼 설정
wrapper {
gradleVersion = '8.5'
distributionType = Wrapper.DistributionType.BIN
}