build.gradle 51.4 KB
Newer Older
1
buildscript {
2
	repositories {
B
Brian Clozel 已提交
3
		maven { url "https://repo.spring.io/plugins-release" }
4 5
	}
	dependencies {
S
Sam Brannen 已提交
6
		classpath("org.springframework.build.gradle:propdeps-plugin:0.0.7")
B
Brian Clozel 已提交
7
		classpath("org.asciidoctor:asciidoctor-gradle-plugin:1.5.2")
8
		classpath("io.spring.gradle:docbook-reference-plugin:0.3.1")
9
		classpath("ws.antonov.gradle.plugins:gradle-plugin-protobuf:0.9.1")
10
	}
11 12
}

13
plugins {
14
	id "org.sonarqube" version "2.1-rc1"
15 16
}

S
Stephane Nicoll 已提交
17 18 19 20 21 22
ext {
	linkHomepage = 'https://projects.spring.io/spring-framework'
	linkCi = 'https://build.spring.io/browse/SPR'
	linkIssue = 'https://jira.spring.io/browse/SPR'
	linkScmUrl = 'https://github.com/spring-projects/spring-framework'
	linkScmConnection = 'scm:git:git://github.com/spring-projects/spring-framework.git'
23
	linkScmDevConnection = 'scm:git:ssh://git@github.com:spring-projects/spring-framework.git'
24

25
	moduleProjects = subprojects.findAll {
26 27
		!it.name.equals('spring-build-src') && !it.name.equals('spring-framework-bom')
	}
S
Stephane Nicoll 已提交
28 29
}

C
Chris Beams 已提交
30
configure(allprojects) { project ->
31 32
	group = "org.springframework"
	version = qualifyVersionIfNecessary(version)
33

34
	ext.activationApiVersion   = "1.1.1"
35
	ext.annotationApiVersion   = "1.2"
J
Juergen Hoeller 已提交
36
	ext.aspectjVersion         = "1.9.0.BETA-5"
37
	ext.beanvalVersion         = "1.1.0.Final"
38
	ext.caffeineVersion        = "2.3.2"
39 40 41 42 43
	ext.eclipselinkVersion     = "2.6.3"
	ext.ehcacheVersion         = "2.10.2"
	ext.ehcachejcacheVersion   = "1.0.1"
	ext.ehcache3Version        = "3.1.1"
	ext.ejbApiVersion          = "3.2"
J
Juergen Hoeller 已提交
44
	ext.elApiVersion           = "3.0.1-b04"
45 46 47 48 49
	ext.fileuploadVersion      = "1.3.2"
	ext.freemarkerVersion      = "2.3.25-incubating"
	ext.groovyVersion          = "2.4.7"
	ext.gsonVersion            = "2.7"
	ext.hamcrestVersion        = "1.3"
50
	ext.hibernate5Version      = "5.2.2.Final"
51 52 53 54 55
	ext.hibval5Version         = "5.2.4.Final"
	ext.hsqldbVersion          = "2.3.4"
	ext.httpasyncVersion       = "4.1.2"
	ext.httpclientVersion      = "4.5.2"
	ext.interceptorApiVersion  = "1.2"
J
Juergen Hoeller 已提交
56
	ext.jackson2Version        = "2.8.1"
57 58
	ext.javamailVersion        = "1.5.5"
	ext.jaxbVersion            = "2.2.11"
59
	ext.jaxwsVersion           = "2.2.11"
60
	ext.jcaVersion             = "1.7"
61
	ext.jettyVersion           = "9.4.0.M1"
62 63 64 65 66
	ext.jodaVersion            = "2.9.4"
	ext.jpaVersion             = "2.1.1"
	ext.jspVersion             = "2.3.2-b02"
	ext.jtaVersion             = "1.2"
	ext.junitVersion           = "4.12"
S
Sam Brannen 已提交
67 68
	ext.junitJupiterVersion    = '5.0.0-M2'
	ext.junitPlatformVersion   = '1.0.0-M2'
69
	ext.log4jVersion           = '2.6.2'
J
Juergen Hoeller 已提交
70
	ext.nettyVersion           = "4.1.4.Final"
71 72 73
	ext.okhttpVersion          = "2.7.5"
	ext.okhttp3Version         = "3.4.1"
	ext.poiVersion             = "3.14"
B
Brian Clozel 已提交
74
	ext.protobufVersion        = "3.0.0"
75 76
	ext.reactivestreamsVersion = "1.0.0"
	ext.reactorVersion         = "2.0.8.RELEASE"
77 78
	ext.reactorCoreVersion     = '3.0.1.BUILD-SNAPSHOT'
	ext.reactorNettyVersion    = '0.6.0.BUILD-SNAPSHOT'
79
	ext.romeVersion            = "1.6.0"
80
	ext.rxjavaVersion          = '1.1.9'
81
	ext.rxnettyVersion         = '0.5.2-rc.3'
82 83 84 85 86 87 88 89
	ext.servletVersion         = "3.1.0"
	ext.slf4jVersion           = "1.7.21"
	ext.snakeyamlVersion       = "1.17"
	ext.snifferVersion         = "1.15"
	ext.testngVersion          = "6.9.10"
	ext.tiles3Version          = "3.0.5"
	ext.tomcatVersion          = "8.5.4"
	ext.tyrusVersion           = "1.13"
90
	ext.undertowVersion        = "1.4.0.Final"
91 92
	ext.websocketVersion       = "1.1"
	ext.woodstoxVersion        = "5.0.2"
93
	ext.xmlunitVersion         = "2.2.1"
94
	ext.xnioVersion            = "3.4.0.Final"
95
	ext.xstreamVersion         = "1.4.9"
96

97
	ext.gradleScriptDir = "${rootProject.projectDir}/gradle"
98

99
	apply plugin: "propdeps"
P
Phillip Webb 已提交
100
	apply plugin: "java"
101
	apply plugin: "test-source-set-dependencies"
102
	apply from: "${gradleScriptDir}/ide.gradle"
C
Chris Beams 已提交
103

S
Stephane Nicoll 已提交
104 105 106 107 108
	configurations {
		sniffer
		javaApiSignature
	}

109 110 111 112 113 114 115 116 117 118
	configurations.all {
		// check for updates every build
		resolutionStrategy.cacheChangingModulesFor 0, 'seconds'

		// consistent netty version (e.g. clashes between netty-all vs netty-common)
		resolutionStrategy.eachDependency { DependencyResolveDetails details ->
			if (details.requested.group == 'io.netty') {
				details.useVersion nettyVersion
			}
		}
R
Rob Winch 已提交
119 120 121 122 123
		resolutionStrategy.eachDependency { DependencyResolveDetails details ->
			if (details.requested.name == 'reactor-core' && details.requested.version.startsWith('3.')) {
				details.useVersion reactorCoreVersion
			}
		}
124 125
	}

P
Phillip Webb 已提交
126 127 128
	compileJava.options*.compilerArgs = [
		"-Xlint:serial", "-Xlint:varargs", "-Xlint:cast", "-Xlint:classfile",
		"-Xlint:dep-ann", "-Xlint:divzero", "-Xlint:empty", "-Xlint:finally",
S
Stephane Nicoll 已提交
129
		"-Xlint:overrides", "-Xlint:path", "-Xlint:processing", "-Xlint:static",
P
Phillip Webb 已提交
130
		"-Xlint:try", "-Xlint:fallthrough", "-Xlint:rawtypes", "-Xlint:deprecation",
131
		"-Xlint:unchecked", "-Xlint:-options", "-Werror"
132
	]
C
Chris Beams 已提交
133

P
Phillip Webb 已提交
134
	compileTestJava.options*.compilerArgs = [
135
		"-Xlint:serial", "-Xlint:-varargs", "-Xlint:cast", "-Xlint:classfile",
P
Phillip Webb 已提交
136
		"-Xlint:dep-ann", "-Xlint:divzero", "-Xlint:empty", "-Xlint:finally",
S
Stephane Nicoll 已提交
137
		"-Xlint:overrides", "-Xlint:path", "-Xlint:processing", "-Xlint:static",
P
Phillip Webb 已提交
138 139 140
		"-Xlint:try", "-Xlint:-fallthrough", "-Xlint:-rawtypes", "-Xlint:-deprecation",
		"-Xlint:-unchecked", "-Xlint:-options"]

141
	compileJava {
142 143
		sourceCompatibility = 1.8
		targetCompatibility = 1.8
144
		options.encoding = 'UTF-8'
145 146 147
	}

	compileTestJava {
J
Juergen Hoeller 已提交
148 149
		sourceCompatibility = 1.8
		targetCompatibility = 1.8
150
		options.encoding = 'UTF-8'
151
		options.compilerArgs += "-parameters"
J
Juergen Hoeller 已提交
152 153
	}

C
Chris Beams 已提交
154 155
	test {
		systemProperty("java.awt.headless", "true")
156
		systemProperty("testGroups", project.properties.get("testGroups"))
157
		scanForTestClasses = false
158
		include(["**/*Tests.class", "**/*Test.class"])
159 160
		// Since we set scanForTestClasses to false, we need to filter out inner
		// classes with the "$" pattern; otherwise, using -Dtest.single=MyTests to
161
		// run MyTests by itself will fail if MyTests contains any inner classes.
162
		exclude(["**/Abstract*.class", '**/*$*'])
S
Stephane Nicoll 已提交
163
		reports.junitXml.destination = file("$buildDir/test-results")
C
Chris Beams 已提交
164
	}
C
Chris Beams 已提交
165

166
	repositories {
B
Brian Clozel 已提交
167
		maven { url "https://repo.spring.io/libs-release" }
168
		maven { url "https://repo.spring.io/milestone" }
169
		maven { url "https://repo.spring.io/snapshot" }	// Reactor 3 snapshots
170
	}
C
Chris Beams 已提交
171

172
	dependencies {
173 174 175
		testCompile("junit:junit:${junitVersion}") {
			exclude group:'org.hamcrest', module:'hamcrest-core'
		}
176
		testCompile("org.mockito:mockito-core:1.10.19") {
177 178
			exclude group:'org.hamcrest', module:'hamcrest-core'
		}
179
		testCompile("org.hamcrest:hamcrest-all:${hamcrestVersion}")
180 181
		testRuntime("org.apache.logging.log4j:log4j-core:${log4jVersion}")
		testRuntime("org.apache.logging.log4j:log4j-jcl:${log4jVersion}")
182

S
Stephane Nicoll 已提交
183
		sniffer("org.codehaus.mojo:animal-sniffer-ant-tasks:${snifferVersion}")
184
		javaApiSignature("org.codehaus.mojo.signature:java18:1.0@signature")
S
Stephane Nicoll 已提交
185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203
	}

	task copyJavaApiSignature(type: Copy) {
		ext.to = file("$buildDir/javaApiSignature/")
		description "Copy the resolved Animal Sniffer signature dependency artifact to a known location and name"
		from configurations.javaApiSignature
		into to
		rename '.*signature', 'javaApi.signature'
	}

	task sniff {
		group = "Verification"
		description = "Checks the Java API signatures"

		dependsOn compileJava
		dependsOn copyJavaApiSignature

		inputs.dir sourceSets.main.output.classesDir
		inputs.dir copyJavaApiSignature.to
204

S
Stephane Nicoll 已提交
205 206 207 208 209 210 211
		doLast {
			ant.taskdef(
				name: 'animalSniffer',
				classname: 'org.codehaus.mojo.animal_sniffer.ant.CheckSignatureTask',
				classpath: configurations.sniffer.asPath
			)

212 213 214 215 216 217 218
			// TODO: Animal Sniffer currently chokes on optional JDK 9 bytecode in AspectJ 1.9 beta 5
			// ant.animalSniffer(
			// 		signature: "$buildDir/javaApiSignature/javaApi.signature",
			// 		classpath: sourceSets.main.compileClasspath.asPath) {
			// 	path(path: sourceSets.main.output.classesDir)
			// 	annotation(className: "org.springframework.lang.UsesSunHttpServer")
			// }
S
Stephane Nicoll 已提交
219
		}
220
	}
C
Chris Beams 已提交
221 222

	ext.javadocLinks = [
223
		"http://docs.oracle.com/javase/8/docs/api/",
224
		"http://docs.oracle.com/javaee/7/api/",
225
		"http://docs.oracle.com/cd/E13222_01/wls/docs90/javadocs/",  // CommonJ
J
Juergen Hoeller 已提交
226 227
		"http://pic.dhe.ibm.com/infocenter/wasinfo/v7r0/topic/com.ibm.websphere.javadoc.doc/web/apidocs/",
		"http://glassfish.java.net/nonav/docs/v3/api/",
P
Phillip Webb 已提交
228 229
		"http://docs.jboss.org/jbossas/javadoc/4.0.5/connector/",
		"http://docs.jboss.org/jbossas/javadoc/7.1.2.Final/",
230
		"http://tiles.apache.org/tiles-request/apidocs/",
J
Juergen Hoeller 已提交
231
		"http://tiles.apache.org/framework/apidocs/",
C
Chris Beams 已提交
232
		"http://www.eclipse.org/aspectj/doc/released/aspectj5rt-api/",
B
Brian Clozel 已提交
233 234
		"http://ehcache.org/apidocs/${ehcacheVersion}",
		"http://ehcache.org/apidocs/${ehcache3Version}",
235
		"http://quartz-scheduler.org/api/2.2.1/",
B
Brian Clozel 已提交
236 237 238
		"http://fasterxml.github.io/jackson-core/javadoc/2.7/",
		"http://fasterxml.github.io/jackson-databind/javadoc/2.7/",
		"http://fasterxml.github.io/jackson-dataformat-xml/javadoc/2.7/",
239
		"http://hc.apache.org/httpcomponents-client-ga/httpclient/apidocs/"
C
Chris Beams 已提交
240
	] as String[]
241 242
}

