/
build.gradle
93 lines (72 loc) · 2.85 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
import org.flywaydb.gradle.task.FlywayMigrateTask
buildscript {
ext {
springBootVersion = "2.0.6.RELEASE"
}
repositories {
mavenCentral()
}
dependencies {
classpath "org.springframework.boot:spring-boot-gradle-plugin:$springBootVersion"
}
}
plugins {
id "java"
id "org.flywaydb.flyway" version "5.0.5"
id "com.gorylenko.gradle-git-properties" version "1.5.1"
}
apply plugin: 'org.springframework.boot'
repositories {
mavenCentral()
}
dependencies {
// Spring/Framework Dependencies
// compile("org.springframework.boot:spring-boot-starter-web:$springBootVersion")
compile group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.9.8'
compile group: 'org.hibernate', name: 'hibernate-validator', version: '6.0.14.Final'
compile group: 'org.springframework', name: 'spring-web', version: '5.1.3.RELEASE'
compile group: 'org.springframework', name: 'spring-webmvc', version: '5.1.3.RELEASE'
compile group: 'org.springframework.boot', name: 'spring-boot-starter', version: '2.1.1.RELEASE'
compile group: 'org.springframework.boot', name: 'spring-boot-starter-tomcat', version: '2.1.1.RELEASE'
compile("com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.9.7")
// DB Dependencies
compile("org.springframework.boot:spring-boot-starter-jdbc:$springBootVersion")
compile("mysql:mysql-connector-java:6.0.6")
// Actuator Dependencies
compile("org.springframework.boot:spring-boot-starter-actuator:$springBootVersion")
// Test-only Dependencies
testCompile("org.springframework.boot:spring-boot-starter-test:$springBootVersion")
testCompile("org.mockito:mockito-core:2.23.4")
}
def developmentDbUrl = "jdbc:mysql://localhost:3306/tracker_dev?user=tracker&useSSL=false&useTimezone=true&serverTimezone=UTC&useLegacyDatetimeCode=false"
bootRun.environment([
"WELCOME_MESSAGE": "hello",
"SPRING_DATASOURCE_URL": developmentDbUrl,
"MANAGEMENT_ENDPOINTS_WEB_EXPOSURE_INCLUDE": "*",
"MANAGEMENT_ENDPOINT_HEALTH_SHOWDETAILS": "always",
"management.info.git.mode": "FULL",
// "ENV_NAME": "ootRun"
])
//bootRun {
// systemProperty 'management.info.git.mode', 'FULL'
//}
def testDbUrl = "jdbc:mysql://localhost:3306/tracker_test?user=tracker&useSSL=false&useTimezone=true&serverTimezone=UTC&useLegacyDatetimeCode=false"
test.environment([
"WELCOME_MESSAGE": "Hello from test",
"SPRING_DATASOURCE_URL": testDbUrl,
"MANAGEMENT_ENDPOINTS_WEB_EXPOSURE_INCLUDE": "*",
"MANAGEMENT_ENDPOINT_HEALTH_SHOWDETAILS": "always",
"ENV_NAME": "test"
])
flyway {
url = developmentDbUrl
user = "tracker"
password = ""
locations = ["filesystem:databases/tracker/migrations"]
}
task testMigrate(type: FlywayMigrateTask) {
url = testDbUrl
}
springBoot {
buildInfo()
}