-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
212 lines (168 loc) · 5.69 KB
/
build.gradle
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
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
buildscript {
ext {
springBootVersion = '3.0.11'
restdocsApiSpecVersion = '0.18.2'
swaggerGeneratorVersion = '2.18.2'
sentryGradleVersion = '4.2.0'
}
repositories {
mavenCentral()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
}
}
plugins {
id 'com.epages.restdocs-api-spec' version "${restdocsApiSpecVersion}"
id 'org.hidetake.swagger.generator' version '2.18.2'
id "io.sentry.jvm.gradle" version "4.2.0"
}
subprojects {
group = 'sopt.org.motivoo'
version = '0.0.1-SNAPSHOT'
apply plugin: "java-library"
apply plugin: "org.springframework.boot"
apply plugin: "io.spring.dependency-management"
// apply plugin: 'com.epages.restdocs-api-spec'+ ${restdocsApiSpecVersion}
// apply plugin: "org.hidetake.swagger.generator:2.18.2"
// apply plugin: "io.sentry.jvm.gradle:4.2.0"
sourceCompatibility = '17'
swaggerSources {
sample {
setInputFile(file("${project.buildDir}/api-spec/openapi3.yaml"))
}
}
Properties properties = new Properties()
properties.load(project.rootProject.file('local.properties').newDataInputStream())
// Sentry 연동을 위한 설정 정보
sentry {
includeSourceContext = true
org = "motivooteam"
projectName = "motivoo-server"
authToken = properties["sentry.AUTH_TOKEN"]
}
// openapi3 스펙 생성 시 설정 정보
openapi3 {
servers = [
{ url = properties["server.BASE_URL"] },
{ url = "http://localhost:8080" }
]
title = "모티부 API 명세서"
description = "Motivoo REST Docs with SwaggerUI"
version = "v0.0.1"
format = "yaml"
}
repositories {
mavenCentral()
maven {
url "https://plugins.gradle.org/m2/"
}
}
configurations {
compileOnly {
extendsFrom annotationProcessor
}
}
dependencies {
// JPA
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
// MySQL
runtimeOnly 'com.mysql:mysql-connector-j'
// H2 (테스트용)
runtimeOnly 'com.h2database:h2'
testImplementation 'com.h2database:h2'
// Security
implementation 'org.springframework.boot:spring-boot-starter-security'
testImplementation 'org.springframework.security:spring-security-test'
// Web
implementation 'org.springframework.boot:spring-boot-starter-web'
// Actuator
implementation 'org.springframework.boot:spring-boot-starter-actuator'
// lombok
compileOnly 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'
testCompileOnly 'org.projectlombok:lombok'
testAnnotationProcessor 'org.projectlombok:lombok'
// Spring Validatior
implementation 'org.springframework.boot:spring-boot-starter-validation'
implementation group: 'org.hibernate.validator', name: 'hibernate-validator'
// Spring Scheduler Test
testImplementation 'org.awaitility:awaitility:4.2.0'
// Slack Webhook
implementation 'com.slack.api:slack-api-client:1.30.0'
implementation 'com.google.code.gson:gson:2.10.1'
// Swagger+RestDocs
implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.0.2'
testImplementation "com.epages:restdocs-api-spec-mockmvc:${restdocsApiSpecVersion}"
testImplementation 'org.springframework.restdocs:spring-restdocs-mockmvc'
testImplementation 'io.rest-assured:rest-assured'
// swaggerUI 'org.webjars:swagger-ui:4.11.1'
// AWS sdk
implementation("software.amazon.awssdk:bom:2.21.0")
implementation("software.amazon.awssdk:s3:2.21.0")
// OAuth2
implementation 'org.springframework.boot:spring-boot-starter-oauth2-client'
implementation 'org.springframework.boot:spring-boot-starter-webflux'
// jwt
implementation group: 'io.jsonwebtoken', name: 'jjwt-api', version: '0.11.2'
implementation group: 'io.jsonwebtoken', name: 'jjwt-impl', version: '0.11.2'
implementation group: 'io.jsonwebtoken', name: 'jjwt-jackson', version: '0.11.2'
// redis
implementation 'org.springframework.boot:spring-boot-starter-data-redis'
// Feign
implementation "org.springframework.cloud:spring-cloud-starter-openfeign:4.0.3"
// Firebase
implementation "com.google.firebase:firebase-admin:9.1.1"
// Sentry
implementation "io.sentry:sentry-spring-boot-starter:4.2.0"
// AOP
implementation 'org.springframework.boot:spring-boot-starter-aop'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
}
dependencyManagement {
imports {
mavenBom "org.springframework.cloud:spring-cloud-dependencies:2022.0.3"
}
}
test {
useJUnitPlatform()
}
tasks.withType(GenerateSwaggerUI) {
dependsOn 'openapi3'
doFirst {
def swaggerUIFile = file("${openapi3.outputDirectory}/api-spec/openapi3.yaml")
def securitySchemesContent = " securitySchemes:\n" + \
" APIKey:\n" + \
" type: apiKey\n" + \
" name: Authorization\n" + \
" in: header\n" + \
"security:\n" +
" - APIKey: [] # Apply the security scheme here"
swaggerUIFile.append securitySchemesContent
}
}
// openAPI 작성 자동화 => 패키징 전에 openapi3 태스크를 먼저 실행하도록 유발
bootJar {
// dependsOn(':openapi3')
// dependsOn generateSwaggerUISample
// from("${generateSwaggerUISample.outputDir}") {
// into 'static/docs'
// }
// copy {
// from "build/resources/main/static/docs"
// into "src/main/resources/static/docs/"
// }
}
openapi3 {
servers = [
{ url = properties["server.BASE_URL"] },
{ url = "http://localhost:8080" }
]
title = "모티부 API 명세서"
description = "Motivoo REST Docs with SwaggerUI"
version = "v0.0.1"
format = "json"
outputFileNamePrefix = "open-api-3.0.1"
outputDirectory = 'build/resources/main/static/docs'
}
}