-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathbuild.gradle
More file actions
161 lines (128 loc) · 4.61 KB
/
build.gradle
File metadata and controls
161 lines (128 loc) · 4.61 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
149
150
151
152
153
154
155
156
157
158
159
160
161
buildscript {
ext {
restdocsApiSpecVersion = '0.18.3' // restdocsApiSpecVersion 버전 변수 설정
}
}
plugins {
id 'java'
id 'org.springframework.boot' version '3.3.4'
id 'io.spring.dependency-management' version '1.1.6'
id 'org.asciidoctor.jvm.convert' version '3.3.2'
// epages-restdocs 플러그인 추가
id 'com.epages.restdocs-api-spec' version "${restdocsApiSpecVersion}"
//swagger generator 플러그인 추가
id 'org.hidetake.swagger.generator' version '2.18.2'
}
group = 'ku-rum'
version = '0.0.1-SNAPSHOT'
java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
}
}
configurations {
compileOnly {
extendsFrom annotationProcessor
}
}
repositories {
mavenCentral()
}
// 5. 생성된 API 스펙이 어느 위치에 있는지 지정
swaggerSources {
sample {
setInputFile(file("${project.buildDir}/api-spec/openapi3.yaml"))
}
}
// 6. openapi3 스펙 생성시 설정 정보
openapi3 {
servers = [
{ url = "https://kuroom.store" },
{ url = "http://localhost:8080" }
]
title = "쿠룸 백엔드 API 문서"
description = "RestDocs를 이용한 Swagger API 문서입니다."
version = "1.0"
format = "yaml"
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-validation'
implementation 'org.springframework.boot:spring-boot-starter-web'
compileOnly 'org.projectlombok:lombok:1.18.22'
annotationProcessor 'org.projectlombok:lombok:1.18.22'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
annotationProcessor "jakarta.annotation:jakarta.annotation-api"
annotationProcessor "jakarta.persistence:jakarta.persistence-api"
// redis
implementation 'org.springframework.boot:spring-boot-starter-data-redis'
implementation 'com.mysql:mysql-connector-j'
// Mail Service
implementation 'org.springframework.boot:spring-boot-starter-mail'
// Thymeleaf (이메일 템플릿)
implementation 'org.springframework.boot:spring-boot-starter-thymeleaf'
// Spring Security
implementation 'org.springframework.boot:spring-boot-starter-security'
testImplementation 'org.springframework.security:spring-security-test'
// JWT
implementation 'io.jsonwebtoken:jjwt-api:0.12.3'
runtimeOnly 'io.jsonwebtoken:jjwt-impl:0.12.3'
runtimeOnly 'io.jsonwebtoken:jjwt-jackson:0.12.3'
// OAUTH
implementation 'org.springframework.boot:spring-boot-starter-oauth2-client'
// Spring REST Docs 의존성
testImplementation 'org.springframework.restdocs:spring-restdocs-mockmvc'
// 8. openAPI3 추가
testImplementation 'com.epages:restdocs-api-spec-mockmvc:' + restdocsApiSpecVersion
// 9. SwaggerUI 추가
swaggerUI 'org.webjars:swagger-ui:4.11.1'
// 10. Assertj 추가
testImplementation 'org.assertj:assertj-core:3.23.1'
//FireBase
implementation 'com.google.firebase:firebase-admin:9.3.0'
//actuator
implementation 'org.springframework.boot:spring-boot-starter-actuator'
//micrometer
implementation 'io.micrometer:micrometer-registry-prometheus'
// AWS SDK v2 for S3 (Presigned URL 용)
implementation platform('software.amazon.awssdk:bom:2.20.26')
implementation 'software.amazon.awssdk:s3'
implementation 'software.amazon.awssdk:s3-transfer-manager'
// postGIS
implementation "org.hibernate.orm:hibernate-spatial"
implementation "org.locationtech.jts:jts-core:1.19.0"
// Test Container
testImplementation 'org.testcontainers:junit-jupiter'
testImplementation 'org.testcontainers:mysql'
// FCM
implementation 'com.google.firebase:firebase-admin:9.7.0'
implementation 'io.prometheus:prometheus-metrics-exposition-formats'
}
tasks.named('test') {
useJUnitPlatform()
}
tasks.named('jar') {
enabled = false
}
// 10. openapi3가 먼저 실행
tasks.withType(GenerateSwaggerUI) {
dependsOn 'openapi3'
doFirst {
def swaggerFile = file("${openapi3.outputDirectory}/openapi3.yaml")
def securitySchemesContent = "security:\n" +
" - bearerAuthJWT: []"
swaggerFile.append securitySchemesContent
}
}
def querydslSrcDir = 'src/main/generated'
clean {
delete file(querydslSrcDir)
}
// 11. 생성된 openapi3 스펙을 기반으로 SwaggerUISample 생성 및 static/docs 패키지에 복사
bootJar {
dependsOn generateSwaggerUISample
from("${generateSwaggerUISample.outputDir}") {
into 'static/docs'
}
}