-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild.gradle
More file actions
201 lines (162 loc) · 5.52 KB
/
Copy pathbuild.gradle
File metadata and controls
201 lines (162 loc) · 5.52 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
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
plugins {
id 'java'
id 'org.springframework.boot' version '3.5.6'
id 'io.spring.dependency-management' version '1.1.7'
id 'org.liquibase.gradle' version '2.2.1'
id 'com.diffplug.spotless' version '7.2.1'
id 'org.asciidoctor.jvm.convert' version '4.0.5'
}
group = 'com.irum'
version = '0.0.1-SNAPSHOT'
description = 'productservice'
java {
toolchain {
languageVersion = JavaLanguageVersion.of(21)
}
}
configurations {
compileOnly {
extendsFrom annotationProcessor
}
asciidoctorExt
}
repositories {
mavenCentral()
maven {
name = "GitHubPackages"
url = "https://maven.pkg.github.com/Profect-4th-IRUM/open-feign-client"
credentials {
username = System.getenv("GIT_USERNAME") ?: project.findProperty("gpr.user")
password = System.getenv("GIT_TOKEN") ?: project.findProperty("gpr.key")
}
}
maven {
name = "GitHubPackages"
url = "https://maven.pkg.github.com/Profect-4th-IRUM/global-module"
credentials {
username = System.getenv("GIT_USERNAME") ?: project.findProperty("gpr.user")
password = System.getenv("GIT_TOKEN") ?: project.findProperty("gpr.key")
}
}
}
def querydslDir = layout.buildDirectory.dir("generated/querydsl")
def snippetsDir = layout.buildDirectory.dir("generated-snippets")
sourceSets {
main {
java {
srcDirs += [querydslDir]
}
}
}
tasks.withType(JavaCompile) {
options.getGeneratedSourceOutputDirectory().set(querydslDir)
}
clean {
delete querydslDir
}
ext {
set('springCloudVersion', "2025.0.0")
}
dependencyManagement {
imports {
mavenBom "org.springframework.cloud:spring-cloud-dependencies:${springCloudVersion}"
}
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-web'
// JPA & DB
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
runtimeOnly 'org.postgresql:postgresql'
runtimeOnly 'com.h2database:h2'
//Spring Validation
implementation 'org.springframework.boot:spring-boot-starter-validation'
//redis
implementation 'org.springframework.boot:spring-boot-starter-data-redis'
// QueryDSL
implementation 'com.querydsl:querydsl-jpa:5.0.0:jakarta'
annotationProcessor 'com.querydsl:querydsl-apt:5.0.0:jakarta'
annotationProcessor 'jakarta.persistence:jakarta.persistence-api'
// Lombok
compileOnly 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'
testCompileOnly 'org.projectlombok:lombok'
testAnnotationProcessor 'org.projectlombok:lombok'
implementation 'org.springframework.cloud:spring-cloud-starter-openfeign'
implementation 'io.github.openfeign:feign-gson:11.0'
// // Config Server
// implementation 'org.springframework.cloud:spring-cloud-starter-config'
// Actuator
implementation 'org.springframework.boot:spring-boot-starter-actuator'
implementation 'io.micrometer:micrometer-core'
implementation 'io.micrometer:micrometer-registry-prometheus'
// common module
implementation 'com.irum:open-feign-client:1.1.0-SNAPSHOT'
implementation 'com.irum:global-module:0.1.8-SNAPSHOT'
// Test
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'org.springframework.security:spring-security-test'
testImplementation 'org.springframework.restdocs:spring-restdocs-mockmvc'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
// 낙관적 락 재시도
implementation 'org.springframework.boot:spring-boot-starter-aop'
implementation 'org.springframework.retry:spring-retry'
implementation 'org.liquibase:liquibase-core'
//actuator
implementation 'org.springframework.boot:spring-boot-starter-actuator'
implementation 'io.micrometer:micrometer-core'
implementation 'io.micrometer:micrometer-registry-prometheus'
// logback
implementation 'net.logstash.logback:logstash-logback-encoder:8.0'
// Embedded Redis
testImplementation('it.ozimov:embedded-redis:0.7.3') {
exclude group: 'org.slf4j', module: 'slf4j-simple'
}
//spring kafka
implementation 'org.springframework.kafka:spring-kafka'
}
test {
useJUnitPlatform()
outputs.dir snippetsDir
}
asciidoctor.doFirst {
delete layout.projectDirectory.dir("src/main/resources/static/docs")
}
asciidoctor {
baseDirFollowsSourceFile() // include 기준을 index.adoc 위치로 고정
sources { include 'index.adoc' } // index.adoc을 진입점으로
attributes('snippets': snippetsDir.get().asFile)
configurations 'asciidoctorExt'
dependsOn test
baseDirFollowsSourceDir()
}
bootJar {
if (project.hasProperty('docs')) {
dependsOn asciidoctor
}
from("${asciidoctor.outputDir}/html5") {
into 'static/docs'
}
}
spotless {
java {
targetExclude("**/generated/querydsl/**")
// Google Java 포맷 적용
googleJavaFormat().aosp()
// import 순서 정렬
importOrder()
// 사용하지 않는 import 제거
removeUnusedImports()
// 각 라인 끝에 있는 공백을 제거
trimTrailingWhitespace()
// 파일 끝에 새로운 라인 추가
endWithNewline()
}
}
tasks.register('updateGitHooks', Copy) {
from('./scripts/') { include 'pre-commit' }
into './.git/hooks'
}
tasks.register('makeGitHooksExecutable', Exec) {
commandLine 'chmod', '+x', './.git/hooks/pre-commit'
dependsOn updateGitHooks
}