build.gradle 48.3 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

S
Stephane Nicoll 已提交
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86
	ext.aspectjVersion        = "1.8.9"
	ext.beanvalVersion        = "1.1.0.Final"
	ext.caffeineVersion       = "2.3.1"
	ext.eclipselinkVersion    = "2.6.3"
	ext.ehcacheVersion        = "2.10.2"
	ext.ehcachejcacheVersion  = "1.0.1"
	ext.ehcache3Version       = "3.1.0"
	ext.ejbVersion            = "3.2"
	ext.fileuploadVersion     = "1.3.2"
	ext.freemarkerVersion     = "2.3.23"
	ext.groovyVersion         = "2.4.7"
	ext.gsonVersion           = "2.7"
	ext.hamcrestVersion       = "1.3"
	ext.hibernate5Version     = "5.2.1.Final"
	ext.hibval5Version        = "5.2.4.Final"
	ext.hsqldbVersion         = "2.3.4"
	ext.httpasyncVersion      = "4.1.2"
	ext.httpclientVersion     = "4.5.2"
	ext.interceptorApiVersion = "1.2"
	ext.jackson2Version       = "2.8.0"
	ext.javamailVersion       = "1.5.5"
	ext.jcaVersion            = "1.7"
	ext.jettyVersion          = "9.3.10.v20160621"
	ext.jodaVersion           = "2.9.4"
	ext.jpaVersion            = "2.1.1"
	ext.jspVersion            = "2.3.2-b02"
	ext.jtaVersion            = "1.2"
	ext.junitVersion          = "4.12"
	ext.junitJupiterVersion   = '5.0.0-M1'
	ext.junitPlatformVersion  = '1.0.0-M1'
	ext.log4jVersion          = '2.6.1'
	ext.nettyVersion          = "4.1.3.Final"
	ext.okhttpVersion         = "2.7.5"
	ext.okhttp3Version        = "3.3.1"
	ext.poiVersion            = "3.14"
	ext.reactorVersion        = "2.0.8.RELEASE"
	ext.reactorCoreVersion    = '3.0.0.BUILD-SNAPSHOT'
	ext.reactorNettyVersion   = '0.5.0.BUILD-SNAPSHOT'
	ext.rxJavaVersion         = '1.1.6'
	ext.romeVersion           = "1.6.0"
	ext.servletVersion        = "3.1.0"
	ext.slf4jVersion          = "1.7.21"
	ext.snakeyamlVersion      = "1.17"
	ext.snifferVersion        = "1.15"
	ext.testngVersion         = "6.9.10"
	ext.tiles3Version         = "3.0.5"
	ext.tomcatVersion         = "8.5.4"
	ext.tyrusVersion          = "1.13"
	ext.undertowVersion       = "1.4.0.CR3"
	ext.websocketVersion      = "1.1"
	ext.woodstoxVersion       = "5.0.2"
	ext.xmlunitVersion        = "1.6"
	ext.xstreamVersion        = "1.4.9"
87

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

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

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

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

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

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

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

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

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

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

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

	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
187

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

	configurations.archives.artifacts.clear()
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

P
Phillip Webb 已提交
598 599
project("spring-jms") {
	description = "Spring JMS"
600

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

P
Phillip Webb 已提交
616 617
project("spring-jdbc") {
	description = "Spring JDBC"
618

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

P
Phillip Webb 已提交
633 634
project("spring-context-support") {
	description = "Spring Context Support"
635

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

P
Phillip Webb 已提交
659 660
project("spring-web") {
	description = "Spring Web"
661
	apply plugin: "groovy"
662

663 664 665 666 667 668 669 670 671 672 673 674 675 676 677
	// 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"
	}

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

739
	}
C
Chris Beams 已提交
740 741
}

P
Phillip Webb 已提交
742 743
project("spring-orm") {
	description = "Spring Object/Relational Mapping"
744

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

P
Phillip Webb 已提交
766 767
project("spring-webmvc") {
	description = "Spring Web MVC"
768

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

838 839 840 841 842 843 844 845
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}"
846
		compile "io.netty:netty-buffer:${nettyVersion}" // Temporarily for JsonObjectDecoder
847
		optional(project(":spring-context-support"))  // for FreeMarker support
848
		provided "javax.servlet:javax.servlet-api:${servletVersion}"
849 850 851
		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
852 853 854 855 856 857 858 859 860 861 862
		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")
863 864 865 866 867 868
		testCompile("org.slf4j:slf4j-jcl:${slf4jVersion}")
		testCompile("javax.validation:validation-api:${beanvalVersion}")
		testCompile("xmlunit:xmlunit:1.6")
	}
}

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

P
Phillip Webb 已提交
919 920
project("spring-test") {
	description = "Spring TestContext Framework"
921

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

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

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

	task aggregateTestReports(type: TestReport) {
1007
		description = 'Aggregates JUnit and TestNG test reports.'
1008 1009 1010 1011 1012
		destinationDir = test.reports.html.destination
		reportOn test, testNG
	}

	check.dependsOn aggregateTestReports
C
Chris Beams 已提交
1013 1014
}

P
Phillip Webb 已提交
1015 1016 1017
project("spring-aspects") {
	description = "Spring Aspects"
	apply from: "aspects.gradle"
1018

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

1038
	eclipse.project {
P
Phillip Webb 已提交
1039
		natures += "org.eclipse.ajdt.ui.ajnature"
1040
		buildCommands = [new org.gradle.plugins.ide.eclipse.model.BuildCommand("org.eclipse.ajdt.core.ajbuilder")]
1041
	}
C
Chris Beams 已提交
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 1075 1076 1077 1078
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)
										}
									}
								}
							}
						}
					}
				}
			}
		}
	}
}

1079 1080
sonarqube {
	properties {
S
Stephane Nicoll 已提交
1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092
		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"
	}
}

1093
configure(rootProject) {
P
Phillip Webb 已提交
1094
	description = "Spring Framework"
1095

B
Brian Clozel 已提交
1096
	apply plugin: "org.asciidoctor.convert"
1097
	apply plugin: "docbook-reference"
1098
	apply plugin: "groovy"
R
Rob Winch 已提交
1099

1100
	// apply plugin: "detect-split-packages"
1101 1102
	apply from: "${gradleScriptDir}/jdiff.gradle"

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

1111 1112 1113
	reference {
		sourceDir = asciidoctor.outputDir
		pdfFilename = "spring-framework-reference.pdf"
1114
		epubFilename = "spring-framework-reference.epub"
1115 1116 1117 1118 1119 1120 1121
		expandPlaceholders = ""
	}

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

1122 1123 1124 1125 1126
	// 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")
	// }
1127

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

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

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

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

1169 1170 1171
		source subprojects.collect { project ->
			project.sourceSets.main.allJava
		}
C
Chris Beams 已提交
1172

P
Phillip Webb 已提交
1173
		maxMemory = "1024m"
C
Chris Beams 已提交
1174
		destinationDir = new File(buildDir, "api")
1175 1176 1177

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

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

P
Phillip Webb 已提交
1194 1195
		from("src/dist") {
			include "changelog.txt"
1196 1197 1198
		}

		from (api) {
1199
			into "javadoc-api"
1200 1201
		}

1202 1203
		from (reference) {
			into "spring-framework-reference"
1204 1205 1206 1207
		}
	}

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

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

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

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

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

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

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

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

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

1327
}
1328

S
Stephane Nicoll 已提交
1329
configure([project(':spring-build-src'), project(':spring-framework-bom')]) {
1330
	sonarqube {
S
Stephane Nicoll 已提交
1331 1332 1333 1334 1335
		skipProject = true
	}
}

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

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