build.gradle 53.8 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")
7
		classpath("org.asciidoctor:asciidoctor-gradle-plugin:1.5.3")
8
		classpath("io.spring.gradle:docbook-reference-plugin:0.3.1")
9
	}
10 11
}

12
plugins {
13
	id "org.sonarqube" version "2.2.1"
14 15
}

S
Stephane Nicoll 已提交
16 17 18 19 20 21
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'
22
	linkScmDevConnection = 'scm:git:ssh://git@github.com:spring-projects/spring-framework.git'
23

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

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

33
	ext.activationApiVersion   = "1.1.1"
34
	ext.annotationApiVersion   = "1.2"
J
Juergen Hoeller 已提交
35
	ext.aspectjVersion         = "1.9.0.BETA-5"
36
	ext.beanvalVersion         = "1.1.0.Final"
37
	ext.cacheApiVersion        = "1.0.0"
38
	ext.caffeineVersion        = "2.3.5"
39
	ext.eclipselinkVersion     = "2.6.4"
40
	ext.ehcacheVersion         = "2.10.3"
41
	ext.ehcachejcacheVersion   = "1.0.1"
42
	ext.ehcache3Version        = "3.1.3"
43
	ext.ejbApiVersion          = "3.2"
J
Juergen Hoeller 已提交
44
	ext.elApiVersion           = "3.0.1-b04"
45 46 47
	ext.fileuploadVersion      = "1.3.2"
	ext.freemarkerVersion      = "2.3.25-incubating"
	ext.groovyVersion          = "2.4.7"
48
	ext.gsonVersion            = "2.8.0"
49
	ext.hamcrestVersion        = "1.3"
50
	ext.hibernate5Version      = "5.2.4.Final"
51
	ext.hibval5Version         = "5.3.2.Final"
52 53 54 55
	ext.hsqldbVersion          = "2.3.4"
	ext.httpasyncVersion       = "4.1.2"
	ext.httpclientVersion      = "4.5.2"
	ext.interceptorApiVersion  = "1.2"
56
	ext.jackson2Version        = "2.8.5"
57
	ext.javamailVersion        = "1.5.6"
58
	ext.jaxbVersion            = "2.2.11"
59
	ext.jaxwsVersion           = "2.2.11"
60
	ext.jcaVersion             = "1.7"
61
	ext.jettyVersion           = "9.4.0.RC1"  // RC2 has broken HEAD handling
62
	ext.jmsVersion             = "2.0.1"
63
	ext.jodaVersion            = "2.9.6"
64
	ext.jpaVersion             = "2.1.1"
65
	ext.jsfVersion             = "2.2"
66 67 68
	ext.jspVersion             = "2.3.2-b02"
	ext.jtaVersion             = "1.2"
	ext.junitVersion           = "4.12"
S
Sam Brannen 已提交
69 70
	ext.junitJupiterVersion    = '5.0.0-M2'
	ext.junitPlatformVersion   = '1.0.0-M2'
71
	ext.log4jVersion           = '2.7'
72
	ext.nettyVersion           = "4.1.6.Final"
73
	ext.okhttpVersion          = "2.7.5"
74
	ext.okhttp3Version         = "3.4.2"
75
	ext.poiVersion             = "3.15"
76
	ext.protobufVersion        = "3.1.0"
77
	ext.quartzVersion          = "2.2.3"
78 79
	ext.reactivestreamsVersion = "1.0.0"
	ext.reactorVersion         = "2.0.8.RELEASE"
S
Sebastien Deleuze 已提交
80
	ext.reactorCoreVersion     = '3.0.3.RELEASE'
81
	ext.reactorNettyVersion    = '0.6.0.BUILD-SNAPSHOT'
82
	ext.romeVersion            = "1.7.0"
83
	ext.rxjavaVersion          = '1.2.2'
84
	ext.rxjavaAdapterVersion   = '1.2.1'
85
	ext.rxjava2Version         = '2.0.1'
86
	ext.rxnettyVersion         = '0.5.2-rc.5'
87 88 89 90
	ext.servletVersion         = "3.1.0"
	ext.slf4jVersion           = "1.7.21"
	ext.snakeyamlVersion       = "1.17"
	ext.snifferVersion         = "1.15"
S
Sam Brannen 已提交
91
	ext.testngVersion          = "6.9.12"
J
Juergen Hoeller 已提交
92
	ext.tiles3Version          = "3.0.7"
93
	ext.tomcatVersion          = "8.5.8"
94
	ext.tyrusVersion           = "1.13"
95
	ext.undertowVersion        = "1.4.4.Final"
96
	ext.websocketVersion       = "1.1"
97
	ext.woodstoxVersion        = "5.0.3"
98
	ext.xmlunitVersion         = "2.2.1"
99
	ext.xnioVersion            = "3.4.1.Final"
100
	ext.xstreamVersion         = "1.4.9"
101

102
	ext.gradleScriptDir = "${rootProject.projectDir}/gradle"
103

104
	apply plugin: "propdeps"
P
Phillip Webb 已提交
105
	apply plugin: "java"
106
	apply plugin: "test-source-set-dependencies"
107
	apply from: "${gradleScriptDir}/ide.gradle"
C
Chris Beams 已提交
108

S
Stephane Nicoll 已提交
109 110 111 112 113
	configurations {
		sniffer
		javaApiSignature
	}

114 115 116 117 118 119 120 121 122 123
	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 已提交
124 125 126 127 128
		resolutionStrategy.eachDependency { DependencyResolveDetails details ->
			if (details.requested.name == 'reactor-core' && details.requested.version.startsWith('3.')) {
				details.useVersion reactorCoreVersion
			}
		}
129 130
	}

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

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

146
	compileJava {
147 148
		sourceCompatibility = 1.8
		targetCompatibility = 1.8
149
		options.encoding = 'UTF-8'
150 151 152
	}

	compileTestJava {
J
Juergen Hoeller 已提交
153 154
		sourceCompatibility = 1.8
		targetCompatibility = 1.8
155
		options.encoding = 'UTF-8'
156
		options.compilerArgs += "-parameters"
J
Juergen Hoeller 已提交
157 158
	}

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

171
	repositories {
B
Brian Clozel 已提交
172
		maven { url "https://repo.spring.io/libs-release" }
173
		maven { url "https://repo.spring.io/milestone" }
174
		maven { url "https://repo.spring.io/snapshot" }
175
	}
C
Chris Beams 已提交
176