243
configure(subprojects - project(":spring-build-src")) { subproject ->
244
	apply plugin: "merge"
245 246
	apply from: "${gradleScriptDir}/publish-maven.gradle"

S
Stephane Nicoll 已提交
247 248 249 250 251
	configurations {
		jacoco
	}

	dependencies {
252
		jacoco("org.jacoco:org.jacoco.agent:0.7.5.201505241946:runtime")
S
Stephane Nicoll 已提交
253 254 255
	}

	gradle.taskGraph.whenReady {taskGraph ->
256
		if (taskGraph.hasTask(':sonarqube')) {
S
Stephane Nicoll 已提交
257 258 259 260
			test.jvmArgs "-javaagent:${configurations.jacoco.asPath}=destfile=${buildDir}/jacoco.exec,includes=org.springframework.*"
		}
	}

261
	jar {
P
Phillip Webb 已提交
262 263 264 265
		manifest.attributes["Created-By"] =
			"${System.getProperty("java.version")} (${System.getProperty("java.specification.vendor")})"
		manifest.attributes["Implementation-Title"] = subproject.name
		manifest.attributes["Implementation-Version"] = subproject.version
266 267 268 269 270

		from("${rootProject.projectDir}/src/dist") {
			include "license.txt"
			include "notice.txt"
			into "META-INF"
P
Phillip Webb 已提交
271
			expand(copyright: new Date().format("yyyy"), version: project.version)
272 273 274 275
		}
	}

	javadoc {
C
Chris Beams 已提交
276 277
		description = "Generates project-level javadoc for use in -javadoc jar"

278 279 280
		options.memberLevel = org.gradle.external.javadoc.JavadocMemberLevel.PROTECTED
		options.author = true
		options.header = project.name
C
Chris Beams 已提交
281
		options.links(project.ext.javadocLinks)
282
		options.addStringOption('Xdoclint:none', '-quiet')
C
Chris Beams 已提交
283 284 285 286 287

		// suppress warnings due to cross-module @see and @link references;
		// note that global 'api' task does display all warnings.
		logging.captureStandardError LogLevel.INFO
		logging.captureStandardOutput LogLevel.INFO // suppress "## warnings" message
288 289
	}

290 291
	task sourcesJar(type: Jar, dependsOn: classes) {
		classifier = 'sources'
292
		from sourceSets.main.allSource
293
		// don't include or exclude anything explicitly by default. See SPR-12085.
294 295 296
	}

	task javadocJar(type: Jar) {
P
Phillip Webb 已提交
297
		classifier = "javadoc"
298 299 300 301 302 303 304
		from javadoc
	}

	artifacts {
		archives sourcesJar
		archives javadocJar
	}
C
Chris Beams 已提交
305 306
}

307 308
project("spring-build-src") {
	description = "Exposes gradle buildSrc for IDE support"
309
	apply plugin: "groovy"
310 311 312

	dependencies {
		compile gradleApi()
R
Rob Winch 已提交
313
		compile localGroovy()
314 315 316 317 318
	}

	configurations.archives.artifacts.clear()
}

