-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
168 lines (132 loc) · 4.31 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
plugins {
id 'org.springframework.boot' version '2.5.4'
id 'io.spring.dependency-management' version '1.0.11.RELEASE'
id 'java'
id "org.asciidoctor.jvm.convert" version "3.3.2"
id "org.sonarqube" version "3.3"
id "jacoco"
}
sonarqube {
properties {
property "sonar.projectKey", "potato-club_national-petition-backend"
property "sonar.organization", "potato-club"
property "sonar.host.url", "https://sonarcloud.io"
property "sonar.coverage.jacoco.xmlReportPaths", "$buildDir/jacoco/jacoco.xml"
}
}
group = 'com.example'
sourceCompatibility = '11'
// 현식추가
archivesBaseName = 'national-petition-backend'
tasks.jar {
enabled = false
}
tasks.bootJar {
enabled = true
mainClass = 'com.example.nationalpetition.NationalPetitionApplication'
}
// 추가 끝
configurations {
compileOnly {
extendsFrom annotationProcessor
}
}
repositories {
mavenCentral()
}
ext {
snippetsDir = file('build/generated-snippets')
}
asciidoctor {
dependsOn test
attributes 'snippets': snippetsDir
inputs.dir snippetsDir
}
asciidoctor.doFirst {
//asciidoctor 실행전 기존에 생성된 API 문서 삭제
delete file('src/main/resources/static/docs')
}
task copyDocument(type: Copy) {
dependsOn asciidoctor
from file("build/docs/asciidoc")
into file("src/main/resources/static/docs")
}
build {
dependsOn copyDocument
}
bootJar {
dependsOn asciidoctor
copy {
from "${asciidoctor.outputDir}"
into "BOOT-INF/classes/static/docs"
}
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation("org.springframework.cloud:spring-cloud-starter-openfeign")
runtimeOnly 'com.h2database:h2'
annotationProcessor 'org.projectlombok:lombok'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
implementation 'org.springframework.boot:spring-boot-starter-webflux'
testImplementation 'org.springframework.restdocs:spring-restdocs-mockmvc'
testImplementation group: 'org.springframework.restdocs', name: 'spring-restdocs-mockmvc', version: '2.0.5.RELEASE'
implementation 'org.springframework.boot:spring-boot-starter-validation'
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-oauth2-client', version: '2.5.4'
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-security', version: '2.5.4'
implementation 'io.jsonwebtoken:jjwt:0.9.1'
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-thymeleaf', version: '2.5.4'
implementation("com.querydsl:querydsl-jpa")
implementation("com.querydsl:querydsl-core")
annotationProcessor("com.querydsl:querydsl-apt::jpa")
annotationProcessor("jakarta.persistence:jakarta.persistence-api")
annotationProcessor("jakarta.annotation:jakarta.annotation-api")
implementation 'org.springdoc:springdoc-openapi-ui:1.5.11'
// flyway
implementation 'org.flywaydb:flyway-core:6.4.2'
// db
implementation group: 'org.mariadb.jdbc', name: 'mariadb-java-client', version: '2.4.1'
// redis
implementation 'org.springframework.boot:spring-boot-starter-data-redis'
implementation 'com.google.code.gson:gson:2.7'
}
dependencyManagement {
imports {
mavenBom "org.springframework.cloud:spring-cloud-dependencies:2020.0.3"
}
}
test {
jacoco {
destinationFile = file("$buildDir/jacoco/jacoco.exec")
}
useJUnitPlatform {
includeEngines 'junit-jupiter'
}
finalizedBy 'jacocoTestReport'
}
// jacoco
jacoco {
toolVersion = '0.8.5'
}
jacocoTestReport {
reports {
html.enabled false
xml.enabled true
csv.enabled false
html.destination file("$buildDir/jacoco/jacoco.html")
xml.destination file("$buildDir/jacoco/jacoco.xml")
}
// 이 설정을 열어주면 Code Coverage가 일정 이상이어야 Build됨
// finalizedBy 'jacocoTestCoverageVerification'
}
// query dsl
def queryDslDir = 'src/main/generated'
sourceSets {
main.java.srcDirs += [queryDslDir]
}
tasks.withType(JavaCompile) {
options.annotationProcessorGeneratedSourcesDirectory = file(queryDslDir)
}
clean.doLast {
file(queryDslDir).deleteDir()
}