177
	dependencies {
178 179 180
		testCompile("junit:junit:${junitVersion}") {
			exclude group:'org.hamcrest', module:'hamcrest-core'
		}
181
		testCompile("org.mockito:mockito-core:2.2.11") {
182 183
			exclude group:'org.hamcrest', module:'hamcrest-core'
		}
184
		testCompile("org.hamcrest:hamcrest-all:${hamcrestVersion}")
185 186
		testRuntime("org.apache.logging.log4j:log4j-core:${log4jVersion}")
		testRuntime("org.apache.logging.log4j:log4j-jcl:${log4jVersion}")
187

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

	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
209

S
Stephane Nicoll 已提交
210 211 212 213 214 215 216
		doLast {
			ant.taskdef(
				name: 'animalSniffer',
				classname: 'org.codehaus.mojo.animal_sniffer.ant.CheckSignatureTask',
				classpath: configurations.sniffer.asPath
			)

217 218 219 220 221 222 223
			// 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 已提交
224
		}
225
	}
C
Chris Beams 已提交
226 227

	ext.javadocLinks = [
228
		"http://docs.oracle.com/javase/8/docs/api/",
229
		"http://docs.oracle.com/javaee/7/api/",
230
		"http://docs.oracle.com/cd/E13222_01/wls/docs90/javadocs/",  // CommonJ
J
Juergen Hoeller 已提交
231 232
		"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 已提交
233 234
		"http://docs.jboss.org/jbossas/javadoc/4.0.5/connector/",
		"http://docs.jboss.org/jbossas/javadoc/7.1.2.Final/",
235
		"http://tiles.apache.org/tiles-request/apidocs/",
J
Juergen Hoeller 已提交
236
		"http://tiles.apache.org/framework/apidocs/",
C
Chris Beams 已提交
237
		"http://www.eclipse.org/aspectj/doc/released/aspectj5rt-api/",
B
Brian Clozel 已提交
238 239
		"http://ehcache.org/apidocs/${ehcacheVersion}",
		"http://ehcache.org/apidocs/${ehcache3Version}",
240
		"http://quartz-scheduler.org/api/2.2.1/",
241 242 243
		"http://fasterxml.github.io/jackson-core/javadoc/2.8/",
		"http://fasterxml.github.io/jackson-databind/javadoc/2.8/",
		"http://fasterxml.github.io/jackson-dataformat-xml/javadoc/2.8/",
244
		"http://hc.apache.org/httpcomponents-client-ga/httpclient/apidocs/"
C
Chris Beams 已提交
245
	] as String[]
246 247
}

248
configure(subprojects - project(":spring-build-src")) { subproject ->
249
	apply plugin: "merge"
250 251
	apply from: "${gradleScriptDir}/publish-maven.gradle"

S
Stephane Nicoll 已提交
252 253 254 255 256
	configurations {
		jacoco
	}

	dependencies {
257
		jacoco("org.jacoco:org.jacoco.agent:0.7.5.201505241946:runtime")
S
Stephane Nicoll 已提交
258 259 260
	}

	gradle.taskGraph.whenReady {taskGraph ->
261
		if (taskGraph.hasTask(':sonarqube')) {
S
Stephane Nicoll 已提交
262 263 264 265
			test.jvmArgs "-javaagent:${configurations.jacoco.asPath}=destfile=${buildDir}/jacoco.exec,includes=org.springframework.*"
		}
	}

266
	jar {
P
Phillip Webb 已提交
267 268 269 270
		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
271 272 273 274 275

		from("${rootProject.projectDir}/src/dist") {
			include "license.txt"
			include "notice.txt"
			into "META-INF"
P
Phillip Webb 已提交
276
			expand(copyright: new Date().format("yyyy"), version: project.version)
277 278 279 280
		}
	}

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

283 284 285
		options.memberLevel = org.gradle.external.javadoc.JavadocMemberLevel.PROTECTED
		options.author = true
		options.header = project.name
C
Chris Beams 已提交
286
		options.links(project.ext.javadocLinks)
287
		options.addStringOption('Xdoclint:none', '-quiet')
C
Chris Beams 已提交
288 289 290 291 292

		// 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
293 294
	}

295 296
	task sourcesJar(type: Jar, dependsOn: classes) {
		classifier = 'sources'
297
		from sourceSets.main.allSource
298
		// don't include or exclude anything explicitly by default. See SPR-12085.
299 300 301
	}

	task javadocJar(type: Jar) {
P
Phillip Webb 已提交
302
		classifier = "javadoc"
303 304 305 306 307 308 309
		from javadoc
	}

	artifacts {
		archives sourcesJar
		archives javadocJar
	}
C
Chris Beams 已提交
310 311
}

312 313
project("spring-build-src") {
	description = "Exposes gradle buildSrc for IDE support"
314
	apply plugin: "groovy"
315 316 317

	dependencies {
		compile gradleApi()
R
Rob Winch 已提交
318
		compile localGroovy()
319 320 321 322 323
	}

	configurations.archives.artifacts.clear()
}

P
Phillip Webb 已提交
324 325
project("spring-core") {
	description = "Spring Core"
326

327 328
	// 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
329
	// further transformed by the JarJar task to depend on org.springframework.asm; this
330
	// avoids including two different copies of asm unnecessarily.
J
Juergen Hoeller 已提交
331
	def cglibVersion = "3.2.4"
332
	def objenesisVersion = "2.4"
333 334 335 336

	configurations {
		jarjar
		cglib
337
		objenesis
338 339 340 341 342 343 344 345 346 347 348 349 350 351 352
	}

	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 已提交
353 354
					rule(pattern: "net.sf.cglib.**", result: "org.springframework.cglib.@1")
					// as mentioned above, transform cglib"s internal asm dependencies from
355 356
					// 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 已提交
357
					rule(pattern: "org.objectweb.asm.**", result: "org.springframework.asm.@1")
358 359 360 361 362
				}
			}
		}
	}

363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381
	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")
				}
			}
		}
	}

382
	dependencies {
383
		cglib("cglib:cglib:${cglibVersion}@jar")
384
		objenesis("org.objenesis:objenesis:${objenesisVersion}@jar")
385
		jarjar("com.googlecode.jarjar:jarjar:1.3")
386

P
Phillip Webb 已提交
387
		compile(files(cglibRepackJar))
388
		compile(files(objenesisRepackJar))
389
		compile("commons-logging:commons-logging:1.2")
390
		optional("org.aspectj:aspectjweaver:${aspectjVersion}")
391
		optional("net.sf.jopt-simple:jopt-simple:5.0.2")
392
		optional("org.reactivestreams:reactive-streams:${reactivestreamsVersion}")
393
		optional("io.projectreactor:reactor-core:${reactorCoreVersion}")
394
		optional "io.reactivex:rxjava:${rxjavaVersion}"
S
Sebastien Deleuze 已提交
395
		optional "io.reactivex.rxjava2:rxjava:${rxjava2Version}"
396
		optional "io.reactivex:rxjava-reactive-streams:${rxjavaAdapterVersion}"
397
		optional("io.netty:netty-buffer:${nettyVersion}")
398
		testCompile("io.projectreactor.addons:reactor-test:${reactorCoreVersion}")
399
		testCompile("javax.xml.bind:jaxb-api:${jaxbVersion}")
400
		testCompile("org.apache.tomcat.embed:tomcat-embed-core:${tomcatVersion}")
401
		testCompile("org.xmlunit:xmlunit-matchers:${xmlunitVersion}")
402
		testCompile("com.fasterxml.woodstox:woodstox-core:${woodstoxVersion}") {
P
Phillip Webb 已提交
403 404
			exclude group: "stax", module: "stax-api"
		}
405 406 407
	}

	jar {
408
		// inline repackaged cglib classes directly into the spring-core jar
409 410
		dependsOn cglibRepackJar
		from(zipTree(cglibRepackJar.archivePath)) {
P
Phillip Webb 已提交
411
			include "org/springframework/cglib/**"
412
		}
413 414 415 416 417

		dependsOn objenesisRepackJar
		from(zipTree(objenesisRepackJar.archivePath)) {
			include "org/springframework/objenesis/**"
		}
418
	}
