build.gradle 54.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")
S
Sebastien Deleuze 已提交
8
		classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.0.5-2"
9
		classpath("io.spring.gradle:docbook-reference-plugin:0.3.1")
10
	}
11 12
}

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

104
	ext.gradleScriptDir = "${rootProject.projectDir}/gradle"
105

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

S
Stephane Nicoll 已提交
111 112 113 114 115
	configurations {
		sniffer
		javaApiSignature
	}

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

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

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

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

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

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

173
	repositories {
B
Brian Clozel 已提交
174
		maven { url "https://repo.spring.io/libs-release" }
175
		maven { url "https://repo.spring.io/milestone" }
R
Polish  
Rossen Stoyanchev 已提交
176
		maven { url "https://repo.spring.io/snapshot" } // reactor-netty 0.6 snapshots
177
	}
C
Chris Beams 已提交
178

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

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

	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
211

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

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

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

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

S
Stephane Nicoll 已提交
254 255 256 257 258
	configurations {
		jacoco
	}

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

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

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

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

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

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

		// 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
295 296
	}

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

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

	artifacts {
		archives sourcesJar
		archives javadocJar
	}
C
Chris Beams 已提交
312 313
}

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

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

	configurations.archives.artifacts.clear()
}

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

329 330
	// Disabled since Kotlin compiler does not support JDK 9 yet
	//apply plugin: "kotlin"
331

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

	configurations {
		jarjar
		cglib
342
		objenesis
343 344 345 346 347 348 349 350 351 352 353 354 355 356 357
	}

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

368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386
	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")
				}
			}
		}
	}

387
	dependencies {
388
		cglib("cglib:cglib:${cglibVersion}@jar")
389
		objenesis("org.objenesis:objenesis:${objenesisVersion}@jar")
390
		jarjar("com.googlecode.jarjar:jarjar:1.3")
391

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

	jar {
415
		// inline repackaged cglib classes directly into the spring-core jar
416 417
		dependsOn cglibRepackJar
		from(zipTree(cglibRepackJar.archivePath)) {
P
Phillip Webb 已提交
418
			include "org/springframework/cglib/**"
419
		}
420 421 422 423 424

		dependsOn objenesisRepackJar
		from(zipTree(objenesisRepackJar.archivePath)) {
			include "org/springframework/objenesis/**"
		}
425
	}
C
Chris Beams 已提交
426 427
}

P
Phillip Webb 已提交
428 429
project("spring-beans") {
	description = "Spring Beans"
430

431
	dependencies {
432 433
		compile(project(":spring-core"))
		compile(files(project(":spring-core").cglibRepackJar))
434
		optional("javax.inject:javax.inject:1")
435
		optional("javax.el:javax.el-api:${elApiVersion}")
436
		optional("org.yaml:snakeyaml:${snakeyamlVersion}")
437
		testCompile("org.apache.tomcat.embed:tomcat-embed-core:${tomcatVersion}")
J
Juergen Hoeller 已提交
438
	}
C
Chris Beams 已提交
439 440
}

441 442
project("spring-beans-groovy") {
	description "Groovy Bean Definitions"
J
Juergen Hoeller 已提交
443
	merge.into = project(":spring-beans")
444
	apply plugin: "groovy"
J
Juergen Hoeller 已提交
445 446 447

	dependencies {
		compile(project(":spring-core"))
448
		optional("org.codehaus.groovy:groovy-all:${groovyVersion}")
J
Juergen Hoeller 已提交
449 450 451 452 453 454 455
	}

	// this module's Java and Groovy sources need to be compiled together
	compileJava.enabled=false
	sourceSets {
		main {
			groovy {
456
				srcDir "src/main/java"
J
Juergen Hoeller 已提交
457 458 459
			}
		}
	}
460 461

	compileGroovy {
462 463
		sourceCompatibility = 1.8
		targetCompatibility = 1.8
464
	}
J
Juergen Hoeller 已提交
465 466
}

