build.gradle 47.9 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"
S
Stephane Nicoll 已提交
41
	ext.ejbVersion           = "3.2"
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.jspVersion           = "2.3.2-b02"
59
	ext.jtaVersion           = "1.2"
J
Juergen Hoeller 已提交
60
	ext.junitVersion         = "4.12"
S
Sam Brannen 已提交
61 62
	ext.junitJupiterVersion  = '5.0.0-M1'
	ext.junitPlatformVersion = '1.0.0-M1'
63
	ext.log4jVersion         = '2.6.1'
64
	ext.nettyVersion         = "4.1.3.Final"
65
	ext.okhttpVersion        = "2.7.5"
66
	ext.okhttp3Version       = "3.3.1"
67
	ext.poiVersion           = "3.14"
R
Rossen Stoyanchev 已提交
68
	ext.reactorVersion       = "2.0.8.RELEASE"
69 70
	ext.reactorCoreVersion   = '3.0.0.BUILD-SNAPSHOT'
	ext.reactorNettyVersion  = '0.5.0.BUILD-SNAPSHOT'
71
	ext.rxJavaVersion        = '1.1.6'
72
	ext.romeVersion          = "1.6.0"
73
	ext.servletVersion       = "3.1.0"
74
	ext.slf4jVersion         = "1.7.21"
75
	ext.snakeyamlVersion     = "1.17"
76
	ext.snifferVersion       = "1.15"
77
	ext.testngVersion        = "6.9.10"
78
	ext.tiles3Version        = "3.0.5"
J
Juergen Hoeller 已提交
79
	ext.tomcatVersion        = "8.5.4"
80
	ext.tyrusVersion         = "1.13"
81
	ext.undertowVersion      = "1.4.0.CR3"
82
	ext.websocketVersion     = "1.1"
83
	ext.woodstoxVersion      = "5.0.2"
84
	ext.xmlunitVersion       = "1.6"
J
Juergen Hoeller 已提交
85
	ext.xstreamVersion       = "1.4.9"
86

87
	ext.gradleScriptDir = "${rootProject.projectDir}/gradle"
88

89
	apply plugin: "propdeps"
P
Phillip Webb 已提交
90
	apply plugin: "java"
91
	apply plugin: "test-source-set-dependencies"
92
	apply from: "${gradleScriptDir}/ide.gradle"
C
Chris Beams 已提交
93

S
Stephane Nicoll 已提交
94 95 96 97 98
	configurations {
		sniffer
		javaApiSignature
	}

99 100 101 102 103 104 105 106 107 108 109 110
	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 已提交
111 112 113
	compileJava.options*.compilerArgs = [
		"-Xlint:serial", "-Xlint:varargs", "-Xlint:cast", "-Xlint:classfile",
		"-Xlint:dep-ann", "-Xlint:divzero", "-Xlint:empty", "-Xlint:finally",
S
Stephane Nicoll 已提交
114
		"-Xlint:overrides", "-Xlint:path", "-Xlint:processing", "-Xlint:static",
P
Phillip Webb 已提交
115
		"-Xlint:try", "-Xlint:fallthrough", "-Xlint:rawtypes", "-Xlint:deprecation",
116
		"-Xlint:unchecked", "-Xlint:-options", "-Werror"
117
	]
C
Chris Beams 已提交
118

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

126
	compileJava {
127 128
		sourceCompatibility = 1.8
		targetCompatibility = 1.8
129 130 131
	}

	compileTestJava {
J
Juergen Hoeller 已提交
132 133
		sourceCompatibility = 1.8
		targetCompatibility = 1.8
134
		options.compilerArgs += "-parameters"
J
Juergen Hoeller 已提交
135 136
	}

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

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

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

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

	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
186

S
Stephane Nicoll 已提交
187 188 189 190 191 192 193 194 195 196 197
		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)
198 199 200
				annotation(className: "org.springframework.lang.UsesJava7")
				annotation(className: "org.springframework.lang.UsesJava8")
				annotation(className: "org.springframework.lang.UsesSunHttpServer")
S
Stephane Nicoll 已提交
201 202
			}
		}
203
	}
C
Chris Beams 已提交
204 205

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

226
configure(subprojects - project(":spring-build-src")) { subproject ->
227
	apply plugin: "merge"
228 229
	apply from: "${gradleScriptDir}/publish-maven.gradle"

S
Stephane Nicoll 已提交
230 231 232 233 234
	configurations {
		jacoco
	}

	dependencies {
235
		jacoco("org.jacoco:org.jacoco.agent:0.7.5.201505241946:runtime")
S
Stephane Nicoll 已提交
236 237 238
	}

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

244
	jar {
P
Phillip Webb 已提交
245 246 247 248
		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
249 250 251 252 253

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

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

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

		// 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
271 272
	}

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

	task javadocJar(type: Jar) {
P
Phillip Webb 已提交
280
		classifier = "javadoc"
281 282 283 284 285 286 287
		from javadoc
	}

	artifacts {
		archives sourcesJar
		archives javadocJar
	}
C
Chris Beams 已提交
288 289
}

