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

13 14 15 16
plugins {
	id "org.sonarqube" version "1.1"
}

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.aspectjVersion       = "1.8.9"
J
Juergen Hoeller 已提交
35
	ext.beanvalVersion       = "1.1.0.Final"
36
	ext.caffeineVersion      = "2.3.1"
37
	ext.eclipselinkVersion   = "2.6.3"
38
	ext.ehcacheVersion       = "2.10.2"
39
	ext.ehcachejcacheVersion = "1.0.1"
40
	ext.ehcache3Version      = "3.1.0"
41
	ext.ejbVersion           = "3.0"
42
	ext.fileuploadVersion    = "1.3.2"
43
	ext.freemarkerVersion    = "2.3.23"
J
Juergen Hoeller 已提交
44
	ext.groovyVersion        = "2.4.7"
45
	ext.gsonVersion          = "2.7"
46
	ext.hamcrestVersion      = "1.3"
J
Juergen Hoeller 已提交
47
	ext.hibernate5Version    = "5.2.1.Final"
48
	ext.hibval5Version       = "5.2.4.Final"
49
	ext.hsqldbVersion        = "2.3.4"
50
	ext.httpasyncVersion     = "4.1.2"
51
	ext.httpclientVersion    = "4.5.2"
52
	ext.jackson2Version      = "2.8.0"
53
	ext.javamailVersion      = "1.5.5"
J
Juergen Hoeller 已提交
54
	ext.jcaVersion           = "1.7"
55
	ext.jettyVersion         = "9.3.10.v20160621"
56
	ext.jodaVersion          = "2.9.4"
J
Juergen Hoeller 已提交
57
	ext.jpaVersion           = "2.1.1"
58
	ext.jtaVersion           = "1.2"
J
Juergen Hoeller 已提交
59
	ext.junitVersion         = "4.12"
S
Sam Brannen 已提交
60 61
	ext.junitJupiterVersion  = '5.0.0-M1'
	ext.junitPlatformVersion = '1.0.0-M1'
62
	ext.log4jVersion         = '2.6.1'
63
	ext.nettyVersion         = "4.1.1.Final"
64
	ext.okhttpVersion        = "2.7.5"
65
	ext.okhttp3Version       = "3.3.1"
66
	ext.poiVersion           = "3.14"
R
Rossen Stoyanchev 已提交
67
	ext.reactorVersion       = "2.0.8.RELEASE"
68 69 70
	ext.reactorCoreVersion   = '2.5.0.BUILD-SNAPSHOT'
	ext.reactorNettyVersion  = '2.5.0.BUILD-SNAPSHOT'
	ext.rxJavaVersion        = '1.1.6'
71 72
	ext.romeVersion          = "1.6.0"
	ext.slf4jVersion         = "1.7.21"
73
	ext.snakeyamlVersion     = "1.17"
74
	ext.snifferVersion       = "1.15"
75
	ext.testngVersion        = "6.9.10"
76
	ext.tiles3Version        = "3.0.5"
77
	ext.tomcatVersion        = "8.5.3"
78
	ext.tyrusVersion         = "1.13"
79
	ext.undertowVersion      = "1.4.0.CR3"
80
	ext.xmlunitVersion       = "1.6"
J
Juergen Hoeller 已提交
81
	ext.xstreamVersion       = "1.4.9"
82

83
	ext.gradleScriptDir = "${rootProject.projectDir}/gradle"
84

85
	apply plugin: "propdeps"
P
Phillip Webb 已提交
86
	apply plugin: "java"
87
	apply plugin: "test-source-set-dependencies"
88
	apply from: "${gradleScriptDir}/ide.gradle"
C
Chris Beams 已提交
89

S
Stephane Nicoll 已提交
90 91 92 93 94
	configurations {
		sniffer
		javaApiSignature
	}

95 96 97 98 99 100 101 102 103 104 105 106
	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
			}
		}
	}

P
Phillip Webb 已提交
107 108 109
	compileJava.options*.compilerArgs = [
		"-Xlint:serial", "-Xlint:varargs", "-Xlint:cast", "-Xlint:classfile",
		"-Xlint:dep-ann", "-Xlint:divzero", "-Xlint:empty", "-Xlint:finally",
S
Stephane Nicoll 已提交
110
		"-Xlint:overrides", "-Xlint:path", "-Xlint:processing", "-Xlint:static",
P
Phillip Webb 已提交
111
		"-Xlint:try", "-Xlint:fallthrough", "-Xlint:rawtypes", "-Xlint:deprecation",
112
		"-Xlint:unchecked", "-Xlint:-options", "-Werror"
113
	]
C
Chris Beams 已提交
114

P
Phillip Webb 已提交
115
	compileTestJava.options*.compilerArgs = [
116
		"-Xlint:serial", "-Xlint:-varargs", "-Xlint:cast", "-Xlint:classfile",
P
Phillip Webb 已提交
117
		"-Xlint:dep-ann", "-Xlint:divzero", "-Xlint:empty", "-Xlint:finally",
S
Stephane Nicoll 已提交
118
		"-Xlint:overrides", "-Xlint:path", "-Xlint:processing", "-Xlint:static",
P
Phillip Webb 已提交
119 120 121
		"-Xlint:try", "-Xlint:-fallthrough", "-Xlint:-rawtypes", "-Xlint:-deprecation",
		"-Xlint:-unchecked", "-Xlint:-options"]

122
	compileJava {
123 124
		sourceCompatibility = 1.8
		targetCompatibility = 1.8
125 126 127
	}

	compileTestJava {
J
Juergen Hoeller 已提交
128 129
		sourceCompatibility = 1.8
		targetCompatibility = 1.8
130
		options.compilerArgs += "-parameters"
J
Juergen Hoeller 已提交
131 132
	}

C
Chris Beams 已提交
133 134
	test {
		systemProperty("java.awt.headless", "true")
135
		systemProperty("testGroups", project.properties.get("testGroups"))
136
		scanForTestClasses = false
137
		include(["**/*Tests.class", "**/*Test.class"])
138 139
		// Since we set scanForTestClasses to false, we need to filter out inner
		// classes with the "$" pattern; otherwise, using -Dtest.single=MyTests to
140
		// run MyTests by itself will fail if MyTests contains any inner classes.
141
		exclude(["**/Abstract*.class", '**/*$*'])
C
Chris Beams 已提交
142
	}
C
Chris Beams 已提交
143

144
	repositories {
B
Brian Clozel 已提交
145
		maven { url "https://repo.spring.io/libs-release" }
146 147
		maven { url 'https://oss.jfrog.org/libs-snapshot' }  // RxNetty 0.5.x snapshots
		maven { url 'http://repo.spring.io/snapshot' }       // Reactor snapshots
148
	}
C
Chris Beams 已提交
149