C
Chris Beams 已提交
419 420
}

P
Phillip Webb 已提交
421 422
project("spring-beans") {
	description = "Spring Beans"
423

424
	dependencies {
425 426
		compile(project(":spring-core"))
		compile(files(project(":spring-core").cglibRepackJar))
427
		optional("javax.inject:javax.inject:1")
428
		optional("javax.el:javax.el-api:${elApiVersion}")
429
		optional("org.yaml:snakeyaml:${snakeyamlVersion}")
430
		testCompile("org.apache.tomcat.embed:tomcat-embed-core:${tomcatVersion}")
J
Juergen Hoeller 已提交
431
	}
C
Chris Beams 已提交
432 433
}

434 435
project("spring-beans-groovy") {
	description "Groovy Bean Definitions"
J
Juergen Hoeller 已提交
436
	merge.into = project(":spring-beans")
437
	apply plugin: "groovy"
J
Juergen Hoeller 已提交
438 439 440

	dependencies {
		compile(project(":spring-core"))
441
		optional("org.codehaus.groovy:groovy-all:${groovyVersion}")
J
Juergen Hoeller 已提交
442 443 444 445 446 447 448
	}

	// this module's Java and Groovy sources need to be compiled together
	compileJava.enabled=false
	sourceSets {
		main {
			groovy {
449
				srcDir "src/main/java"
J
Juergen Hoeller 已提交
450 451 452
			}
		}
	}
453 454

	compileGroovy {
455 456
		sourceCompatibility = 1.8
		targetCompatibility = 1.8
457
	}
J
Juergen Hoeller 已提交
458 459
}

P
Phillip Webb 已提交
460 461
project("spring-aop") {
	description = "Spring AOP"
462

463
	dependencies {
464
		compile(project(":spring-beans"))
465 466
		compile(project(":spring-core"))
		compile(files(project(":spring-core").cglibRepackJar))
467
		compile(files(project(":spring-core").objenesisRepackJar))
468
		optional("org.aspectj:aspectjweaver:${aspectjVersion}")
469
		optional("org.apache.commons:commons-pool2:2.4.2")
470
		optional("com.jamonapi:jamon:2.81")
471
	}
C
Chris Beams 已提交
472 473
}

P
Phillip Webb 已提交
474 475
project("spring-expression") {
	description = "Spring Expression Language (SpEL)"
476

477
	dependencies {
478
		compile(project(":spring-core"))
479
	}
C
Chris Beams 已提交
480 481
}

P
Phillip Webb 已提交
482 483
project("spring-instrument") {
	description = "Spring Instrument"
484

485
	jar {
P
Phillip Webb 已提交
486 487
		manifest.attributes["Premain-Class"] =
			"org.springframework.instrument.InstrumentationSavingAgent"
488 489
		manifest.attributes["Agent-Class"] =
			"org.springframework.instrument.InstrumentationSavingAgent"
490 491 492
		manifest.attributes["Can-Redefine-Classes"] = "true"
		manifest.attributes["Can-Retransform-Classes"] = "true"
		manifest.attributes["Can-Set-Native-Method-Prefix"] = "false"
493
	}
C
Chris Beams 已提交
494 495
}

P
Phillip Webb 已提交
496 497
project("spring-context") {
	description = "Spring Context"
498
	apply plugin: "groovy"
499

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

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

	dependencies {
		compile(project(":spring-beans"))
		compile(project(":spring-core"))
538 539
		optional("javax.xml.bind:jaxb-api:${jaxbVersion}")
		optional("javax.activation:activation:${activationApiVersion}")
540 541 542 543 544 545 546 547 548 549 550
		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")
551
		testCompile("org.codehaus.jettison:jettison:1.3.8") {
552 553
			exclude group: 'stax', module: 'stax-api'
		}
554
		testCompile("org.xmlunit:xmlunit-matchers:${xmlunitVersion}")
555 556
        testCompile(files(genCastor.classesDir).builtBy(genCastor))
        testCompile(files(genJaxb.classesDir).builtBy(genJaxb))
557 558 559
		testRuntime("xerces:xercesImpl:2.11.0")  // for Castor
		testRuntime("com.sun.xml.bind:jaxb-core:${jaxbVersion}")
		testRuntime("com.sun.xml.bind:jaxb-impl:${jaxbVersion}")
560
	}
561 562 563 564 565 566 567 568 569
}

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

	dependencies {
		compile(project(":spring-beans"))
		compile(project(":spring-core"))
		compile(project(":spring-context"))
570
		optional(project(":spring-oxm"))
571
		optional("io.projectreactor:reactor-core:${reactorVersion}") {
572
			force = true  // enforce 2.0.x
573
		}
S
Stephane Maldini 已提交
574
		optional("io.projectreactor:reactor-net:${reactorVersion}") {
575 576
			exclude group: "io.netty", module: "netty-all"
		}
577
		optional("io.netty:netty-all:${nettyVersion}")
B
Brian Clozel 已提交
578
		optional("org.eclipse.jetty.websocket:websocket-server:${jettyVersion}") {
B
Brian Clozel 已提交
579 580
			exclude group: "javax.servlet", module: "javax.servlet-api"
		}
B
Brian Clozel 已提交
581
		optional("org.eclipse.jetty.websocket:websocket-client:${jettyVersion}")
582
		optional("com.fasterxml.jackson.core:jackson-databind:${jackson2Version}")
583
		optional("javax.xml.bind:jaxb-api:${jaxbVersion}")
584
		testCompile("javax.inject:javax.inject-tck:1")
585
		testCompile("javax.servlet:javax.servlet-api:${servletVersion}")
J
Juergen Hoeller 已提交
586
		testCompile("javax.validation:validation-api:${beanvalVersion}")
587
		testCompile("com.thoughtworks.xstream:xstream:${xstreamVersion}")
588 589 590 591 592
		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 已提交
593
		testCompile("org.eclipse.jetty:jetty-webapp:${jettyVersion}") {
B
Brian Clozel 已提交
594
			exclude group: "javax.servlet", module: "javax.servlet-api"
595
		}
596 597
		testCompile("org.apache.tomcat.embed:tomcat-embed-core:${tomcatVersion}")
		testCompile("org.apache.tomcat.embed:tomcat-embed-websocket:${tomcatVersion}")
598
		testCompile("io.netty:netty-all:${nettyVersion}")
599
		testCompile("org.xmlunit:xmlunit-matchers:${xmlunitVersion}")
600 601
		testCompile("org.slf4j:slf4j-jcl:${slf4jVersion}")
		testRuntime("javax.activation:activation:${activationApiVersion}")
602 603
		testRuntime("com.sun.xml.bind:jaxb-core:${jaxbVersion}")
		testRuntime("com.sun.xml.bind:jaxb-impl:${jaxbVersion}")
604
	}
