-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
183 lines (148 loc) · 5.93 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
plugins {
id 'java'
id 'jacoco'
id 'checkstyle'
id 'org.sonarqube' version '4.2.1.3168'
id 'org.springframework.boot' version '3.1.0'
id 'io.spring.dependency-management' version '1.1.0'
id 'org.asciidoctor.jvm.convert' version '3.3.2'
id 'com.google.cloud.tools.jib' version '3.3.2'
// restDocs & Swagger Plugin
id("com.epages.restdocs-api-spec") version "0.18.2"
}
version = "0.0.1"
group = 'com.e2i'
sourceCompatibility = '17'
configurations {
compileOnly {
extendsFrom annotationProcessor
}
}
repositories {
mavenCentral()
}
checkstyle {
toolVersion = '10.4'
}
dependencies {
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-reactive'
implementation 'org.springframework.boot:spring-boot-starter-validation'
implementation 'org.springframework.boot:spring-boot-starter-security:3.1.0'
implementation 'org.springframework.boot:spring-boot-starter-data-redis:3.1.0'
implementation group: 'org.mariadb.jdbc', name: 'mariadb-java-client', version: '2.4.1'
// Query Details
implementation 'com.github.gavlyukovskiy:p6spy-spring-boot-starter:1.9.0'
// Monitoring
implementation 'org.springframework.boot:spring-boot-starter-actuator'
implementation 'io.micrometer:micrometer-registry-prometheus'
implementation 'com.auth0:java-jwt:4.4.0'
implementation 'org.flywaydb:flyway-core'
implementation 'org.flywaydb:flyway-mysql'
testImplementation 'org.projectlombok:lombok:1.18.26'
compileOnly 'org.projectlombok:lombok'
testCompileOnly 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'
runtimeOnly 'com.h2database:h2'
implementation platform('software.amazon.awssdk:bom:2.20.26')
implementation 'software.amazon.awssdk:sns:2.20.90'
implementation 'software.amazon.awssdk:ses:2.20.86'
implementation 'software.amazon.awssdk:s3:2.20.82'
// REST - Assured
testImplementation 'io.rest-assured:rest-assured:5.3.2'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'io.projectreactor:reactor-test'
testImplementation 'org.springframework.restdocs:spring-restdocs-mockmvc'
testImplementation 'io.projectreactor:reactor-test'
testImplementation 'org.springframework.security:spring-security-test'
testImplementation 'org.springframework.restdocs:spring-restdocs-mockmvc'
implementation 'com.querydsl:querydsl-jpa:5.0.0:jakarta'
annotationProcessor "com.querydsl:querydsl-apt:5.0.0:jakarta"
annotationProcessor "jakarta.annotation:jakarta.annotation-api"
annotationProcessor "jakarta.persistence:jakarta.persistence-api"
testImplementation 'it.ozimov:embedded-redis:0.7.2'
annotationProcessor "org.springframework.boot:spring-boot-configuration-processor"
// Component that test code convert to Swagger file and include restDocs Api
testImplementation('com.epages:restdocs-api-spec-mockmvc:0.18.2') //2.2
// Json Serializer
implementation 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.15.0'
implementation 'com.fasterxml.jackson.core:jackson-databind:2.15.0'
implementation 'com.fasterxml.jackson.core:jackson-core:2.15.0'
implementation 'com.fasterxml.jackson.core:jackson-annotations:2.15.0'
// expo push notification
implementation('io.github.jav:expo-server-sdk:1.1.0')
}
// Querydsl
def querydslDir = "$buildDir/generated/querydsl"
sourceSets {
main.java.srcDirs += [querydslDir]
}
tasks.withType(JavaCompile) {
options.annotationProcessorGeneratedSourcesDirectory = file(querydslDir)
}
clean {
delete file(querydslDir)
}
// Set Swagger-ui description
openapi3 {
setServers([
{
url = "http://localhost:8080"
description = "LOCAL server"
},
{
url = "http://ec2-52-78-215-171.ap-northeast-2.compute.amazonaws.com:8080"
description = "Develop Server"
},
{
url = "http://wemeet-elb-1696815651.ap-northeast-2.elb.amazonaws.com"
description = "Production Server"
}
])
setTitle("We:meet")
setDescription("We:meet API Documentation")
setVersion("0.1.0")
setFormat("yaml") // or json
}
// Add Gradle Task for generate .yaml file for API Doc
tasks.register('copyOasToSwagger', Copy) {
delete "src/main/resources/static/swagger-ui/openapi3.yaml" // Delete the existing OAS file
from "${buildDir}/api-spec/openapi3.yaml" // Specify the OAS file to be copied
into "src/main/resources/static/swagger-ui/" // Copy the file to the target directory
dependsOn "openapi3" // Set openapi3 task to be executed first
}
sonar {
properties {
property 'sonar.host.url', 'https://sonarcloud.io'
property 'sonar.organization', 'swm-e2i'
property 'sonar.projectKey', 'SWM-E2I_wemeet-backend'
property 'sonar.coverage.jacoco.xmlReportPaths', 'build/reports/jacoco/test/jacocoTestReport.xml'
property 'sonar.java.checkstyle.reportPaths', 'build/reports/checkstyle/main.xml'
}
}
jacocoTestReport {
reports {
xml.enabled true
}
}
tasks.named('test') {
useJUnitPlatform()
}
jib {
def inputTag = project.hasProperty('inputTag') ? project.property('inputTag') : '0.0.0'
from {
image = 'eclipse-temurin:17-jdk-alpine'
}
to {
image = '634460857598.dkr.ecr.ap-northeast-2.amazonaws.com/wemeet-ecr'
tags = [inputTag]
credHelper = 'ecr-login'
}
container {
creationTime = 'USE_CURRENT_TIMESTAMP'
jvmFlags = ['-javaagent:/scouter.agent.jar', '-Dscouter.config=/spring-scouter.conf',
'-XX:+UseContainerSupport', '-Dserver.port=8080', '-Dfile.encoding=UTF-8', '-Duser.timezone=Asia/Seoul']
ports = ['8080']
}
}