150
	dependencies {
151 152 153
		testCompile("junit:junit:${junitVersion}") {
			exclude group:'org.hamcrest', module:'hamcrest-core'
		}
154
		testCompile("org.mockito:mockito-core:1.10.19") {
155 156
			exclude group:'org.hamcrest', module:'hamcrest-core'
		}
157
		testCompile("org.hamcrest:hamcrest-all:${hamcrestVersion}")
158 159
		testRuntime("org.apache.logging.log4j:log4j-core:${log4jVersion}")
		testRuntime("org.apache.logging.log4j:log4j-jcl:${log4jVersion}")
160

S
Stephane Nicoll 已提交
161
		sniffer("org.codehaus.mojo:animal-sniffer-ant-tasks:${snifferVersion}")
162
		javaApiSignature("org.codehaus.mojo.signature:java18:1.0@signature")
S
Stephane Nicoll 已提交
163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181
	}

	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
182

S
Stephane Nicoll 已提交
183 184 185 186 187 188 189 190 191 192 193
		doLast {
			ant.taskdef(
				name: 'animalSniffer',
				classname: 'org.codehaus.mojo.animal_sniffer.ant.CheckSignatureTask',
				classpath: configurations.sniffer.asPath
			)

			ant.animalSniffer(
					signature: "$buildDir/javaApiSignature/javaApi.signature",
					classpath: sourceSets.main.compileClasspath.asPath) {
				path(path: sourceSets.main.output.classesDir)
194 195 196
				annotation(className: "org.springframework.lang.UsesJava7")
				annotation(className: "org.springframework.lang.UsesJava8")
				annotation(className: "org.springframework.lang.UsesSunHttpServer")
S
Stephane Nicoll 已提交
197 198
			}
		}
199
	}
C
Chris Beams 已提交
200 201

	ext.javadocLinks = [
202
		"http://docs.oracle.com/javase/8/docs/api/",
203
		"http://docs.oracle.com/javaee/7/api/",
204
		"http://docs.oracle.com/cd/E13222_01/wls/docs90/javadocs/",  // CommonJ
J
Juergen Hoeller 已提交
205 206
		"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 已提交
207 208
		"http://docs.jboss.org/jbossas/javadoc/4.0.5/connector/",
		"http://docs.jboss.org/jbossas/javadoc/7.1.2.Final/",
209
		"http://tiles.apache.org/tiles-request/apidocs/",
J
Juergen Hoeller 已提交
210
		"http://tiles.apache.org/framework/apidocs/",
C
Chris Beams 已提交
211
		"http://www.eclipse.org/aspectj/doc/released/aspectj5rt-api/",
B
Brian Clozel 已提交
212 213
		"http://ehcache.org/apidocs/${ehcacheVersion}",
		"http://ehcache.org/apidocs/${ehcache3Version}",
214
		"http://quartz-scheduler.org/api/2.2.1/",
B
Brian Clozel 已提交
215 216 217
		"http://fasterxml.github.io/jackson-core/javadoc/2.7/",
		"http://fasterxml.github.io/jackson-databind/javadoc/2.7/",
		"http://fasterxml.github.io/jackson-dataformat-xml/javadoc/2.7/",
218
		"http://hc.apache.org/httpcomponents-client-ga/httpclient/apidocs/"
C
Chris Beams 已提交
219
	] as String[]
220 221
}

222
configure(subprojects - project(":spring-build-src")) { subproject ->
223
	apply plugin: "merge"
224 225
	apply from: "${gradleScriptDir}/publish-maven.gradle"

S
Stephane Nicoll 已提交
226 227 228 229 230
	configurations {
		jacoco
	}

	dependencies {
231
		jacoco("org.jacoco:org.jacoco.agent:0.7.5.201505241946:runtime")
S
Stephane Nicoll 已提交
232 233 234
	}

	gradle.taskGraph.whenReady {taskGraph ->
235
		if (taskGraph.hasTask(':sonarqube')) {
S
Stephane Nicoll 已提交
236 237 238 239
			test.jvmArgs "-javaagent:${configurations.jacoco.asPath}=destfile=${buildDir}/jacoco.exec,includes=org.springframework.*"
		}
	}

240
	jar {
P
Phillip Webb 已提交
241 242 243 244
		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
245 246 247 248 249

		from("${rootProject.projectDir}/src/dist") {
			include "license.txt"
			include "notice.txt"
			into "META-INF"
P
Phillip Webb 已提交
250
			expand(copyright: new Date().format("yyyy"), version: project.version)
251 252 253 254
		}
	}

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

257 258 259
		options.memberLevel = org.gradle.external.javadoc.JavadocMemberLevel.PROTECTED
		options.author = true
		options.header = project.name
C
Chris Beams 已提交
260
		options.links(project.ext.javadocLinks)
261
		options.addStringOption('Xdoclint:none', '-quiet')
C
Chris Beams 已提交
262 263 264 265 266

		// 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
267 268
	}

269 270
	task sourcesJar(type: Jar, dependsOn: classes) {
		classifier = 'sources'
271
		from sourceSets.main.allSource
272
		// don't include or exclude anything explicitly by default. See SPR-12085.
273 274 275
	}

	task javadocJar(type: Jar) {
P
Phillip Webb 已提交
276
		classifier = "javadoc"
277 278 279 280 281 282 283
		from javadoc
	}

	artifacts {
		archives sourcesJar
		archives javadocJar
	}
C
Chris Beams 已提交
284 285
}

286 287
project("spring-build-src") {
	description = "Exposes gradle buildSrc for IDE support"
288
	apply plugin: "groovy"
289 290 291

	dependencies {
		compile gradleApi()
R
Rob Winch 已提交
292
		compile localGroovy()
293 294 295 296 297
	}

	configurations.archives.artifacts.clear()
}

P
Phillip Webb 已提交
298 299
project("spring-core") {
	description = "Spring Core"
300

301 302
	// 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
303
	// further transformed by the JarJar task to depend on org.springframework.asm; this
304
	// avoids including two different copies of asm unnecessarily.
J
Juergen Hoeller 已提交
305
	def cglibVersion = "3.2.4"
306
	def objenesisVersion = "2.4"
307 308 309 310

	configurations {
		jarjar
		cglib
311
		objenesis
312 313 314 315 316 317 318 319 320 321 322 323 324 325 326
	}

	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 已提交
327 328
					rule(pattern: "net.sf.cglib.**", result: "org.springframework.cglib.@1")
					// as mentioned above, transform cglib"s internal asm dependencies from
329 330
					// 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 已提交
331
					rule(pattern: "org.objectweb.asm.**", result: "org.springframework.asm.@1")
332 333 334 335 336
				}
			}
		}
	}

337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355
	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")
				}
			}
		}
	}