290 291
project("spring-build-src") {
	description = "Exposes gradle buildSrc for IDE support"
292
	apply plugin: "groovy"
293 294 295

	dependencies {
		compile gradleApi()
R
Rob Winch 已提交
296
		compile localGroovy()
297 298 299 300 301
	}

	configurations.archives.artifacts.clear()
}

P
Phillip Webb 已提交
302 303
project("spring-core") {
	description = "Spring Core"
304

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

	configurations {
		jarjar
		cglib
315
		objenesis
316 317 318 319 320 321 322 323 324 325 326 327 328 329 330
	}

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

341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359
	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")
				}
			}
		}
	}

360
	dependencies {
361
		cglib("cglib:cglib:${cglibVersion}@jar")
362
		objenesis("org.objenesis:objenesis:${objenesisVersion}@jar")
363
		jarjar("com.googlecode.jarjar:jarjar:1.3")
364

P
Phillip Webb 已提交
365
		compile(files(cglibRepackJar))
366
		compile(files(objenesisRepackJar))
367
		compile("commons-logging:commons-logging:1.2")
368
		optional("org.aspectj:aspectjweaver:${aspectjVersion}")
369
		optional("net.sf.jopt-simple:jopt-simple:5.0.2")
370 371 372 373
		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}")
374
		testCompile("org.apache.tomcat.embed:tomcat-embed-core:${tomcatVersion}")
375
		testCompile("xmlunit:xmlunit:${xmlunitVersion}")
376
		testCompile("com.fasterxml.woodstox:woodstox-core:${woodstoxVersion}") {
P
Phillip Webb 已提交
377 378
			exclude group: "stax", module: "stax-api"
		}
379 380 381
	}

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

		dependsOn objenesisRepackJar
		from(zipTree(objenesisRepackJar.archivePath)) {
			include "org/springframework/objenesis/**"
		}
392
	}
C
Chris Beams 已提交
393 394
}

