-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
76 lines (65 loc) · 2.2 KB
/
Copy pathbuild.gradle
File metadata and controls
76 lines (65 loc) · 2.2 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
buildscript {
ext {
springBootVersion = '1.3.5.RELEASE'
}
repositories {
mavenCentral()
maven {url "https://plugins.gradle.org/m2/" }
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
classpath("gradle.plugin.com.boxfuse.client:flyway-release:4.0.3")
}
}
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'spring-boot'
apply plugin: 'org.flywaydb.flyway'
jar {
baseName = 'cats-core'
version = '0.0.1-SNAPSHOT'
}
sourceCompatibility = 1.8
targetCompatibility = 1.8
repositories {
mavenCentral()
jcenter()
}
dependencies {
compile('org.springframework.boot:spring-boot-starter-data-jpa')
compile('org.springframework.boot:spring-boot-starter-data-mongodb')
compile('org.springframework.boot:spring-boot-starter-web')
compile('org.postgresql:postgresql:9.4.1207')
compile('com.microsoft.sqlserver:sqljdbc4:4.0')
compile('org.springframework.boot:spring-boot-devtools')
compile('io.springfox:springfox-swagger2:2.5.0')
compile('io.springfox:springfox-swagger-ui:2.5.0')
compile('org.apache.poi:poi-ooxml:3.16-beta1')
//compile('org.flywaydb:flyway-core:4.0.3')
testCompile('org.springframework.boot:spring-boot-starter-test')
}
eclipse {
classpath {
containers.remove('org.eclipse.jdt.launching.JRE_CONTAINER')
containers 'org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8'
}
}
/* This task expects a parameter called 'mf' for migration file description
Usage: gradle mkm -Pmf=AddNewColumnToTable
Note: Migration name should be in CamelCase
*/
task mkm <<{
description = 'Creates a new migraiton file for flyway. Usage: gradle mkm -Pmf=AddNewColumnToTable'
def fileName = mf.replaceAll(/\B[A-Z]/) { '_' + it }.toLowerCase()
def date = new Date()
def formattedDate = date.format('yyyyMMddHHmmss')
def migrationFileName = "V${formattedDate}__${fileName}.sql"
def file = new File("${projectDir}/src/main/resources/db/migration/${migrationFileName}")
file.text = "-- Migration file ${migrationFileName} created at --"
println "Generated new migration file ${migrationFileName}"
}
flyway{
url = 'jdbc:postgresql://localhost:5432/cats_dev'
user = 'cats'
password = 'cats'
}