605 606 607 608 609

	if (JavaVersion.current().java9Compatible) {
		// Reactor2TcpClient's use of Netty requires access to sun.nio.ch.SelectorImpl
		test.jvmArgs(["--add-exports", "java.base/sun.nio.ch=ALL-UNNAMED"])
	}
C
Chris Beams 已提交
610 611
}

P
Phillip Webb 已提交
612 613
project("spring-tx") {
	description = "Spring Transaction"
614

615
	dependencies {
616 617
		compile(project(":spring-beans"))
		compile(project(":spring-core"))
618
		optional(project(":spring-aop"))
619
		optional(project(":spring-context"))  // for JCA, @EnableTransactionManagement
620
		optional("javax.transaction:javax.transaction-api:${jtaVersion}")
J
Juergen Hoeller 已提交
621
		optional("javax.resource:javax.resource-api:${jcaVersion}")
622
		optional("javax.ejb:javax.ejb-api:${ejbApiVersion}")
S
Stephane Nicoll 已提交
623
		optional("javax.interceptor:javax.interceptor-api:${interceptorApiVersion}")
624
		optional("com.ibm.websphere:uow:6.0.2.17")
625
		testCompile("org.aspectj:aspectjweaver:${aspectjVersion}")
J
Juergen Hoeller 已提交
626
		testCompile("org.eclipse.persistence:javax.persistence:${jpaVersion}")
627
		testCompile("org.codehaus.groovy:groovy-all:${groovyVersion}")
628
	}
C
Chris Beams 已提交
629 630
}

P
Phillip Webb 已提交
631 632
project("spring-jms") {
	description = "Spring JMS"
633

634
	dependencies {
635 636 637 638
		compile(project(":spring-core"))
		compile(project(":spring-beans"))
		compile(project(":spring-aop"))
		compile(project(":spring-context"))
639
		compile(project(":spring-messaging"))
640
		compile(project(":spring-tx"))
641
		provided("javax.jms:javax.jms-api:${jmsVersion}")
642
		optional(project(":spring-oxm"))
643
		optional("javax.transaction:javax.transaction-api:${jtaVersion}")
J
Juergen Hoeller 已提交
644
		optional("javax.resource:javax.resource-api:${jcaVersion}")
645
		optional("com.fasterxml.jackson.core:jackson-databind:${jackson2Version}")
646
		testRuntime("javax.activation:activation:${activationApiVersion}")
647
	}
C
Chris Beams 已提交
648 649
}

P
Phillip Webb 已提交
650 651
project("spring-jdbc") {
	description = "Spring JDBC"
652

653
	dependencies {
654
		compile(project(":spring-beans"))
655
		compile(project(":spring-core"))
656
		compile(project(":spring-tx"))
657
		optional(project(":spring-context"))  // for JndiDataSourceLookup
658
		optional("javax.transaction:javax.transaction-api:${jtaVersion}")
659
		optional("com.mchange:c3p0:0.9.5.2")
P
Phillip Webb 已提交
660
		optional("org.hsqldb:hsqldb:${hsqldbVersion}")
661 662 663
		optional("com.h2database:h2:1.4.193")
		optional("org.apache.derby:derby:10.13.1.1")
		optional("org.apache.derby:derbyclient:10.13.1.1")
664
	}
C
Chris Beams 已提交
665 666
}

P
Phillip Webb 已提交
667 668
project("spring-context-support") {
	description = "Spring Context Support"
669

670
	dependencies {
671 672 673
		compile(project(":spring-core"))
		compile(project(":spring-beans"))
		compile(project(":spring-context"))
674 675
		optional(project(":spring-jdbc"))  // for Quartz support
		optional(project(":spring-tx"))  // for Quartz support
676
		optional("javax.activation:activation:${activationApiVersion}")
677
		optional("javax.mail:javax.mail-api:${javamailVersion}")
678
		optional("javax.cache:cache-api:${cacheApiVersion}")
B
Ben Manes 已提交
679
		optional("com.github.ben-manes.caffeine:caffeine:${caffeineVersion}")
680
		optional("net.sf.ehcache:ehcache:${ehcacheVersion}")
681
		optional("org.quartz-scheduler:quartz:${quartzVersion}")
682
		optional("org.codehaus.fabric3.api:commonj:1.1.0")
683
		optional("org.freemarker:freemarker:${freemarkerVersion}")
684
		optional("com.lowagie:itext:2.1.7")
685
		testCompile(project(":spring-context"))
686
		testCompile("org.apache.poi:poi:${poiVersion}")
P
Phillip Webb 已提交
687
		testCompile("org.hsqldb:hsqldb:${hsqldbVersion}")
688
		testCompile("org.slf4j:slf4j-api:${slf4jVersion}")
689
		testRuntime("com.sun.mail:javax.mail:${javamailVersion}")
690
		testRuntime("org.ehcache:jcache:${ehcachejcacheVersion}")
691
	}
C
Chris Beams 已提交
692 693
}

694 695 696 697 698 699 700 701 702 703 704
project("spring-context-indexer") {
	description = "Spring Context Indexer"

	dependencies {
		testCompile(project(":spring-context"))
		testCompile("javax.inject:javax.inject:1")
		testCompile("javax.annotation:javax.annotation-api:${annotationApiVersion}")
		testCompile("org.eclipse.persistence:javax.persistence:${jpaVersion}")
	}
}

P
Phillip Webb 已提交
705 706
project("spring-web") {
	description = "Spring Web"
707
	apply plugin: "groovy"
708

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

	if (JavaVersion.current().java9Compatible) {
		// Netty4ClientHttpRequestFactory requires access to sun.nio.ch.SelectorImpl
		test.jvmArgs(["--add-exports", "java.base/sun.nio.ch=ALL-UNNAMED"])
	}
789 790 791 792
}

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

794 795 796 797 798 799 800
	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}"