P
Phillip Webb 已提交
467 468
project("spring-aop") {
	description = "Spring AOP"
469

470
	dependencies {
471
		compile(project(":spring-beans"))
472 473
		compile(project(":spring-core"))
		compile(files(project(":spring-core").cglibRepackJar))
474
		compile(files(project(":spring-core").objenesisRepackJar))
475
		optional("org.aspectj:aspectjweaver:${aspectjVersion}")
476
		optional("org.apache.commons:commons-pool2:2.4.2")
477
		optional("com.jamonapi:jamon:2.81")
478
	}
C
Chris Beams 已提交
479 480
}

P
Phillip Webb 已提交
481 482
project("spring-expression") {
	description = "Spring Expression Language (SpEL)"
483

484
	dependencies {
485
		compile(project(":spring-core"))
486
	}
C
Chris Beams 已提交
487 488
}

P
Phillip Webb 已提交
489 490
project("spring-instrument") {
	description = "Spring Instrument"
491

492
	jar {
P
Phillip Webb 已提交
493 494
		manifest.attributes["Premain-Class"] =
			"org.springframework.instrument.InstrumentationSavingAgent"
495 496
		manifest.attributes["Agent-Class"] =
			"org.springframework.instrument.InstrumentationSavingAgent"
497 498 499
		manifest.attributes["Can-Redefine-Classes"] = "true"
		manifest.attributes["Can-Retransform-Classes"] = "true"
		manifest.attributes["Can-Set-Native-Method-Prefix"] = "false"
500
	}
C
Chris Beams 已提交
501 502
}

P
Phillip Webb 已提交
503 504
project("spring-context") {
	description = "Spring Context"
505
	apply plugin: "groovy"
506

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

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

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

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

573 574
	// Disabled since Kotlin compiler does not support JDK 9 yet
	//apply plugin: "kotlin"
S
Sebastien Deleuze 已提交
575

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

	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 已提交
622 623
}

P
Phillip Webb 已提交
624 625
project("spring-tx") {
	description = "Spring Transaction"
626

627
	dependencies {
628 629
		compile(project(":spring-beans"))
		compile(project(":spring-core"))
630
		optional(project(":spring-aop"))
631
		optional(project(":spring-context"))  // for JCA, @EnableTransactionManagement
632
		optional("javax.transaction:javax.transaction-api:${jtaVersion}")
J
Juergen Hoeller 已提交
633
		optional("javax.resource:javax.resource-api:${jcaVersion}")
634
		optional("javax.ejb:javax.ejb-api:${ejbApiVersion}")
S
Stephane Nicoll 已提交
635
		optional("javax.interceptor:javax.interceptor-api:${interceptorApiVersion}")
636
		optional("com.ibm.websphere:uow:6.0.2.17")
637
		testCompile("org.aspectj:aspectjweaver:${aspectjVersion}")
J
Juergen Hoeller 已提交
638
		testCompile("org.eclipse.persistence:javax.persistence:${jpaVersion}")
639
		testCompile("org.codehaus.groovy:groovy-all:${groovyVersion}")
640
	}
C
Chris Beams 已提交
641 642
}

P
Phillip Webb 已提交
643 644
project("spring-jms") {
	description = "Spring JMS"
645

646
	dependencies {
647 648 649 650
		compile(project(":spring-core"))
		compile(project(":spring-beans"))
		compile(project(":spring-aop"))
		compile(project(":spring-context"))
651
		compile(project(":spring-messaging"))
652
		compile(project(":spring-tx"))
653
		provided("javax.jms:javax.jms-api:${jmsVersion}")
654
		optional(project(":spring-oxm"))
655
		optional("javax.transaction:javax.transaction-api:${jtaVersion}")
J
Juergen Hoeller 已提交
656
		optional("javax.resource:javax.resource-api:${jcaVersion}")
657
		optional("com.fasterxml.jackson.core:jackson-databind:${jackson2Version}")
658
		testRuntime("javax.activation:activation:${activationApiVersion}")
659
	}
C
Chris Beams 已提交
660 661
}