P
Phillip Webb 已提交
319 320
project("spring-core") {
	description = "Spring Core"
321

322 323
	// As of Spring 4.0.3, spring-core includes asm 5.x and repackages cglib 3.2, inlining
	// both into the spring-core jar. cglib 3.2 itself depends on asm 5.x and is therefore
324
	// further transformed by the JarJar task to depend on org.springframework.asm; this
325
	// avoids including two different copies of asm unnecessarily.
J
Juergen Hoeller 已提交
326
	def cglibVersion = "3.2.4"
327
	def objenesisVersion = "2.4"
328 329 330 331

	configurations {
		jarjar
		cglib
332
		objenesis
333 334 335 336 337 338 339 340 341 342 343 344 345 346 347
	}

	task cglibRepackJar(type: Jar) { repackJar ->
		repackJar.baseName = "spring-cglib-repack"
		repackJar.version = cglibVersion

		doLast() {
			project.ant {
				taskdef name: "jarjar", classname: "com.tonicsystems.jarjar.JarJarTask",
					classpath: configurations.jarjar.asPath
				jarjar(destfile: repackJar.archivePath) {
					configurations.cglib.each { originalJar ->
						zipfileset(src: originalJar)
					}
					// repackage net.sf.cglib => org.springframework.cglib
P
Phillip Webb 已提交
348 349
					rule(pattern: "net.sf.cglib.**", result: "org.springframework.cglib.@1")
					// as mentioned above, transform cglib"s internal asm dependencies from
350 351
					// org.objectweb.asm => org.springframework.asm. Doing this counts on the
					// the fact that Spring and cglib depend on the same version of asm!
P
Phillip Webb 已提交
352
					rule(pattern: "org.objectweb.asm.**", result: "org.springframework.asm.@1")
353 354 355 356 357
				}
			}
		}
	}

358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376
	task objenesisRepackJar(type: Jar) { repackJar ->
		repackJar.baseName = "spring-objenesis-repack"
		repackJar.version = objenesisVersion

		doLast() {
			project.ant {
				taskdef name: "jarjar", classname: "com.tonicsystems.jarjar.JarJarTask",
					classpath: configurations.jarjar.asPath
				jarjar(destfile: repackJar.archivePath) {
					configurations.objenesis.each { originalJar ->
						zipfileset(src: originalJar)
					}
					// repackage org.objenesis => org.springframework.objenesis
					rule(pattern: "org.objenesis.**", result: "org.springframework.objenesis.@1")
				}
			}
		}
	}

377
	dependencies {
378
		cglib("cglib:cglib:${cglibVersion}@jar")
379
		objenesis("org.objenesis:objenesis:${objenesisVersion}@jar")
380
		jarjar("com.googlecode.jarjar:jarjar:1.3")
381

P
Phillip Webb 已提交
382
		compile(files(cglibRepackJar))
383
		compile(files(objenesisRepackJar))
384
		compile("commons-logging:commons-logging:1.2")
385
		optional("org.aspectj:aspectjweaver:${aspectjVersion}")
386
		optional("net.sf.jopt-simple:jopt-simple:5.0.2")
387
		optional("org.reactivestreams:reactive-streams:${reactivestreamsVersion}")
388
		optional("io.projectreactor:reactor-core:${reactorCoreVersion}")
389
		optional "io.reactivex:rxjava:${rxjavaVersion}"
390
		optional("io.netty:netty-buffer:${nettyVersion}")
391
		testCompile("javax.xml.bind:jaxb-api:${jaxbVersion}")
392
		testCompile("org.apache.tomcat.embed:tomcat-embed-core:${tomcatVersion}")
393
		testCompile("org.xmlunit:xmlunit-matchers:${xmlunitVersion}")
394
		testCompile("com.fasterxml.woodstox:woodstox-core:${woodstoxVersion}") {
P
Phillip Webb 已提交
395 396
			exclude group: "stax", module: "stax-api"
		}
397 398 399
	}

	jar {
400
		// inline repackaged cglib classes directly into the spring-core jar
401 402
		dependsOn cglibRepackJar
		from(zipTree(cglibRepackJar.archivePath)) {
P
Phillip Webb 已提交
403
			include "org/springframework/cglib/**"
404
		}
405 406 407 408 409

		dependsOn objenesisRepackJar
		from(zipTree(objenesisRepackJar.archivePath)) {
			include "org/springframework/objenesis/**"
		}
410
	}
C
Chris Beams 已提交
411 412
}

P
Phillip Webb 已提交
413 414
project("spring-beans") {
	description = "Spring Beans"
415

416
	dependencies {
417 418
		compile(project(":spring-core"))
		compile(files(project(":spring-core").cglibRepackJar))
419
		optional("javax.inject:javax.inject:1")
420
		optional("javax.el:javax.el-api:${elApiVersion}")
421
		optional("org.yaml:snakeyaml:${snakeyamlVersion}")
422
		testCompile("org.apache.tomcat.embed:tomcat-embed-core:${tomcatVersion}")
J
Juergen Hoeller 已提交
423
	}
C
Chris Beams 已提交
424 425
}

426 427
project("spring-beans-groovy") {
	description "Groovy Bean Definitions"
J
Juergen Hoeller 已提交
428
	merge.into = project(":spring-beans")
429
	apply plugin: "groovy"
J
Juergen Hoeller 已提交
430 431 432

	dependencies {
		compile(project(":spring-core"))
433
		optional("org.codehaus.groovy:groovy-all:${groovyVersion}")
J
Juergen Hoeller 已提交
434 435 436 437 438 439 440
	}

	// this module's Java and Groovy sources need to be compiled together
	compileJava.enabled=false
	sourceSets {
		main {
			groovy {
441
				srcDir "src/main/java"
J
Juergen Hoeller 已提交
442 443 444
			}
		}
	}
445 446

	compileGroovy {
447 448
		sourceCompatibility = 1.8
		targetCompatibility = 1.8
449
	}
J
Juergen Hoeller 已提交
450 451
}

P
Phillip Webb 已提交
452 453
project("spring-aop") {
	description = "Spring AOP"
454

455
	dependencies {
456
		compile(project(":spring-beans"))
457 458
		compile(project(":spring-core"))
		compile(files(project(":spring-core").cglibRepackJar))
459
		compile(files(project(":spring-core").objenesisRepackJar))
460
		optional("org.aspectj:aspectjweaver:${aspectjVersion}")
461
		optional("org.apache.commons:commons-pool2:2.4.2")
462
		optional("com.jamonapi:jamon:2.81")
463
	}
C
Chris Beams 已提交
464 465
}

P
Phillip Webb 已提交
466 467
project("spring-expression") {
	description = "Spring Expression Language (SpEL)"
468

469
	dependencies {
470
		compile(project(":spring-core"))
471
	}
C
Chris Beams 已提交
472 473
}

P
Phillip Webb 已提交
474 475
project("spring-instrument") {
	description = "Spring Instrument"
476

477
	jar {
P
Phillip Webb 已提交
478 479
		manifest.attributes["Premain-Class"] =
			"org.springframework.instrument.InstrumentationSavingAgent"
480 481
		manifest.attributes["Agent-Class"] =
			"org.springframework.instrument.InstrumentationSavingAgent"
482 483 484
		manifest.attributes["Can-Redefine-Classes"] = "true"
		manifest.attributes["Can-Retransform-Classes"] = "true"
		manifest.attributes["Can-Set-Native-Method-Prefix"] = "false"
485
	}
C
Chris Beams 已提交
486 487
}

P
Phillip Webb 已提交
488 489
project("spring-context") {
	description = "Spring Context"
490
	apply plugin: "groovy"
491

492
	dependencies {
493 494 495 496 497
		compile(project(":spring-aop"))
		compile(project(":spring-beans"))
		compile(project(":spring-expression"))
		compile(project(":spring-core"))
		compile(files(project(":spring-core").cglibRepackJar))
498
		optional(project(":spring-instrument"))
499
		optional("javax.inject:javax.inject:1")
500 501
		optional("javax.annotation:javax.annotation-api:${annotationApiVersion}")
		optional("javax.xml.ws:jaxws-api:${jaxwsVersion}")
502
		optional("javax.ejb:javax.ejb-api:${ejbApiVersion}")
S
Stephane Nicoll 已提交
503
		optional("javax.interceptor:javax.interceptor-api:${interceptorApiVersion}")
504
		optional("javax.enterprise.concurrent:javax.enterprise.concurrent-api:1.0")
505
		optional("javax.money:money-api:1.0")
J
Juergen Hoeller 已提交
506 507
		optional("org.eclipse.persistence:javax.persistence:${jpaVersion}")
		optional("javax.validation:validation-api:${beanvalVersion}")
508
		optional("org.hibernate:hibernate-validator:${hibval5Version}")
509 510
		optional("joda-time:joda-time:${jodaVersion}")
		optional("org.aspectj:aspectjweaver:${aspectjVersion}")
J
Juergen Hoeller 已提交
511
		optional("org.codehaus.groovy:groovy-all:${groovyVersion}")
512
		optional("org.beanshell:bsh:2.0b4")
513
		testCompile("javax.inject:javax.inject-tck:1")
514 515
		testCompile("javax.el:javax.el-api:${elApiVersion}")
		testCompile("org.glassfish:javax.el:3.0.1-b08")
516
		testCompile("org.javamoney:moneta:1.1")
517
		testCompile("org.apache.commons:commons-pool2:2.4.2")
518
		testCompile("org.slf4j:slf4j-api:${slf4jVersion}")
519 520 521 522 523 524 525 526 527 528 529
		testRuntime("javax.xml.bind:jaxb-api:${jaxbVersion}")
	}
}

project("spring-oxm") {
	description = "Spring Object/XML Marshalling"
	apply from: "oxm.gradle"

	dependencies {
		compile(project(":spring-beans"))
		compile(project(":spring-core"))
530 531
		optional("javax.xml.bind:jaxb-api:${jaxbVersion}")
		optional("javax.activation:activation:${activationApiVersion}")
532 533 534 535 536 537 538 539 540 541 542 543 544 545
		optional("org.codehaus.castor:castor-xml:1.4.1")  {
			exclude group: 'stax', module: 'stax-api'
			exclude group: "org.springframework", module: "spring-context"
		}
		optional("com.thoughtworks.xstream:xstream:${xstreamVersion}") {
			exclude group: 'xpp3', module: 'xpp3_min'
			exclude group: 'xmlpull', module: 'xmlpull'
		}
		optional("org.jibx:jibx-run:1.2.6")
		testCompile(project(":spring-context"))
		testCompile("xpp3:xpp3:1.1.4c")
		testCompile("org.codehaus.jettison:jettison:1.3.7") {
			exclude group: 'stax', module: 'stax-api'
		}
546
		testCompile("org.xmlunit:xmlunit-matchers:${xmlunitVersion}")
547 548
        testCompile(files(genCastor.classesDir).builtBy(genCastor))
        testCompile(files(genJaxb.classesDir).builtBy(genJaxb))
549 550 551
		testRuntime("xerces:xercesImpl:2.11.0")  // for Castor
		testRuntime("com.sun.xml.bind:jaxb-core:${jaxbVersion}")
		testRuntime("com.sun.xml.bind:jaxb-impl:${jaxbVersion}")
552
	}
553 554 555 556 557 558 559 560 561
}