801
		optional("javax.xml.bind:jaxb-api:${jaxbVersion}")
802 803
		optional("com.fasterxml.jackson.core:jackson-databind:${jackson2Version}")
		optional("org.freemarker:freemarker:${freemarkerVersion}")
804
		optional "org.apache.httpcomponents:httpclient:${httpclientVersion}"
805
		optional('org.webjars:webjars-locator:0.32')
806 807 808 809 810
		optional("io.reactivex:rxnetty-http:${rxnettyVersion}") {
			exclude group: 'io.reactivex', module: 'rxjava'
		}
		optional("io.reactivex:rxjava:${rxjavaVersion}")
		optional("io.reactivex:rxjava-reactive-streams:${rxjavaAdapterVersion}")
811
		testCompile("io.projectreactor.addons:reactor-test:${reactorCoreVersion}")
812
		testCompile("javax.validation:validation-api:${beanvalVersion}")
R
Rossen Stoyanchev 已提交
813
		testCompile("org.hibernate:hibernate-validator:${hibval5Version}")
814 815 816 817
		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}")
818
		testCompile("io.projectreactor.ipc:reactor-netty:${reactorNettyVersion}")
S
Sebastien Deleuze 已提交
819
		testCompile "io.reactivex.rxjava2:rxjava:${rxjava2Version}"
820
		testCompile("io.undertow:undertow-core:${undertowVersion}")
821
		testCompile("org.jboss.xnio:xnio-api:${xnioVersion}")
822
		testCompile("com.fasterxml:aalto-xml:1.0.0")
823
		testCompile("org.xmlunit:xmlunit-matchers:${xmlunitVersion}")
824
		testCompile("org.slf4j:slf4j-jcl:${slf4jVersion}")
825 826
		testRuntime("javax.el:javax.el-api:${elApiVersion}")
		testRuntime("org.glassfish:javax.el:3.0.1-b08")
827 828 829
		testRuntime("com.sun.xml.bind:jaxb-core:${jaxbVersion}")
		testRuntime("com.sun.xml.bind:jaxb-impl:${jaxbVersion}")
		testRuntime("javax.activation:activation:${activationApiVersion}")
830
		testRuntime("org.jboss.xnio:xnio-nio:${xnioVersion}")
831
		testRuntime("org.jboss.logging:jboss-logging:3.3.0.Final")
832
		testRuntime("org.webjars:underscorejs:1.8.3")
833
	}
834 835 836 837 838

	if (JavaVersion.current().java9Compatible) {
		// ReactorClientHttpConnector requires access to sun.nio.ch.SelectorImpl
		test.jvmArgs(["--add-exports", "java.base/sun.nio.ch=ALL-UNNAMED"])
	}
C
Chris Beams 已提交
839 840
}

P
Phillip Webb 已提交
841 842
project("spring-orm") {
	description = "Spring Object/Relational Mapping"
843

844
	dependencies {
845 846 847 848 849 850 851
		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 已提交
852
		optional("org.eclipse.persistence:javax.persistence:${jpaVersion}")
853 854
		optional("org.eclipse.persistence:org.eclipse.persistence.core:${eclipselinkVersion}")
		optional("org.eclipse.persistence:org.eclipse.persistence.jpa:${eclipselinkVersion}") {
855 856
			exclude group: 'org.eclipse.persistence', module: 'javax.persistence'
		}
857
		optional("org.hibernate:hibernate-core:${hibernate5Version}")
858
		optional("javax.servlet:javax.servlet-api:${servletVersion}")
S
Sam Brannen 已提交
859
		testCompile("org.aspectj:aspectjweaver:${aspectjVersion}")
P
Phillip Webb 已提交
860
		testCompile("org.hsqldb:hsqldb:${hsqldbVersion}")
861
		testCompile("org.slf4j:slf4j-jcl:${slf4jVersion}")
862
		testRuntime("javax.xml.bind:jaxb-api:${jaxbVersion}")
863
	}
C
Chris Beams 已提交
864 865
}

P
Phillip Webb 已提交
866 867
project("spring-webmvc") {
	description = "Spring Web MVC"
868

869
	dependencies {
870
		compile(project(":spring-aop"))
871 872
		compile(project(":spring-beans"))
		compile(project(":spring-context"))
873
		compile(project(":spring-core"))
874
		compile(files(project(":spring-core").objenesisRepackJar))
875 876
		compile(project(":spring-expression"))
		compile(project(":spring-web"))
877
		provided("javax.servlet:javax.servlet-api:${servletVersion}")
878
		optional(project(":spring-context-support"))  // for FreeMarker support
879
		optional(project(":spring-oxm"))  // for MarshallingView
880
		optional("javax.servlet.jsp:javax.servlet.jsp-api:${jspVersion}")
881
		optional("javax.servlet.jsp.jstl:javax.servlet.jsp.jstl-api:1.2.1")
882
		optional("javax.xml.bind:jaxb-api:${jaxbVersion}")
883 884
		optional("org.apache.poi:poi:${poiVersion}")
		optional("org.apache.poi:poi-ooxml:${poiVersion}")
885
		optional("org.freemarker:freemarker:${freemarkerVersion}")
886
		optional("org.codehaus.groovy:groovy-all:${groovyVersion}")
887 888
		optional("com.lowagie:itext:2.1.7")
		optional("com.fasterxml.jackson.core:jackson-databind:${jackson2Version}")
889
		optional("com.fasterxml.jackson.dataformat:jackson-dataformat-xml:${jackson2Version}")
890 891
		optional("com.fasterxml.jackson.dataformat:jackson-dataformat-smile:${jackson2Version}")
		optional("com.fasterxml.jackson.dataformat:jackson-dataformat-cbor:${jackson2Version}")
892
		optional("com.rometools:rome:${romeVersion}")
893
		optional("javax.el:javax.el-api:${elApiVersion}")
894 895
		optional("org.apache.tiles:tiles-api:${tiles3Version}")
		optional("org.apache.tiles:tiles-core:${tiles3Version}") {
896 897
			exclude group: "org.slf4j", module: "jcl-over-slf4j"
		}
898
		optional("org.apache.tiles:tiles-servlet:${tiles3Version}") {
899 900
			exclude group: "org.slf4j", module: "jcl-over-slf4j"
		}
901
		optional("org.apache.tiles:tiles-jsp:${tiles3Version}") {
902 903
			exclude group: "org.slf4j", module: "jcl-over-slf4j"
		}
904
		optional("org.apache.tiles:tiles-el:${tiles3Version}") {
905 906
			exclude group: "org.slf4j", module: "jcl-over-slf4j"
		}
907
		optional("org.apache.tiles:tiles-extras:${tiles3Version}") {
908 909 910
			exclude group: "org.slf4j", module: "jcl-over-slf4j"
			exclude group: "org.springframework", module: "spring-web"
		}
911
		optional('org.webjars:webjars-locator:0.32')
912
		testCompile("org.xmlunit:xmlunit-matchers:${xmlunitVersion}")
913
		testCompile("dom4j:dom4j:1.6.1") {
P
Phillip Webb 已提交
914
			exclude group: "xml-apis", module: "xml-apis"
915 916
		}
		testCompile("jaxen:jaxen:1.1.1") {
P
Phillip Webb 已提交
917 918 919
			exclude group: "xml-apis", module: "xml-apis"
			exclude group: "xom", module: "xom"
			exclude group: "xerces", module: "xercesImpl"
920
		}
B
Brian Clozel 已提交
921
		testCompile("org.eclipse.jetty:jetty-servlet:${jettyVersion}") {
B
Brian Clozel 已提交
922
			exclude group: "javax.servlet", module: "javax.servlet"
923
		}
B
Brian Clozel 已提交
924
		testCompile("org.eclipse.jetty:jetty-server:${jettyVersion}") {
B
Brian Clozel 已提交
925
			exclude group: "javax.servlet", module: "javax.servlet"
926
		}
J
Juergen Hoeller 已提交
927
		testCompile("javax.validation:validation-api:${beanvalVersion}")
928
		testCompile("org.hibernate:hibernate-validator:${hibval5Version}")
929 930
		testCompile("org.apache.httpcomponents:httpclient:${httpclientVersion}")
		testCompile("commons-fileupload:commons-fileupload:${fileuploadVersion}")
931
		testCompile("commons-io:commons-io:1.3")
932
		testCompile("joda-time:joda-time:${jodaVersion}")
933
		testCompile("org.slf4j:slf4j-jcl:${slf4jVersion}")
934
		testCompile("org.mozilla:rhino:1.7.7.1")
935
		testRuntime("org.jruby:jruby:9.1.5.0")
936 937
		testRuntime("org.python:jython-standalone:2.5.3")
		testRuntime("org.webjars:underscorejs:1.8.3")
938
		testRuntime("org.glassfish:javax.el:3.0.1-b08")
939 940 941
		testRuntime("com.sun.xml.bind:jaxb-core:${jaxbVersion}")
		testRuntime("com.sun.xml.bind:jaxb-impl:${jaxbVersion}")
		testRuntime("javax.activation:activation:${activationApiVersion}")
942 943 944
	}
}