P
Phillip Webb 已提交
662 663
project("spring-jdbc") {
	description = "Spring JDBC"
664

665
	dependencies {
666
		compile(project(":spring-beans"))
667
		compile(project(":spring-core"))
668
		compile(project(":spring-tx"))
669
		optional(project(":spring-context"))  // for JndiDataSourceLookup
670
		optional("javax.transaction:javax.transaction-api:${jtaVersion}")
671
		optional("com.mchange:c3p0:0.9.5.2")
P
Phillip Webb 已提交
672
		optional("org.hsqldb:hsqldb:${hsqldbVersion}")
673 674 675
		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")
676
	}
C
Chris Beams 已提交
677 678
}

P
Phillip Webb 已提交
679 680
project("spring-context-support") {
	description = "Spring Context Support"
681

682
	dependencies {
683 684 685
		compile(project(":spring-core"))
		compile(project(":spring-beans"))
		compile(project(":spring-context"))
686 687
		optional(project(":spring-jdbc"))  // for Quartz support
		optional(project(":spring-tx"))  // for Quartz support
688
		optional("javax.activation:activation:${activationApiVersion}")
689
		optional("javax.mail:javax.mail-api:${javamailVersion}")
690
		optional("javax.cache:cache-api:${cacheApiVersion}")
B
Ben Manes 已提交
691
		optional("com.github.ben-manes.caffeine:caffeine:${caffeineVersion}")
692
		optional("net.sf.ehcache:ehcache:${ehcacheVersion}")
693
		optional("org.quartz-scheduler:quartz:${quartzVersion}")
694
		optional("org.codehaus.fabric3.api:commonj:1.1.0")
695
		optional("org.freemarker:freemarker:${freemarkerVersion}")
696
		optional("com.lowagie:itext:2.1.7")
697
		testCompile(project(":spring-context"))
698
		testCompile("org.apache.poi:poi:${poiVersion}")
P
Phillip Webb 已提交
699
		testCompile("org.hsqldb:hsqldb:${hsqldbVersion}")
700
		testCompile("org.slf4j:slf4j-api:${slf4jVersion}")
701
		testRuntime("com.sun.mail:javax.mail:${javamailVersion}")
702
		testRuntime("org.ehcache:jcache:${ehcachejcacheVersion}")
703
	}
C
Chris Beams 已提交
704 705
}

706 707 708 709 710 711 712 713 714 715 716
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 已提交
717 718
project("spring-web") {
	description = "Spring Web"
S
Sebastien Deleuze 已提交
719

720
	apply plugin: "groovy"
721 722
	// Disabled since Kotlin compiler does not support JDK 9 yet
	//apply plugin: "kotlin"
723

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

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

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

811 812
	// Disabled since Kotlin compiler does not support JDK 9 yet
	//apply plugin: "kotlin"
S
Sebastien Deleuze 已提交
813

814 815 816 817 818 819 820
	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}"
821
		optional("javax.xml.bind:jaxb-api:${jaxbVersion}")
822 823
		optional("com.fasterxml.jackson.core:jackson-databind:${jackson2Version}")
		optional("org.freemarker:freemarker:${freemarkerVersion}")
824
		optional "org.apache.httpcomponents:httpclient:${httpclientVersion}"
825
		optional('org.webjars:webjars-locator:0.32')
826 827 828 829 830
		optional("io.reactivex:rxnetty-http:${rxnettyVersion}") {
			exclude group: 'io.reactivex', module: 'rxjava'
		}
		optional("io.reactivex:rxjava:${rxjavaVersion}")
		optional("io.reactivex:rxjava-reactive-streams:${rxjavaAdapterVersion}")
831
		testCompile("io.projectreactor.addons:reactor-test:${reactorCoreVersion}")
832
		testCompile("javax.validation:validation-api:${beanvalVersion}")
R
Rossen Stoyanchev 已提交
833
		testCompile("org.hibernate:hibernate-validator:${hibval5Version}")
834 835 836 837
		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}")
838
		testCompile("io.projectreactor.ipc:reactor-netty:${reactorNettyVersion}")