P
Phillip Webb 已提交
395 396
project("spring-beans") {
	description = "Spring Beans"
397

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

408 409
project("spring-beans-groovy") {
	description "Groovy Bean Definitions"
J
Juergen Hoeller 已提交
410
	merge.into = project(":spring-beans")
411
	apply plugin: "groovy"
J
Juergen Hoeller 已提交
412 413 414

	dependencies {
		compile(project(":spring-core"))
415
		optional("org.codehaus.groovy:groovy-all:${groovyVersion}")
J
Juergen Hoeller 已提交
416 417 418 419 420 421 422
	}

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

	compileGroovy {
429 430
		sourceCompatibility = 1.8
		targetCompatibility = 1.8
431
	}
J
Juergen Hoeller 已提交
432 433
}

P
Phillip Webb 已提交
434 435
project("spring-aop") {
	description = "Spring AOP"
436

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

P
Phillip Webb 已提交
448 449
project("spring-expression") {
	description = "Spring Expression Language (SpEL)"
450

451
	dependencies {
452
		compile(project(":spring-core"))
453
	}
C
Chris Beams 已提交
454 455
}

P
Phillip Webb 已提交
456 457
project("spring-instrument") {
	description = "Spring Instrument"
458

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

P
Phillip Webb 已提交
470 471
project("spring-context") {
	description = "Spring Context"
472
	apply plugin: "groovy"
473

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

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

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

P
Phillip Webb 已提交
541 542
project("spring-tx") {
	description = "Spring Transaction"
543

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

P
Phillip Webb 已提交
559 560 561
project("spring-oxm") {
	description = "Spring Object/XML Marshalling"
	apply from: "oxm.gradle"
562

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

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

P
Phillip Webb 已提交
595 596
project("spring-jms") {
	description = "Spring JMS"
597

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

P
Phillip Webb 已提交
613 614
project("spring-jdbc") {
	description = "Spring JDBC"
615

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

P
Phillip Webb 已提交
630 631
project("spring-context-support") {
	description = "Spring Context Support"
632

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

P
Phillip Webb 已提交
656 657
project("spring-web") {
	description = "Spring Web"
658
	apply plugin: "groovy"
659

660 661 662 663 664 665 666 667 668 669 670 671 672 673 674
	// 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"
	}

675
	dependencies {
676 677
		compile(project(":spring-aop"))  // for JaxWsPortProxyFactoryBean
		compile(project(":spring-beans"))  // for MultipartFilter
678
		compile(project(":spring-context"))
679
		compile(project(":spring-core"))
680
		provided "javax.servlet:javax.servlet-api:${servletVersion}"
681
		optional(project(":spring-oxm"))  // for MarshallingHttpMessageConverter
682
		optional("javax.servlet.jsp:javax.servlet.jsp-api:${jspVersion}")
683
		optional("javax.el:javax.el-api:2.2.5")
684
		optional("javax.faces:javax.faces-api:2.2")
J
Juergen Hoeller 已提交
685
		optional("javax.validation:validation-api:${beanvalVersion}")
686
		optional("org.codehaus.groovy:groovy-all:${groovyVersion}")
687
		optional("com.caucho:hessian:4.0.38")
688
		optional("commons-fileupload:commons-fileupload:${fileuploadVersion}")
689 690 691 692 693 694 695 696 697
		optional("org.reactivestreams:reactive-streams:1.0.0")
		optional("io.projectreactor:reactor-core:${reactorCoreVersion}")
		optional("io.projectreactor:reactor-netty:${reactorNettyVersion}")
		optional("io.reactivex:rxnetty-http:0.5.2-SNAPSHOT") {
			exclude group: 'io.reactivex', module: 'rxjava'
		}
		optional("io.reactivex:rxjava:${rxJavaVersion}")
		optional("io.undertow:undertow-core:1.3.20.Final")
		optional("io.netty:netty-buffer:${nettyVersion}") // Temporarily for JsonObjectDecoder
698 699 700
	  	optional("com.fasterxml.woodstox:woodstox-core:${woodstoxVersion}") { // woodstox before aalto
			exclude group: "stax", module: "stax-api"
		}
701
		optional("com.fasterxml:aalto-xml:1.0.0")
702 703
		optional("org.apache.httpcomponents:httpclient:${httpclientVersion}")
		optional("org.apache.httpcomponents:httpasyncclient:${httpasyncVersion}")
704
		optional("io.netty:netty-all:${nettyVersion}")
705
		optional("com.squareup.okhttp:okhttp:${okhttpVersion}")
706
		optional("com.squareup.okhttp3:okhttp:${okhttp3Version}")
707
		optional("com.fasterxml.jackson.core:jackson-databind:${jackson2Version}")
708
		optional("com.fasterxml.jackson.dataformat:jackson-dataformat-xml:${jackson2Version}")
R
Roy Clarkson 已提交
709
		optional("com.google.code.gson:gson:${gsonVersion}")
710
		optional("com.rometools:rome:${romeVersion}")
B
Brian Clozel 已提交
711
		optional("org.eclipse.jetty:jetty-servlet:${jettyVersion}") {
B
Brian Clozel 已提交
712
			exclude group: "javax.servlet", module: "javax.servlet-api"
713
		}
B
Brian Clozel 已提交
714
		optional("org.eclipse.jetty:jetty-server:${jettyVersion}") {
B
Brian Clozel 已提交
715
			exclude group: "javax.servlet", module: "javax.servlet-api"
716
		}
717 718
		optional("com.google.protobuf:protobuf-java:2.6.1")
		optional("com.googlecode.protobuf-java-format:protobuf-java-format:1.4")
719
		optional("javax.mail:javax.mail-api:${javamailVersion}")
720
		testCompile(project(":spring-context-support"))  // for JafMediaTypeFactory
721
		testCompile("xmlunit:xmlunit:${xmlunitVersion}")
722
		testCompile("org.slf4j:slf4j-jcl:${slf4jVersion}")
723 724 725
		testCompile("org.apache.taglibs:taglibs-standard-jstlel:1.2.1") {
			exclude group: "org.apache.taglibs", module: "taglibs-standard-spec"
		}
726
		testCompile("com.fasterxml.jackson.datatype:jackson-datatype-joda:${jackson2Version}")
727
		testCompile("com.fasterxml.jackson.datatype:jackson-datatype-jdk8:${jackson2Version}")
728
		testCompile("com.fasterxml.jackson.module:jackson-module-kotlin:${jackson2Version}")
729
		testRuntime("com.sun.mail:javax.mail:${javamailVersion}")
730 731 732 733 734
		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}")
		testCompile("com.squareup.okhttp3:mockwebserver:3.0.1")
735

736
	}
C
Chris Beams 已提交
737 738
}

P
Phillip Webb 已提交
739 740
project("spring-orm") {
	description = "Spring Object/Relational Mapping"
741

742
	dependencies {
743 744 745 746 747 748 749
		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 已提交
750
		optional("org.eclipse.persistence:javax.persistence:${jpaVersion}")
751 752
		optional("org.eclipse.persistence:org.eclipse.persistence.core:${eclipselinkVersion}")
		optional("org.eclipse.persistence:org.eclipse.persistence.jpa:${eclipselinkVersion}") {
753 754
			exclude group: 'org.eclipse.persistence', module: 'javax.persistence'
		}
755
		optional("org.hibernate:hibernate-core:${hibernate5Version}")
756
		optional("javax.servlet:javax.servlet-api:${servletVersion}")
S
Sam Brannen 已提交
757
		testCompile("org.aspectj:aspectjweaver:${aspectjVersion}")
P
Phillip Webb 已提交
758
		testCompile("org.hsqldb:hsqldb:${hsqldbVersion}")
759
		testCompile("org.slf4j:slf4j-jcl:${slf4jVersion}")
760
	}
C
Chris Beams 已提交
761 762
}

P
Phillip Webb 已提交
763 764
project("spring-webmvc") {
	description = "Spring Web MVC"
765

766
	dependencies {
767
		compile(project(":spring-aop"))
768 769
		compile(project(":spring-beans"))
		compile(project(":spring-context"))
770
		compile(project(":spring-core"))
771
		compile(files(project(":spring-core").objenesisRepackJar))
772 773
		compile(project(":spring-expression"))
		compile(project(":spring-web"))
774
		provided("javax.servlet:javax.servlet-api:${servletVersion}")
775
		optional(project(":spring-context-support"))  // for FreeMarker support
776
		optional(project(":spring-oxm"))  // for MarshallingView
777
		optional("javax.servlet.jsp:javax.servlet.jsp-api:${jspVersion}")
778
		optional("javax.servlet.jsp.jstl:javax.servlet.jsp.jstl-api:1.2.1")
779 780
		optional("org.apache.poi:poi:${poiVersion}")
		optional("org.apache.poi:poi-ooxml:${poiVersion}")
781
		optional("org.freemarker:freemarker:${freemarkerVersion}")
782
		optional("org.codehaus.groovy:groovy-all:${groovyVersion}")
783 784
		optional("com.lowagie:itext:2.1.7")
		optional("com.fasterxml.jackson.core:jackson-databind:${jackson2Version}")
785
		optional("com.fasterxml.jackson.dataformat:jackson-dataformat-xml:${jackson2Version}")
786
		optional("com.rometools:rome:${romeVersion}")
787 788 789
		optional("javax.el:javax.el-api:2.2.5")
		optional("org.apache.tiles:tiles-api:${tiles3Version}")
		optional("org.apache.tiles:tiles-core:${tiles3Version}") {
790 791
			exclude group: "org.slf4j", module: "jcl-over-slf4j"
		}
792
		optional("org.apache.tiles:tiles-servlet:${tiles3Version}") {
793 794
			exclude group: "org.slf4j", module: "jcl-over-slf4j"
		}
795
		optional("org.apache.tiles:tiles-jsp:${tiles3Version}") {
796 797
			exclude group: "org.slf4j", module: "jcl-over-slf4j"
		}
798
		optional("org.apache.tiles:tiles-el:${tiles3Version}") {
799 800
			exclude group: "org.slf4j", module: "jcl-over-slf4j"
		}
801
		optional("org.apache.tiles:tiles-extras:${tiles3Version}") {
802 803 804
			exclude group: "org.slf4j", module: "jcl-over-slf4j"
			exclude group: "org.springframework", module: "spring-web"
		}
805
		optional('org.webjars:webjars-locator:0.32')
806
		testCompile("xmlunit:xmlunit:${xmlunitVersion}")
807
		testCompile("dom4j:dom4j:1.6.1") {
P
Phillip Webb 已提交
808
			exclude group: "xml-apis", module: "xml-apis"
809 810
		}
		testCompile("jaxen:jaxen:1.1.1") {
P
Phillip Webb 已提交
811 812 813
			exclude group: "xml-apis", module: "xml-apis"
			exclude group: "xom", module: "xom"
			exclude group: "xerces", module: "xercesImpl"
814
		}
B
Brian Clozel 已提交
815
		testCompile("org.eclipse.jetty:jetty-servlet:${jettyVersion}") {
B
Brian Clozel 已提交
816
			exclude group: "javax.servlet", module: "javax.servlet"
817
		}
B
Brian Clozel 已提交
818
		testCompile("org.eclipse.jetty:jetty-server:${jettyVersion}") {
B
Brian Clozel 已提交
819
			exclude group: "javax.servlet", module: "javax.servlet"
820
		}
J
Juergen Hoeller 已提交
821
		testCompile("javax.validation:validation-api:${beanvalVersion}")
822
		testCompile("org.hibernate:hibernate-validator:${hibval5Version}")
823 824
		testCompile("org.apache.httpcomponents:httpclient:${httpclientVersion}")
		testCompile("commons-fileupload:commons-fileupload:${fileuploadVersion}")
825
		testCompile("commons-io:commons-io:1.3")
826
		testCompile("joda-time:joda-time:${jodaVersion}")
827
		testCompile("org.slf4j:slf4j-jcl:${slf4jVersion}")
828
		testCompile("org.mozilla:rhino:1.7.7.1")
829 830 831
		testRuntime("org.jruby:jruby:9.1.2.0")
		testRuntime("org.python:jython-standalone:2.5.3")
		testRuntime("org.webjars:underscorejs:1.8.3")
832
	}
C
Chris Beams 已提交
833 834
}

835 836 837 838 839 840 841 842
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}"
843
		compile "io.netty:netty-buffer:${nettyVersion}" // Temporarily for JsonObjectDecoder
844
		optional(project(":spring-context-support"))  // for FreeMarker support
845
		provided "javax.servlet:javax.servlet-api:${servletVersion}"
846 847 848
		optional("com.fasterxml.jackson.core:jackson-databind:${jackson2Version}")
		optional("org.freemarker:freemarker:${freemarkerVersion}")
		optional "org.apache.httpcomponents:httpclient:4.5.1" // Needed to run Javadoc without error
849 850 851 852 853 854 855 856 857 858 859
		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}")
		testCompile("io.projectreactor:reactor-netty:${reactorNettyVersion}")
		testCompile("io.reactivex:rxnetty-http:0.5.2-SNAPSHOT") {
			exclude group: 'io.reactivex', module: 'rxjava'
		}
		testCompile("io.undertow:undertow-core:1.3.20.Final")
		testCompile("io.reactivex:rxjava:${rxJavaVersion}")
		testCompile("com.fasterxml:aalto-xml:1.0.0")
860 861 862 863 864 865
		testCompile("org.slf4j:slf4j-jcl:${slf4jVersion}")
		testCompile("javax.validation:validation-api:${beanvalVersion}")
		testCompile("xmlunit:xmlunit:1.6")
	}
}

866 867 868 869 870 871 872 873 874
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"))
875 876
		optional("javax.servlet:javax.servlet-api:${servletVersion}")
		optional("javax.websocket:javax.websocket-api:${websocketVersion}")
877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900
		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"
		}
901
		optional("org.jboss.xnio:xnio-api:3.3.7.Final")
902 903 904
		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}")
905 906 907
		testCompile("io.projectreactor:reactor-core:${reactorVersion}") {
			force = true // enforce 2.0.x
		}
908 909 910
		testCompile("io.projectreactor:reactor-net:${reactorVersion}")
		testCompile("io.netty:netty-all:${nettyVersion}")
		testCompile("org.slf4j:slf4j-jcl:${slf4jVersion}")
911 912
		testRuntime("org.jboss.xnio:xnio-nio:3.3.7.Final")
		testRuntime("org.jboss.logging:jboss-logging:3.3.0.Final")
913 914 915
	}
}