945 946 947 948 949 950 951 952 953
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"))
954 955
		optional("javax.servlet:javax.servlet-api:${servletVersion}")
		optional("javax.websocket:javax.websocket-api:${websocketVersion}")
956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979
		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"
		}
980
		optional("org.jboss.xnio:xnio-api:${xnioVersion}")
981 982 983
		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}")
984
		testCompile("io.projectreactor:reactor-core:${reactorVersion}") {
985
			force = true  // enforce 2.0.x
986
		}
987 988 989
		testCompile("io.projectreactor:reactor-net:${reactorVersion}")
		testCompile("io.netty:netty-all:${nettyVersion}")
		testCompile("org.slf4j:slf4j-jcl:${slf4jVersion}")
990
		testRuntime("org.jboss.xnio:xnio-nio:${xnioVersion}")
991
		testRuntime("org.jboss.logging:jboss-logging:3.3.0.Final")
992
	}
993 994 995 996 997

	if (JavaVersion.current().java9Compatible) {
		// Reactor2TcpClient's use of Netty requires access to sun.nio.ch.SelectorImpl
		test.jvmArgs(["--add-exports", "java.base/sun.nio.ch=ALL-UNNAMED"])
	}
998 999
}

P
Phillip Webb 已提交
1000 1001
project("spring-test") {
	description = "Spring TestContext Framework"
1002

1003
	dependencies {
1004
		compile(project(":spring-core"))
1005 1006 1007 1008 1009 1010 1011
		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"))
1012
		optional(project(":spring-websocket"))
1013
		optional("junit:junit:${junitVersion}")
1014
		optional("org.junit.jupiter:junit-jupiter-api:${junitJupiterVersion}")
1015
		optional("org.testng:testng:${testngVersion}")
1016
		optional("javax.inject:javax.inject:1")
1017 1018
		optional("javax.servlet:javax.servlet-api:${servletVersion}")
		optional("javax.servlet.jsp:javax.servlet.jsp-api:${jspVersion}")
1019 1020 1021 1022
		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"
		}
1023
		optional("javax.el:javax.el-api:${elApiVersion}")
1024
		optional("javax.websocket:javax.websocket-api:${websocketVersion}")
1025 1026
		optional("javax.activation:activation:${activationApiVersion}")
		optional("javax.xml.bind:jaxb-api:${jaxbVersion}")
1027
		optional("org.aspectj:aspectjweaver:${aspectjVersion}")
S
Sam Brannen 已提交
1028
		optional("org.codehaus.groovy:groovy-all:${groovyVersion}")
1029
		optional("org.hamcrest:hamcrest-core:${hamcrestVersion}")
1030
		optional("org.xmlunit:xmlunit-matchers:${xmlunitVersion}")
1031 1032 1033
		optional("net.sourceforge.htmlunit:htmlunit:2.23")
		optional("org.seleniumhq.selenium:htmlunit-driver:2.23.2")
		optional("org.seleniumhq.selenium:selenium-java:3.0.1") {
1034 1035
			exclude group: "io.netty", module: "netty"
		}
1036
		optional("org.skyscreamer:jsonassert:1.4.0")
1037
		optional("com.jayway.jsonpath:json-path:2.2.0")
1038 1039
		optional("org.reactivestreams:reactive-streams:${reactivestreamsVersion}")
		optional("io.projectreactor:reactor-core:${reactorCoreVersion}")
1040 1041
		testCompile(project(":spring-context-support"))
		testCompile(project(":spring-oxm"))
1042
		testCompile("javax.mail:javax.mail-api:${javamailVersion}")
1043
		testCompile("javax.ejb:javax.ejb-api:${ejbApiVersion}")
S
Stephane Nicoll 已提交
1044
		testCompile("javax.interceptor:javax.interceptor-api:${interceptorApiVersion}")
1045
		testCompile("org.hibernate:hibernate-core:${hibernate5Version}")
1046
		testCompile("org.hibernate:hibernate-validator:${hibval5Version}")
1047 1048
		// Enable use of the JUnitPlatform Runner
		testCompile("org.junit.platform:junit-platform-runner:${junitPlatformVersion}")
1049
		testCompile("com.thoughtworks.xstream:xstream:${xstreamVersion}")
1050
		testCompile("com.fasterxml.jackson.core:jackson-databind:${jackson2Version}")
1051
		testCompile("com.rometools:rome:${romeVersion}")
1052 1053
		testCompile("org.apache.tiles:tiles-api:${tiles3Version}")
		testCompile("org.apache.tiles:tiles-core:${tiles3Version}") {
1054 1055
			exclude group: "org.slf4j", module: "jcl-over-slf4j"
		}
1056
		testCompile("org.apache.tiles:tiles-servlet:${tiles3Version}") {
1057 1058
			exclude group: "org.slf4j", module: "jcl-over-slf4j"
		}
1059
		testCompile("org.hsqldb:hsqldb:${hsqldbVersion}")
S
Sam Brannen 已提交
1060
		testCompile("org.slf4j:slf4j-jcl:${slf4jVersion}")
1061
		testCompile("org.apache.httpcomponents:httpclient:${httpclientVersion}")
1062
		testCompile("javax.cache:cache-api:${cacheApiVersion}")
1063
		testCompile('de.bechte.junit:junit-hierarchicalcontextrunner:4.12.1')
1064
		testRuntime("org.junit.jupiter:junit-jupiter-engine:${junitJupiterVersion}")
1065
		testRuntime("org.apache.logging.log4j:log4j-jul:${log4jVersion}")  // Java Util Logging for JUnit 5
1066
		testRuntime("org.ehcache:ehcache:${ehcache3Version}")
J
Juergen Hoeller 已提交
1067
		testRuntime("org.terracotta:management-model:2.0.0")
1068 1069
		testRuntime("javax.el:javax.el-api:${elApiVersion}")
		testRuntime("org.glassfish:javax.el:3.0.1-b08")
1070 1071
		testRuntime("com.sun.xml.bind:jaxb-core:${jaxbVersion}")
		testRuntime("com.sun.xml.bind:jaxb-impl:${jaxbVersion}")
1072
	}