S
Sebastien Deleuze 已提交
839
		testCompile "io.reactivex.rxjava2:rxjava:${rxjava2Version}"
840
		testCompile("io.undertow:undertow-core:${undertowVersion}")
841
		testCompile("org.jboss.xnio:xnio-api:${xnioVersion}")
842
		testCompile("com.fasterxml:aalto-xml:1.0.0")
843
		testCompile("org.xmlunit:xmlunit-matchers:${xmlunitVersion}")
844
		testCompile("org.slf4j:slf4j-jcl:${slf4jVersion}")
S
Sebastien Deleuze 已提交
845 846
		testCompile("org.jetbrains.kotlin:kotlin-reflect:${kotlinVersion}")
		testCompile("org.jetbrains.kotlin:kotlin-stdlib:${kotlinVersion}")
847 848
		testRuntime("javax.el:javax.el-api:${elApiVersion}")
		testRuntime("org.glassfish:javax.el:3.0.1-b08")
849 850 851
		testRuntime("com.sun.xml.bind:jaxb-core:${jaxbVersion}")
		testRuntime("com.sun.xml.bind:jaxb-impl:${jaxbVersion}")
		testRuntime("javax.activation:activation:${activationApiVersion}")
852
		testRuntime("org.jboss.xnio:xnio-nio:${xnioVersion}")
853
		testRuntime("org.jboss.logging:jboss-logging:3.3.0.Final")
854
		testRuntime("org.webjars:underscorejs:1.8.3")
855
	}
856 857 858 859 860

	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 已提交
861 862
}

P
Phillip Webb 已提交
863 864
project("spring-orm") {
	description = "Spring Object/Relational Mapping"
865

866
	dependencies {
867 868 869 870 871 872 873
		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 已提交
874
		optional("org.eclipse.persistence:javax.persistence:${jpaVersion}")
875 876
		optional("org.eclipse.persistence:org.eclipse.persistence.core:${eclipselinkVersion}")
		optional("org.eclipse.persistence:org.eclipse.persistence.jpa:${eclipselinkVersion}") {
877 878
			exclude group: 'org.eclipse.persistence', module: 'javax.persistence'
		}
879
		optional("org.hibernate:hibernate-core:${hibernate5Version}")
880
		optional("javax.servlet:javax.servlet-api:${servletVersion}")
S
Sam Brannen 已提交
881
		testCompile("org.aspectj:aspectjweaver:${aspectjVersion}")
P
Phillip Webb 已提交
882
		testCompile("org.hsqldb:hsqldb:${hsqldbVersion}")
883
		testCompile("org.slf4j:slf4j-jcl:${slf4jVersion}")
884
		testRuntime("javax.xml.bind:jaxb-api:${jaxbVersion}")
885
	}
C
Chris Beams 已提交
886 887
}

P
Phillip Webb 已提交
888 889
project("spring-webmvc") {
	description = "Spring Web MVC"
890

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

967 968 969 970 971 972 973 974 975
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"))
976 977
		optional("javax.servlet:javax.servlet-api:${servletVersion}")
		optional("javax.websocket:javax.websocket-api:${websocketVersion}")
978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001
		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"
		}
1002
		optional("org.jboss.xnio:xnio-api:${xnioVersion}")
1003 1004 1005
		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}")
1006
		testCompile("io.projectreactor:reactor-core:${reactorVersion}") {
1007
			force = true  // enforce 2.0.x
1008
		}
1009 1010 1011
		testCompile("io.projectreactor:reactor-net:${reactorVersion}")
		testCompile("io.netty:netty-all:${nettyVersion}")
		testCompile("org.slf4j:slf4j-jcl:${slf4jVersion}")
1012
		testRuntime("org.jboss.xnio:xnio-nio:${xnioVersion}")
1013
		testRuntime("org.jboss.logging:jboss-logging:3.3.0.Final")
1014
	}
1015 1016 1017 1018 1019

	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"])
	}
1020 1021
}