356
	dependencies {
357
		cglib("cglib:cglib:${cglibVersion}@jar")
358
		objenesis("org.objenesis:objenesis:${objenesisVersion}@jar")
359
		jarjar("com.googlecode.jarjar:jarjar:1.3")
360

P
Phillip Webb 已提交
361
		compile(files(cglibRepackJar))
362
		compile(files(objenesisRepackJar))
363
		compile("commons-logging:commons-logging:1.2")
364
		optional("org.aspectj:aspectjweaver:${aspectjVersion}")
365
		optional("net.sf.jopt-simple:jopt-simple:5.0.2")
366 367 368 369
		optional("org.reactivestreams:reactive-streams:1.0.0")
		optional("io.projectreactor:reactor-core:${reactorCoreVersion}")
		optional "io.reactivex:rxjava:${rxJavaVersion}"
		optional("io.netty:netty-buffer:${nettyVersion}")
370
		testCompile("org.apache.tomcat.embed:tomcat-embed-core:${tomcatVersion}")
371
		testCompile("xmlunit:xmlunit:${xmlunitVersion}")
372
		testCompile("com.fasterxml.woodstox:woodstox-core:5.0.2") {
P
Phillip Webb 已提交
373 374
			exclude group: "stax", module: "stax-api"
		}
375 376 377
	}

	jar {
378
		// inline repackaged cglib classes directly into the spring-core jar
379 380
		dependsOn cglibRepackJar
		from(zipTree(cglibRepackJar.archivePath)) {
P
Phillip Webb 已提交
381
			include "org/springframework/cglib/**"
382
		}
383 384 385 386 387

		dependsOn objenesisRepackJar
		from(zipTree(objenesisRepackJar.archivePath)) {
			include "org/springframework/objenesis/**"
		}
388
	}
C
Chris Beams 已提交
389 390
}

P
Phillip Webb 已提交
391 392
project("spring-beans") {
	description = "Spring Beans"
393

394
	dependencies {
395 396
		compile(project(":spring-core"))
		compile(files(project(":spring-core").cglibRepackJar))
397
		optional("javax.inject:javax.inject:1")
398
		optional("javax.el:javax.el-api:2.2.5")
399
		optional("org.yaml:snakeyaml:${snakeyamlVersion}")
400
		testCompile("org.apache.tomcat.embed:tomcat-embed-core:${tomcatVersion}")
J
Juergen Hoeller 已提交
401
	}
C
Chris Beams 已提交
402 403
}

404 405
project("spring-beans-groovy") {
	description "Groovy Bean Definitions"
J
Juergen Hoeller 已提交
406
	merge.into = project(":spring-beans")
407
	apply plugin: "groovy"
J
Juergen Hoeller 已提交
408 409 410

	dependencies {
		compile(project(":spring-core"))
411
		optional("org.codehaus.groovy:groovy-all:${groovyVersion}")
J
Juergen Hoeller 已提交
412 413 414 415 416 417 418
	}

	// this module's Java and Groovy sources need to be compiled together
	compileJava.enabled=false
	sourceSets {
		main {
			groovy {
419
				srcDir "src/main/java"
J
Juergen Hoeller 已提交
420 421 422
			}
		}
	}
423 424

	compileGroovy {
425 426
		sourceCompatibility = 1.8
		targetCompatibility = 1.8
427
	}
J
Juergen Hoeller 已提交
428 429
}

P
Phillip Webb 已提交
430 431
project("spring-aop") {
	description = "Spring AOP"
432

433
	dependencies {
434
		compile(project(":spring-beans"))
435 436
		compile(project(":spring-core"))
		compile(files(project(":spring-core").cglibRepackJar))
437
		compile(files(project(":spring-core").objenesisRepackJar))
438
		optional("org.aspectj:aspectjweaver:${aspectjVersion}")
439
		optional("org.apache.commons:commons-pool2:2.4.2")
440
		optional("com.jamonapi:jamon:2.81")
441
	}
C
Chris Beams 已提交
442 443
}

P
Phillip Webb 已提交
444 445
project("spring-expression") {
	description = "Spring Expression Language (SpEL)"
446

447
	dependencies {
448
		compile(project(":spring-core"))
449
	}
C
Chris Beams 已提交
450 451
}

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

455
	jar {
P
Phillip Webb 已提交
456 457
		manifest.attributes["Premain-Class"] =
			"org.springframework.instrument.InstrumentationSavingAgent"
458 459
		manifest.attributes["Agent-Class"] =
			"org.springframework.instrument.InstrumentationSavingAgent"
460 461 462
		manifest.attributes["Can-Redefine-Classes"] = "true"
		manifest.attributes["Can-Retransform-Classes"] = "true"
		manifest.attributes["Can-Set-Native-Method-Prefix"] = "false"
463
	}
C
Chris Beams 已提交
464 465
}

P
Phillip Webb 已提交
466 467
project("spring-context") {
	description = "Spring Context"
468
	apply plugin: "groovy"
469

470
	dependencies {
471 472 473 474 475
		compile(project(":spring-aop"))
		compile(project(":spring-beans"))
		compile(project(":spring-expression"))
		compile(project(":spring-core"))
		compile(files(project(":spring-core").cglibRepackJar))
476
		optional(project(":spring-instrument"))
477
		optional("javax.inject:javax.inject:1")
478
		optional("javax.ejb:ejb-api:${ejbVersion}")
479
		optional("javax.enterprise.concurrent:javax.enterprise.concurrent-api:1.0")
480
		optional("javax.money:money-api:1.0")
J
Juergen Hoeller 已提交
481 482
		optional("org.eclipse.persistence:javax.persistence:${jpaVersion}")
		optional("javax.validation:validation-api:${beanvalVersion}")
483
		optional("org.hibernate:hibernate-validator:${hibval5Version}")
484 485
		optional("joda-time:joda-time:${jodaVersion}")
		optional("org.aspectj:aspectjweaver:${aspectjVersion}")
J
Juergen Hoeller 已提交
486
		optional("org.codehaus.groovy:groovy-all:${groovyVersion}")
487
		optional("org.beanshell:bsh:2.0b4")
488
		testCompile("javax.inject:javax.inject-tck:1")
489 490
		testCompile("javax.el:javax.el-api:2.2.5")
		testCompile("org.glassfish.web:javax.el:2.2.6")
491
		testCompile("org.javamoney:moneta:1.1")
492
		testCompile("org.apache.commons:commons-pool2:2.4.2")
493
		testCompile("org.slf4j:slf4j-api:${slf4jVersion}")
494
	}
495 496 497 498 499 500 501 502 503
}

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

	dependencies {
		compile(project(":spring-beans"))
		compile(project(":spring-core"))
		compile(project(":spring-context"))
504
		optional(project(":spring-oxm"))
505 506 507
		optional("io.projectreactor:reactor-core:${reactorVersion}") {
			force = true // enforce 2.0.x
		}
S
Stephane Maldini 已提交
508
		optional("io.projectreactor:reactor-net:${reactorVersion}") {
509 510
			exclude group: "io.netty", module: "netty-all"
		}
511
		optional("io.netty:netty-all:${nettyVersion}")
B
Brian Clozel 已提交
512
		optional("org.eclipse.jetty.websocket:websocket-server:${jettyVersion}") {
B
Brian Clozel 已提交
513 514
			exclude group: "javax.servlet", module: "javax.servlet-api"
		}
B
Brian Clozel 已提交
515
		optional("org.eclipse.jetty.websocket:websocket-client:${jettyVersion}")
516
		optional("com.fasterxml.jackson.core:jackson-databind:${jackson2Version}")
517
		testCompile("javax.inject:javax.inject-tck:1")
518
		testCompile("javax.servlet:javax.servlet-api:3.1.0")
J
Juergen Hoeller 已提交
519
		testCompile("javax.validation:validation-api:${beanvalVersion}")
520
		testCompile("com.thoughtworks.xstream:xstream:${xstreamVersion}")
521 522 523 524 525
		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 已提交
526
		testCompile("org.eclipse.jetty:jetty-webapp:${jettyVersion}") {
B
Brian Clozel 已提交
527
			exclude group: "javax.servlet", module: "javax.servlet-api"
528
		}
529 530
		testCompile("org.apache.tomcat.embed:tomcat-embed-core:${tomcatVersion}")
		testCompile("org.apache.tomcat.embed:tomcat-embed-websocket:${tomcatVersion}")
531
		testCompile("io.netty:netty-all:${nettyVersion}")
532
		testCompile("org.slf4j:slf4j-jcl:${slf4jVersion}")
533
		testCompile("xmlunit:xmlunit:${xmlunitVersion}")
534
	}