1073 1074

	task testNG(type: Test) {
1075
		description = 'Runs TestNG tests.'
1076
		useTestNG()
1077
		scanForTestClasses = false
1078 1079
		include(["**/testng/**/*Tests.class", "**/testng/**/*Test.class"])
		// Show STD_OUT & STD_ERR of the test JVM(s) on the console:
1080
		// testLogging.showStandardStreams = true
1081
		// forkEvery 1
1082
		reports.junitXml.destination = file("$buildDir/test-results")
1083 1084 1085
	}

	test {
1086
		description = 'Runs JUnit tests.'
1087 1088
		dependsOn testNG
		useJUnit()
1089 1090 1091
		scanForTestClasses = false
		include(['**/*Tests.class', '**/*Test.class', '**/SpringJUnitJupiterTestSuite.class'])
		exclude(['**/testng/**/*.*'])
1092 1093
		// Java Util Logging for JUnit 5.
		// systemProperty('java.util.logging.manager', 'org.apache.logging.log4j.jul.LogManager')
1094
		reports.junitXml.destination = file("$buildDir/test-results")
1095
	}
1096 1097

	task aggregateTestReports(type: TestReport) {
1098
		description = 'Aggregates JUnit and TestNG test reports.'
1099 1100 1101 1102 1103
		destinationDir = test.reports.html.destination
		reportOn test, testNG
	}

	check.dependsOn aggregateTestReports
C
Chris Beams 已提交
1104 1105
}

P
Phillip Webb 已提交
1106 1107 1108
project("spring-aspects") {
	description = "Spring Aspects"
	apply from: "aspects.gradle"
1109

1110
	dependencies {
1111
		aspects(project(":spring-orm"))
1112 1113 1114
		ajc("org.aspectj:aspectjtools:${aspectjVersion}")
		rt("org.aspectj:aspectjrt:${aspectjVersion}")
		compile("org.aspectj:aspectjweaver:${aspectjVersion}")
J
Juergen Hoeller 已提交
1115
		provided("org.eclipse.persistence:javax.persistence:${jpaVersion}")
1116 1117 1118 1119 1120 1121
		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
1122
		optional("javax.transaction:javax.transaction-api:${jtaVersion}")  // for @javax.transaction.Transactional support
1123
		optional("javax.cache:cache-api:${cacheApiVersion}")
1124
		testCompile(project(":spring-core"))  // for CodeStyleAspect
1125
		testCompile(project(":spring-test"))
1126
		testCompile("javax.mail:javax.mail-api:${javamailVersion}")
1127
	}
1128

1129
	eclipse.project {
P
Phillip Webb 已提交
1130
		natures += "org.eclipse.ajdt.ui.ajnature"
1131
		buildCommands = [new org.gradle.plugins.ide.eclipse.model.BuildCommand("org.eclipse.ajdt.core.ajbuilder")]
1132
	}
C
Chris Beams 已提交
1133 1134
}

1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169
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)
										}
									}
								}
							}
						}
					}
				}
			}
		}
	}
}

1170 1171
sonarqube {
	properties {
S
Stephane Nicoll 已提交
1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183
		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"
	}
}