project("spring-messaging") {
	description = "Spring Messaging"

	dependencies {
		compile(project(":spring-beans"))
		compile(project(":spring-core"))
		compile(project(":spring-context"))
562
		optional(project(":spring-oxm"))
563
		optional("io.projectreactor:reactor-core:${reactorVersion}") {
564
			force = true  // enforce 2.0.x
565
		}
S
Stephane Maldini 已提交
566
		optional("io.projectreactor:reactor-net:${reactorVersion}") {
567 568
			exclude group: "io.netty", module: "netty-all"
		}
569
		optional("io.netty:netty-all:${nettyVersion}")
B
Brian Clozel 已提交
570
		optional("org.eclipse.jetty.websocket:websocket-server:${jettyVersion}") {
B
Brian Clozel 已提交
571 572
			exclude group: "javax.servlet", module: "javax.servlet-api"
		}
B
Brian Clozel 已提交
573
		optional("org.eclipse.jetty.websocket:websocket-client:${jettyVersion}")
574
		optional("com.fasterxml.jackson.core:jackson-databind:${jackson2Version}")
575
		optional("javax.xml.bind:jaxb-api:${jaxbVersion}")
576
		testCompile("javax.inject:javax.inject-tck:1")
577
		testCompile("javax.servlet:javax.servlet-api:${servletVersion}")
J
Juergen Hoeller 已提交
578
		testCompile("javax.validation:validation-api:${beanvalVersion}")
579
		testCompile("com.thoughtworks.xstream:xstream:${xstreamVersion}")
580 581 582 583 584
		testCompile("org.apache.activemq:activemq-broker:5.8.0")
		testCompile("org.apache.activemq:activemq-kahadb-store:5.8.0") {
			exclude group: "org.springframework", module: "spring-context"
		}
		testCompile("org.apache.activemq:activemq-stomp:5.8.0")
B
Brian Clozel 已提交
585
		testCompile("org.eclipse.jetty:jetty-webapp:${jettyVersion}") {
B
Brian Clozel 已提交
586
			exclude group: "javax.servlet", module: "javax.servlet-api"
587
		}
588 589
		testCompile("org.apache.tomcat.embed:tomcat-embed-core:${tomcatVersion}")
		testCompile("org.apache.tomcat.embed:tomcat-embed-websocket:${tomcatVersion}")
590
		testCompile("io.netty:netty-all:${nettyVersion}")
591
		testCompile("org.xmlunit:xmlunit-matchers:${xmlunitVersion}")
592 593
		testCompile("org.slf4j:slf4j-jcl:${slf4jVersion}")
		testRuntime("javax.activation:activation:${activationApiVersion}")
594 595
		testRuntime("com.sun.xml.bind:jaxb-core:${jaxbVersion}")
		testRuntime("com.sun.xml.bind:jaxb-impl:${jaxbVersion}")
596
	}
C
Chris Beams 已提交
597 598
}

P
Phillip Webb 已提交
599 600
project("spring-tx") {
	description = "Spring Transaction"
601

602
	dependencies {
603 604
		compile(project(":spring-beans"))
		compile(project(":spring-core"))
605
		optional(project(":spring-aop"))
606
		optional(project(":spring-context"))  // for JCA, @EnableTransactionManagement
607
		optional("javax.transaction:javax.transaction-api:${jtaVersion}")
J
Juergen Hoeller 已提交
608
		optional("javax.resource:javax.resource-api:${jcaVersion}")
609
		optional("javax.ejb:javax.ejb-api:${ejbApiVersion}")
S
Stephane Nicoll 已提交
610
		optional("javax.interceptor:javax.interceptor-api:${interceptorApiVersion}")
611
		optional("com.ibm.websphere:uow:6.0.2.17")
612
		testCompile("org.aspectj:aspectjweaver:${aspectjVersion}")
J
Juergen Hoeller 已提交
613
		testCompile("org.eclipse.persistence:javax.persistence:${jpaVersion}")
614
		testCompile("org.codehaus.groovy:groovy-all:${groovyVersion}")
615
	}
C
Chris Beams 已提交
616 617
}

P
Phillip Webb 已提交
618 619
project("spring-jms") {
	description = "Spring JMS"
620

621
	dependencies {
622 623 624 625
		compile(project(":spring-core"))
		compile(project(":spring-beans"))
		compile(project(":spring-aop"))
		compile(project(":spring-context"))
626
		compile(project(":spring-messaging"))
627
		compile(project(":spring-tx"))
J
Juergen Hoeller 已提交
628
		provided("javax.jms:javax.jms-api:2.0.1")
629
		optional(project(":spring-oxm"))
630
		optional("javax.transaction:javax.transaction-api:${jtaVersion}")
J
Juergen Hoeller 已提交
631
		optional("javax.resource:javax.resource-api:${jcaVersion}")
632
		optional("com.fasterxml.jackson.core:jackson-databind:${jackson2Version}")
633
		testRuntime("javax.activation:activation:${activationApiVersion}")
634
	}
C
Chris Beams 已提交
635 636
}

P
Phillip Webb 已提交
637 638
project("spring-jdbc") {
	description = "Spring JDBC"
639

640
	dependencies {
641
		compile(project(":spring-beans"))
642
		compile(project(":spring-core"))
643
		compile(project(":spring-tx"))
644
		optional(project(":spring-context"))  // for JndiDataSourceLookup
645
		optional("javax.transaction:javax.transaction-api:${jtaVersion}")
646
		optional("com.mchange:c3p0:0.9.5.2")
P
Phillip Webb 已提交
647
		optional("org.hsqldb:hsqldb:${hsqldbVersion}")
648
		optional("com.h2database:h2:1.4.192")
649 650
		optional("org.apache.derby:derby:10.12.1.1")
		optional("org.apache.derby:derbyclient:10.12.1.1")
651
	}
C
Chris Beams 已提交
652 653
}

P
Phillip Webb 已提交
654 655
project("spring-context-support") {
	description = "Spring Context Support"
656

657
	dependencies {
658 659 660
		compile(project(":spring-core"))
		compile(project(":spring-beans"))
		compile(project(":spring-context"))
661 662
		optional(project(":spring-jdbc"))  // for Quartz support
		optional(project(":spring-tx"))  // for Quartz support
663
		optional("javax.activation:activation:${activationApiVersion}")
664
		optional("javax.mail:javax.mail-api:${javamailVersion}")
S
Stephane Nicoll 已提交
665
		optional("javax.cache:cache-api:1.0.0")
B
Ben Manes 已提交
666
		optional("com.github.ben-manes.caffeine:caffeine:${caffeineVersion}")
667
		optional("net.sf.ehcache:ehcache:${ehcacheVersion}")
668
		optional("org.quartz-scheduler:quartz:2.2.3")
669
		optional("org.codehaus.fabric3.api:commonj:1.1.0")
670
		optional("org.freemarker:freemarker:${freemarkerVersion}")
671
		optional("com.lowagie:itext:2.1.7")
672
		testCompile(project(":spring-context"))
673
		testCompile("org.apache.poi:poi:${poiVersion}")
P
Phillip Webb 已提交
674
		testCompile("org.hsqldb:hsqldb:${hsqldbVersion}")
675
		testCompile("org.slf4j:slf4j-api:${slf4jVersion}")
676
		testRuntime("com.sun.mail:javax.mail:${javamailVersion}")
677
		testRuntime("org.ehcache:jcache:${ehcachejcacheVersion}")
678
	}
C
Chris Beams 已提交
679 680
}

