-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
161 lines (125 loc) · 5.56 KB
/
build.gradle
File metadata and controls
161 lines (125 loc) · 5.56 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
plugins {
id 'java'
id 'org.springframework.boot' version '3.3.0'
id 'io.spring.dependency-management' version '1.1.5'
id 'com.palantir.docker' version '0.36.0'
id "com.dorongold.task-tree" version '3.0.0'
}
group = 'com.nailcase'
version = '0.0.3'
java {
sourceCompatibility = '21'
toolchain {
languageVersion = JavaLanguageVersion.of(21)
}
}
compileJava {
options.compilerArgs << "-parameters"
}
configurations {
compileOnly {
extendsFrom annotationProcessor
}
}
repositories {
mavenCentral()
}
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-security'
implementation 'org.springframework.boot:spring-boot-starter-validation'
implementation 'org.springframework.cloud:spring-cloud-starter-aws:2.2.6.RELEASE'
// 스웨거
implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.5.0'
//테스트용
implementation 'com.fasterxml.jackson.core:jackson-databind'
//minIO
implementation 'io.minio:minio:8.5.9'
// 보일러플레이트 코드를 줄이기 위한 Lombok
compileOnly 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'
implementation 'org.mapstruct:mapstruct:1.5.3.Final'
annotationProcessor 'org.mapstruct:mapstruct-processor:1.5.3.Final'
//oauth2.0
implementation 'org.springframework.boot:spring-boot-starter-oauth2-client'
// 개발 도구
developmentOnly 'org.springframework.boot:spring-boot-devtools' // 라이브 리로드 및 기타 개발 향상을 위한 Devtools
// 데이터베이스 관련 의존성
runtimeOnly 'com.h2database:h2' // 인메모리 테스트 및 개발용 H2 데이터베이스
testImplementation 'com.h2database:h2'
runtimeOnly 'org.postgresql:postgresql' // 프로덕션 사용을 위한 PostgreSQL 데이터베이스 (현재 주석 처리됨)
//jwt관련 라이브러리
implementation 'com.auth0:java-jwt:4.4.0'
//redis 관련 라이브러리
implementation('org.springframework.boot:spring-boot-starter-data-redis')
// 테스트 의존성
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'org.springframework.boot:spring-boot-starter-validation'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
testImplementation 'org.springframework.security:spring-security-test'
testImplementation 'org.jeasy:easy-random-core:5.0.0'
testImplementation 'org.jeasy:easy-random:5.0.0' // 랜덤 테스트 데이터 생성
// Spring Security 테스트를 위한 보안 테스트 스타터 (보안 스타터 사용 시 필요)
testCompileOnly 'org.projectlombok:lombok' // 테스트 의존성 추가
testAnnotationProcessor 'org.projectlombok:lombok' // 테스트 의존성 추가
// querydsl
implementation 'com.querydsl:querydsl-jpa:5.1.0:jakarta'
annotationProcessor "com.querydsl:querydsl-apt:5.1.0:jakarta"
annotationProcessor "jakarta.annotation:jakarta.annotation-api"
annotationProcessor "jakarta.persistence:jakarta.persistence-api"
// scheduler
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-quartz', version: '2.3.2.RELEASE'
// spring batch
implementation 'org.springframework.boot:spring-boot-starter-batch'
testImplementation 'org.springframework.batch:spring-batch-test'
// 채팅
implementation 'org.springframework.boot:spring-boot-starter-websocket'
implementation 'org.springframework:spring-messaging'
//rabbitmq
implementation 'org.springframework.boot:spring-boot-starter-amqp'
implementation 'org.springframework.integration:spring-integration-stomp'
implementation 'io.projectreactor.netty:reactor-netty'
}
// querydsl
def generated = 'src/main/generated'
tasks.withType(JavaCompile).configureEach {
options.annotationProcessorPath = configurations.annotationProcessor
options.generatedSourceOutputDirectory = file("build/generated/sources/annotationProcessor/java/main")
}
sourceSets {
main.java.srcDirs += ["build/generated/sources/annotationProcessor/java/main", "build/generated"]
}
clean {
delete file(generated)
}
tasks.named('test') {
useJUnitPlatform()
}
docker {
// test 주석 처리 해제하면 테스트 실행합니다.
// dependsOn check
// start
println "task: docker start, jar file:${tasks.bootJar.outputs.files.singleFile.name}"
// ./gradlew dockerPush -PdUsername=dockerUsername 으로 입력받은 dockerUsername
def dockerUsername = project.getProperties()["dUsername"]
if (dockerUsername) {
// dUsername을 입력하면 -> {{dUsername}}/nail-case:0.0.1-SNAPSHOT 형태로 이미지 생성됩니다.
// 항상 이미지 버전 명시하지 않고 최신버전은 latest로 당겨올 수 있습니다.
name "${dockerUsername}/${project.name}:${version}"
tag 'DockerHub' as String, "${dockerUsername}/${project.name}:latest"
} else {
// dUsername을 입력하지 않으면 로컬 이미지가 생성됩니다.
name "${project.name}:${version}"
}
// dockerfile 위치, dockerfile ARG
dockerfile file('./docker/dockerfile')
files tasks.bootJar.outputs.files
buildArgs(['JAR_FILE': tasks.bootJar.outputs.files.singleFile.name])
}
tasks.withType(JavaCompile).configureEach {
options.compilerArgs.add("-parameters")
}
tasks.withType(GroovyCompile).configureEach {
groovyOptions.parameters = true
}