P
Phillip Webb 已提交
1022 1023
project("spring-test") {
	description = "Spring TestContext Framework"
1024

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

	task testNG(type: Test) {
1097
		description = 'Runs TestNG tests.'
1098
		useTestNG()
1099
		scanForTestClasses = false
1100 1101
		include(["**/testng/**/*Tests.class", "**/testng/**/*Test.class"])
		// Show STD_OUT & STD_ERR of the test JVM(s) on the console:
1102
		// testLogging.showStandardStreams = true
1103
		// forkEvery 1
1104
		reports.junitXml.destination = file("$buildDir/test-results")
1105 1106 1107
	}

	test {
1108
		description = 'Runs JUnit tests.'
1109 1110
		dependsOn testNG
		useJUnit()
1111 1112 1113
		scanForTestClasses = false
		include(['**/*Tests.class', '**/*Test.class', '**/SpringJUnitJupiterTestSuite.class'])
		exclude(['**/testng/**/*.*'])
1114 1115
		// Java Util Logging for JUnit 5.
		// systemProperty('java.util.logging.manager', 'org.apache.logging.log4j.jul.LogManager')
1116
		reports.junitXml.destination = file("$buildDir/test-results")
1117
	}
1118 1119

	task aggregateTestReports(type: TestReport) {
1120
		description = 'Aggregates JUnit and TestNG test reports.'
1121 1122 1123 1124 1125
		destinationDir = test.reports.html.destination
		reportOn test, testNG
	}

	check.dependsOn aggregateTestReports
C
Chris Beams 已提交
1126 1127
}

P
Phillip Webb 已提交
1128 1129 1130
project("spring-aspects") {
	description = "Spring Aspects"
	apply from: "aspects.gradle"
1131

1132
	dependencies {
1133
		aspects(project(":spring-orm"))
1134 1135 1136
		ajc("org.aspectj:aspectjtools:${aspectjVersion}")
		rt("org.aspectj:aspectjrt:${aspectjVersion}")
		compile("org.aspectj:aspectjweaver:${aspectjVersion}")
J
Juergen Hoeller 已提交
1137
		provided("org.eclipse.persistence:javax.persistence:${jpaVersion}")
1138 1139 1140 1141 1142 1143
		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
1144
		optional("javax.transaction:javax.transaction-api:${jtaVersion}")  // for @javax.transaction.Transactional support
1145
		optional("javax.cache:cache-api:${cacheApiVersion}")
1146
		testCompile(project(":spring-core"))  // for CodeStyleAspect
1147
		testCompile(project(":spring-test"))
1148
		testCompile("javax.mail:javax.mail-api:${javamailVersion}")
1149
	}
1150

1151
	eclipse.project {
P
Phillip Webb 已提交
1152
		natures += "org.eclipse.ajdt.ui.ajnature"
1153
		buildCommands = [new org.gradle.plugins.ide.eclipse.model.BuildCommand("org.eclipse.ajdt.core.ajbuilder")]
1154
	}
C
Chris Beams 已提交
1155 1156
}

1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191
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)
										}
									}
								}
							}
						}
					}
				}
			}
		}
	}
}

1192 1193
sonarqube {
	properties {
S
Stephane Nicoll 已提交
1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205
		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"
	}
}