P
Phillip Webb 已提交
681 682
project("spring-web") {
	description = "Spring Web"
683
	apply plugin: "groovy"
684

685 686 687 688 689 690 691 692 693 694 695 696 697 698 699
	// Re-generate Protobuf classes from *.proto files and move them in test sources
	if (project.hasProperty('genProtobuf')) {
		apply plugin: 'protobuf'

		task updateGenProtobuf(type:Copy, dependsOn: ":spring-web:generateTestProto") {
			from "${project.buildDir}/generated-sources/test/"
			into "${projectDir}/src/test/java"
			doLast {
				project.delete "${project.buildDir}/generated-sources/test"
			}
		}

		tasks.getByPath("compileTestJava").dependsOn "updateGenProtobuf"
	}

700
	dependencies {
701 702
		compile(project(":spring-aop"))  // for JaxWsPortProxyFactoryBean
		compile(project(":spring-beans"))  // for MultipartFilter
703
		compile(project(":spring-context"))
704
		compile(project(":spring-core"))
705
		provided "javax.servlet:javax.servlet-api:${servletVersion}"
706
		optional(project(":spring-oxm"))  // for MarshallingHttpMessageConverter
707
		optional("javax.servlet.jsp:javax.servlet.jsp-api:${jspVersion}")
708
		optional("javax.el:javax.el-api:${elApiVersion}")
709
		optional("javax.faces:javax.faces-api:2.2")
J
Juergen Hoeller 已提交
710
		optional("javax.validation:validation-api:${beanvalVersion}")
711
		optional("javax.activation:activation:${activationApiVersion}")
712
		optional("org.codehaus.groovy:groovy-all:${groovyVersion}")
713
		optional("com.caucho:hessian:4.0.38")
714
		optional("commons-fileupload:commons-fileupload:${fileuploadVersion}")
715
		optional("org.reactivestreams:reactive-streams:${reactivestreamsVersion}")
716
		optional("io.projectreactor:reactor-core:${reactorCoreVersion}")
717
		optional("io.projectreactor.ipc:reactor-netty:${reactorNettyVersion}")
J
Juergen Hoeller 已提交
718
		optional("io.reactivex:rxnetty-http:${rxnettyVersion}") {
719 720
			exclude group: 'io.reactivex', module: 'rxjava'
		}
721 722
		optional("io.reactivex:rxjava:${rxjavaVersion}")
		optional("io.undertow:undertow-core:${undertowVersion}")
723
		optional("org.jboss.xnio:xnio-api:${xnioVersion}")
724
		optional("io.netty:netty-buffer:${nettyVersion}") // Temporarily for JsonObjectDecoder
725 726 727
	  	optional("com.fasterxml.woodstox:woodstox-core:${woodstoxVersion}") { // woodstox before aalto
			exclude group: "stax", module: "stax-api"
		}
728
		optional("com.fasterxml:aalto-xml:1.0.0")
729 730
		optional("org.apache.httpcomponents:httpclient:${httpclientVersion}")
		optional("org.apache.httpcomponents:httpasyncclient:${httpasyncVersion}")
731
		optional("io.netty:netty-all:${nettyVersion}")
732
		optional("com.squareup.okhttp:okhttp:${okhttpVersion}")
733
		optional("com.squareup.okhttp3:okhttp:${okhttp3Version}")
734
		optional("com.fasterxml.jackson.core:jackson-databind:${jackson2Version}")
735
		optional("com.fasterxml.jackson.dataformat:jackson-dataformat-xml:${jackson2Version}")
R
Roy Clarkson 已提交
736
		optional("com.google.code.gson:gson:${gsonVersion}")
737
		optional("com.rometools:rome:${romeVersion}")
B
Brian Clozel 已提交
738
		optional("org.eclipse.jetty:jetty-servlet:${jettyVersion}") {
B
Brian Clozel 已提交
739
			exclude group: "javax.servlet", module: "javax.servlet-api"
740
		}
B
Brian Clozel 已提交
741
		optional("org.eclipse.jetty:jetty-server:${jettyVersion}") {
B
Brian Clozel 已提交
742
			exclude group: "javax.servlet", module: "javax.servlet-api"
743
		}
744 745
		optional("com.google.protobuf:protobuf-java:${protobufVersion}")
		optional("com.google.protobuf:protobuf-java-util:${protobufVersion}")
746
		optional("com.googlecode.protobuf-java-format:protobuf-java-format:1.4")
747 748
		optional("javax.xml.bind:jaxb-api:${jaxbVersion}")
		optional("javax.xml.ws:jaxws-api:${jaxwsVersion}")
749
		optional("javax.mail:javax.mail-api:${javamailVersion}")
750
		testCompile(project(":spring-context-support"))  // for JafMediaTypeFactory
751 752 753
		testCompile("org.apache.taglibs:taglibs-standard-jstlel:1.2.1") {
			exclude group: "org.apache.taglibs", module: "taglibs-standard-spec"
		}
754
		testCompile("com.fasterxml.jackson.datatype:jackson-datatype-joda:${jackson2Version}")
755
		testCompile("com.fasterxml.jackson.datatype:jackson-datatype-jdk8:${jackson2Version}")
756
		testCompile("com.fasterxml.jackson.module:jackson-module-kotlin:${jackson2Version}")
757 758 759 760
		testCompile("org.apache.tomcat:tomcat-util:${tomcatVersion}")
		testCompile("org.apache.tomcat.embed:tomcat-embed-core:${tomcatVersion}")
		testCompile("org.eclipse.jetty:jetty-server:${jettyVersion}")
		testCompile("org.eclipse.jetty:jetty-servlet:${jettyVersion}")
761 762 763 764
		testCompile("com.squareup.okhttp3:mockwebserver:${okhttp3Version}")
		testCompile("org.xmlunit:xmlunit-matchers:${xmlunitVersion}")
		testCompile("org.slf4j:slf4j-jcl:${slf4jVersion}")
		testRuntime("com.sun.mail:javax.mail:${javamailVersion}")
765 766
		testRuntime("com.sun.xml.bind:jaxb-core:${jaxbVersion}")
		testRuntime("com.sun.xml.bind:jaxb-impl:${jaxbVersion}")
767
		testRuntime("org.jboss.xnio:xnio-nio:${xnioVersion}")
768
		testRuntime("org.jboss.logging:jboss-logging:3.3.0.Final")
769 770 771 772 773
	}
}

project("spring-web-reactive") {
	description = "Spring Web Reactive"
774

775 776 777 778 779 780 781
	dependencies {
		compile(project(":spring-core"))
		compile(project(":spring-web"))
		compile "org.reactivestreams:reactive-streams:${reactivestreamsVersion}"
		compile "io.projectreactor:reactor-core:${reactorCoreVersion}"
		optional(project(":spring-context-support"))  // for FreeMarker support
		provided "javax.servlet:javax.servlet-api:${servletVersion}"
782
		optional("javax.xml.bind:jaxb-api:${jaxbVersion}")
783 784
		optional("com.fasterxml.jackson.core:jackson-databind:${jackson2Version}")
		optional("org.freemarker:freemarker:${freemarkerVersion}")
785
		optional "org.apache.httpcomponents:httpclient:${httpclientVersion}"
786
		testCompile("javax.validation:validation-api:${beanvalVersion}")
787 788 789 790
		testCompile("org.apache.tomcat:tomcat-util:${tomcatVersion}")
		testCompile("org.apache.tomcat.embed:tomcat-embed-core:${tomcatVersion}")
		testCompile("org.eclipse.jetty:jetty-server:${jettyVersion}")
		testCompile("org.eclipse.jetty:jetty-servlet:${jettyVersion}")
791
		testCompile("io.projectreactor.ipc:reactor-netty:${reactorNettyVersion}")
J
Juergen Hoeller 已提交
792
		testCompile("io.reactivex:rxnetty-http:${rxnettyVersion}") {
793 794 795
			exclude group: 'io.reactivex', module: 'rxjava'
		}
		testCompile("io.reactivex:rxjava:${rxjavaVersion}")
796
		testCompile("io.undertow:undertow-core:${undertowVersion}")
797
		testCompile("org.jboss.xnio:xnio-api:${xnioVersion}")
798
		testCompile("com.fasterxml:aalto-xml:1.0.0")
799
		testCompile("org.xmlunit:xmlunit-matchers:${xmlunitVersion}")
800
		testCompile("org.slf4j:slf4j-jcl:${slf4jVersion}")
801 802 803
		testRuntime("com.sun.xml.bind:jaxb-core:${jaxbVersion}")
		testRuntime("com.sun.xml.bind:jaxb-impl:${jaxbVersion}")
		testRuntime("javax.activation:activation:${activationApiVersion}")
804
		testRuntime("org.jboss.xnio:xnio-nio:${xnioVersion}")
805
		testRuntime("org.jboss.logging:jboss-logging:3.3.0.Final")
806
	}
C
Chris Beams 已提交
807 808
}

P
Phillip Webb 已提交
809 810
project("spring-orm") {
	description = "Spring Object/Relational Mapping"
811

812
	dependencies {
813 814 815 816 817 818 819
		compile(project(":spring-beans"))
		compile(project(":spring-core"))
		compile(project(":spring-jdbc"))
		compile(project(":spring-tx"))
		optional(project(":spring-aop"))
		optional(project(":spring-context"))
		optional(project(":spring-web"))
J
Juergen Hoeller 已提交
820
		optional("org.eclipse.persistence:javax.persistence:${jpaVersion}")
821 822
		optional("org.eclipse.persistence:org.eclipse.persistence.core:${eclipselinkVersion}")
		optional("org.eclipse.persistence:org.eclipse.persistence.jpa:${eclipselinkVersion}") {
823 824
			exclude group: 'org.eclipse.persistence', module: 'javax.persistence'
		}
825
		optional("org.hibernate:hibernate-core:${hibernate5Version}")
826
		optional("javax.servlet:javax.servlet-api:${servletVersion}")
S
Sam Brannen 已提交
827
		testCompile("org.aspectj:aspectjweaver:${aspectjVersion}")
P
Phillip Webb 已提交
828
		testCompile("org.hsqldb:hsqldb:${hsqldbVersion}")
829
		testCompile("org.slf4j:slf4j-jcl:${slf4jVersion}")
830
		testRuntime("javax.xml.bind:jaxb-api:${jaxbVersion}")
831
	}
C
Chris Beams 已提交
832 833
}

