-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathbuild.gradle
More file actions
101 lines (89 loc) · 2.68 KB
/
build.gradle
File metadata and controls
101 lines (89 loc) · 2.68 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
buildscript {
ext {
springBootVersion = '1.5.7.RELEASE'
}
repositories {
mavenCentral()
jcenter()
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
classpath 'org.postgresql:postgresql:9.4.1212'
classpath "nu.studer:gradle-jooq-plugin:2.0.7"
classpath "gradle.plugin.com.boxfuse.client:flyway-release:4.2.0"
}
}
apply plugin: 'java'
apply plugin: 'idea'
apply plugin: 'org.springframework.boot'
apply plugin: "nu.studer.jooq"
apply plugin: "org.flywaydb.flyway"
group = 'ru.hixon'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = 1.8
repositories {
mavenCentral()
}
dependencies {
compile('org.springframework.boot:spring-boot-starter-actuator')
compile('org.springframework.boot:spring-boot-actuator-docs')
compile group: 'org.flywaydb', name: 'flyway-core', version: '4.2.0'
compile('org.springframework.boot:spring-boot-starter-jooq')
compile('org.springframework.boot:spring-boot-starter-web')
runtime('org.springframework.boot:spring-boot-devtools')
testCompile('org.springframework.boot:spring-boot-starter-test')
compile('org.postgresql:postgresql:9.4.1212')
jooqRuntime 'org.postgresql:postgresql:9.4.1212'
}
ext {
databaseUrl = 'jdbc:postgresql://localhost:5432/blog'
databaseLogin = 'spring-boot-user'
databasePassword = 'spring-boot-user'
}
processResources {
expand(project.properties)
}
jooq {
csmart(sourceSets.main) {
jdbc {
driver = 'org.postgresql.Driver'
url = databaseUrl
user = databaseLogin
password = databasePassword
schema = 'public'
}
generator {
name = 'org.jooq.util.DefaultGenerator'
strategy {
name = 'org.jooq.util.DefaultGeneratorStrategy'
}
database {
name = 'org.jooq.util.postgres.PostgresDatabase'
inputSchema = 'public'
}
generate {
relations = true
deprecated = false
records = true
immutablePojos = false
fluentSetters = true
}
target {
packageName = 'ru.hixon.gen'
directory = 'src/main/generated/java'
}
}
}
}
flyway {
url = databaseUrl
user = databaseLogin
password = databasePassword
schemas = ['public']
locations = ["filesystem:$project.projectDir/src/main/resources/db/migration"]
}
generateCsmartJooqSchemaSource.dependsOn flywayMigrate
bootRun.dependsOn flywayMigrate