-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
147 lines (116 loc) · 4.03 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
/* 전체 프로젝트 의존성 관리 */
buildscript {
ext {
springBootVersion = '2.3.4.RELEASE'
springfoxVersion = '2.9.2'
}
repositories {
mavenCentral()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
classpath "io.spring.gradle:dependency-management-plugin:0.6.0.RELEASE"
}
}
allprojects {
apply plugin: 'java'
apply plugin: 'io.spring.dependency-management'
apply plugin: 'org.springframework.boot'
group 'kr.seok'
version '1.0-SNAPSHOT'
repositories {
mavenCentral()
}
}
subprojects {
sourceCompatibility = JavaVersion.VERSION_1_8
configurations {
compileOnly {
extendsFrom annotationProcessor
}
}
dependencies {
compileOnly 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'
runtimeOnly 'com.h2database:h2'
testImplementation('org.springframework.boot:spring-boot-starter-test') {
exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
}
}
test {
useJUnitPlatform()
}
}
/* Querydsl 라이브러리를 사용하는 모듈 리스트 */
def querydslProjects = [
project(":module-domain"),
project(":module-api"),
project(":module-batch")
]
configure(querydslProjects) {
apply plugin: "io.spring.dependency-management"
dependencies {
compileOnly "com.querydsl:querydsl-jpa"
compileOnly "com.querydsl:querydsl-core"
annotationProcessor "com.querydsl:querydsl-apt:${dependencyManagement.importedProperties['querydsl.version']}:jpa" // querydsl JPAAnnotationProcessor 사용 지정
annotationProcessor "jakarta.persistence:jakarta.persistence-api:2.2.3"
annotationProcessor "jakarta.annotation:jakarta.annotation-api:1.3.5"
}
// querydsl 적용
def generated='src/main/generated'
sourceSets {
main.java.srcDirs += [ generated ]
}
tasks.withType(JavaCompile) {
options.annotationProcessorGeneratedSourcesDirectory = file(generated)
}
clean.doLast {
file(generated).deleteDir()
}
}
project(":module-common") {
/* DTO, Util 클래스 등등 */
dependencies {
}
bootJar { enabled = false }
jar { enabled = true }
}
project(":module-core") {
/* 도메인 및 비즈니스 로직을 포함하고 있지 않은 모듈로 security, logging, filter */
dependencies {
implementation project(":module-common")
}
}
project(":module-domain") {
/* 서비스 비즈니스 로직과 관계가 없음, 하나의 인프라 스트럭쳐에 대한 책임만 갖는다. (DB Server, Redis, ElasticSearch 등등) */
dependencies {
implementation project(":module-common")
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
}
}
project(":module-redis") {
/* 서비스 비즈니스 로직과 관계가 없음, 하나의 인프라 스트럭쳐에 대한 책임만 갖는다. (DB Server, Redis, ElasticSearch 등등) */
dependencies {
implementation project(":module-common")
implementation 'org.springframework.boot:spring-boot-starter-data-redis'
}
}
project(":module-api") {
/* API용 비즈니스 로직관련 모듈 swagger */
dependencies {
implementation project(":module-common")
implementation("io.springfox:springfox-swagger2:${springfoxVersion}")
implementation("io.springfox:springfox-swagger-ui:${springfoxVersion}")
implementation 'org.springframework.boot:spring-boot-starter-web'
}
}
project(":module-batch") {
/* Batch Service 관련 */
dependencies {
implementation project(":module-common")
implementation("org.apache.poi:poi:4.1.2") // .xlsx
implementation("org.apache.poi:poi-ooxml:4.1.2") // .xls
implementation 'org.springframework.boot:spring-boot-starter-batch'
testImplementation 'org.springframework.batch:spring-batch-test'
}
}