-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
126 lines (101 loc) · 4.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
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
// =========================================================================
// Plugin Declaration
// =========================================================================
plugins {
id 'com.github.ben-manes.versions' version '0.21.0'
id 'com.gorylenko.gradle-git-properties' version '2.0.0'
id 'io.spring.dependency-management' version '1.0.7.RELEASE'
id 'org.ajoberstar.grgit' version '3.1.1'
id 'org.sonarqube' version '2.7'
id 'org.springframework.boot' version '2.1.4.RELEASE'
}
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: 'jacoco'
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'war'
// =========================================================================
// Project Information
// =========================================================================
description = 'A simple web application illustrating how to structure a SpringMVC project.'
// =========================================================================
// Project Attributes
// =========================================================================
def head = grgit.head().abbreviatedId
def gitDescription = grgit.describe(match: ['v*']) ?: "v0.0-${grgit.log().size()}-g${head}"
group = 'com.github.owenfarrell'
version = gitDescription.substring(1).replaceFirst("-", ".").replace("g${head}", 'SNAPSHOT')
if (version != null && System.getenv('TRAVIS_PULL_REQUEST') == 'false') {
status = version.endsWith('SNAPSHOT') ? 'milestone' : 'release'
}
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
// =========================================================================
// Dependency Management
// =========================================================================
repositories {
mavenCentral()
}
dependencies {
// OWASP Sanitizer
implementation group: 'com.googlecode.owasp-java-html-sanitizer', name: 'owasp-java-html-sanitizer', version: '20190325.1'
// Webjars
runtimeOnly group: 'org.webjars', name: 'webjars-locator', version: '0.36'
runtimeOnly group: 'org.webjars', name: 'bootstrap', version: '4.1.1'
runtimeOnly group: 'org.webjars', name: 'font-awesome', version: '5.0.13-2'
runtimeOnly group: 'org.webjars', name: 'html5shiv', version: '3.7.3-1'
runtimeOnly group: 'org.webjars', name: 'jquery', version: '3.3.1-1'
runtimeOnly group: 'org.webjars', name: 'popper.js', version: '1.12.9-1'
runtimeOnly group: 'org.webjars', name: 'respond', version: '1.4.2-1'
// Spring Boot
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-actuator'
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-security'
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-web'
testImplementation group: 'org.springframework.boot', name: 'spring-boot-starter-test'
// Apache Tomcat
providedRuntime group: 'org.apache.tomcat.embed', name: 'tomcat-embed-jasper'
providedRuntime group: 'org.springframework.boot', name: 'spring-boot-starter-tomcat'
// Java Servlet
compileOnly group: 'javax.servlet', name: 'javax.servlet-api', version: '3.1.0'
compileOnly group: 'javax.servlet.jsp', name: 'javax.servlet.jsp-api', version: '2.3.1'
implementation group: 'javax.servlet', name: 'jstl', version: '1.2'
constraints {
implementation('com.google.guava:guava:24.1.1-jre') {
because 'CVE-2018-10237'
}
implementation('org.apache.commons:commons-compress:1.16') {
because 'CVE-2018-1324'
}
}
}
// =========================================================================
// Task Type Configuration
// =========================================================================
tasks.withType(JacocoReport) {
reports.xml.enabled true
}
check.dependsOn tasks.withType(JacocoReport)
tasks.withType(Jar) {
version = null
}
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
options.compilerArgs << '-Xlint:unchecked' << '-Xlint:deprecation'
}
tasks.withType(Test) {
systemProperties['java.io.tmpdir'] = temporaryDir.absolutePath
}
// =========================================================================
// Plugin Task Configuration
// =========================================================================
processResources {
expand(project.properties)
}
springBoot {
buildInfo()
}
wrapper {
distributionType = Wrapper.DistributionType.ALL
gradleVersion = '5.3.1'
}