C
Chris Beams 已提交
535 536
}

P
Phillip Webb 已提交
537 538
project("spring-tx") {
	description = "Spring Transaction"
539

540
	dependencies {
541 542
		compile(project(":spring-beans"))
		compile(project(":spring-core"))
543
		optional(project(":spring-aop"))
544
		optional(project(":spring-context"))  // for JCA, @EnableTransactionManagement
545
		optional("javax.transaction:javax.transaction-api:${jtaVersion}")
J
Juergen Hoeller 已提交
546
		optional("javax.resource:javax.resource-api:${jcaVersion}")
547
		optional("javax.ejb:ejb-api:${ejbVersion}")
548
		optional("com.ibm.websphere:uow:6.0.2.17")
549
		testCompile("org.aspectj:aspectjweaver:${aspectjVersion}")
J
Juergen Hoeller 已提交
550
		testCompile("org.eclipse.persistence:javax.persistence:${jpaVersion}")
551
		testCompile("org.codehaus.groovy:groovy-all:${groovyVersion}")
552
	}
C
Chris Beams 已提交
553 554
}

P
Phillip Webb 已提交
555 556 557
project("spring-oxm") {
	description = "Spring Object/XML Marshalling"
	apply from: "oxm.gradle"
558

P
Phillip Webb 已提交
559
	compileTestJava {
560 561
		// necessary to avoid java.lang.VerifyError on jibx compilation
		// see http://jira.codehaus.org/browse/JIBX-465
562 563
		sourceCompatibility = 1.8
		targetCompatibility = 1.8
564 565
	}

566
	dependencies {
567 568
		compile(project(":spring-beans"))
		compile(project(":spring-core"))
569
		optional("org.codehaus.castor:castor-xml:1.4.1")  {
570
			exclude group: 'stax', module: 'stax-api'
571
			exclude group: "org.springframework", module: "spring-context"
572 573 574 575 576
		}
		optional("com.thoughtworks.xstream:xstream:${xstreamVersion}") {
			exclude group: 'xpp3', module: 'xpp3_min'
			exclude group: 'xmlpull', module: 'xmlpull'
		}
577
		optional("org.jibx:jibx-run:1.2.6")
578
		testCompile(project(":spring-context"))
579
		testCompile("xmlunit:xmlunit:${xmlunitVersion}")
580 581
		testCompile("xpp3:xpp3:1.1.4c")
		testCompile("org.codehaus.jettison:jettison:1.3.7") {
582 583
			exclude group: 'stax', module: 'stax-api'
		}
584 585 586 587
		if (compileTestJava.enabled) {
			testCompile(files(genCastor.classesDir).builtBy(genCastor))
			testCompile(files(genJaxb.classesDir).builtBy(genJaxb))
		}
588
	}
C
Chris Beams 已提交
589 590
}

P
Phillip Webb 已提交
591 592
project("spring-jms") {
	description = "Spring JMS"
593

594
	dependencies {
595 596 597 598
		compile(project(":spring-core"))
		compile(project(":spring-beans"))
		compile(project(":spring-aop"))
		compile(project(":spring-context"))
599
		compile(project(":spring-messaging"))
600
		compile(project(":spring-tx"))
J
Juergen Hoeller 已提交
601
		provided("javax.jms:javax.jms-api:2.0.1")
602
		optional(project(":spring-oxm"))
603
		optional("javax.transaction:javax.transaction-api:${jtaVersion}")
J
Juergen Hoeller 已提交
604
		optional("javax.resource:javax.resource-api:${jcaVersion}")
605
		optional("com.fasterxml.jackson.core:jackson-databind:${jackson2Version}")
606
	}
C
Chris Beams 已提交
607 608
}

P
Phillip Webb 已提交
609 610
project("spring-jdbc") {
	description = "Spring JDBC"
611

612
	dependencies {
613
		compile(project(":spring-beans"))
614
		compile(project(":spring-core"))
615
		compile(project(":spring-tx"))
616
		optional(project(":spring-context"))  // for JndiDataSourceLookup
617
		optional("javax.transaction:javax.transaction-api:${jtaVersion}")
618
		optional("com.mchange:c3p0:0.9.5.2")
P
Phillip Webb 已提交
619
		optional("org.hsqldb:hsqldb:${hsqldbVersion}")
620
		optional("com.h2database:h2:1.4.192")
621 622
		optional("org.apache.derby:derby:10.12.1.1")
		optional("org.apache.derby:derbyclient:10.12.1.1")
623
	}
C
Chris Beams 已提交
624 625
}

P
Phillip Webb 已提交
626 627
project("spring-context-support") {
	description = "Spring Context Support"
628

629
	dependencies {
630 631 632
		compile(project(":spring-core"))
		compile(project(":spring-beans"))
		compile(project(":spring-context"))
633 634
		optional(project(":spring-jdbc"))  // for Quartz support
		optional(project(":spring-tx"))  // for Quartz support
635
		optional("javax.mail:javax.mail-api:${javamailVersion}")
S
Stephane Nicoll 已提交
636
		optional("javax.cache:cache-api:1.0.0")
B
Ben Manes 已提交
637
		optional("com.github.ben-manes.caffeine:caffeine:${caffeineVersion}")
638
		optional("net.sf.ehcache:ehcache:${ehcacheVersion}")
639
		optional("org.quartz-scheduler:quartz:2.2.3")
640
		optional("org.codehaus.fabric3.api:commonj:1.1.0")
641
		optional("org.freemarker:freemarker:${freemarkerVersion}")
642
		optional("com.lowagie:itext:2.1.7")
643
		testCompile(project(":spring-context"))
644
		testCompile("org.apache.poi:poi:${poiVersion}")
P
Phillip Webb 已提交
645
		testCompile("org.hsqldb:hsqldb:${hsqldbVersion}")
646
		testCompile("org.slf4j:slf4j-api:${slf4jVersion}")
647
		testRuntime("com.sun.mail:javax.mail:${javamailVersion}")
648
		testRuntime("org.ehcache:jcache:${ehcachejcacheVersion}")
649
	}
C
Chris Beams 已提交
650 651
}