P
Phillip Webb 已提交
916 917
project("spring-test") {
	description = "Spring TestContext Framework"
918

919
	dependencies {
920
		compile(project(":spring-core"))
921 922 923 924 925 926 927
		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"))
928
		optional(project(":spring-websocket"))
929
		optional("junit:junit:${junitVersion}")
930
		optional("org.junit.jupiter:junit-jupiter-api:${junitJupiterVersion}")
931
		optional("org.testng:testng:${testngVersion}")
932
		optional("javax.inject:javax.inject:1")
933 934
		optional("javax.servlet:javax.servlet-api:${servletVersion}")
		optional("javax.servlet.jsp:javax.servlet.jsp-api:${jspVersion}")
935 936 937 938
		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"
		}
939
		optional("javax.el:javax.el-api:2.2.5")
940
		optional("javax.websocket:javax.websocket-api:${websocketVersion}")
941
		optional("org.aspectj:aspectjweaver:${aspectjVersion}")
S
Sam Brannen 已提交
942
		optional("org.codehaus.groovy:groovy-all:${groovyVersion}")
943
		optional("org.hamcrest:hamcrest-core:${hamcrestVersion}")
944
		optional("xmlunit:xmlunit:${xmlunitVersion}")
945 946
		optional("net.sourceforge.htmlunit:htmlunit:2.22")
		optional("org.seleniumhq.selenium:htmlunit-driver:2.21")
947 948 949
		optional("org.seleniumhq.selenium:selenium-java:2.53.1") {
			exclude group: "io.netty", module: "netty"
		}
950 951
		optional("org.skyscreamer:jsonassert:1.3.0")
		optional("com.jayway.jsonpath:json-path:2.2.0")
952 953
		testCompile(project(":spring-context-support"))
		testCompile(project(":spring-oxm"))
954
		testCompile("javax.mail:javax.mail-api:${javamailVersion}")
S
Stephane Nicoll 已提交
955
		testCompile("javax.ejb:javax.ejb-api:${ejbVersion}")
956
		testCompile("org.hibernate:hibernate-core:${hibernate5Version}")
957
		testCompile("org.hibernate:hibernate-validator:${hibval5Version}")
958 959
		// Enable use of the JUnitPlatform Runner
		testCompile("org.junit.platform:junit-platform-runner:${junitPlatformVersion}")
960
		testCompile("com.thoughtworks.xstream:xstream:${xstreamVersion}")
961
		testCompile("com.fasterxml.jackson.core:jackson-databind:${jackson2Version}")
962
		testCompile("com.rometools:rome:${romeVersion}")
963 964
		testCompile("org.apache.tiles:tiles-api:${tiles3Version}")
		testCompile("org.apache.tiles:tiles-core:${tiles3Version}") {
965 966
			exclude group: "org.slf4j", module: "jcl-over-slf4j"
		}
967
		testCompile("org.apache.tiles:tiles-servlet:${tiles3Version}") {
968 969
			exclude group: "org.slf4j", module: "jcl-over-slf4j"
		}
970
		testCompile("org.hsqldb:hsqldb:${hsqldbVersion}")
S
Sam Brannen 已提交
971
		testCompile("org.slf4j:slf4j-jcl:${slf4jVersion}")
972
		testCompile("org.apache.httpcomponents:httpclient:${httpclientVersion}")
973
		testCompile("javax.cache:cache-api:1.0.0")
974
		testRuntime("org.junit.jupiter:junit-jupiter-engine:${junitJupiterVersion}")
975 976
		// Java Util Logging for JUnit 5.
		testRuntime("org.apache.logging.log4j:log4j-jul:${log4jVersion}")
977
		testRuntime("org.ehcache:ehcache:${ehcache3Version}")
J
Juergen Hoeller 已提交
978
		testRuntime("org.terracotta:management-model:2.0.0")
979
	}