1184
configure(rootProject) {
P
Phillip Webb 已提交
1185
	description = "Spring Framework"
1186

B
Brian Clozel 已提交
1187
	apply plugin: "org.asciidoctor.convert"
1188
	apply plugin: "docbook-reference"
1189
	apply plugin: "groovy"
R
Rob Winch 已提交
1190

1191
	// apply plugin: "detect-split-packages"
1192 1193
	apply from: "${gradleScriptDir}/jdiff.gradle"

R
Rob Winch 已提交
1194
	asciidoctor {
B
Brian Clozel 已提交
1195 1196
		sourceDir project.file('src/asciidoc')
		separateOutputDirs = false
1197
		backends = ['docbook']
B
Brian Clozel 已提交
1198
		options doctype: 'book', eruby: 'erubis'
J
Juergen Hoeller 已提交
1199
		attributes 'spring-version': project.version, 'revnumber': project.version, 'docinfo': ""
1200 1201
	}

1202 1203 1204
	reference {
		sourceDir = asciidoctor.outputDir
		pdfFilename = "spring-framework-reference.pdf"
1205
		epubFilename = "spring-framework-reference.epub"
1206 1207 1208 1209 1210 1211 1212
		expandPlaceholders = ""
	}

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

1213 1214 1215 1216 1217
	// 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")
	// }
1218

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

1222
	dependencies {  // for integration tests
1223
		testCompile(project(":spring-aop"))
1224
		testCompile(project(":spring-beans"))
1225
		testCompile(project(":spring-context"))
1226 1227
		testCompile(project(":spring-core"))
		testCompile(project(":spring-expression"))
1228
		testCompile(project(":spring-jdbc"))
1229
		testCompile(project(":spring-orm"))
1230
		testCompile(project(":spring-test"))
1231
		testCompile(project(":spring-tx"))
1232
		testCompile(project(":spring-web"))
1233
		testCompile("javax.servlet:javax.servlet-api:${servletVersion}")
1234
		testCompile("javax.inject:javax.inject:1")
J
Juergen Hoeller 已提交
1235
		testCompile("javax.resource:javax.resource-api:${jcaVersion}")
1236
		testCompile("org.aspectj:aspectjweaver:${aspectjVersion}")
1237
		testCompile("org.hibernate:hibernate-core:${hibernate5Version}")
P
Phillip Webb 已提交
1238
		testCompile("org.hsqldb:hsqldb:${hsqldbVersion}")
1239 1240 1241
	}

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

1246 1247 1248 1249 1250
		dependsOn {
			subprojects.collect {
				it.tasks.getByName("jar")
			}
		}
1251 1252 1253
		options.memberLevel = org.gradle.external.javadoc.JavadocMemberLevel.PROTECTED
		options.author = true
		options.header = rootProject.description
P
Phillip Webb 已提交
1254
		options.overview = "src/api/overview.html"
1255
		options.stylesheetFile = file("src/api/stylesheet.css")
1256
		options.splitIndex = true
C
Chris Beams 已提交
1257
		options.links(project.ext.javadocLinks)
1258
		options.addStringOption('Xdoclint:none', '-quiet')
C
Chris Beams 已提交
1259

1260 1261 1262
		source subprojects.collect { project ->
			project.sourceSets.main.allJava
		}
C
Chris Beams 已提交
1263

P
Phillip Webb 已提交
1264
		maxMemory = "1024m"
C
Chris Beams 已提交
1265
		destinationDir = new File(buildDir, "api")
1266 1267 1268

		doFirst {
			classpath = files(
1269 1270
                // ensure Servlet 3.x has precedence on the javadoc classpath
                project(":spring-webmvc").sourceSets.main.compileClasspath.files.find { it =~ "servlet-api" },
1271 1272 1273 1274 1275
				// 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 })
		}
1276 1277
	}

1278
	task docsZip(type: Zip, dependsOn: 'reference') {
P
Phillip Webb 已提交
1279 1280 1281
		group = "Distribution"
		baseName = "spring-framework"
		classifier = "docs"
1282 1283 1284
		description = "Builds -${classifier} archive containing api and reference " +
			"for deployment at http://static.springframework.org/spring-framework/docs."

P
Phillip Webb 已提交
1285 1286
		from("src/dist") {
			include "changelog.txt"
1287 1288 1289
		}

		from (api) {
1290
			into "javadoc-api"
1291 1292
		}

1293 1294
		from (reference) {
			into "spring-framework-reference"
1295 1296 1297 1298
		}
	}

	task schemaZip(type: Zip) {
P
Phillip Webb 已提交
1299 1300 1301
		group = "Distribution"
		baseName = "spring-framework"
		classifier = "schema"
1302 1303
		description = "Builds -${classifier} archive containing all " +
			"XSDs for deployment at http://springframework.org/schema."
S
Stephane Nicoll 已提交
1304
		duplicatesStrategy 'exclude'
1305
		moduleProjects.each { subproject ->
1306 1307 1308
			def Properties schemas = new Properties();

			subproject.sourceSets.main.resources.find {
P
Phillip Webb 已提交
1309
				it.path.endsWith("META-INF/spring.schemas")
1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326
			}?.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 已提交
1327 1328 1329
		group = "Distribution"
		baseName = "spring-framework"
		classifier = "dist"
1330
		description = "Builds -${classifier} archive, containing all jars and docs, " +
J
Juergen Hoeller 已提交
1331
			"suitable for community download page."
1332 1333 1334

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

P
Phillip Webb 已提交
1335 1336 1337 1338
		from("src/dist") {
			include "readme.txt"
			include "license.txt"
			include "notice.txt"
1339
			into "${baseDir}"
P
Phillip Webb 已提交
1340
			expand(copyright: new Date().format("yyyy"), version: project.version)
1341 1342 1343 1344 1345 1346 1347 1348 1349 1350
		}

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

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

1351
		moduleProjects.each { subproject ->
1352 1353
			into ("${baseDir}/libs") {
				from subproject.jar
P
Phillip Webb 已提交
1354
				if (subproject.tasks.findByPath("sourcesJar")) {
1355 1356
					from subproject.sourcesJar
				}
P
Phillip Webb 已提交
1357
				if (subproject.tasks.findByPath("javadocJar")) {
1358 1359 1360 1361 1362 1363
					from subproject.javadocJar
				}
			}
		}
	}

1364
	// Create a distribution that contains all dependencies (required and optional).
1365 1366
	// Not published by default; only for use when building from source.
	task depsZip(type: Zip, dependsOn: distZip) { zipTask ->
P
Phillip Webb 已提交
1367 1368 1369
		group = "Distribution"
		baseName = "spring-framework"
		classifier = "dist-with-deps"
1370 1371 1372 1373 1374 1375 1376 1377 1378 1379
		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 ->
1380 1381
					(subproject.configurations.runtime.resolvedConfiguration.resolvedArtifacts +
					subproject.configurations.optional.resolvedConfiguration.resolvedArtifacts).each { artifact ->
1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402
						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 已提交
1403
		description = "Generates gradlew[.bat] scripts"
S
Sam Brannen 已提交
1404
		gradleVersion = '3.0'
1405 1406

		doLast() {
1407
			def gradleOpts = "-XX:MaxMetaspaceSize=1024m -Xmx1024m"
1408
			def gradleBatOpts = "$gradleOpts -XX:MaxHeapSize=256m"
P
Phillip Webb 已提交
1409
			File wrapperFile = file("gradlew")
1410 1411
			wrapperFile.text = wrapperFile.text.replace("DEFAULT_JVM_OPTS=",
				"GRADLE_OPTS=\"$gradleOpts \$GRADLE_OPTS\"\nDEFAULT_JVM_OPTS=")
P
Phillip Webb 已提交
1412
			File wrapperBatFile = file("gradlew.bat")
1413 1414 1415 1416
			wrapperBatFile.text = wrapperBatFile.text.replace("set DEFAULT_JVM_OPTS=",
				"set GRADLE_OPTS=$gradleBatOpts %GRADLE_OPTS%\nset DEFAULT_JVM_OPTS=")
		}
	}
1417

1418
}
1419

S
Stephane Nicoll 已提交
1420
configure([project(':spring-build-src'), project(':spring-framework-bom')]) {
1421
	sonarqube {
S
Stephane Nicoll 已提交
1422 1423 1424 1425 1426
		skipProject = true
	}
}

configure(project(':spring-core')) {
1427 1428
	sonarqube {
		properties {
S
Stephane Nicoll 已提交
1429 1430 1431 1432 1433 1434
			property "sonar.exclusions",
					"src/main/java/org/springframework/cglib/**/*,src/main/java/org/springframework/asm/**/*"
		}
	}
}

1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445
/*
 * 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-")) {
1446
			return version.replace('BUILD', qualifier)
1447 1448
		}
	}
1449
	return version
1450
}