P
Phillip Webb 已提交
834 835
project("spring-webmvc") {
	description = "Spring Web MVC"
836

837
	dependencies {
838
		compile(project(":spring-aop"))
839 840
		compile(project(":spring-beans"))
		compile(project(":spring-context"))
841
		compile(project(":spring-core"))
842
		compile(files(project(":spring-core").objenesisRepackJar))
843 844
		compile(project(":spring-expression"))
		compile(project(":spring-web"))
845
		provided("javax.servlet:javax.servlet-api:${servletVersion}")
846
		optional(project(":spring-context-support"))  // for FreeMarker support
847
		optional(project(":spring-oxm"))  // for MarshallingView
848
		optional("javax.servlet.jsp:javax.servlet.jsp-api:${jspVersion}")
849
		optional("javax.servlet.jsp.jstl:javax.servlet.jsp.jstl-api:1.2.1")
850
		optional("javax.xml.bind:jaxb-api:${jaxbVersion}")
851 852
		optional("org.apache.poi:poi:${poiVersion}")
		optional("org.apache.poi:poi-ooxml:${poiVersion}")
853
		optional("org.freemarker:freemarker:${freemarkerVersion}")
854
		optional("org.codehaus.groovy:groovy-all:${groovyVersion}")
855 856
		optional("com.lowagie:itext:2.1.7")
		optional("com.fasterxml.jackson.core:jackson-databind:${jackson2Version}")
857
		optional("com.fasterxml.jackson.dataformat:jackson-dataformat-xml:${jackson2Version}")
858
		optional("com.rometools:rome:${romeVersion}")
859
		optional("javax.el:javax.el-api:${elApiVersion}")
860 861
		optional("org.apache.tiles:tiles-api:${tiles3Version}")
		optional("org.apache.tiles:tiles-core:${tiles3Version}") {
862 863
			exclude group: "org.slf4j", module: "jcl-over-slf4j"
		}
864
		optional("org.apache.tiles:tiles-servlet:${tiles3Version}") {
865 866
			exclude group: "org.slf4j", module: "jcl-over-slf4j"
		}
867
		optional("org.apache.tiles:tiles-jsp:${tiles3Version}") {
868 869
			exclude group: "org.slf4j", module: "jcl-over-slf4j"
		}
870
		optional("org.apache.tiles:tiles-el:${tiles3Version}") {
871 872
			exclude group: "org.slf4j", module: "jcl-over-slf4j"
		}
873
		optional("org.apache.tiles:tiles-extras:${tiles3Version}") {
874 875 876
			exclude group: "org.slf4j", module: "jcl-over-slf4j"
			exclude group: "org.springframework", module: "spring-web"
		}
877
		optional('org.webjars:webjars-locator:0.32')
878
		testCompile("org.xmlunit:xmlunit-matchers:${xmlunitVersion}")
879
		testCompile("dom4j:dom4j:1.6.1") {
P
Phillip Webb 已提交
880
			exclude group: "xml-apis", module: "xml-apis"
881 882
		}
		testCompile("jaxen:jaxen:1.1.1") {
P
Phillip Webb 已提交
883 884 885
			exclude group: "xml-apis", module: "xml-apis"
			exclude group: "xom", module: "xom"
			exclude group: "xerces", module: "xercesImpl"
886
		}
B
Brian Clozel 已提交
887
		testCompile("org.eclipse.jetty:jetty-servlet:${jettyVersion}") {
B
Brian Clozel 已提交
888
			exclude group: "javax.servlet", module: "javax.servlet"
889
		}
B
Brian Clozel 已提交
890
		testCompile("org.eclipse.jetty:jetty-server:${jettyVersion}") {
B
Brian Clozel 已提交
891
			exclude group: "javax.servlet", module: "javax.servlet"
892
		}
J
Juergen Hoeller 已提交
893
		testCompile("javax.validation:validation-api:${beanvalVersion}")
894
		testCompile("org.hibernate:hibernate-validator:${hibval5Version}")
895 896
		testCompile("org.apache.httpcomponents:httpclient:${httpclientVersion}")
		testCompile("commons-fileupload:commons-fileupload:${fileuploadVersion}")
897
		testCompile("commons-io:commons-io:1.3")
898
		testCompile("joda-time:joda-time:${jodaVersion}")
899
		testCompile("org.slf4j:slf4j-jcl:${slf4jVersion}")
900
		testCompile("org.mozilla:rhino:1.7.7.1")
901 902 903
		testRuntime("org.jruby:jruby:9.1.2.0")
		testRuntime("org.python:jython-standalone:2.5.3")
		testRuntime("org.webjars:underscorejs:1.8.3")
904 905 906
		testRuntime("com.sun.xml.bind:jaxb-core:${jaxbVersion}")
		testRuntime("com.sun.xml.bind:jaxb-impl:${jaxbVersion}")
		testRuntime("javax.activation:activation:${activationApiVersion}")
907 908 909
	}
}

910 911 912 913 914 915 916 917 918
project("spring-websocket") {
	description = "Spring WebSocket"

	dependencies {
		compile(project(":spring-core"))
		compile(project(":spring-context"))
		compile(project(":spring-web"))
		optional(project(":spring-messaging"))
		optional(project(":spring-webmvc"))
919 920
		optional("javax.servlet:javax.servlet-api:${servletVersion}")
		optional("javax.websocket:javax.websocket-api:${websocketVersion}")
921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944
		optional("org.apache.tomcat:tomcat-websocket:${tomcatVersion}") {
			exclude group: "org.apache.tomcat", module: "tomcat-websocket-api"
			exclude group: "org.apache.tomcat", module: "tomcat-servlet-api"
		}
		optional("org.glassfish.tyrus:tyrus-spi:${tyrusVersion}")
		optional("org.glassfish.tyrus:tyrus-core:${tyrusVersion}")
		optional("org.glassfish.tyrus:tyrus-server:${tyrusVersion}")
		optional("org.glassfish.tyrus:tyrus-container-servlet:${tyrusVersion}")
		optional("org.eclipse.jetty:jetty-webapp:${jettyVersion}") {
			exclude group: "javax.servlet", module: "javax.servlet"
		}
		optional("org.eclipse.jetty.websocket:websocket-server:${jettyVersion}") {
			exclude group: "javax.servlet", module: "javax.servlet"
		}
		optional("org.eclipse.jetty.websocket:websocket-client:${jettyVersion}")
		optional("org.eclipse.jetty:jetty-client:${jettyVersion}")
		optional("io.undertow:undertow-core:${undertowVersion}")
		optional("io.undertow:undertow-servlet:${undertowVersion}") {
			exclude group: "org.jboss.spec.javax.servlet", module: "jboss-servlet-api_3.1_spec"
			exclude group: "org.jboss.spec.javax.annotation", module: "jboss-annotations-api_1.2_spec"
		}
		optional("io.undertow:undertow-websockets-jsr:${undertowVersion}") {
			exclude group: "org.jboss.spec.javax.websocket", module: "jboss-websocket-api_1.1_spec"
		}
945
		optional("org.jboss.xnio:xnio-api:${xnioVersion}")
946 947 948
		optional("com.fasterxml.jackson.core:jackson-databind:${jackson2Version}")
		testCompile("org.apache.tomcat.embed:tomcat-embed-core:${tomcatVersion}")
		testCompile("org.apache.tomcat.embed:tomcat-embed-websocket:${tomcatVersion}")
949
		testCompile("io.projectreactor:reactor-core:${reactorVersion}") {
950
			force = true  // enforce 2.0.x
951
		}
952 953 954
		testCompile("io.projectreactor:reactor-net:${reactorVersion}")
		testCompile("io.netty:netty-all:${nettyVersion}")
		testCompile("org.slf4j:slf4j-jcl:${slf4jVersion}")
955
		testRuntime("org.jboss.xnio:xnio-nio:${xnioVersion}")
956
		testRuntime("org.jboss.logging:jboss-logging:3.3.0.Final")
957 958 959
	}
}

