-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
141 lines (118 loc) · 5.16 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
import org.yaml.snakeyaml.Yaml
buildscript {
ext {
SPRING_BOOT_VERSION = "3.0.0"
SPRING_SECURITY_VERSION = "6.0.0"
}
repositories {
mavenCentral()
gradlePluginPortal()
}
dependencies {
classpath "org.springframework.boot:spring-boot-gradle-plugin:${SPRING_BOOT_VERSION}"
classpath "io.spring.gradle:dependency-management-plugin:1.1.0"
classpath "org.flywaydb:flyway-gradle-plugin:9.8.3"
classpath "org.flywaydb:flyway-mysql:9.8.3"
classpath "org.yaml:snakeyaml:1.33"
classpath "com.github.ben-manes:gradle-versions-plugin:0.44.0"
}
}
apply plugin: "org.springframework.boot"
apply plugin: "io.spring.dependency-management"
apply plugin: "org.flywaydb.flyway"
apply plugin: "com.github.ben-manes.versions"
apply plugin: "java"
apply plugin: "groovy"
apply plugin: "eclipse"
apply plugin: "idea"
java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
repositories {
mavenCentral()
}
configurations {
mybatisGenerate
}
ext {
// path
PROJECT_ROOT_PATH = projectDir.absolutePath.replaceAll("\\\\", "/")
JAVA_ROOT_PATH = "${PROJECT_ROOT_PATH}/src/main/java"
RESOURCES_ROOT_PATH = "app/src/main/resources"
PROPERTY_ROOT_PATH = "${rootProject.rootDir.path}/${RESOURCES_ROOT_PATH}"
GRADLE_ROOT_PATH = "../gradle"
// application properties
APPLICATION_PROPERTIES = new Yaml().load(new File("${PROPERTY_ROOT_PATH}/application.yml").newInputStream())
// application info
APPLICATION_NAME = APPLICATION_PROPERTIES.project.name
APPLICATION_VERSION = APPLICATION_PROPERTIES.project.version
// datasource
DATASOURCE_URL = "jdbc:mysql://localhost:3306/reminder"
DATASOURCE_USERNAME = "reminder"
DATASOURCE_PASSWORD = "reminder"
DATASOURCE_DRIVER = "com.mysql.cj.jdbc.Driver"
// mybatis
MYBATIS_PROPERTY = APPLICATION_PROPERTIES.project.mybatis
}
dependencies {
// spring boot
implementation "org.springframework.boot:spring-boot-starter-web:${SPRING_BOOT_VERSION}"
implementation "org.springframework.boot:spring-boot-starter-validation:${SPRING_BOOT_VERSION}"
implementation "org.springframework.boot:spring-boot-starter-security:${SPRING_BOOT_VERSION}"
testImplementation "org.springframework.boot:spring-boot-starter-test:${SPRING_BOOT_VERSION}"
annotationProcessor "org.springframework.boot:spring-boot-configuration-processor:${SPRING_BOOT_VERSION}"
// spring security
implementation "org.springframework.security:spring-security-core:${SPRING_SECURITY_VERSION}"
implementation "org.springframework.security:spring-security-web:${SPRING_SECURITY_VERSION}"
implementation "org.springframework.security:spring-security-config:${SPRING_SECURITY_VERSION}"
testImplementation "org.springframework.security:spring-security-test:${SPRING_SECURITY_VERSION}"
// flyway
implementation "org.flywaydb:flyway-core:9.8.3"
implementation "org.flywaydb:flyway-mysql:9.8.3"
// lombok
implementation "org.projectlombok:lombok:1.18.24"
annotationProcessor "org.projectlombok:lombok:1.18.24"
testImplementation "org.projectlombok:lombok:1.18.24"
testAnnotationProcessor "org.projectlombok:lombok:1.18.24"
// mybatis
implementation "org.mybatis.spring.boot:mybatis-spring-boot-starter:${SPRING_BOOT_VERSION}"
implementation "org.mybatis.generator:mybatis-generator-maven-plugin:1.4.1"
mybatisGenerate "org.mybatis.generator:mybatis-generator-core:1.4.1"
mybatisGenerate "com.softwareloop:mybatis-generator-lombok-plugin:1.0"
mybatisGenerate "mysql:mysql-connector-java:8.0.31"
// mysql
implementation "mysql:mysql-connector-java:8.0.31"
// swagger
implementation "org.springdoc:springdoc-openapi-starter-webmvc-ui:2.0.0"
implementation "org.springdoc:springdoc-openapi-starter-common:2.0.0"
implementation "com.github.therapi:therapi-runtime-javadoc:0.15.0"
annotationProcessor "com.github.therapi:therapi-runtime-javadoc-scribe:0.15.0"
// test
testImplementation "org.spockframework:spock-core:2.4-M1-groovy-4.0"
testImplementation "org.spockframework:spock-spring:2.4-M1-groovy-4.0"
testImplementation "org.jeasy:easy-random-core:5.0.0"
testImplementation "org.apache.groovy:groovy:4.0.6"
testImplementation "org.apache.groovy:groovy-sql:4.0.6"
// logging
implementation "ch.qos.logback:logback-classic:1.4.5"
// util
implementation "com.google.guava:guava:31.1-jre"
implementation "org.apache.commons:commons-lang3:3.12.0"
implementation "org.apache.commons:commons-collections4:4.4"
implementation "commons-net:commons-net:3.9.0"
implementation "commons-validator:commons-validator:1.7"
implementation "net.rakugakibox.util:yaml-resource-bundle:1.2"
}
tasks.withType(Test) {
systemProperties System.properties
}
tasks.withType(JavaExec) {
systemProperties System.properties
}
apply from: "${GRADLE_ROOT_PATH}/jar.gradle"
apply from: "${GRADLE_ROOT_PATH}/run.gradle"
apply from: "${GRADLE_ROOT_PATH}/test.gradle"
apply from: "${GRADLE_ROOT_PATH}/flyway.gradle"
apply from: "${GRADLE_ROOT_PATH}/javadoc.gradle"
apply from: "${GRADLE_ROOT_PATH}/mybatis.gradle"