P
Phillip Webb 已提交
652 653
project("spring-web") {
	description = "Spring Web"
654
	apply plugin: "groovy"
655

656 657 658 659 660 661 662 663 664 665 666 667 668 669 670
	// Re-generate Protobuf classes from *.proto files and move them in test sources
	if (project.hasProperty('genProtobuf')) {
		apply plugin: 'protobuf'

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

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

671
	dependencies {
672 673
		compile(project(":spring-aop"))  // for JaxWsPortProxyFactoryBean
		compile(project(":spring-beans"))  // for MultipartFilter
674
		compile(project(":spring-context"))
675
		compile(project(":spring-core"))
676
		provided("javax.servlet:javax.servlet-api:3.0.1")
677
		optional(project(":spring-oxm"))  // for MarshallingHttpMessageConverter
678
		optional("javax.servlet.jsp:javax.servlet.jsp-api:2.2.1")
679
		optional("javax.el:javax.el-api:2.2.5")
680
		optional("javax.faces:javax.faces-api:2.2")
J
Juergen Hoeller 已提交
681
		optional("javax.validation:validation-api:${beanvalVersion}")
682
		optional("org.codehaus.groovy:groovy-all:${groovyVersion}")
683
		optional("com.caucho:hessian:4.0.38")
684 685 686
		optional("commons-fileupload:commons-fileupload:${fileuploadVersion}")
		optional("org.apache.httpcomponents:httpclient:${httpclientVersion}")
		optional("org.apache.httpcomponents:httpasyncclient:${httpasyncVersion}")
687
		optional("io.netty:netty-all:${nettyVersion}")
688
		optional("com.squareup.okhttp:okhttp:${okhttpVersion}")
689
		optional("com.squareup.okhttp3:okhttp:${okhttp3Version}")
690
		optional("com.fasterxml.jackson.core:jackson-databind:${jackson2Version}")
691
		optional("com.fasterxml.jackson.dataformat:jackson-dataformat-xml:${jackson2Version}")
R
Roy Clarkson 已提交
692
		optional("com.google.code.gson:gson:${gsonVersion}")
693
		optional("com.rometools:rome:${romeVersion}")
B
Brian Clozel 已提交
694
		optional("org.eclipse.jetty:jetty-servlet:${jettyVersion}") {
B
Brian Clozel 已提交
695
			exclude group: "javax.servlet", module: "javax.servlet-api"
696
		}
B
Brian Clozel 已提交
697
		optional("org.eclipse.jetty:jetty-server:${jettyVersion}") {
B
Brian Clozel 已提交
698
			exclude group: "javax.servlet", module: "javax.servlet-api"
699
		}
700 701
		optional("com.google.protobuf:protobuf-java:2.6.1")
		optional("com.googlecode.protobuf-java-format:protobuf-java-format:1.4")
702
		optional("javax.mail:javax.mail-api:${javamailVersion}")
703
		testCompile(project(":spring-context-support"))  // for JafMediaTypeFactory
704
		testCompile("xmlunit:xmlunit:${xmlunitVersion}")
705
		testCompile("org.slf4j:slf4j-jcl:${slf4jVersion}")
706 707 708
		testCompile("org.apache.taglibs:taglibs-standard-jstlel:1.2.1") {
			exclude group: "org.apache.taglibs", module: "taglibs-standard-spec"
		}
709
		testCompile("com.fasterxml.jackson.datatype:jackson-datatype-joda:${jackson2Version}")
710
		testCompile("com.fasterxml.jackson.datatype:jackson-datatype-jdk8:${jackson2Version}")
711
		testCompile("com.fasterxml.jackson.module:jackson-module-kotlin:${jackson2Version}")
712
		testRuntime("com.sun.mail:javax.mail:${javamailVersion}")
713
	}
C
Chris Beams 已提交
714 715
}

P
Phillip Webb 已提交
716 717
project("spring-orm") {
	description = "Spring Object/Relational Mapping"
718

719
	dependencies {
720 721 722 723 724 725 726
		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 已提交
727
		optional("org.eclipse.persistence:javax.persistence:${jpaVersion}")
728 729
		optional("org.eclipse.persistence:org.eclipse.persistence.core:${eclipselinkVersion}")
		optional("org.eclipse.persistence:org.eclipse.persistence.jpa:${eclipselinkVersion}") {
730 731
			exclude group: 'org.eclipse.persistence', module: 'javax.persistence'
		}
732
		optional("org.hibernate:hibernate-core:${hibernate5Version}")
733
		optional("javax.servlet:javax.servlet-api:3.0.1")
S
Sam Brannen 已提交
734
		testCompile("org.aspectj:aspectjweaver:${aspectjVersion}")
P
Phillip Webb 已提交
735
		testCompile("org.hsqldb:hsqldb:${hsqldbVersion}")
736
		testCompile("org.slf4j:slf4j-jcl:${slf4jVersion}")
737
	}
C
Chris Beams 已提交
738 739
}

P
Phillip Webb 已提交
740 741
project("spring-webmvc") {
	description = "Spring Web MVC"
742

743
	dependencies {
744
		compile(project(":spring-aop"))
745 746
		compile(project(":spring-beans"))
		compile(project(":spring-context"))
747
		compile(project(":spring-core"))
748
		compile(files(project(":spring-core").objenesisRepackJar))
749 750
		compile(project(":spring-expression"))
		compile(project(":spring-web"))
751
		provided("javax.servlet:javax.servlet-api:3.1.0")
752
		optional(project(":spring-context-support"))  // for FreeMarker support
753
		optional(project(":spring-oxm"))  // for MarshallingView
754 755
		optional("javax.servlet.jsp:javax.servlet.jsp-api:2.2.1")
		optional("javax.servlet.jsp.jstl:javax.servlet.jsp.jstl-api:1.2.1")
756 757
		optional("org.apache.poi:poi:${poiVersion}")
		optional("org.apache.poi:poi-ooxml:${poiVersion}")
758
		optional("org.freemarker:freemarker:${freemarkerVersion}")
759
		optional("org.codehaus.groovy:groovy-all:${groovyVersion}")
760 761
		optional("com.lowagie:itext:2.1.7")
		optional("com.fasterxml.jackson.core:jackson-databind:${jackson2Version}")
762
		optional("com.fasterxml.jackson.dataformat:jackson-dataformat-xml:${jackson2Version}")
763
		optional("com.rometools:rome:${romeVersion}")
764 765 766
		optional("javax.el:javax.el-api:2.2.5")
		optional("org.apache.tiles:tiles-api:${tiles3Version}")
		optional("org.apache.tiles:tiles-core:${tiles3Version}") {
767 768
			exclude group: "org.slf4j", module: "jcl-over-slf4j"
		}
769
		optional("org.apache.tiles:tiles-servlet:${tiles3Version}") {
770 771
			exclude group: "org.slf4j", module: "jcl-over-slf4j"
		}
772
		optional("org.apache.tiles:tiles-jsp:${tiles3Version}") {
773 774
			exclude group: "org.slf4j", module: "jcl-over-slf4j"
		}
775
		optional("org.apache.tiles:tiles-el:${tiles3Version}") {
776 777
			exclude group: "org.slf4j", module: "jcl-over-slf4j"
		}
778
		optional("org.apache.tiles:tiles-extras:${tiles3Version}") {
779 780 781
			exclude group: "org.slf4j", module: "jcl-over-slf4j"
			exclude group: "org.springframework", module: "spring-web"
		}
782
		optional('org.webjars:webjars-locator:0.32')
783
		testCompile("xmlunit:xmlunit:${xmlunitVersion}")
784
		testCompile("dom4j:dom4j:1.6.1") {
P
Phillip Webb 已提交
785
			exclude group: "xml-apis", module: "xml-apis"
786 787
		}
		testCompile("jaxen:jaxen:1.1.1") {
P
Phillip Webb 已提交
788 789 790
			exclude group: "xml-apis", module: "xml-apis"
			exclude group: "xom", module: "xom"
			exclude group: "xerces", module: "xercesImpl"
791
		}
B
Brian Clozel 已提交
792
		testCompile("org.eclipse.jetty:jetty-servlet:${jettyVersion}") {
B
Brian Clozel 已提交
793
			exclude group: "javax.servlet", module: "javax.servlet"
794
		}
B
Brian Clozel 已提交
795
		testCompile("org.eclipse.jetty:jetty-server:${jettyVersion}") {
B
Brian Clozel 已提交
796
			exclude group: "javax.servlet", module: "javax.servlet"
797
		}
J
Juergen Hoeller 已提交
798
		testCompile("javax.validation:validation-api:${beanvalVersion}")
799
		testCompile("org.hibernate:hibernate-validator:${hibval5Version}")
800 801
		testCompile("org.apache.httpcomponents:httpclient:${httpclientVersion}")
		testCompile("commons-fileupload:commons-fileupload:${fileuploadVersion}")
802
		testCompile("commons-io:commons-io:1.3")
803
		testCompile("joda-time:joda-time:${jodaVersion}")
804
		testCompile("org.slf4j:slf4j-jcl:${slf4jVersion}")
805
		testCompile("org.mozilla:rhino:1.7.7.1")
806 807 808
		testRuntime("org.jruby:jruby:9.1.2.0")
		testRuntime("org.python:jython-standalone:2.5.3")
		testRuntime("org.webjars:underscorejs:1.8.3")
809
	}
C
Chris Beams 已提交
810 811
}

812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843
project("spring-web-reactive") {
	description = "Spring Web Reactive"

	dependencies {
		compile(project(":spring-core"))
		compile(project(":spring-web"))
		compile "org.reactivestreams:reactive-streams:1.0.0"
		compile "io.projectreactor:reactor-core:${reactorCoreVersion}"
		compile "io.netty:netty-buffer:${nettyVersion}" // Temporarily for JsonObjectDecoder
		optional(project(":spring-context-support"))  // for FreeMarker support
		provided "javax.servlet:javax.servlet-api:3.1.0"
		optional "org.apache.tomcat:tomcat-util:${tomcatVersion}"
		optional "org.apache.tomcat.embed:tomcat-embed-core:${tomcatVersion}"
		optional "org.eclipse.jetty:jetty-server:${jettyVersion}"
		optional "org.eclipse.jetty:jetty-servlet:${jettyVersion}"
		optional 'io.undertow:undertow-core:1.3.20.Final'
		optional "io.projectreactor:reactor-netty:${reactorNettyVersion}"
		optional "io.reactivex:rxjava:${rxJavaVersion}"
		optional("io.reactivex:rxnetty-http:0.5.2-SNAPSHOT") {
			exclude group: 'io.reactivex', module: 'rxjava'
		}
		optional("com.fasterxml.jackson.core:jackson-databind:${jackson2Version}")
		optional("com.fasterxml:aalto-xml:1.0.0")
		optional("org.freemarker:freemarker:${freemarkerVersion}")
		optional "org.apache.httpcomponents:httpclient:4.5.1" // Needed to run Javadoc without error
		testCompile("org.slf4j:slf4j-jcl:${slf4jVersion}")
		testCompile "com.squareup.okhttp3:mockwebserver:3.0.1"
		testCompile("javax.validation:validation-api:${beanvalVersion}")
		testCompile("xmlunit:xmlunit:1.6")
	}
}

844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878
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"))
		optional("javax.servlet:javax.servlet-api:3.1.0")
		optional("javax.websocket:javax.websocket-api:1.0")
		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"
		}