P
Phillip Webb 已提交
960 961
project("spring-test") {
	description = "Spring TestContext Framework"
962

963
	dependencies {
964
		compile(project(":spring-core"))
965 966 967 968 969 970 971
		optional(project(":spring-beans"))
		optional(project(":spring-context"))
		optional(project(":spring-jdbc"))
		optional(project(":spring-tx"))
		optional(project(":spring-orm"))
		optional(project(":spring-web"))
		optional(project(":spring-webmvc"))
972
		optional(project(":spring-websocket"))
973
		optional("junit:junit:${junitVersion}")
974
		optional("org.junit.jupiter:junit-jupiter-api:${junitJupiterVersion}")
975
		optional("org.testng:testng:${testngVersion}")
976
		optional("javax.inject:javax.inject:1")
977 978
		optional("javax.servlet:javax.servlet-api:${servletVersion}")
		optional("javax.servlet.jsp:javax.servlet.jsp-api:${jspVersion}")
979 980 981 982
		optional("javax.servlet.jsp.jstl:javax.servlet.jsp.jstl-api:1.2.1")
		optional("org.apache.taglibs:taglibs-standard-jstlel:1.2.1") {
			exclude group: "org.apache.taglibs", module: "taglibs-standard-spec"
		}
983
		optional("javax.el:javax.el-api:${elApiVersion}")
984
		optional("javax.websocket:javax.websocket-api:${websocketVersion}")
985 986
		optional("javax.activation:activation:${activationApiVersion}")
		optional("javax.xml.bind:jaxb-api:${jaxbVersion}")
987
		optional("org.aspectj:aspectjweaver:${aspectjVersion}")
S
Sam Brannen 已提交
988
		optional("org.codehaus.groovy:groovy-all:${groovyVersion}")
989
		optional("org.hamcrest:hamcrest-core:${hamcrestVersion}")
990
		optional("org.xmlunit:xmlunit-matchers:${xmlunitVersion}")
991 992
		optional("net.sourceforge.htmlunit:htmlunit:2.22")
		optional("org.seleniumhq.selenium:htmlunit-driver:2.21")
993 994 995
		optional("org.seleniumhq.selenium:selenium-java:2.53.1") {
			exclude group: "io.netty", module: "netty"
		}
996 997
		optional("org.skyscreamer:jsonassert:1.3.0")
		optional("com.jayway.jsonpath:json-path:2.2.0")
998 999
		testCompile(project(":spring-context-support"))
		testCompile(project(":spring-oxm"))
1000
		testCompile("javax.mail:javax.mail-api:${javamailVersion}")
1001
		testCompile("javax.ejb:javax.ejb-api:${ejbApiVersion}")
S
Stephane Nicoll 已提交
1002
		testCompile("javax.interceptor:javax.interceptor-api:${interceptorApiVersion}")
1003
		testCompile("org.hibernate:hibernate-core:${hibernate5Version}")
1004
		testCompile("org.hibernate:hibernate-validator:${hibval5Version}")
1005 1006
		// Enable use of the JUnitPlatform Runner
		testCompile("org.junit.platform:junit-platform-runner:${junitPlatformVersion}")
1007
		testCompile("com.thoughtworks.xstream:xstream:${xstreamVersion}")
1008
		testCompile("com.fasterxml.jackson.core:jackson-databind:${jackson2Version}")
1009
		testCompile("com.rometools:rome:${romeVersion}")
1010 1011
		testCompile("org.apache.tiles:tiles-api:${tiles3Version}")
		testCompile("org.apache.tiles:tiles-core:${tiles3Version}") {
1012 1013
			exclude group: "org.slf4j", module: "jcl-over-slf4j"
		}
1014
		testCompile("org.apache.tiles:tiles-servlet:${tiles3Version}") {
1015 1016
			exclude group: "org.slf4j", module: "jcl-over-slf4j"
		}
1017
		testCompile("org.hsqldb:hsqldb:${hsqldbVersion}")
S
Sam Brannen 已提交
1018
		testCompile("org.slf4j:slf4j-jcl:${slf4jVersion}")
1019
		testCompile("org.apache.httpcomponents:httpclient:${httpclientVersion}")
1020
		testCompile("javax.cache:cache-api:1.0.0")
1021
		testRuntime("org.junit.jupiter:junit-jupiter-engine:${junitJupiterVersion}")
1022
		testRuntime("org.apache.logging.log4j:log4j-jul:${log4jVersion}")  // Java Util Logging for JUnit 5
1023
		testRuntime("org.ehcache:ehcache:${ehcache3Version}")
J
Juergen Hoeller 已提交
1024
		testRuntime("org.terracotta:management-model:2.0.0")
1025 1026
		testRuntime("com.sun.xml.bind:jaxb-core:${jaxbVersion}")
		testRuntime("com.sun.xml.bind:jaxb-impl:${jaxbVersion}")
1027
	}
1028 1029

	task testNG(type: Test) {
1030
		description = 'Runs TestNG tests.'
1031
		useTestNG()
1032
		scanForTestClasses = false
1033 1034
		include(["**/testng/**/*Tests.class", "**/testng/**/*Test.class"])
		// Show STD_OUT & STD_ERR of the test JVM(s) on the console:
1035
		// testLogging.showStandardStreams = true
1036
		// forkEvery 1
1037
		reports.junitXml.destination = file("$buildDir/test-results")
1038 1039 1040
	}

	test {
1041
		description = 'Runs JUnit tests.'
1042 1043
		dependsOn testNG
		useJUnit()
1044 1045 1046
		scanForTestClasses = false
		include(['**/*Tests.class', '**/*Test.class', '**/SpringJUnitJupiterTestSuite.class'])
		exclude(['**/testng/**/*.*'])
1047 1048
		// Java Util Logging for JUnit 5.
		// systemProperty('java.util.logging.manager', 'org.apache.logging.log4j.jul.LogManager')
1049
		reports.junitXml.destination = file("$buildDir/test-results")
1050
	}
1051 1052

	task aggregateTestReports(type: TestReport) {
1053
		description = 'Aggregates JUnit and TestNG test reports.'
1054 1055 1056 1057 1058
		destinationDir = test.reports.html.destination
		reportOn test, testNG
	}

	check.dependsOn aggregateTestReports
C
Chris Beams 已提交
1059 1060
}

P
Phillip Webb 已提交
1061 1062 1063
project("spring-aspects") {
	description = "Spring Aspects"
	apply from: "aspects.gradle"
1064

1065
	dependencies {
1066
		aspects(project(":spring-orm"))
1067 1068 1069
		ajc("org.aspectj:aspectjtools:${aspectjVersion}")
		rt("org.aspectj:aspectjrt:${aspectjVersion}")
		compile("org.aspectj:aspectjweaver:${aspectjVersion}")
J
Juergen Hoeller 已提交
1070
		provided("org.eclipse.persistence:javax.persistence:${jpaVersion}")
1071 1072 1073 1074 1075 1076
		optional(project(":spring-aop"))  // for @Async support
		optional(project(":spring-beans"))  // for @Configurable support
		optional(project(":spring-context"))  // for @Enable* support
		optional(project(":spring-context-support"))  // for JavaMail and JSR-107 support
		optional(project(":spring-orm"))  // for JPA exception translation support
		optional(project(":spring-tx"))  // for JPA, @Transactional support
1077
		optional("javax.transaction:javax.transaction-api:${jtaVersion}")  // for @javax.transaction.Transactional support
S
Stephane Nicoll 已提交
1078
		optional("javax.cache:cache-api:1.0.0")
1079
		testCompile(project(":spring-core"))  // for CodeStyleAspect
1080
		testCompile(project(":spring-test"))
1081
		testCompile("javax.mail:javax.mail-api:${javamailVersion}")
1082
	}
1083

1084
	eclipse.project {
P
Phillip Webb 已提交
1085
		natures += "org.eclipse.ajdt.ui.ajnature"
1086
		buildCommands = [new org.gradle.plugins.ide.eclipse.model.BuildCommand("org.eclipse.ajdt.core.ajbuilder")]
1087
	}
C
Chris Beams 已提交
1088 1089
}

1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124
project("spring-framework-bom") {
	description = "Spring Framework (Bill of Materials)"

	configurations.archives.artifacts.clear()
	artifacts {
		// work around GRADLE-2406 by attaching text artifact
		archives(file("spring-framework-bom.txt"))
	}

	install {
		repositories.mavenInstaller {
			pom.whenConfigured {
				packaging = "pom"
				withXml {
					asNode().children().last() + {
						delegate.dependencyManagement {
							delegate.dependencies {
								parent.subprojects.sort { "$it.name" }.each { p ->
									if (p.hasProperty("merge") && p.merge.into == null && p != project) {
										delegate.dependency {
											delegate.groupId(p.group)
											delegate.artifactId(p.name)
											delegate.version(p.version)
										}
									}
								}
							}
						}
					}
				}
			}
		}
	}
}

1125 1126
sonarqube {
	properties {
S
Stephane Nicoll 已提交
1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138
		property "sonar.projectName", "Spring Framework"
		property "sonar.profile", "Spring Framework"
		property "sonar.jacoco.reportPath", "${buildDir.name}/jacoco.exec"
		property "sonar.links.homepage", linkHomepage
		property "sonar.links.ci", linkCi
		property "sonar.links.issue", linkIssue
		property "sonar.links.scm", linkScmUrl
		property "sonar.links.scm_dev", linkScmDevConnection
		property "sonar.java.coveragePlugin", "jacoco"
	}
}