1206
configure(rootProject) {
P
Phillip Webb 已提交
1207
	description = "Spring Framework"
1208

B
Brian Clozel 已提交
1209
	apply plugin: "org.asciidoctor.convert"
1210
	apply plugin: "docbook-reference"
1211
	apply plugin: "groovy"
R
Rob Winch 已提交
1212

1213
	// apply plugin: "detect-split-packages"
1214 1215
	apply from: "${gradleScriptDir}/jdiff.gradle"

R
Rob Winch 已提交
1216
	asciidoctor {
B
Brian Clozel 已提交
1217 1218
		sourceDir project.file('src/asciidoc')
		separateOutputDirs = false
1219
		backends = ['docbook']
B
Brian Clozel 已提交
1220
		options doctype: 'book', eruby: 'erubis'
J
Juergen Hoeller 已提交
1221
		attributes 'spring-version': project.version, 'revnumber': project.version, 'docinfo': ""
1222 1223
	}

1224 1225 1226
	reference {
		sourceDir = asciidoctor.outputDir
		pdfFilename = "spring-framework-reference.pdf"
1227
		epubFilename = "spring-framework-reference.epub"
1228 1229 1230 1231 1232 1233 1234
		expandPlaceholders = ""
	}

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

1235 1236 1237 1238 1239
	// 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")
	// }
1240

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

1244
	dependencies {  // for integration tests
1245
		testCompile(project(":spring-aop"))
1246
		testCompile(project(":spring-beans"))
1247
		testCompile(project(":spring-context"))
1248 1249
		testCompile(project(":spring-core"))
		testCompile(project(":spring-expression"))
1250
		testCompile(project(":spring-jdbc"))
1251
		testCompile(project(":spring-orm"))
1252
		testCompile(project(":spring-test"))
1253
		testCompile(project(":spring-tx"))
1254
		testCompile(project(":spring-web"))
1255
		testCompile("javax.servlet:javax.servlet-api:${servletVersion}")
1256
		testCompile("javax.inject:javax.inject:1")
J
Juergen Hoeller 已提交
1257
		testCompile("javax.resource:javax.resource-api:${jcaVersion}")
1258
		testCompile("org.aspectj:aspectjweaver:${aspectjVersion}")
1259
		testCompile("org.hibernate:hibernate-core:${hibernate5Version}")
P
Phillip Webb 已提交
1260
		testCompile("org.hsqldb:hsqldb:${hsqldbVersion}")
1261 1262 1263
	}

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

1268 1269 1270 1271 1272
		dependsOn {
			subprojects.collect {
				it.tasks.getByName("jar")
			}
		}
1273 1274 1275
		options.memberLevel = org.gradle.external.javadoc.JavadocMemberLevel.PROTECTED
		options.author = true
		options.header = rootProject.description
P
Phillip Webb 已提交
1276
		options.overview = "src/api/overview.html"
1277
		options.stylesheetFile = file("src/api/stylesheet.css")
1278
		options.splitIndex = true
C
Chris Beams 已提交
1279
		options.links(project.ext.javadocLinks)
1280
		options.addStringOption('Xdoclint:none', '-quiet')
C
Chris Beams 已提交
1281

1282 1283 1284
		source subprojects.collect { project ->
			project.sourceSets.main.allJava
		}
C
Chris Beams 已提交
1285

P
Phillip Webb 已提交
1286
		maxMemory = "1024m"
C
Chris Beams 已提交
1287
		destinationDir = new File(buildDir, "api")
1288 1289 1290

		doFirst {
			classpath = files(
1291 1292
                // ensure Servlet 3.x has precedence on the javadoc classpath
                project(":spring-webmvc").sourceSets.main.compileClasspath.files.find { it =~ "servlet-api" },
1293 1294 1295 1296 1297
				// 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 })
		}
1298 1299
	}

1300
	task docsZip(type: Zip, dependsOn: 'reference') {
P
Phillip Webb 已提交
1301 1302 1303
		group = "Distribution"
		baseName = "spring-framework"
		classifier = "docs"
1304 1305 1306
		description = "Builds -${classifier} archive containing api and reference " +
			"for deployment at http://static.springframework.org/spring-framework/docs."

P
Phillip Webb 已提交
1307 1308
		from("src/dist") {
			include "changelog.txt"
1309 1310 1311
		}

		from (api) {
1312
			into "javadoc-api"
1313 1314
		}

1315 1316
		from (reference) {
			into "spring-framework-reference"
1317 1318 1319 1320
		}
	}

	task schemaZip(type: Zip) {
P
Phillip Webb 已提交
1321 1322 1323
		group = "Distribution"
		baseName = "spring-framework"
		classifier = "schema"
1324 1325
		description = "Builds -${classifier} archive containing all " +
			"XSDs for deployment at http://springframework.org/schema."
S
Stephane Nicoll 已提交
1326
		duplicatesStrategy 'exclude'
1327
		moduleProjects.each { subproject ->
1328 1329 1330
			def Properties schemas = new Properties();

			subproject.sourceSets.main.resources.find {
P
Phillip Webb 已提交
1331
				it.path.endsWith("META-INF/spring.schemas")
1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348
			}?.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 已提交
1349 1350 1351
		group = "Distribution"
		baseName = "spring-framework"
		classifier = "dist"
1352
		description = "Builds -${classifier} archive, containing all jars and docs, " +
J
Juergen Hoeller 已提交
1353
			"suitable for community download page."
1354 1355 1356

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

P
Phillip Webb 已提交
1357 1358 1359 1360
		from("src/dist") {
			include "readme.txt"
			include "license.txt"
			include "notice.txt"
1361
			into "${baseDir}"
P
Phillip Webb 已提交
1362
			expand(copyright: new Date().format("yyyy"), version: project.version)
1363 1364 1365 1366 1367 1368 1369 1370 1371 1372
		}

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

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

1373
		moduleProjects.each { subproject ->
1374 1375
			into ("${baseDir}/libs") {
				from subproject.jar
P
Phillip Webb 已提交
1376
				if (subproject.tasks.findByPath("sourcesJar")) {
1377 1378
					from subproject.sourcesJar
				}
P
Phillip Webb 已提交
1379
				if (subproject.tasks.findByPath("javadocJar")) {
1380 1381 1382 1383 1384 1385
					from subproject.javadocJar
				}
			}
		}
	}

1386
	// Create a distribution that contains all dependencies (required and optional).
1387 1388
	// Not published by default; only for use when building from source.
	task depsZip(type: Zip, dependsOn: distZip) { zipTask ->
P
Phillip Webb 已提交
1389 1390 1391
		group = "Distribution"
		baseName = "spring-framework"
		classifier = "dist-with-deps"
1392 1393 1394 1395 1396 1397 1398 1399 1400 1401
		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 ->
1402 1403
					(subproject.configurations.runtime.resolvedConfiguration.resolvedArtifacts +
					subproject.configurations.optional.resolvedConfiguration.resolvedArtifacts).each { artifact ->
1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424
						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 已提交
1425
		description = "Generates gradlew[.bat] scripts"
S
Sam Brannen 已提交
1426
		gradleVersion = '3.0'
1427 1428

		doLast() {
1429
			def gradleOpts = "-XX:MaxMetaspaceSize=1024m -Xmx1024m"
1430
			def gradleBatOpts = "$gradleOpts -XX:MaxHeapSize=256m"
P
Phillip Webb 已提交
1431
			File wrapperFile = file("gradlew")
1432 1433
			wrapperFile.text = wrapperFile.text.replace("DEFAULT_JVM_OPTS=",
				"GRADLE_OPTS=\"$gradleOpts \$GRADLE_OPTS\"\nDEFAULT_JVM_OPTS=")
P
Phillip Webb 已提交
1434
			File wrapperBatFile = file("gradlew.bat")
1435 1436 1437 1438
			wrapperBatFile.text = wrapperBatFile.text.replace("set DEFAULT_JVM_OPTS=",
				"set GRADLE_OPTS=$gradleBatOpts %GRADLE_OPTS%\nset DEFAULT_JVM_OPTS=")
		}
	}
1439

1440
}
1441

S
Stephane Nicoll 已提交
1442
configure([project(':spring-build-src'), project(':spring-framework-bom')]) {
1443
	sonarqube {
S
Stephane Nicoll 已提交
1444 1445 1446 1447 1448
		skipProject = true
	}
}

configure(project(':spring-core')) {
1449 1450
	sonarqube {
		properties {
S
Stephane Nicoll 已提交
1451 1452 1453 1454 1455 1456
			property "sonar.exclusions",
					"src/main/java/org/springframework/cglib/**/*,src/main/java/org/springframework/asm/**/*"
		}
	}
}

1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467
/*
 * 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-")) {
1468
			return version.replace('BUILD', qualifier)
1469 1470
		}
	}
1471
	return version
1472
}