-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
82 lines (70 loc) · 2.12 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
/*
* This file was generated by the Gradle 'init' task.
*
* This is a general purpose Gradle build.
* Learn more about Gradle by exploring our samples at https://docs.gradle.org/7.0.2/samples
*/
buildscript {
ext { // extra로 설정한 변수이며, 반복해서 사용할 것들
spring = "2.4.1"
boot = "org.springframework.boot"
lombok = "org.projectlombok:lombok"
}
repositories {
mavenCentral()
}
dependencies {
classpath("$boot:spring-boot-gradle-plugin:$spring")
}
}
allprojects { // 모든 프로젝트의 공통으로 쓰게될 group과 version
group= "com.sp.fc"
version = "1.0.0"
}
subprojects { // 프로젝트의 하위 폴더 생성
apply plugin: "java" // main의 java와 resource 폴더 생성해줌
apply plugin: boot // 부트가 추가해주는 gradle task들 ex) bootWar : war파일로 생성
apply plugin: "io.spring.dependency-management"
apply plugin: "idea"
repositories {
mavenCentral()
}
configurations {
developmentOnly
runtimeClasspath {
extendsFrom developmentOnly
}
}
dependencies {
developmentOnly("$boot:spring-boot-devtools") //초반에는 로그인에 문제생김
implementation "$boot:spring-boot-starter-security"
implementation 'com.fasterxml.jackson.core:jackson-annotations' // json ignore 사용
compileOnly lombok
testCompileOnly lombok
annotationProcessor lombok
testAnnotationProcessor lombok
testImplementation "$boot:spring-boot-starter-test"
}
test {
useJUnitPlatform()
}
}
["comp", "test", "web"].each {
def subProjectDir = new File(projectDir, it)
subProjectDir.eachDir {dir->
def projectName = ":${it}-${dir.name}"
project(projectName){
bootJar.enabled(false)
jar.enabled(true)
}
}
}
["server"].each {
def subProjectDir = new File(projectDir, it)
subProjectDir.eachDir {dir->
def projectName = ":${it}-${dir.name}"
project(projectName){
}
}
}
help.enabled(false)