1139
configure(rootProject) {
P
Phillip Webb 已提交
1140
	description = "Spring Framework"
1141

B
Brian Clozel 已提交
1142
	apply plugin: "org.asciidoctor.convert"
1143
	apply plugin: "docbook-reference"
1144
	apply plugin: "groovy"
R
Rob Winch 已提交
1145

1146
	// apply plugin: "detect-split-packages"
1147 1148
	apply from: "${gradleScriptDir}/jdiff.gradle"

R
Rob Winch 已提交
1149
	asciidoctor {
B
Brian Clozel 已提交
1150 1151
		sourceDir project.file('src/asciidoc')
		separateOutputDirs = false
1152
		backends = ['docbook']
B
Brian Clozel 已提交
1153
		options doctype: 'book', eruby: 'erubis'
J
Juergen Hoeller 已提交
1154
		attributes 'spring-version': project.version, 'revnumber': project.version, 'docinfo': ""
1155 1156
	}

1157 1158 1159
	reference {
		sourceDir = asciidoctor.outputDir
		pdfFilename = "spring-framework-reference.pdf"
1160
		epubFilename = "spring-framework-reference.epub"
1161 1162 1163 1164 1165 1166 1167
		expandPlaceholders = ""
	}

	afterEvaluate {
		tasks.findAll { it.name.startsWith("reference") }.each{ it.dependsOn.add("asciidoctor") }
	}

1168 1169 1170 1171 1172
	// TODO: DetectSplitPackagesPlugin fails in line 154 due to method not found on java.io.File.
	// TODO: Possibly related to user rights or OS differences; passes on local Windows machine.
	// detectSplitPackages {
	//	projectsToScan -= project(":spring-instrument-tomcat")
	// }
1173

C
Chris Beams 已提交
1174
	// don't publish the default jar for the root project
1175 1176
	configurations.archives.artifacts.clear()

1177
	dependencies {  // for integration tests
1178
		testCompile(project(":spring-aop"))
1179
		testCompile(project(":spring-beans"))
1180
		testCompile(project(":spring-context"))
1181 1182
		testCompile(project(":spring-core"))
		testCompile(project(":spring-expression"))
1183
		testCompile(project(":spring-jdbc"))
1184
		testCompile(project(":spring-orm"))
1185
		testCompile(project(":spring-test"))
1186
		testCompile(project(":spring-tx"))
1187
		testCompile(project(":spring-web"))
1188
		testCompile("javax.servlet:javax.servlet-api:${servletVersion}")
1189
		testCompile("javax.inject:javax.inject:1")
J
Juergen Hoeller 已提交
1190
		testCompile("javax.resource:javax.resource-api:${jcaVersion}")
1191
		testCompile("org.aspectj:aspectjweaver:${aspectjVersion}")
1192
		testCompile("org.hibernate:hibernate-core:${hibernate5Version}")
P
Phillip Webb 已提交
1193
		testCompile("org.hsqldb:hsqldb:${hsqldbVersion}")
1194 1195 1196
	}

	task api(type: Javadoc) {
P
Phillip Webb 已提交
1197 1198
		group = "Documentation"
		description = "Generates aggregated Javadoc API documentation."
1199
		title = "${rootProject.description} ${version} API"
C
Chris Beams 已提交
1200

1201 1202 1203 1204 1205
		dependsOn {
			subprojects.collect {
				it.tasks.getByName("jar")
			}
		}
1206 1207 1208
		options.memberLevel = org.gradle.external.javadoc.JavadocMemberLevel.PROTECTED
		options.author = true
		options.header = rootProject.description
P
Phillip Webb 已提交
1209
		options.overview = "src/api/overview.html"
1210
		options.stylesheetFile = file("src/api/stylesheet.css")
1211
		options.splitIndex = true
C
Chris Beams 已提交
1212
		options.links(project.ext.javadocLinks)
1213
		options.addStringOption('Xdoclint:none', '-quiet')
C
Chris Beams 已提交
1214

1215 1216 1217
		source subprojects.collect { project ->
			project.sourceSets.main.allJava
		}
C
Chris Beams 已提交
1218

P
Phillip Webb 已提交
1219
		maxMemory = "1024m"
C
Chris Beams 已提交
1220
		destinationDir = new File(buildDir, "api")
1221 1222 1223

		doFirst {
			classpath = files(
1224 1225
                // ensure Servlet 3.x has precedence on the javadoc classpath
                project(":spring-webmvc").sourceSets.main.compileClasspath.files.find { it =~ "servlet-api" },
1226 1227 1228 1229 1230
				// ensure the javadoc process can resolve types compiled from .aj sources
				project(":spring-aspects").sourceSets.main.output
			)
			classpath += files(subprojects.collect { it.sourceSets.main.compileClasspath })
		}
1231 1232
	}

1233
	task docsZip(type: Zip, dependsOn: 'reference') {
P
Phillip Webb 已提交
1234 1235 1236
		group = "Distribution"
		baseName = "spring-framework"
		classifier = "docs"
1237 1238 1239
		description = "Builds -${classifier} archive containing api and reference " +
			"for deployment at http://static.springframework.org/spring-framework/docs."

P
Phillip Webb 已提交
1240 1241
		from("src/dist") {
			include "changelog.txt"
1242 1243 1244
		}

		from (api) {
1245
			into "javadoc-api"
1246 1247
		}

1248 1249
		from (reference) {
			into "spring-framework-reference"
1250 1251 1252 1253
		}
	}

	task schemaZip(type: Zip) {
P
Phillip Webb 已提交
1254 1255 1256
		group = "Distribution"
		baseName = "spring-framework"
		classifier = "schema"
1257 1258
		description = "Builds -${classifier} archive containing all " +
			"XSDs for deployment at http://springframework.org/schema."
S
Stephane Nicoll 已提交
1259
		duplicatesStrategy 'exclude'
1260
		moduleProjects.each { subproject ->
1261 1262 1263
			def Properties schemas = new Properties();

			subproject.sourceSets.main.resources.find {
P
Phillip Webb 已提交
1264
				it.path.endsWith("META-INF/spring.schemas")
1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281
			}?.withInputStream { schemas.load(it) }

			for (def key : schemas.keySet()) {
				def shortName = key.replaceAll(/http.*schema.(.*).spring-.*/, '$1')
				assert shortName != key
				File xsdFile = subproject.sourceSets.main.resources.find {
					it.path.endsWith(schemas.get(key))
				}
				assert xsdFile != null
				into (shortName) {
					from xsdFile.path
				}
			}
		}
	}

	task distZip(type: Zip, dependsOn: [docsZip, schemaZip]) {
P
Phillip Webb 已提交
1282 1283 1284
		group = "Distribution"
		baseName = "spring-framework"
		classifier = "dist"
1285
		description = "Builds -${classifier} archive, containing all jars and docs, " +
J
Juergen Hoeller 已提交
1286
			"suitable for community download page."
1287 1288 1289

		ext.baseDir = "${baseName}-${project.version}";

P
Phillip Webb 已提交
1290 1291 1292 1293
		from("src/dist") {
			include "readme.txt"
			include "license.txt"
			include "notice.txt"
1294
			into "${baseDir}"
P
Phillip Webb 已提交
1295
			expand(copyright: new Date().format("yyyy"), version: project.version)
1296 1297 1298 1299 1300 1301 1302 1303 1304 1305
		}

		from(zipTree(docsZip.archivePath)) {
			into "${baseDir}/docs"
		}

		from(zipTree(schemaZip.archivePath)) {
			into "${baseDir}/schema"
		}

1306
		moduleProjects.each { subproject ->
1307 1308
			into ("${baseDir}/libs") {
				from subproject.jar
P
Phillip Webb 已提交
1309
				if (subproject.tasks.findByPath("sourcesJar")) {
1310 1311
					from subproject.sourcesJar
				}
P
Phillip Webb 已提交
1312
				if (subproject.tasks.findByPath("javadocJar")) {
1313 1314 1315 1316 1317 1318
					from subproject.javadocJar
				}
			}
		}
	}

1319
	// Create a distribution that contains all dependencies (required and optional).
1320 1321
	// Not published by default; only for use when building from source.
	task depsZip(type: Zip, dependsOn: distZip) { zipTask ->
P
Phillip Webb 已提交
1322 1323 1324
		group = "Distribution"
		baseName = "spring-framework"
		classifier = "dist-with-deps"
1325 1326 1327 1328 1329 1330 1331 1332 1333 1334
		description = "Builds -${classifier} archive, containing everything " +
			"in the -${distZip.classifier} archive plus all runtime dependencies."

		from zipTree(distZip.archivePath)

		gradle.taskGraph.whenReady { taskGraph ->
			if (taskGraph.hasTask(":${zipTask.name}")) {
				def projectNames = rootProject.subprojects*.name
				def artifacts = new HashSet()
				subprojects.each { subproject ->
1335 1336
					(subproject.configurations.runtime.resolvedConfiguration.resolvedArtifacts +
					subproject.configurations.optional.resolvedConfiguration.resolvedArtifacts).each { artifact ->
1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357
						def dependency = artifact.moduleVersion.id
						if (!projectNames.contains(dependency.name)) {
							artifacts << artifact.file
						}
					}
				}

				zipTask.from(artifacts) {
					into "${distZip.baseDir}/deps"
				}
			}
		}
	}

	artifacts {
		archives docsZip
		archives schemaZip
		archives distZip
	}

	task wrapper(type: Wrapper) {
P
Phillip Webb 已提交
1358
		description = "Generates gradlew[.bat] scripts"
S
Sam Brannen 已提交
1359
		gradleVersion = '3.0'
1360 1361

		doLast() {
1362
			def gradleOpts = "-XX:MaxMetaspaceSize=1024m -Xmx1024m"
1363
			def gradleBatOpts = "$gradleOpts -XX:MaxHeapSize=256m"
P
Phillip Webb 已提交
1364
			File wrapperFile = file("gradlew")
1365 1366
			wrapperFile.text = wrapperFile.text.replace("DEFAULT_JVM_OPTS=",
				"GRADLE_OPTS=\"$gradleOpts \$GRADLE_OPTS\"\nDEFAULT_JVM_OPTS=")
P
Phillip Webb 已提交
1367
			File wrapperBatFile = file("gradlew.bat")
1368 1369 1370 1371
			wrapperBatFile.text = wrapperBatFile.text.replace("set DEFAULT_JVM_OPTS=",
				"set GRADLE_OPTS=$gradleBatOpts %GRADLE_OPTS%\nset DEFAULT_JVM_OPTS=")
		}
	}
1372

1373
}
1374

S
Stephane Nicoll 已提交
1375
configure([project(':spring-build-src'), project(':spring-framework-bom')]) {
1376
	sonarqube {
S
Stephane Nicoll 已提交
1377 1378 1379 1380 1381
		skipProject = true
	}
}

configure(project(':spring-core')) {
1382 1383
	sonarqube {
		properties {
S
Stephane Nicoll 已提交
1384 1385 1386 1387 1388 1389
			property "sonar.exclusions",
					"src/main/java/org/springframework/cglib/**/*,src/main/java/org/springframework/asm/**/*"
		}
	}
}

1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400
/*
 * Support publication of artifacts versioned by topic branch.
 * CI builds supply `-P BRANCH_NAME=<TOPIC>` to gradle at build time.
 * If <TOPIC> starts with 'SPR-', change version
 *     from BUILD-SNAPSHOT => <TOPIC>-SNAPSHOT
 *     e.g. 3.2.1.BUILD-SNAPSHOT => 3.2.1.SPR-1234-SNAPSHOT
 */
def qualifyVersionIfNecessary(version) {
	if (rootProject.hasProperty("BRANCH_NAME")) {
		def qualifier = rootProject.getProperty("BRANCH_NAME")
		if (qualifier.startsWith("SPR-")) {
1401
			return version.replace('BUILD', qualifier)
1402 1403
		}
	}
1404
	return version
1405
}