879
		optional("org.jboss.xnio:xnio-api:3.3.7.Final")
880 881 882
		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}")
883 884 885
		testCompile("io.projectreactor:reactor-core:${reactorVersion}") {
			force = true // enforce 2.0.x
		}
886 887 888
		testCompile("io.projectreactor:reactor-net:${reactorVersion}")
		testCompile("io.netty:netty-all:${nettyVersion}")
		testCompile("org.slf4j:slf4j-jcl:${slf4jVersion}")
889 890
		testRuntime("org.jboss.xnio:xnio-nio:3.3.7.Final")
		testRuntime("org.jboss.logging:jboss-logging:3.3.0.Final")
891 892 893
	}
}

P
Phillip Webb 已提交
894 895
project("spring-test") {
	description = "Spring TestContext Framework"
896

897
	dependencies {
898
		compile(project(":spring-core"))
899 900 901 902 903 904 905
		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"))
906
		optional(project(":spring-websocket"))
907
		optional("junit:junit:${junitVersion}")
908
		optional("org.junit.jupiter:junit-jupiter-api:${junitJupiterVersion}")
909
		optional("org.testng:testng:${testngVersion}")
910
		optional("javax.inject:javax.inject:1")
911
		optional("javax.servlet:javax.servlet-api:3.0.1")
912 913 914 915 916
		optional("javax.servlet.jsp:javax.servlet.jsp-api:2.2.1")
		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"
		}
917
		optional("javax.el:javax.el-api:2.2.5")
918
		optional("javax.websocket:javax.websocket-api:1.0")
919
		optional("org.aspectj:aspectjweaver:${aspectjVersion}")
S
Sam Brannen 已提交
920
		optional("org.codehaus.groovy:groovy-all:${groovyVersion}")
921
		optional("org.hamcrest:hamcrest-core:${hamcrestVersion}")
922
		optional("xmlunit:xmlunit:${xmlunitVersion}")
923 924
		optional("net.sourceforge.htmlunit:htmlunit:2.22")
		optional("org.seleniumhq.selenium:htmlunit-driver:2.21")
925 926 927
		optional("org.seleniumhq.selenium:selenium-java:2.53.1") {
			exclude group: "io.netty", module: "netty"
		}
928 929
		optional("org.skyscreamer:jsonassert:1.3.0")
		optional("com.jayway.jsonpath:json-path:2.2.0")
930 931
		testCompile(project(":spring-context-support"))
		testCompile(project(":spring-oxm"))
932
		testCompile("javax.mail:javax.mail-api:${javamailVersion}")
933
		testCompile("javax.ejb:ejb-api:${ejbVersion}")
934
		testCompile("org.hibernate:hibernate-core:${hibernate5Version}")
935
		testCompile("org.hibernate:hibernate-validator:${hibval5Version}")
936 937
		// Enable use of the JUnitPlatform Runner
		testCompile("org.junit.platform:junit-platform-runner:${junitPlatformVersion}")
938
		testCompile("com.thoughtworks.xstream:xstream:${xstreamVersion}")
939
		testCompile("com.fasterxml.jackson.core:jackson-databind:${jackson2Version}")
940
		testCompile("com.rometools:rome:${romeVersion}")
941 942
		testCompile("org.apache.tiles:tiles-api:${tiles3Version}")
		testCompile("org.apache.tiles:tiles-core:${tiles3Version}") {
943 944
			exclude group: "org.slf4j", module: "jcl-over-slf4j"
		}
945
		testCompile("org.apache.tiles:tiles-servlet:${tiles3Version}") {
946 947
			exclude group: "org.slf4j", module: "jcl-over-slf4j"
		}
948
		testCompile("org.hsqldb:hsqldb:${hsqldbVersion}")
S
Sam Brannen 已提交
949
		testCompile("org.slf4j:slf4j-jcl:${slf4jVersion}")
950
		testCompile("org.apache.httpcomponents:httpclient:${httpclientVersion}")
951
		testCompile("javax.cache:cache-api:1.0.0")
952
		testRuntime("org.junit.jupiter:junit-jupiter-engine:${junitJupiterVersion}")
953 954
		// Java Util Logging for JUnit 5.
		testRuntime("org.apache.logging.log4j:log4j-jul:${log4jVersion}")
955
		testRuntime("org.ehcache:ehcache:${ehcache3Version}")
J
Juergen Hoeller 已提交
956
		testRuntime("org.terracotta:management-model:2.0.0")
957
	}
