-
Notifications
You must be signed in to change notification settings - Fork 34
/
build.gradle
97 lines (86 loc) · 2.43 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
apply plugin: 'java'
apply plugin: 'idea'
apply plugin: 'spring-boot'
apply plugin: 'org.flywaydb.flyway'
apply plugin: 'java'
apply plugin: "pmd"
repositories {
jcenter(){
url "http://jcenter.bintray.com/"
}
flatDir {
dirs 'lib'
}
}
flyway {
url = 'jdbc:mysql://localhost:3306'
user = 'root'
password = 'password'
schemas = ['bookmarks']
locations = ['classpath:db.migration']
}
pmd {
ignoreFailures = true
sourceSets = [sourceSets.main]
reportsDir = file("$project.buildDir/reports/pmd")
ruleSets = [
"java-basic",
"java-braces",
"java-strings",
"java-design",
"java-unusedcode"
]
}
task stage {
dependsOn build
}
// add CPD to check
check << {
File outDir = new File("$project.buildDir/reports/pmd/")
outDir.mkdirs()
ant.taskdef(name: 'cpd', classname: 'net.sourceforge.pmd.cpd.CPDTask',
classpath: configurations.pmd.asPath)
ant.cpd(minimumTokenCount: '100', format: 'xml',
outputFile: new File(outDir , 'cpd.xml')) {
fileset(dir: "src/main/java") {
include(name: '**/*.java')
}
}
}
buildscript {
repositories {
jcenter()
flatDir {
dirs 'lib'
}
}
dependencies {
classpath 'org.springframework.boot:spring-boot-gradle-plugin:1.3.1.RELEASE'
classpath 'org.flywaydb:flyway-gradle-plugin:3.2.1'
}
}
jar {
baseName = project.name
version = '0.1.0'
exclude('application.properties')
exclude('gradle.properties')
}
dependencies {
compile 'org.springframework.boot:spring-boot-starter-web'
compile 'org.springframework.boot:spring-boot-starter-aop'
compile 'org.springframework.boot:spring-boot-starter-data-jpa'
compile "org.springframework.boot:spring-boot-starter-actuator"
compile("org.apache.commons:commons-lang3:3.2.1")
compile("com.google.guava:guava:16.0.1")
compile("org.yaml:snakeyaml:1.13")
compile("mysql:mysql-connector-java:5.1.28")
compile("org.postgresql:postgresql:9.4-1201-jdbc4")
testCompile("junit:junit:4.11")
testCompile 'org.hamcrest:hamcrest-all:1.3'
testCompile "org.mockito:mockito-all:1.8.4"
testCompile 'com.jayway.jsonpath:json-path:0.9.1'
testCompile 'com.jayway.jsonpath:json-path-assert:0.9.1'
testCompile("org.springframework:spring-test:4.0.6.RELEASE")
testCompile("org.hsqldb:hsqldb:2.0.0")
testCompile("org.skyscreamer:jsonassert:0.9.0")
}