-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
163 lines (133 loc) · 4.06 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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
buildscript {
System.setProperty("catalina.base", "build")
repositories {
mavenCentral()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:${dependencyVersionSpringBootGradlePlugin}")
classpath("net.researchgate:gradle-release:${dependencyVersionGradleReleasePlugin}")
classpath("org.owasp:dependency-check-gradle:${dependencyVersionGradleDependencyCheckPlugin}")
}
}
repositories {
mavenCentral()
}
// IDE plugins
apply plugin: 'eclipse-wtp'
apply plugin: 'idea'
// Java dev plugins
apply plugin: 'war'
apply plugin: 'java'
apply plugin: 'jacoco'
apply plugin: 'jdepend'
apply plugin: 'spring-boot'
apply plugin: 'maven'
apply plugin: 'groovy'
// code quality plugins
apply plugin: 'checkstyle'
//dependency check plugin
apply plugin: 'org.owasp.dependencycheck'
configurations {
}
sourceSets {
test {
resources {
srcDir 'src/config'
}
}
}
checkstyle {
toolVersion = "7.1.1"
}
dependencyCheck {
failBuildOnCVSS=11
suppressionFile='config/dependencycheck/suppressions.xml'
}
// project artifact info
group = groupId
archivesBaseName = artifactId
version = 'SNAPSHOT'
// configure plugins
jacoco {
toolVersion = "${dependencyVersionJacocoTool}"
reportsDir = file("${buildDir}/jacocoReportDir")
}
def excludedSources = ['**/model/**']
test {
jacoco {
excludes = excludedSources
append = false
destinationFile = file("$buildDir/jacoco/jacoco.exec")
classDumpFile = file("$buildDir/jacoco/classpathdumps")
}
testLogging {
events "passed", "skipped", "failed"
}
}
jacocoTestReport {
doFirst {
classDirectories = fileTree(dir: "${buildDir}/classes/main/").exclude(excludedSources)
}
reports {
xml.enabled false
csv.enabled false
html.destination "${buildDir}/jacocoHtml"
}
}
bootRun {
systemProperties = System.properties
doFirst {
systemProperty "spring.profiles.active", "local"
}
}
// configure project specific properties/dependencies
sourceCompatibility = 1.8
targetCompatibility = 1.8
// Add a provided configuration.
// This is used to add jar dependencies that are needed for compile time only
// but should not be bundled in the war/ear projects.
configurations { provided }
sourceSets {
main {
compileClasspath += [configurations.provided]
}
test {
compileClasspath += [configurations.provided]
runtimeClasspath += [configurations.provided]
groovy {
srcDirs = ['src/test/groovy/functional', 'src/test/groovy/unit']
}
}
}
// optional: if using 'eclipse' plugin
eclipse.classpath.plusConfigurations += [configurations.provided]
ext {
dependencyVersionJetty9='9.3.9.v20160517'
dependencyVersionGroovy='2.4.6'
dependencyVersionGroovyHttpBuilder='0.7.1'
dependencyVersionApacheHttp='4.3.5'
dependencyVersionMockito='1.10.19'
dependencyVersionAssertj='3.4.1'
dependencyVersionSwagger2='2.4.0'
}
dependencies {
provided 'javax.servlet:javax.servlet-api:3.1.0'
// swagger
compile("io.springfox:springfox-swagger2:${dependencyVersionSwagger2}")
compile("io.springfox:springfox-staticdocs:${dependencyVersionSwagger2}")
// dependencies
compile("org.springframework.boot:spring-boot-starter-web:${dependencyVersionSpringBoot}")
compile("commons-io:commons-io:${dependencyVersionCommonsIo}")
compile("com.javaslang:javaslang:${dependencyVersionJavaslang}")
// test dependencies
testCompile "org.springframework.boot:spring-boot-starter-test:${dependencyVersionSpringBoot}"
testCompile "org.mockito:mockito-all:${dependencyVersionMockito}"
testCompile "org.assertj:assertj-core:${dependencyVersionAssertj}"
testCompile "org.codehaus.groovy:groovy-all:${dependencyVersionGroovy}"
testCompile "org.codehaus.groovy.modules.http-builder:http-builder:${dependencyVersionGroovyHttpBuilder}"
testCompile "org.apache.httpcomponents:httpclient:${dependencyVersionApacheHttp}"
testCompile "org.apache.httpcomponents:httpmime:${dependencyVersionApacheHttp}"
testCompile 'org.spockframework:spock-core:1.0-groovy-2.4'
testCompile 'org.spockframework:spock-spring:1.0-groovy-2.4'
testCompile 'cglib:cglib-nodep:3.2.2'
}