-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathbuild.gradle
231 lines (202 loc) · 7.61 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
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
buildscript {
ext {
// set gradle properties regarding nexus
nexus_url = project.findProperty('nexus_url') ?: System.getenv('NEXUS_HOST')
nexus_user = project.findProperty('nexus_user') ?: System.getenv('NEXUS_USERNAME')
nexus_pw = project.findProperty('nexus_pw') ?: System.getenv('NEXUS_PASSWORD')
no_nexus = project.findProperty('no_nexus') ?: System.getenv('NO_NEXUS') ?: false
if (!no_nexus && (nexus_url == null || nexus_user == null || nexus_pw == null)) {
throw new GradleException("property 'no_nexus' is set to false, but neither " +
"'nexus_url', 'nexus_user' nor 'nexus_pw' is configured. You can do so " +
"by e.g. creating a gradle.properties file in your 'GRADLE_USER_HOME' " +
"(by default '~/.gradle') folder and setting the nexus properties there.")
}
nexusFolderReleases = project.findProperty('nexus_folder_releases')
?: System.getenv('NEXUS_FOLDER_RELEASES') ?: "maven-releases"
nexusFolderSnapshots = project.findProperty('nexus_folder_snapshots')
?: System.getenv('NEXUS_FOLDER_SNAPSHOTS') ?: "maven-snapshots"
}
}
plugins {
id 'org.springframework.boot' version '2.4.1'
id 'io.spring.dependency-management' version '1.0.10.RELEASE'
id 'java'
id 'maven-publish'
id 'jacoco'
id 'org.sonarqube' version "3.0"
id "com.diffplug.spotless" version "5.8.2"
id "nebula.lint" version "16.9.1"
}
group = 'prov'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = 1.11
repositories {
if (!no_nexus) {
println("INFO: using nexus repositories, because property no_nexus=$no_nexus and nexus_url=${nexus_url}")
def nexusMaven = { repoUrl ->
maven {
credentials {
username = "${nexus_user}"
password = "${nexus_pw}"
}
url repoUrl
}
}
nexusMaven("${nexus_url}/repository/maven-public/")
nexusMaven("${nexus_url}/repository/atlassian_public/")
maven() {
url "https://packages.atlassian.com/mvn/maven-atlassian-external/"
}
maven() {
url "https://packages.atlassian.com/maven-public/"
}
} else {
println("INFO: using repository 'mavenCentral', because property no_nexus=$no_nexus")
mavenCentral()
maven() {
url "https://maven.atlassian.com/content/repositories/atlassian-public/"
}
maven() {
url "https://packages.atlassian.com/mvn/maven-atlassian-external/"
}
maven() {
url "https://packages.atlassian.com/maven-public/"
}
maven() {
url 'http://maven.imagej.net/content/repositories/public/'
}
}
}
configurations {
compileOnly {
extendsFrom annotationProcessor
}
}
dependencies {
implementation('io.springfox:springfox-boot-starter:3.0.0')
implementation('org.springframework.boot:spring-boot-starter-actuator')
implementation('org.springframework.boot:spring-boot-starter-mail')
implementation('org.springframework.boot:spring-boot-starter-security')
//security framework
implementation('org.springframework.boot:spring-boot-starter-thymeleaf')
//templating for frontend
implementation('org.springframework.boot:spring-boot-starter-web')
runtimeOnly('org.springframework.boot:spring-boot-devtools')
//hot reloading, disabling cache ...
testImplementation('org.springframework.boot:spring-boot-starter-test')
testImplementation('org.springframework.restdocs:spring-restdocs-mockmvc')
testImplementation('org.springframework.security:spring-security-test')
implementation('org.thymeleaf.extras:thymeleaf-extras-springsecurity5')
// oauth2
implementation('org.springframework.security:spring-security-oauth2-core')
implementation('org.springframework.security:spring-security-oauth2-client')
implementation('org.springframework.security:spring-security-oauth2-jose')
implementation('org.springframework.security.oauth:spring-security-oauth2:2.5.0.RELEASE')
implementation('io.fabric8:openshift-client:5.12.1') {
exclude(group: 'org.slf4j', module: 'slf4j-api')
exclude(group: 'org.slf4j', module: 'slf4j-log4j12')
}
// azure ad
runtimeOnly('com.microsoft.azure:azure-active-directory-spring-boot-starter:2.3.5')
//frontend webjars
implementation('org.webjars:webjars-locator:0.37')
implementation('org.webjars.bower:jquery:3.4.1')
implementation('org.webjars.bower:bootstrap:3.3.7')
implementation('org.webjars.bower:react:16.1.0')
implementation('org.webjars.bower:font-awesome:4.7.0')
implementation('org.webjars.bower:lodash:4.17.10')
//encryption library for properties
implementation('com.github.ulisesbocchio:jasypt-spring-boot-starter:2.1.2')
//easy http calls to atlassian JSON APIs
implementation('com.squareup.okhttp3:okhttp:4.9.0')
implementation('commons-io:commons-io:2.11.0')
implementation('commons-httpclient:commons-httpclient:3.1')
implementation('com.atlassian.platform:platform') {
version {
strictly '3.5.2'
} // Cannot upgrade to '3.5.24'
transitive = true
}
implementation('com.atlassian.security:atlassian-security:3.2.14') {
transitive = true
}
implementation('com.atlassian.security:atlassian-cookie-tools:3.2.14') {
transitive = true
}
implementation('javax.validation:validation-api:2.0.1.Final')
implementation('com.atlassian.crowd:crowd-integration-springsecurity:5.1.3')
implementation group: 'javax.xml.bind', name: 'jaxb-api', version: '2.3.1'
implementation group: 'org.glassfish.jaxb', name: 'jaxb-runtime', version: '2.3.1'
implementation group: 'xerces', name: 'xercesImpl', version: '2.9.1'
testImplementation('com.github.tomakehurst:wiremock-jre8:2.32.0')
}
bootJar {
doFirst {
copy {
println 'bootJar: copy new frond end artifacts to resources folder!'
from 'client/dist/client/nfe'
into 'build/resources/main/static/nfe'
}
}
launchScript()
archiveFileName = "app.jar"
destinationDirectory = file("$buildDir/../docker")
}
test {
finalizedBy jacocoTestReport
useJUnitPlatform()
}
bootRun {
doFirst {
copy {
println 'bootRun: Copy New Front End files!!!'
from 'client/dist/client/nfe'
into 'build/resources/main/static/nfe'
}
}
args = [
'--spring.config.location=file:./build/resources/main/application-local.properties'
]
}
jacoco {
toolVersion = "0.8.6"
}
jacocoTestReport {
reports {
xml.enabled true
}
}
// run with ./gradlew spotlessApply
spotless {
java {
googleJavaFormat('1.9')
trimTrailingWhitespace()
indentWithSpaces(2)
endWithNewline()
}
}
// run with ./gradlew lintGradle
gradleLint {
alwaysRun = false
rules = ['unused-dependency']
}
task npmBuild(type:Exec) {
workingDir 'client'
//on windows:
commandLine 'cmd', '/c', 'npm', 'run', 'build'
//on linux
commandLine 'npm', 'run', 'build'
}
// Uncomment to compile npm front if frontend.spa.enabled=true in .properties
//bootRun.dependsOn npmBuild
configurations.all {
resolutionStrategy.eachDependency {
// com.atlassian.platform:platform:3.5.2
if(it.requested.name == 'platform') {
it.useTarget 'com.atlassian.platform:platform:3.5.24'
}
}
}
// configurations.implementation {
// exclude group: 'com.google.code.findbugs', module: 'jsr305'
// }