-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
501 lines (443 loc) · 18.7 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
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
/*
* web: build.gradle
* XNAT http://www.xnat.org
* Copyright (c) 2005-2017, Washington University School of Medicine and Howard Hughes Medical Institute
* All Rights Reserved
*
* Released under the Simplified BSD.
*/
import org.gradle.internal.jvm.Jvm
buildscript {
repositories {
mavenLocal()
jcenter()
mavenCentral()
maven {
url "https://plugins.gradle.org/m2/"
}
maven {
url 'https://nrgxnat.jfrog.io/nrgxnat/libs-release'
name 'XNAT Release Repository'
}
maven {
url 'https://nrgxnat.jfrog.io/nrgxnat/libs-snapshot'
name 'XNAT Snapshot Repository'
}
}
dependencies {
classpath "com.bmuschko:gradle-cargo-plugin:2.2.2"
classpath "com.bmuschko:gradle-tomcat-plugin:2.2.4"
classpath "gradle.plugin.com.palantir.gradle.gitversion:gradle-git-version:0.5.3"
}
}
// specify the app name here for convenience
// (without a gradle.properties file)
def appName = 'xnat-reboot'
def appVersion = ''
def vXnatRebootDev = '0.0.1-SNAPSHOT'
def vXnatReboot = '0.0.0'
def vXnatDev = '1.7.3-SNAPSHOT'
def vXnat = '1.7.2'
def vXImgView = '1.0.0-SNAPSHOT'
def vSpring = '4.2.9.RELEASE'
def vSpringSecurity = '4.0.4.RELEASE'
def vSwagger = '2.4.0'
def vHibernate = '4.3.11.Final'
def vEhcache = '2.6.11'
def vJackson = '2.6.5'
def vPostgreSQL = '9.4.1209.jre7'
def vServletApi = '3.1.0'
def vTomcat = '7.0.68'
def vCargo = '1.4.18'
def vSlf4j = '1.7.21'
def vLog4j = '1.2.17'
def vJunit = '4.12'
def vJacoco = '0.7.8'
def vSaxon = '9.1.0.8'
def vGroovy = '2.4.7'
def vJython = '2.7.0'
group 'org.nrg.xnat'
version = "${vXnatDev}"
//version = "${vXnatRebootDev}"
apply plugin: 'groovy'
apply plugin: 'java'
apply plugin: 'war'
apply plugin: 'maven'
apply plugin: 'jacoco'
apply plugin: 'maven-publish'
apply plugin: 'com.bmuschko.tomcat'
apply plugin: 'com.bmuschko.cargo'
apply plugin: "com.palantir.git-version"
apply plugin: 'idea'
apply plugin: 'eclipse'
repositories {
mavenLocal()
maven {
url 'http://dcm4che.org/maven2'
name 'dcm4che Maven Repository'
}
jcenter()
mavenCentral()
maven {
url 'https://nrgxnat.jfrog.io/nrgxnat/libs-release'
name 'XNAT Release Repository'
}
maven {
url 'https://nrgxnat.jfrog.io/nrgxnat/libs-snapshot'
name 'XNAT Snapshot Repository'
}
maven {
url 'https://nrgxnat.jfrog.io/nrgxnat/ext-release'
name 'XNAT External Release Repository'
}
}
sourceCompatibility = 1.7
targetCompatibility = 1.7
def javaVersion = Jvm.current().javaVersion
if (javaVersion.java8Compatible || javaVersion.java9Compatible) {
if (hasProperty("rt.17.jar")) {
// Solution for bootstrap classpath warning and possible issues with compatibility with 1.7 libraries
// was taken from this post on discuss.gradle.org: http://bit.ly/24xD9j0
def rt17jar = getProperty("rt.17.jar")
logger.info "Using ${rt17jar} as the bootstrap class path jar."
gradle.projectsEvaluated {
tasks.withType(JavaCompile) {
options.fork = true
options.compilerArgs << "-XDignore.symbol.file"
options.bootClasspath = rt17jar
}
}
} else {
logger.warn "No value was set for the rt.17.jar build property, but you are using a Java 8- or 9-compatible JDK. You should consider setting rt.17.jar to indicate a jar file containing the Java 1.7 run-time library:\n"
logger.warn "\n"
logger.warn " ./gradlew -Prt.17.jar=rt-1.7.0_45.jar war\n"
logger.warn "\n"
logger.warn "You can also set this property in a gradle.properties file, either in the top level of your build folder or in the folder ~/.gradle/:\n"
logger.warn "\n"
logger.warn " rt.17.jar=/home/developer/.gradle/rt.17.jar\n"
logger.warn "\n"
logger.warn "In some isolated instances, using a bootstrap library from a JDK version later than 1.7 can result in run-time errors.\n"
}
} else if (!javaVersion.java7Compatible) {
throw new BuildCancelledException("You are using a JDK version (${javaVersion}) that is not compatible with Java 7. The XNAT build will fail. Please install a JDK version of Java 7 or later.")
}
if (hasProperty("archiveName")) {
war.archiveName = archiveName.endsWith(".war") ? archiveName : "${archiveName}.war"
} else if (!appName.isEmpty()) {
war.archiveName = appVersion.isEmpty() ? "${appName}.war" : "${appName}-${appVersion}.war"
} else {
war.baseName = "xnat-web"
}
tomcatRun.contextPath = '/'
tomcatRunWar.contextPath = '/'
[tomcatRun, tomcatRunWar].each { task ->
// TODO: This can be configured with an external folder reference to be used for loading XNAT modules.
task.additionalRuntimeResources << file('/Users/rherrick/xnat/config/plugins')
}
task deployToTomcat(type: Copy, dependsOn: war) {
from war.archivePath
into "${propertyWithDefault('tomcatHome', '.')}/webapps"
}
cargo {
// These properties must be set in the ~/.gradle/gradle.properties file or passed on the Gradle command line in
// the form -PdeployPort=8080 -PdeployContext=/ -PdeployHost=localhost -PdeployUser=deploy -PdeployPassword=deploy
containerId = 'tomcat7x'
port = propertyWithDefault('deployPort', 8080) as int
deployable {
context = propertyWithDefault('deployContext', '/')
}
remote {
hostname = propertyWithDefault('deployHost', 'localhost')
username = propertyWithDefault('deployUser', 'deploy')
password = propertyWithDefault('deployPassword', 'deploy')
}
}
if (JavaVersion.current().isJava8Compatible()) {
allprojects {
tasks.withType(Javadoc) {
options.addStringOption('Xdoclint:none', '-quiet')
}
}
}
// Pulls in the Jenkins BUILD_NUMBER environment variable if available.
def buildDate = new Date()
def buildNumber = System.getenv().BUILD_NUMBER?.toInteger() ?: "Manual"
def revision = gitVersion().replace("${version}-", "")
logger.info "Git version: ${gitVersion()}"
logger.info "Build-Date: ${buildDate}"
logger.info "Build-Number: ${buildNumber}"
logger.info "Implementation-Sha: ${revision}"
logger.info "Implementation-Version: ${version}"
jar {
manifest {
attributes 'Application-Name': 'XNAT',
'Build-Date': buildDate,
'Build-Number': buildNumber,
'Implementation-Sha': revision,
'Implementation-Version': version
}
}
war {
manifest {
attributes 'Application-Name': 'XNAT',
'Build-Date': buildDate,
'Build-Number': buildNumber,
'Implementation-Sha': revision,
'Implementation-Version': version
}
}
jacoco {
toolVersion = vJacoco
}
jacocoTestReport {
dependsOn test
reports {
xml.enabled false
csv.enabled false
html.destination "${buildDir}/jacocoHtml"
}
}
task sourceJar(type: Jar, dependsOn: classes) {
from sourceSets.main.allSource
}
task javadocJar(type: Jar, dependsOn: javadoc) {
from javadoc.destinationDir
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
artifact sourceJar {
classifier "sources"
}
artifact javadocJar {
classifier "javadoc"
}
pom.withXml {
def root = asNode()
root.appendNode('name', 'XNAT Server')
root.appendNode('description', 'XNAT is an open-source imaging informatics software platform dedicated to helping you perform imaging-based research. XNAT’s core functions manage importing, archiving, processing and securely distributing imaging and related study data. But its extended uses continue to evolve.')
root.appendNode('url', 'https://bitbucket.org/xnatdev/xnat-web')
root.appendNode('inceptionYear', '2016')
def scm = root.appendNode('scm')
scm.appendNode('url', 'https://bitbucket.org/xnatdev/xnat-web')
scm.appendNode('connection', 'scm:https://bitbucket.org/xnatdev/xnat-web.git')
scm.appendNode('developerConnection', 'scm:git://bitbucket.org/xnatdev/xnat-web.git')
def license = root.appendNode('licenses').appendNode('license')
license.appendNode('name', 'Simplified BSD 2-Clause License')
license.appendNode('url', 'http://xnat.org/about/license.php')
license.appendNode('distribution', 'repo')
def developers = root.appendNode('developers')
def rherrick = developers.appendNode('developer')
rherrick.appendNode('id', 'rherrick')
rherrick.appendNode('name', 'Rick Herrick')
rherrick.appendNode('email', '[email protected]')
}
}
}
repositories {
maven {
credentials {
// These properties must be set in the ~/.gradle/gradle.properties file or passed on the Gradle command
// line in the form -PrepoUsername=foo -PrepoPassword=bar.
username propertyWithDefault('repoUsername', 'username')
password propertyWithDefault('repoPassword', 'password')
}
if (project.version.endsWith('-SNAPSHOT')) {
url "https://nrgxnat.jfrog.io/nrgxnat/libs-snapshot-local"
} else {
url "https://nrgxnat.jfrog.io/nrgxnat/libs-release-local"
}
}
}
}
def propertyWithDefault(def String property, def Object value) {
hasProperty(property) ? getProperty(property) : value
}
configurations {
all*.exclude group: 'avalon-framework'
all*.exclude group: 'avalon-logkit'
all*.exclude group: 'com.metaparadigm'
all*.exclude group: 'commons-dbcp'
all*.exclude group: 'commons-pool'
all*.exclude group: 'excalibur-component'
all*.exclude group: 'excalibur-instrument'
all*.exclude group: 'excalibur-logger'
all*.exclude group: 'excalibur-pool'
all*.exclude group: 'fop'
all*.exclude group: 'geronimo-spec'
all*.exclude group: 'hsqldb'
all*.exclude group: 'imagej'
all*.exclude group: 'jamon'
all*.exclude group: 'jakarta-regexp'
all*.exclude group: 'org.apache.geronimo.specs'
all*.exclude group: 'servletapi'
all*.exclude group: 'velocity'
all*.exclude group: 'xmlrpc'
all*.exclude group: 'quartz'
all*.exclude group: 'ant', module: 'ant'
all*.exclude group: 'commons-email', module: 'commons-email'
all*.exclude group: 'edu.ucar', module: 'netcdf'
all*.exclude group: 'javax.jms', module: 'jms'
all*.exclude group: 'javax.mail', module: 'mail'
all*.exclude group: 'javax.servlet', module: 'servlet-api'
all*.exclude group: 'javax.sql', module: 'jdbc-stdext'
all*.exclude group: 'javax.transaction', module: 'jta'
all*.exclude group: 'jdbc', module: 'jdbc'
all*.exclude group: 'jms', module: 'jms'
all*.exclude group: 'jython', module: 'jython'
all*.exclude group: 'org.nrg', module: 'nrg'
all*.exclude group: 'org.nrg', module: 'plexiviewer'
all*.exclude group: 'org.nrg.xdat', module: 'beans'
all*.exclude group: 'org.nrg.xnat', module: 'web'
all*.exclude group: 'net.sf.saxon', module: 'saxon'
all*.exclude group: 'net.sf.saxon', module: 'saxon-dom'
all*.exclude group: 'net.sf.saxon', module: 'saxon-xpath'
all*.exclude group: 'net.sf.saxon', module: 'Saxon-B'
all*.exclude group: 'stax', module: 'stax-api'
all*.exclude group: 'xml-apis', module: 'xml-apis'
all*.exclude module: 'commons-beanutils-core'
all*.exclude module: 'log4j-slf4j-impl'
all*.exclude module: 'pipelineCNDAXNAT'
all*.exclude module: 'slf4j-simple'
}
dependencies {
// NRG dependencies first.
compile "org.nrg.xnat:spawner:${vXnatDev}"
compile("org.nrg.xnat:xnat-data-models:${vXnatDev}") {
transitive = false
}
compile "org.nrg.xdat:core:${vXnatDev}"
compile "org.nrg:framework:${vXnatDev}"
compile "org.nrg:transaction:${vXnat}"
compile "org.nrg:prefs:${vXnatDev}"
compile "org.nrg:config:${vXnat}"
compile "org.nrg:automation:${vXnat}"
compile "org.nrg:dicomtools:${vXnatDev}"
compile "org.nrg:anonymize:${vXnat}"
compile "org.nrg:mail:${vXnat}"
compile "org.nrg:notify:${vXnat}"
compile "org.nrg:dicom-xnat-mx:${vXnatDev}"
compile "org.nrg:dicom-xnat-sop:${vXnatDev}"
compile "org.nrg:dicom-xnat-util:${vXnatDev}"
compile "org.nrg:ecat4xnat:${vXnat}"
compile "org.nrg:ExtAttr:4.2.1"
compile "org.nrg:DicomEdit:6.0.2"
compile "org.nrg:DicomImageUtils:${vXnat}"
compile "org.nrg:PrearcImporter:${vXnat}"
compile "org.nrg:SessionBuilders:${vXnat}"
compile "org.nrg:pipelineBase:1.0"
compile "org.nrg:pipelineBuild:1.0"
compile "org.nrg:pipelineWorkflow:1.0"
compile "org.nrg:pipelineXNAT:1.0"
compile "org.nrg.xnat.pipeline:client:1.7.0"
compile "org.nrg.xnat.pipeline:xnat_pipeline:1.7.0"
compile "org.nrg.xnat.pipeline:xnat_tools:1.7.0"
compile("org.nrg.xnat:plexiviewer:1.7.0") {
transitive = false
}
compile "dcm4che:dcm4che-core:2.0.25"
compile "dcm4che:dcm4che-image:2.0.25"
compile "dcm4che:dcm4che-imageio:2.0.25"
compile "dcm4che:dcm4che-imageio-rle:2.0.25"
compile "dcm4che:dcm4che-iod:2.0.25"
compile "dcm4che:dcm4che-net:2.0.25"
compile "org.springframework:spring-aop:${vSpring}"
compile "org.springframework:spring-beans:${vSpring}"
compile "org.springframework:spring-context-support:${vSpring}"
compile "org.springframework:spring-context:${vSpring}"
compile "org.springframework:spring-core:${vSpring}"
compile "org.springframework:spring-jdbc:${vSpring}"
compile "org.springframework:spring-jms:${vSpring}"
compile "org.springframework:spring-messaging:${vSpring}"
compile "org.springframework:spring-orm:${vSpring}"
compile "org.springframework:spring-oxm:${vSpring}"
compile "org.springframework:spring-tx:${vSpring}"
compile "org.springframework:spring-web:${vSpring}"
compile "org.springframework:spring-webmvc:${vSpring}"
compile "io.springfox:springfox-swagger2:${vSwagger}"
compile "io.springfox:springfox-swagger-ui:${vSwagger}"
compile "org.springframework.security:spring-security-acl:${vSpringSecurity}"
compile "org.springframework.security:spring-security-aspects:${vSpringSecurity}"
compile "org.springframework.security:spring-security-config:${vSpringSecurity}"
compile "org.springframework.security:spring-security-ldap:${vSpringSecurity}"
compile "org.springframework.security:spring-security-taglibs:${vSpringSecurity}"
compile "org.springframework.ldap:spring-ldap-core:2.0.4.RELEASE"
compile "org.hibernate:hibernate-core:${vHibernate}"
compile "org.hibernate:hibernate-ehcache:${vHibernate}"
compile "org.hibernate:hibernate-validator:4.3.2.Final"
compile "org.hibernate:hibernate-envers:4.3.11.Final"
compile "net.sf.ehcache:ehcache-core:${vEhcache}"
compile "com.marvinformatics.hibernate:hibernate-native-json:0.3"
compile "com.noelios.restlet:com.noelios.restlet:1.1.10"
compile "com.noelios.restlet:com.noelios.restlet.ext.servlet:1.1.10"
compile "org.restlet:org.restlet.ext.fileupload:1.1.10"
compile "com.fasterxml.jackson.core:jackson-annotations:${vJackson}"
compile "com.fasterxml.jackson.core:jackson-core:${vJackson}"
compile "com.fasterxml.jackson.core:jackson-databind:${vJackson}"
compile "com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:${vJackson}"
compile "com.fasterxml.jackson.datatype:jackson-datatype-hibernate4:${vJackson}"
compile "com.fasterxml.jackson.datatype:jackson-datatype-guava:${vJackson}"
compile "org.json:json:20151123"
compile "com.thoughtworks.xstream:xstream:1.4.9"
compile "xerces:xercesImpl:2.11.0"
compile "commons-beanutils:commons-beanutils:1.9.2"
compile "commons-codec:commons-codec:1.10"
compile "commons-collections:commons-collections:3.2.2"
compile "commons-configuration:commons-configuration:1.10"
compile "commons-digester:commons-digester:1.8.1"
compile "commons-discovery:commons-discovery:0.5"
compile "commons-fileupload:commons-fileupload:1.3.1"
compile "commons-net:commons-net:3.4"
compile "org.apache.commons:commons-configuration2:2.1"
compile "org.apache.commons:commons-email:1.4"
compile "org.apache.commons:commons-math:2.2"
compile "org.apache.httpcomponents:httpclient:4.5.1"
compile "org.apache.httpcomponents:httpcore:4.4.4"
compile "org.apache.httpcomponents:httpcore-nio:4.4.4"
compile "org.codehaus.groovy:groovy-all:${vGroovy}"
compile "org.python:jython-standalone:${vJython}"
// compile "net.sf.saxon:Saxon-HE:${vSaxon}"
compile "net.sourceforge.saxon:saxon:${vSaxon}"
compile "xalan:xalan:2.7.2"
compile "eu.bitwalker:UserAgentUtils:1.20"
compile "com.twmacinta:fast-md5:2.7.1"
compile "com.h2database:h2:1.4.191"
compile "com.lowagie:itext:4.2.1"
compile "net.java.dev.msv:msv-core:2013.6.1"
compile "gnu.getopt:java-getopt:1.0.13"
compile "org.quartz-scheduler:quartz:2.2.2"
compile "org.reflections:reflections:0.9.10"
compile "org.apache.xmlbeans:xmlbeans:2.6.0"
compile "org.apache.xmlbeans:xmlbeans-xpath:2.6.0"
compile "org.apache.xbean:xbean-spring:4.5"
compile "net.java.dev.msv:xsdlib:2013.6.1"
compile "org.postgresql:postgresql:${vPostgreSQL}"
compile "org.slf4j:slf4j-api:${vSlf4j}"
compile "org.slf4j:slf4j-log4j12:${vSlf4j}"
compile "org.slf4j:jul-to-slf4j:${vSlf4j}"
compile "log4j:log4j:${vLog4j}"
compile "javax.servlet:jstl:1.2"
compile "javax.mail:javax.mail-api:1.5.5"
compile 'com.google.code.gson:gson:2.6.2'
compile 'com.google.guava:guava:20.0'
runtime "org.nrg.xnatx.plugins:ximgview-plugin:${vXImgView}"
runtime "org.apache.activemq:activemq-core:5.7.0"
runtime "org.apache.ant:ant:1.9.8"
runtime "axis:axis-ant:1.4"
runtime "axis:axis-schema:1.3"
runtime "cglib:cglib:3.2.0"
runtime "org.hsqldb:hsqldb:1.8.0.10"
runtime "org.codehaus.groovy.modules.http-builder:http-builder:0.7.2"
runtime "net.imagej:ij:1.50e"
runtime "net.bull.javamelody:javamelody-core:1.58.0"
runtime "org.javassist:javassist:3.21.0-GA"
providedCompile "javax.servlet:javax.servlet-api:${vServletApi}"
tomcat "org.apache.tomcat.embed:tomcat-embed-core:${vTomcat}",
"org.apache.tomcat.embed:tomcat-embed-logging-juli:${vTomcat}",
"org.apache.tomcat.embed:tomcat-embed-jasper:${vTomcat}"
cargo "org.codehaus.cargo:cargo-core-uberjar:${vCargo}",
"org.codehaus.cargo:cargo-ant:${vCargo}"
testCompile "junit:junit:${vJunit}"
testCompile "org.springframework:spring-test:${vSpring}"
}