958 959

	task testNG(type: Test) {
960
		description = 'Runs TestNG tests.'
961
		useTestNG()
962
		scanForTestClasses = false
963 964
		include(["**/testng/**/*Tests.class", "**/testng/**/*Test.class"])
		// Show STD_OUT & STD_ERR of the test JVM(s) on the console:
965
		// testLogging.showStandardStreams = true
966
		// forkEvery 1
967 968 969
	}

	test {
970
		description = 'Runs JUnit tests.'
971 972
		dependsOn testNG
		useJUnit()
973 974 975
		scanForTestClasses = false
		include(['**/*Tests.class', '**/*Test.class', '**/SpringJUnitJupiterTestSuite.class'])
		exclude(['**/testng/**/*.*'])
976 977
		// Java Util Logging for JUnit 5.
		// systemProperty('java.util.logging.manager', 'org.apache.logging.log4j.jul.LogManager')
978
	}
979 980

	task aggregateTestReports(type: TestReport) {
981
		description = 'Aggregates JUnit and TestNG test reports.'
982 983 984 985 986
		destinationDir = test.reports.html.destination
		reportOn test, testNG
	}

	check.dependsOn aggregateTestReports
C
Chris Beams 已提交
987 988
}

P
Phillip Webb 已提交
989 990 991
project("spring-aspects") {
	description = "Spring Aspects"
	apply from: "aspects.gradle"
992

993
	dependencies {
994
		aspects(project(":spring-orm"))
995 996 997
		ajc("org.aspectj:aspectjtools:${aspectjVersion}")
		rt("org.aspectj:aspectjrt:${aspectjVersion}")
		compile("org.aspectj:aspectjweaver:${aspectjVersion}")
J
Juergen Hoeller 已提交
998
		provided("org.eclipse.persistence:javax.persistence:${jpaVersion}")
999 1000 1001 1002 1003 1004
		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
1005
		optional("javax.transaction:javax.transaction-api:${jtaVersion}")  // for @javax.transaction.Transactional support
S
Stephane Nicoll 已提交
1006
		optional("javax.cache:cache-api:1.0.0")
1007
		testCompile(project(":spring-core"))  // for CodeStyleAspect
1008
		testCompile(project(":spring-test"))
1009
		testCompile("javax.mail:javax.mail-api:${javamailVersion}")
1010
	}
1011

1012
	eclipse.project {
P
Phillip Webb 已提交
1013
		natures += "org.eclipse.ajdt.ui.ajnature"
1014
		buildCommands = [new org.gradle.plugins.ide.eclipse.model.BuildCommand("org.eclipse.ajdt.core.ajbuilder")]
1015
	}
C
Chris Beams 已提交
1016 1017
}

1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052
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)
										}
									}
								}
							}
						}
					}
				}
			}
		}
	}
}

1053 1054
sonarqube {
	properties {
S
Stephane Nicoll 已提交
1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066
		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"
	}
}