980 981

	task testNG(type: Test) {
982
		description = 'Runs TestNG tests.'
983
		useTestNG()
984
		scanForTestClasses = false
985 986
		include(["**/testng/**/*Tests.class", "**/testng/**/*Test.class"])
		// Show STD_OUT & STD_ERR of the test JVM(s) on the console:
987
		// testLogging.showStandardStreams = true
988
		// forkEvery 1
989 990 991
	}

	test {
992
		description = 'Runs JUnit tests.'
993 994
		dependsOn testNG
		useJUnit()
995 996 997
		scanForTestClasses = false
		include(['**/*Tests.class', '**/*Test.class', '**/SpringJUnitJupiterTestSuite.class'])
		exclude(['**/testng/**/*.*'])
998 999
		// Java Util Logging for JUnit 5.
		// systemProperty('java.util.logging.manager', 'org.apache.logging.log4j.jul.LogManager')
1000
	}
1001 1002

	task aggregateTestReports(type: TestReport) {
1003
		description = 'Aggregates JUnit and TestNG test reports.'
1004 1005 1006 1007 1008
		destinationDir = test.reports.html.destination
		reportOn test, testNG
	}

	check.dependsOn aggregateTestReports
C
Chris Beams 已提交
1009 1010
}

P
Phillip Webb 已提交
1011 1012 1013
project("spring-aspects") {
	description = "Spring Aspects"
	apply from: "aspects.gradle"
1014

1015
	dependencies {
1016
		aspects(project(":spring-orm"))
1017 1018 1019
		ajc("org.aspectj:aspectjtools:${aspectjVersion}")
		rt("org.aspectj:aspectjrt:${aspectjVersion}")
		compile("org.aspectj:aspectjweaver:${aspectjVersion}")
J
Juergen Hoeller 已提交
1020
		provided("org.eclipse.persistence:javax.persistence:${jpaVersion}")
1021 1022 1023 1024 1025 1026
		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
1027
		optional("javax.transaction:javax.transaction-api:${jtaVersion}")  // for @javax.transaction.Transactional support
S
Stephane Nicoll 已提交
1028
		optional("javax.cache:cache-api:1.0.0")
1029
		testCompile(project(":spring-core"))  // for CodeStyleAspect
1030
		testCompile(project(":spring-test"))
1031
		testCompile("javax.mail:javax.mail-api:${javamailVersion}")
1032
	}
1033

1034
	eclipse.project {
P
Phillip Webb 已提交
1035
		natures += "org.eclipse.ajdt.ui.ajnature"
1036
		buildCommands = [new org.gradle.plugins.ide.eclipse.model.BuildCommand("org.eclipse.ajdt.core.ajbuilder")]
1037
	}
C
Chris Beams 已提交
1038 1039
}

1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074
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)
										}
									}
								}
							}
						}
					}
				}
			}
		}
	}
}

1075 1076
sonarqube {
	properties {
S
Stephane Nicoll 已提交
1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088
		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"
	}
}

1089
configure(rootProject) {
P
Phillip Webb 已提交
1090
	description = "Spring Framework"
1091

B
Brian Clozel 已提交
1092
	apply plugin: "org.asciidoctor.convert"
1093
	apply plugin: "docbook-reference"
1094
	apply plugin: "groovy"
R
Rob Winch 已提交
1095

1096
	// apply plugin: "detect-split-packages"
1097 1098
	apply from: "${gradleScriptDir}/jdiff.gradle"

R
Rob Winch 已提交
1099
	asciidoctor {
B
Brian Clozel 已提交
1100 1101
		sourceDir project.file('src/asciidoc')
		separateOutputDirs = false
1102
		backends = ['docbook']
B
Brian Clozel 已提交
1103
		options doctype: 'book', eruby: 'erubis'
J
Juergen Hoeller 已提交
1104
		attributes 'spring-version': project.version, 'revnumber': project.version, 'docinfo': ""
1105 1106
	}

1107 1108 1109
	reference {
		sourceDir = asciidoctor.outputDir
		pdfFilename = "spring-framework-reference.pdf"
1110
		epubFilename = "spring-framework-reference.epub"
1111 1112 1113 1114 1115 1116 1117
		expandPlaceholders = ""
	}

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

1118 1119 1120 1121 1122
	// 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")
	// }
1123

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

1127
	dependencies {  // for integration tests
1128
		testCompile(project(":spring-aop"))
1129
		testCompile(project(":spring-beans"))
1130
		testCompile(project(":spring-context"))
1131 1132
		testCompile(project(":spring-core"))
		testCompile(project(":spring-expression"))
1133
		testCompile(project(":spring-jdbc"))
1134
		testCompile(project(":spring-orm"))
1135
		testCompile(project(":spring-test"))
1136
		testCompile(project(":spring-tx"))
1137
		testCompile(project(":spring-web"))
1138
		testCompile("javax.servlet:javax.servlet-api:${servletVersion}")
1139
		testCompile("javax.inject:javax.inject:1")
J
Juergen Hoeller 已提交
1140
		testCompile("javax.resource:javax.resource-api:${jcaVersion}")
1141
		testCompile("org.aspectj:aspectjweaver:${aspectjVersion}")
1142
		testCompile("org.hibernate:hibernate-core:${hibernate5Version}")
P
Phillip Webb 已提交
1143
		testCompile("org.hsqldb:hsqldb:${hsqldbVersion}")
1144 1145 1146
	}

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

1151 1152 1153 1154 1155
		dependsOn {
			subprojects.collect {
				it.tasks.getByName("jar")
			}
		}
1156 1157 1158
		options.memberLevel = org.gradle.external.javadoc.JavadocMemberLevel.PROTECTED
		options.author = true
		options.header = rootProject.description
P
Phillip Webb 已提交
1159
		options.overview = "src/api/overview.html"
1160
		options.stylesheetFile = file("src/api/stylesheet.css")
1161
		options.splitIndex = true
C
Chris Beams 已提交
1162
		options.links(project.ext.javadocLinks)
1163
		options.addStringOption('Xdoclint:none', '-quiet')
C
Chris Beams 已提交
1164

1165 1166 1167
		source subprojects.collect { project ->
			project.sourceSets.main.allJava
		}
C
Chris Beams 已提交
1168

P
Phillip Webb 已提交
1169
		maxMemory = "1024m"
C
Chris Beams 已提交
1170
		destinationDir = new File(buildDir, "api")
1171 1172 1173

		doFirst {
			classpath = files(
1174 1175
                // ensure Servlet 3.x has precedence on the javadoc classpath
                project(":spring-webmvc").sourceSets.main.compileClasspath.files.find { it =~ "servlet-api" },
1176 1177 1178 1179 1180
				// 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 })
		}
1181 1182
	}

1183
	task docsZip(type: Zip, dependsOn: 'reference') {
P
Phillip Webb 已提交
1184 1185 1186
		group = "Distribution"
		baseName = "spring-framework"
		classifier = "docs"
1187 1188 1189
		description = "Builds -${classifier} archive containing api and reference " +
			"for deployment at http://static.springframework.org/spring-framework/docs."

P
Phillip Webb 已提交
1190 1191
		from("src/dist") {
			include "changelog.txt"
1192 1193 1194
		}

		from (api) {
1195
			into "javadoc-api"
1196 1197
		}

1198 1199
		from (reference) {
			into "spring-framework-reference"
1200 1201 1202 1203
		}
	}

	task schemaZip(type: Zip) {
P
Phillip Webb 已提交
1204 1205 1206
		group = "Distribution"
		baseName = "spring-framework"
		classifier = "schema"
1207 1208
		description = "Builds -${classifier} archive containing all " +
			"XSDs for deployment at http://springframework.org/schema."
S
Stephane Nicoll 已提交
1209
		duplicatesStrategy 'exclude'
1210
		moduleProjects.each { subproject ->
1211 1212 1213
			def Properties schemas = new Properties();

			subproject.sourceSets.main.resources.find {
P
Phillip Webb 已提交
1214
				it.path.endsWith("META-INF/spring.schemas")
1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231
			}?.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 已提交
1232 1233 1234
		group = "Distribution"
		baseName = "spring-framework"
		classifier = "dist"
1235
		description = "Builds -${classifier} archive, containing all jars and docs, " +
J
Juergen Hoeller 已提交
1236
			"suitable for community download page."
1237 1238 1239

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

P
Phillip Webb 已提交
1240 1241 1242 1243
		from("src/dist") {
			include "readme.txt"
			include "license.txt"
			include "notice.txt"
1244
			into "${baseDir}"
P
Phillip Webb 已提交
1245
			expand(copyright: new Date().format("yyyy"), version: project.version)
1246 1247 1248 1249 1250 1251 1252 1253 1254 1255
		}

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

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

1256
		moduleProjects.each { subproject ->
1257 1258
			into ("${baseDir}/libs") {
				from subproject.jar
P
Phillip Webb 已提交
1259
				if (subproject.tasks.findByPath("sourcesJar")) {
1260 1261
					from subproject.sourcesJar
				}
P
Phillip Webb 已提交
1262
				if (subproject.tasks.findByPath("javadocJar")) {
1263 1264 1265 1266 1267 1268
					from subproject.javadocJar
				}
			}
		}
	}

1269
	// Create a distribution that contains all dependencies (required and optional).
1270 1271
	// Not published by default; only for use when building from source.
	task depsZip(type: Zip, dependsOn: distZip) { zipTask ->
P
Phillip Webb 已提交
1272 1273 1274
		group = "Distribution"
		baseName = "spring-framework"
		classifier = "dist-with-deps"
1275 1276 1277 1278 1279 1280 1281 1282 1283 1284
		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 ->
1285 1286
					(subproject.configurations.runtime.resolvedConfiguration.resolvedArtifacts +
					subproject.configurations.optional.resolvedConfiguration.resolvedArtifacts).each { artifact ->
1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307
						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 已提交
1308
		description = "Generates gradlew[.bat] scripts"
1309
		gradleVersion = "2.14.1"
1310 1311

		doLast() {
1312
			def gradleOpts = "-XX:MaxMetaspaceSize=1024m -Xmx1024m"
1313
			def gradleBatOpts = "$gradleOpts -XX:MaxHeapSize=256m"
P
Phillip Webb 已提交
1314
			File wrapperFile = file("gradlew")
1315 1316
			wrapperFile.text = wrapperFile.text.replace("DEFAULT_JVM_OPTS=",
				"GRADLE_OPTS=\"$gradleOpts \$GRADLE_OPTS\"\nDEFAULT_JVM_OPTS=")
P
Phillip Webb 已提交
1317
			File wrapperBatFile = file("gradlew.bat")
1318 1319 1320 1321
			wrapperBatFile.text = wrapperBatFile.text.replace("set DEFAULT_JVM_OPTS=",
				"set GRADLE_OPTS=$gradleBatOpts %GRADLE_OPTS%\nset DEFAULT_JVM_OPTS=")
		}
	}
1322

1323
}
1324

S
Stephane Nicoll 已提交
1325
configure([project(':spring-build-src'), project(':spring-framework-bom')]) {
1326
	sonarqube {
S
Stephane Nicoll 已提交
1327 1328 1329 1330 1331
		skipProject = true
	}
}

configure(project(':spring-core')) {
1332 1333
	sonarqube {
		properties {
S
Stephane Nicoll 已提交
1334 1335 1336 1337 1338 1339
			property "sonar.exclusions",
					"src/main/java/org/springframework/cglib/**/*,src/main/java/org/springframework/asm/**/*"
		}
	}
}

1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350
/*
 * 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-")) {
1351
			return version.replace('BUILD', qualifier)
1352 1353
		}
	}
1354
	return version
1355
}