1067
configure(rootProject) {
P
Phillip Webb 已提交
1068
	description = "Spring Framework"
1069

B
Brian Clozel 已提交
1070
	apply plugin: "org.asciidoctor.convert"
1071
	apply plugin: "docbook-reference"
1072
	apply plugin: "groovy"
R
Rob Winch 已提交
1073

1074
	// apply plugin: "detect-split-packages"
1075 1076
	apply from: "${gradleScriptDir}/jdiff.gradle"

R
Rob Winch 已提交
1077
	asciidoctor {
B
Brian Clozel 已提交
1078 1079
		sourceDir project.file('src/asciidoc')
		separateOutputDirs = false
1080
		backends = ['docbook']
B
Brian Clozel 已提交
1081
		options doctype: 'book', eruby: 'erubis'
J
Juergen Hoeller 已提交
1082
		attributes 'spring-version': project.version, 'revnumber': project.version, 'docinfo': ""
1083 1084
	}

1085 1086 1087
	reference {
		sourceDir = asciidoctor.outputDir
		pdfFilename = "spring-framework-reference.pdf"
1088
		epubFilename = "spring-framework-reference.epub"
1089 1090 1091 1092 1093 1094 1095
		expandPlaceholders = ""
	}

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

1096 1097 1098 1099 1100
	// 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")
	// }
1101

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

1105
	dependencies {  // for integration tests
1106
		testCompile(project(":spring-aop"))
1107
		testCompile(project(":spring-beans"))
1108
		testCompile(project(":spring-context"))
1109 1110
		testCompile(project(":spring-core"))
		testCompile(project(":spring-expression"))
1111
		testCompile(project(":spring-jdbc"))
1112
		testCompile(project(":spring-orm"))
1113
		testCompile(project(":spring-test"))
1114
		testCompile(project(":spring-tx"))
1115
		testCompile(project(":spring-web"))
1116
		testCompile("javax.servlet:javax.servlet-api:3.0.1")
1117
		testCompile("javax.inject:javax.inject:1")
J
Juergen Hoeller 已提交
1118
		testCompile("javax.resource:javax.resource-api:${jcaVersion}")
1119
		testCompile("org.aspectj:aspectjweaver:${aspectjVersion}")
1120
		testCompile("org.hibernate:hibernate-core:${hibernate5Version}")
P
Phillip Webb 已提交
1121
		testCompile("org.hsqldb:hsqldb:${hsqldbVersion}")
1122 1123 1124
	}

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

1129 1130 1131 1132 1133
		dependsOn {
			subprojects.collect {
				it.tasks.getByName("jar")
			}
		}
1134 1135 1136
		options.memberLevel = org.gradle.external.javadoc.JavadocMemberLevel.PROTECTED
		options.author = true
		options.header = rootProject.description
P
Phillip Webb 已提交
1137
		options.overview = "src/api/overview.html"
1138
		options.stylesheetFile = file("src/api/stylesheet.css")
1139
		options.splitIndex = true
C
Chris Beams 已提交
1140
		options.links(project.ext.javadocLinks)
1141
		options.addStringOption('Xdoclint:none', '-quiet')
C
Chris Beams 已提交
1142

1143 1144 1145
		source subprojects.collect { project ->
			project.sourceSets.main.allJava
		}
C
Chris Beams 已提交
1146

P
Phillip Webb 已提交
1147
		maxMemory = "1024m"
C
Chris Beams 已提交
1148
		destinationDir = new File(buildDir, "api")
1149 1150 1151

		doFirst {
			classpath = files(
1152 1153
                // ensure Servlet 3.x has precedence on the javadoc classpath
                project(":spring-webmvc").sourceSets.main.compileClasspath.files.find { it =~ "servlet-api" },
1154 1155 1156 1157 1158
				// 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 })
		}
1159 1160
	}

1161
	task docsZip(type: Zip, dependsOn: 'reference') {
P
Phillip Webb 已提交
1162 1163 1164
		group = "Distribution"
		baseName = "spring-framework"
		classifier = "docs"
1165 1166 1167
		description = "Builds -${classifier} archive containing api and reference " +
			"for deployment at http://static.springframework.org/spring-framework/docs."

P
Phillip Webb 已提交
1168 1169
		from("src/dist") {
			include "changelog.txt"
1170 1171 1172
		}

		from (api) {
1173
			into "javadoc-api"
1174 1175
		}

1176 1177
		from (reference) {
			into "spring-framework-reference"
1178 1179 1180 1181
		}
	}

	task schemaZip(type: Zip) {
P
Phillip Webb 已提交
1182 1183 1184
		group = "Distribution"
		baseName = "spring-framework"
		classifier = "schema"
1185 1186
		description = "Builds -${classifier} archive containing all " +
			"XSDs for deployment at http://springframework.org/schema."
S
Stephane Nicoll 已提交
1187
		duplicatesStrategy 'exclude'
1188
		moduleProjects.each { subproject ->
1189 1190 1191
			def Properties schemas = new Properties();

			subproject.sourceSets.main.resources.find {
P
Phillip Webb 已提交
1192
				it.path.endsWith("META-INF/spring.schemas")
1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209
			}?.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 已提交
1210 1211 1212
		group = "Distribution"
		baseName = "spring-framework"
		classifier = "dist"
1213
		description = "Builds -${classifier} archive, containing all jars and docs, " +
J
Juergen Hoeller 已提交
1214
			"suitable for community download page."
1215 1216 1217

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

P
Phillip Webb 已提交
1218 1219 1220 1221
		from("src/dist") {
			include "readme.txt"
			include "license.txt"
			include "notice.txt"
1222
			into "${baseDir}"
P
Phillip Webb 已提交
1223
			expand(copyright: new Date().format("yyyy"), version: project.version)
1224 1225 1226 1227 1228 1229 1230 1231 1232 1233
		}

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

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

1234
		moduleProjects.each { subproject ->
1235 1236
			into ("${baseDir}/libs") {
				from subproject.jar
P
Phillip Webb 已提交
1237
				if (subproject.tasks.findByPath("sourcesJar")) {
1238 1239
					from subproject.sourcesJar
				}
P
Phillip Webb 已提交
1240
				if (subproject.tasks.findByPath("javadocJar")) {
1241 1242 1243 1244 1245 1246
					from subproject.javadocJar
				}
			}
		}
	}

1247
	// Create a distribution that contains all dependencies (required and optional).
1248 1249
	// Not published by default; only for use when building from source.
	task depsZip(type: Zip, dependsOn: distZip) { zipTask ->
P
Phillip Webb 已提交
1250 1251 1252
		group = "Distribution"
		baseName = "spring-framework"
		classifier = "dist-with-deps"
1253 1254 1255 1256 1257 1258 1259 1260 1261 1262
		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 ->
1263 1264
					(subproject.configurations.runtime.resolvedConfiguration.resolvedArtifacts +
					subproject.configurations.optional.resolvedConfiguration.resolvedArtifacts).each { artifact ->
1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285
						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 已提交
1286
		description = "Generates gradlew[.bat] scripts"
S
Sam Brannen 已提交
1287
		gradleVersion = "2.14"
1288 1289

		doLast() {
1290
			def gradleOpts = "-XX:MaxMetaspaceSize=1024m -Xmx1024m"
1291
			def gradleBatOpts = "$gradleOpts -XX:MaxHeapSize=256m"
P
Phillip Webb 已提交
1292
			File wrapperFile = file("gradlew")
1293 1294
			wrapperFile.text = wrapperFile.text.replace("DEFAULT_JVM_OPTS=",
				"GRADLE_OPTS=\"$gradleOpts \$GRADLE_OPTS\"\nDEFAULT_JVM_OPTS=")
P
Phillip Webb 已提交
1295
			File wrapperBatFile = file("gradlew.bat")
1296 1297 1298 1299
			wrapperBatFile.text = wrapperBatFile.text.replace("set DEFAULT_JVM_OPTS=",
				"set GRADLE_OPTS=$gradleBatOpts %GRADLE_OPTS%\nset DEFAULT_JVM_OPTS=")
		}
	}
1300

1301
}
1302

S
Stephane Nicoll 已提交
1303
configure([project(':spring-build-src'), project(':spring-framework-bom')]) {
1304
	sonarqube {
S
Stephane Nicoll 已提交
1305 1306 1307 1308 1309
		skipProject = true
	}
}

configure(project(':spring-core')) {
1310 1311
	sonarqube {
		properties {
S
Stephane Nicoll 已提交
1312 1313 1314 1315 1316 1317
			property "sonar.exclusions",
					"src/main/java/org/springframework/cglib/**/*,src/main/java/org/springframework/asm/**/*"
		}
	}
}

1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328
/*
 * 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-")) {
1329
			return version.replace('BUILD', qualifier)
1330 1331
		}
	}
1332
	return version
1333
}