build.gradle 49.8 KB
Newer Older
1 2
buildscript {
	repositories {
3
		maven { url "https://repo.spring.io/plugins-release" }
4 5 6
	}
	dependencies {
		classpath("org.springframework.build.gradle:propdeps-plugin:0.0.7")
7
		classpath("org.asciidoctor:asciidoctor-gradle-plugin:1.5.2")
8 9
		classpath("io.spring.gradle:docbook-reference-plugin:0.3.1")
		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"
}

17
ext {
18 19 20 21 22 23 24 25
	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'
	linkScmDevConnection = 'scm:git:ssh://git@github.com:spring-projects/spring-framework.git'

	moduleProjects = subprojects.findAll {
26 27 28 29 30 31 32 33
		!it.name.equals('spring-build-src') && !it.name.equals('spring-framework-bom')
	}
}

configure(allprojects) { project ->
	group = "org.springframework"
	version = qualifyVersionIfNecessary(version)

34
	ext.aspectjVersion       = "1.8.9"
35
	ext.caffeineVersion      = "2.3.5"
36
	ext.eclipselinkVersion   = "2.4.2"
37
	ext.ehcacheVersion       = "2.10.4"
38
	ext.ehcachejcacheVersion = "1.0.1"
39
	ext.ehcache3Version      = "3.1.4"
40
	ext.ejbVersion           = "3.0"
41
	ext.fileuploadVersion    = "1.3.3"
42
	ext.freemarkerVersion    = "2.3.23"
43
	ext.groovyVersion        = "2.4.15"
44
	ext.gsonVersion          = "2.8.5"
45
	ext.guavaVersion         = "20.0"
46
	ext.hamcrestVersion      = "1.3"
47
	ext.hibernate3Version    = "3.6.10.Final"
48
	ext.hibernate4Version    = "4.3.11.Final"
49
	ext.hibernate5Version    = "5.2.10.Final"
50
	ext.hibval4Version       = "4.3.2.Final"
51
	ext.hibval5Version       = "5.2.5.Final"
52
	ext.hsqldbVersion        = "2.3.4"
53 54 55
	ext.httpasyncVersion     = "4.1.4"
	ext.httpclientVersion    = "4.5.6"
	ext.jackson2Version      = "2.8.11.3"
56
	ext.jasperreportsVersion = "6.2.1"  // our tests fail with JR-internal NPEs against 6.2.2 and higher
57
	ext.javamailVersion      = "1.5.6"
58
	ext.jettyVersion         = "9.3.14.v20161028"  // as of 9.3.15, Jetty has hard Servlet 3.1 requirement
59
	ext.jetty94Version       = "9.4.6.v20170531"  // for spring-websocket support, optimized for Jetty 9.4
60
	ext.jodaVersion          = "2.9.9"
61
	ext.jrubyVersion         = "1.7.27"  // JRuby 9000 primarily supported through JSR-223 (StandardScriptFactory)
62
	ext.jtaVersion           = "1.2"
63
	ext.junitVersion         = "4.12"
64
	ext.log4jVersion         = "1.2.17"
65
	ext.nettyVersion         = "4.1.31.Final"
66
	ext.okhttpVersion        = "2.7.5"
67
	ext.okhttp3Version       = "3.8.1"
68
	ext.openjpaVersion       = "2.4.2"
69
	ext.poiVersion           = "3.14"
70
	ext.reactorVersion       = "2.0.8.RELEASE"
71
	ext.romeVersion          = "1.7.4"
72
	ext.slf4jVersion         = "1.7.25"
73
	ext.snakeyamlVersion     = "1.17"
74
	ext.snifferVersion       = "1.17"
75
	ext.testngVersion        = "6.9.10"
76
	ext.tiles2Version        = "2.2.2"
77 78
	ext.tiles3Version        = "3.0.8"
	ext.tomcatVersion        = "8.5.35"
79
	ext.tyrusVersion         = "1.3.5"  // constrained by WebLogic 12.1.3 support
80
	ext.undertowVersion      = "1.3.33.Final"
81 82
	ext.xmlunitVersion       = "1.6"
	ext.xstreamVersion       = "1.4.9"
83

84 85 86 87 88 89 90
	ext.gradleScriptDir = "${rootProject.projectDir}/gradle"

	apply plugin: "propdeps"
	apply plugin: "java"
	apply plugin: "test-source-set-dependencies"
	apply from: "${gradleScriptDir}/ide.gradle"

91 92 93 94 95
	configurations {
		sniffer
		javaApiSignature
	}

96 97 98 99 100 101 102 103 104
	compileJava.options*.compilerArgs = [
		"-Xlint:serial", "-Xlint:varargs", "-Xlint:cast", "-Xlint:classfile",
		"-Xlint:dep-ann", "-Xlint:divzero", "-Xlint:empty", "-Xlint:finally",
		"-Xlint:overrides", "-Xlint:path", "-Xlint:processing", "-Xlint:static",
		"-Xlint:try", "-Xlint:fallthrough", "-Xlint:rawtypes", "-Xlint:deprecation",
		"-Xlint:unchecked", "-Xlint:-options", "-Werror"
	]

	compileTestJava.options*.compilerArgs = [
105
		"-Xlint:serial", "-Xlint:-varargs", "-Xlint:cast", "-Xlint:classfile",
106 107 108 109 110
		"-Xlint:dep-ann", "-Xlint:divzero", "-Xlint:empty", "-Xlint:finally",
		"-Xlint:overrides", "-Xlint:path", "-Xlint:processing", "-Xlint:static",
		"-Xlint:try", "-Xlint:-fallthrough", "-Xlint:-rawtypes", "-Xlint:-deprecation",
		"-Xlint:-unchecked", "-Xlint:-options"]

111
	compileJava {
112 113
		sourceCompatibility = 1.6
		targetCompatibility = 1.6
114
		options.encoding = 'UTF-8'
115
	}
116

117
	compileTestJava {
118 119
		sourceCompatibility = 1.8
		targetCompatibility = 1.8
120
		options.encoding = 'UTF-8'
121
		options.compilerArgs += "-parameters"
122 123 124 125 126 127
	}

	test {
		systemProperty("java.awt.headless", "true")
		systemProperty("testGroups", project.properties.get("testGroups"))
		scanForTestClasses = false
128
		include(["**/*Tests.class", "**/*Test.class"])
129 130
		// Since we set scanForTestClasses to false, we need to filter out inner
		// classes with the "$" pattern; otherwise, using -Dtest.single=MyTests to
131
		// run MyTests by itself will fail if MyTests contains any inner classes.
132 133 134 135
		exclude(["**/Abstract*.class", '**/*$*'])
	}

	repositories {
136
		maven { url "https://repo.spring.io/libs-release" }
137 138 139
	}

	dependencies {
140 141 142
		testCompile("junit:junit:${junitVersion}") {
			exclude group:'org.hamcrest', module:'hamcrest-core'
		}
143
		testCompile("org.mockito:mockito-core:1.10.19") {
144 145
			exclude group:'org.hamcrest', module:'hamcrest-core'
		}
146
		testCompile("org.hamcrest:hamcrest-all:${hamcrestVersion}")
147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185

		sniffer("org.codehaus.mojo:animal-sniffer-ant-tasks:${snifferVersion}")
		javaApiSignature("org.codehaus.mojo.signature:java16:1.1@signature")  // API level from JDK 6 update 18
	}

	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

		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)
				annotation(className: "org.springframework.lang.UsesJava7")
				annotation(className: "org.springframework.lang.UsesJava8")
				annotation(className: "org.springframework.lang.UsesSunHttpServer")
			}
		}
186 187 188
	}

	ext.javadocLinks = [
189
		"http://docs.oracle.com/javase/8/docs/api/",
190
		"http://docs.oracle.com/javaee/7/api/",
191
		"http://docs.oracle.com/cd/E13222_01/wls/docs90/javadocs/",  // CommonJ
192 193 194 195 196 197 198 199 200 201 202
		"http://pic.dhe.ibm.com/infocenter/wasinfo/v7r0/topic/com.ibm.websphere.javadoc.doc/web/apidocs/",
		"http://glassfish.java.net/nonav/docs/v3/api/",
		"http://docs.jboss.org/jbossas/javadoc/4.0.5/connector/",
		"http://docs.jboss.org/jbossas/javadoc/7.1.2.Final/",
		"http://commons.apache.org/proper/commons-lang/javadocs/api-2.5/",
		"http://commons.apache.org/proper/commons-codec/apidocs/",
		"http://commons.apache.org/proper/commons-dbcp/apidocs/",
		"http://portals.apache.org/pluto/portlet-2.0-apidocs/",
		"http://tiles.apache.org/tiles-request/apidocs/",
		"http://tiles.apache.org/framework/apidocs/",
		"http://www.eclipse.org/aspectj/doc/released/aspectj5rt-api/",
203 204 205
		"http://ehcache.org/apidocs/${ehcacheVersion}",
		"http://ehcache.org/apidocs/${ehcache3Version}",
		"http://quartz-scheduler.org/api/2.2.1/",
206 207 208
		"http://fasterxml.github.io/jackson-core/javadoc/2.8/",
		"http://fasterxml.github.io/jackson-databind/javadoc/2.8/",
		"http://fasterxml.github.io/jackson-dataformat-xml/javadoc/2.8/",
209
		"http://hc.apache.org/httpcomponents-client-ga/httpclient/apidocs/"
210 211 212 213 214 215 216
	] as String[]
}

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

217 218 219 220
	configurations {
		jacoco
	}
	dependencies {
221
		jacoco("org.jacoco:org.jacoco.agent:0.7.5.201505241946:runtime")
222 223 224
	}

	gradle.taskGraph.whenReady {taskGraph ->
225
		if (taskGraph.hasTask(':sonarqube')) {
226 227 228 229
			test.jvmArgs "-javaagent:${configurations.jacoco.asPath}=destfile=${buildDir}/jacoco.exec,includes=org.springframework.*"
		}
	}

230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250
	jar {
		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

		from("${rootProject.projectDir}/src/dist") {
			include "license.txt"
			include "notice.txt"
			into "META-INF"
			expand(copyright: new Date().format("yyyy"), version: project.version)
		}
	}

	javadoc {
		description = "Generates project-level javadoc for use in -javadoc jar"

		options.memberLevel = org.gradle.external.javadoc.JavadocMemberLevel.PROTECTED
		options.author = true
		options.header = project.name
		options.links(project.ext.javadocLinks)
251
		options.addStringOption('Xdoclint:none', '-quiet')
252

253 254
		// Suppress warnings due to cross-module @see and @link references.
		// Note that global 'api' task does display all warnings.
255
		logging.captureStandardError LogLevel.INFO
256
		logging.captureStandardOutput LogLevel.INFO  // suppress "## warnings" message
257 258 259 260 261
	}

	task sourcesJar(type: Jar, dependsOn: classes) {
		classifier = 'sources'
		from sourceSets.main.allSource
262
		// Don't include or exclude anything explicitly by default. See SPR-12085.
263 264 265 266 267 268 269 270 271 272 273 274 275 276 277
	}

	task javadocJar(type: Jar) {
		classifier = "javadoc"
		from javadoc
	}

	artifacts {
		archives sourcesJar
		archives javadocJar
	}
}

project("spring-build-src") {
	description = "Exposes gradle buildSrc for IDE support"
278

279 280 281 282 283 284 285 286 287 288 289 290 291
	apply plugin: "groovy"

	dependencies {
		compile gradleApi()
		compile localGroovy()
	}

	configurations.archives.artifacts.clear()
}

project("spring-core") {
	description = "Spring Core"

292 293 294
	// spring-core includes asm and repackages cglib, inlining both into the spring-core jar.
	// cglib itself depends on asm and is therefore further transformed by the JarJar task to
	// depend on org.springframework.asm; this avoids including two different copies of asm.
295
	def cglibVersion = "3.2.6"
296
	def objenesisVersion = "2.6"
297 298 299 300

	configurations {
		jarjar
		cglib
301
		objenesis
302 303
	}

304 305 306
	task cglibRepackJar(type: Jar) { repackJar ->
		repackJar.baseName = "spring-cglib-repack"
		repackJar.version = cglibVersion
307 308 309 310 311 312

		doLast() {
			project.ant {
				taskdef name: "jarjar", classname: "com.tonicsystems.jarjar.JarJarTask",
					classpath: configurations.jarjar.asPath
				jarjar(destfile: repackJar.archivePath) {
313
					configurations.cglib.each { originalJar ->
314 315
						zipfileset(src: originalJar)
					}
316
					// Repackage net.sf.cglib => org.springframework.cglib
317
					rule(pattern: "net.sf.cglib.**", result: "org.springframework.cglib.@1")
318
					// As mentioned above, transform cglib's internal asm dependencies from
319 320
					// org.objectweb.asm => org.springframework.asm. Doing this counts on the
					// the fact that Spring and cglib depend on the same version of asm!
321 322 323 324 325 326
					rule(pattern: "org.objectweb.asm.**", result: "org.springframework.asm.@1")
				}
			}
		}
	}

327 328 329
	task objenesisRepackJar(type: Jar) { repackJar ->
		repackJar.baseName = "spring-objenesis-repack"
		repackJar.version = objenesisVersion
330 331 332 333 334 335

		doLast() {
			project.ant {
				taskdef name: "jarjar", classname: "com.tonicsystems.jarjar.JarJarTask",
					classpath: configurations.jarjar.asPath
				jarjar(destfile: repackJar.archivePath) {
336
					configurations.objenesis.each { originalJar ->
337 338
						zipfileset(src: originalJar)
					}
339
					// Repackage org.objenesis => org.springframework.objenesis
340
					rule(pattern: "org.objenesis.**", result: "org.springframework.objenesis.@1")
341 342 343 344 345 346 347
				}
			}
		}
	}

	dependencies {
		cglib("cglib:cglib:${cglibVersion}@jar")
348
		objenesis("org.objenesis:objenesis:${objenesisVersion}@jar")
349 350 351
		jarjar("com.googlecode.jarjar:jarjar:1.3")

		compile(files(cglibRepackJar))
352
		compile(files(objenesisRepackJar))
353 354
		compile("commons-logging:commons-logging:1.2")
		optional("commons-codec:commons-codec:1.10")
355
		optional("org.aspectj:aspectjweaver:${aspectjVersion}")
356
		optional("net.sf.jopt-simple:jopt-simple:5.0.3")
357
		optional("log4j:log4j:${log4jVersion}")
358
		testCompile("org.apache.tomcat.embed:tomcat-embed-core:${tomcatVersion}")
359
		testCompile("xmlunit:xmlunit:${xmlunitVersion}")
360
		testCompile("com.fasterxml.woodstox:woodstox-core:5.0.3") {
361 362 363 364 365
			exclude group: "stax", module: "stax-api"
		}
	}

	jar {
366
		// Inline repackaged cglib classes directly into spring-core jar
367 368 369 370
		dependsOn cglibRepackJar
		from(zipTree(cglibRepackJar.archivePath)) {
			include "org/springframework/cglib/**"
		}
371 372 373 374 375 376

		dependsOn objenesisRepackJar
		from(zipTree(objenesisRepackJar.archivePath)) {
			include "org/springframework/objenesis/**"
		}
	}
377 378 379 380 381 382 383 384 385
}

project("spring-beans") {
	description = "Spring Beans"

	dependencies {
		compile(project(":spring-core"))
		compile(files(project(":spring-core").cglibRepackJar))
		optional("javax.inject:javax.inject:1")
386
		optional("javax.el:javax.el-api:2.2.5")
387
		optional("org.yaml:snakeyaml:${snakeyamlVersion}")
388
		testCompile("log4j:log4j:${log4jVersion}")
389
		testCompile("org.apache.tomcat.embed:tomcat-embed-core:${tomcatVersion}")
390
	}
391 392
}

393 394
project("spring-beans-groovy") {
	description "Groovy Bean Definitions"
395

396 397 398 399 400 401 402 403
	merge.into = project(":spring-beans")
	apply plugin: "groovy"

	dependencies {
		compile(project(":spring-core"))
		optional("org.codehaus.groovy:groovy-all:${groovyVersion}")
	}

404 405
	// This module's Java and Groovy sources need to be compiled together.
	compileJava.enabled = false
406 407 408 409 410 411 412 413 414
	sourceSets {
		main {
			groovy {
				srcDir "src/main/java"
			}
		}
	}

	compileGroovy {
415 416
		sourceCompatibility = 1.6
		targetCompatibility = 1.6
417 418 419
	}
}

420 421 422 423 424 425 426
project("spring-aop") {
	description = "Spring AOP"

	dependencies {
		compile(project(":spring-beans"))
		compile(project(":spring-core"))
		compile(files(project(":spring-core").cglibRepackJar))
427
		compile(files(project(":spring-core").objenesisRepackJar))
428
		optional("org.aspectj:aspectjweaver:${aspectjVersion}")
429
		optional("commons-pool:commons-pool:1.6")
430
		optional("org.apache.commons:commons-pool2:2.4.2")
431
		optional("com.jamonapi:jamon:2.81")
432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448
	}
}

project("spring-expression") {
	description = "Spring Expression Language (SpEL)"

	dependencies {
		compile(project(":spring-core"))
	}
}

project("spring-instrument") {
	description = "Spring Instrument"

	jar {
		manifest.attributes["Premain-Class"] =
			"org.springframework.instrument.InstrumentationSavingAgent"
449 450
		manifest.attributes["Agent-Class"] =
			"org.springframework.instrument.InstrumentationSavingAgent"
451 452 453 454 455 456 457 458 459 460 461 462
		manifest.attributes["Can-Redefine-Classes"] = "true"
		manifest.attributes["Can-Retransform-Classes"] = "true"
		manifest.attributes["Can-Set-Native-Method-Prefix"] = "false"
	}
}

project("spring-instrument-tomcat") {
	description = "Spring Instrument Tomcat"

	dependencies {
		provided("org.apache.tomcat:catalina:6.0.16")
	}
463 464 465 466

	jar {
		exclude("org/apache/**")  // exclude the mock used to bridge between pre-7.0.63 and 7.0.63+
	}
467 468 469 470
}

project("spring-context") {
	description = "Spring Context"
471

472
	apply plugin: "groovy"
473 474 475 476 477

	dependencies {
		compile(project(":spring-aop"))
		compile(project(":spring-beans"))
		compile(project(":spring-core"))
478
		compile(project(":spring-expression"))
479 480 481
		compile(files(project(":spring-core").cglibRepackJar))
		optional(project(":spring-instrument"))
		optional("javax.inject:javax.inject:1")
482
		optional("javax.ejb:ejb-api:${ejbVersion}")
483
		optional("javax.enterprise.concurrent:javax.enterprise.concurrent-api:1.0")
484
		optional("javax.money:money-api:1.0.1")
485
		optional("org.eclipse.persistence:javax.persistence:2.0.0")
486
		optional("javax.validation:validation-api:1.0.0.GA")
487
		optional("org.hibernate:hibernate-validator:${hibval4Version}")
488
		optional("joda-time:joda-time:${jodaVersion}")
489
		optional("org.aspectj:aspectjweaver:${aspectjVersion}")
490
		optional("org.codehaus.groovy:groovy-all:${groovyVersion}")
491
		optional("org.beanshell:bsh:2.0b5")
492
		optional("org.jruby:jruby:${jrubyVersion}")
493
		testCompile("javax.inject:javax.inject-tck:1")
494
		testCompile("org.javamoney:moneta:1.1")
495
		testCompile("commons-dbcp:commons-dbcp:1.4")
496
		testCompile("org.apache.commons:commons-pool2:2.4.2")
497 498 499 500
		testCompile("org.slf4j:slf4j-api:${slf4jVersion}")
	}
}

501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531
project("spring-oxm") {
	description = "Spring Object/XML Marshalling"
	apply from: "oxm.gradle"

	dependencies {
		compile(project(":spring-beans"))
		compile(project(":spring-core"))
		optional("org.codehaus.castor:castor-xml:1.4.1")  {
			exclude group: 'stax', module: 'stax-api'
			exclude group: "org.springframework", module: "spring-context"
		}
		optional("org.apache.xmlbeans:xmlbeans:2.6.0") {
			exclude group: 'stax', module: 'stax-api'
		}
		optional("com.thoughtworks.xstream:xstream:${xstreamVersion}") {
			exclude group: 'xpp3', module: 'xpp3_min'
			exclude group: 'xmlpull', module: 'xmlpull'
		}
		optional("org.jibx:jibx-run:1.2.6")
		testCompile(project(":spring-context"))
		testCompile("org.ogce:xpp3:1.1.6")
		testCompile("org.codehaus.jettison:jettison:1.3.8") {
			exclude group: 'stax', module: 'stax-api'
		}
		testCompile("xmlunit:xmlunit:${xmlunitVersion}")
		testCompile(files(genCastor.classesDir).builtBy(genCastor))
		testCompile(files(genJaxb.classesDir).builtBy(genJaxb))
		testCompile(files(genXmlbeans.classesDir).builtBy(genXmlbeans))
	}
}

532 533 534 535 536 537
project("spring-messaging") {
	description = "Spring Messaging"

	dependencies {
		compile(project(":spring-beans"))
		compile(project(":spring-context"))
538
		compile(project(":spring-core"))
539 540 541
		optional(project(":spring-oxm"))
		optional("io.projectreactor:reactor-core:${reactorVersion}")
		optional("io.projectreactor:reactor-net:${reactorVersion}") {
542 543
			exclude group: "io.netty", module: "netty-all"
		}
544
		optional("io.netty:netty-all:${nettyVersion}")
545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563
		optional("org.eclipse.jetty.websocket:websocket-server:${jettyVersion}") {
			exclude group: "javax.servlet", module: "javax.servlet-api"
		}
		optional("org.eclipse.jetty.websocket:websocket-client:${jettyVersion}")
		optional("com.fasterxml.jackson.core:jackson-databind:${jackson2Version}")
		testCompile("javax.inject:javax.inject-tck:1")
		testCompile("javax.servlet:javax.servlet-api:3.1.0")
		testCompile("javax.validation:validation-api:1.0.0.GA")
		testCompile("com.thoughtworks.xstream:xstream:${xstreamVersion}")
		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")
		testCompile("org.eclipse.jetty:jetty-webapp:${jettyVersion}") {
			exclude group: "javax.servlet", module: "javax.servlet-api"
		}
		testCompile("org.apache.tomcat.embed:tomcat-embed-core:${tomcatVersion}")
		testCompile("org.apache.tomcat.embed:tomcat-embed-websocket:${tomcatVersion}")
564
		testCompile("io.netty:netty-all:${nettyVersion}")
565
		testCompile("commons-dbcp:commons-dbcp:1.4")
566
		testCompile("log4j:log4j:${log4jVersion}")
567
		testCompile("org.slf4j:slf4j-jcl:${slf4jVersion}")
568
		testCompile("xmlunit:xmlunit:${xmlunitVersion}")
569 570 571
	}
}

572 573 574 575 576 577 578
project("spring-tx") {
	description = "Spring Transaction"

	dependencies {
		compile(project(":spring-beans"))
		compile(project(":spring-core"))
		optional(project(":spring-aop"))
579
		optional(project(":spring-context"))  // for JCA, @EnableTransactionManagement
580
		optional("javax.transaction:javax.transaction-api:${jtaVersion}")
581
		optional("javax.resource:connector-api:1.5")
582
		optional("javax.ejb:ejb-api:${ejbVersion}")
583 584
		optional("com.ibm.websphere:uow:6.0.2.17")
		testCompile("org.aspectj:aspectjweaver:${aspectjVersion}")
585
		testCompile("org.eclipse.persistence:javax.persistence:2.0.0")
586
		testCompile("org.codehaus.groovy:groovy-all:${groovyVersion}")
587 588 589 590 591 592 593 594
	}
}

project("spring-jms") {
	description = "Spring JMS"

	dependencies {
		compile(project(":spring-aop"))
595
		compile(project(":spring-beans"))
596
		compile(project(":spring-context"))
597
		compile(project(":spring-core"))
598
		compile(project(":spring-messaging"))
599
		compile(project(":spring-tx"))
600
		provided("javax.jms:jms-api:1.1-rev-1")
601
		optional(project(":spring-oxm"))
602
		optional("javax.transaction:javax.transaction-api:${jtaVersion}")
603
		optional("javax.resource:connector-api:1.5")
604
		optional("com.fasterxml.jackson.core:jackson-databind:${jackson2Version}")
605 606 607 608 609 610 611 612 613 614
	}
}

project("spring-jdbc") {
	description = "Spring JDBC"

	dependencies {
		compile(project(":spring-beans"))
		compile(project(":spring-core"))
		compile(project(":spring-tx"))
615
		optional(project(":spring-context"))  // for JndiDataSourceLookup
616 617
		optional("javax.transaction:javax.transaction-api:${jtaVersion}")
		optional("com.mchange:c3p0:0.9.5.2")
618
		optional("org.hsqldb:hsqldb:${hsqldbVersion}")
619 620 621
		optional("com.h2database:h2:1.4.193")
		optional("org.apache.derby:derby:10.13.1.1")
		optional("org.apache.derby:derbyclient:10.13.1.1")
622 623 624 625 626 627 628 629 630
	}
}

project("spring-context-support") {
	description = "Spring Context Support"

	dependencies {
		compile(project(":spring-beans"))
		compile(project(":spring-context"))
631
		compile(project(":spring-core"))
632 633
		optional(project(":spring-jdbc"))  // for Quartz support
		optional(project(":spring-tx"))  // for Quartz support
634
		optional("javax.mail:javax.mail-api:${javamailVersion}")
635
		optional("javax.cache:cache-api:1.0.0")
636
		optional("com.google.guava:guava:${guavaVersion}")
637
		optional("com.github.ben-manes.caffeine:caffeine:${caffeineVersion}")
638
		optional("net.sf.ehcache:ehcache:${ehcacheVersion}")
639
		optional("org.quartz-scheduler:quartz:2.2.3")
640
		optional("org.codehaus.fabric3.api:commonj:1.1.0")
641
		optional("org.apache.velocity:velocity:1.7")
642
		optional("org.freemarker:freemarker:${freemarkerVersion}")
643
		optional("com.lowagie:itext:2.1.7")
644
		optional("net.sf.jasperreports:jasperreports:$jasperreportsVersion") {
645 646 647 648
			exclude group: "com.fasterxml.jackson.core", module: "jackson-annotations"
			exclude group: "com.fasterxml.jackson.core", module: "jackson-core"
			exclude group: "com.fasterxml.jackson.core", module: "jackson-databind"
			exclude group: "org.olap4j", module: "olap4j"
649
			exclude group: "xml-apis", module: "xml-apis"
650
			exclude group: "org.springframework", module: "spring-context"
651
		}
652
		testCompile(project(":spring-context"))
653
		testCompile("org.apache.poi:poi:${poiVersion}")
654 655
		testCompile("commons-beanutils:commons-beanutils:1.8.0")  // for Velocity/JasperReports
		testCompile("commons-digester:commons-digester:1.8.1")  // for Velocity/JasperReports
656
		testCompile("org.hsqldb:hsqldb:${hsqldbVersion}")
657
		testCompile("org.slf4j:slf4j-api:${slf4jVersion}")
658 659
		testRuntime("com.sun.mail:javax.mail:${javamailVersion}")
		testRuntime("org.ehcache:jcache:${ehcachejcacheVersion}")
660 661
		testRuntime("org.ehcache:ehcache:${ehcache3Version}")
		testRuntime("org.terracotta:management-model:2.3.0")
662 663 664 665 666
	}
}

project("spring-web") {
	description = "Spring Web"
667

668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683
	apply plugin: "groovy"

	// 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"
	}
684 685

	dependencies {
686 687
		compile(project(":spring-aop"))  // for JaxWsPortProxyFactoryBean
		compile(project(":spring-beans"))  // for MultipartFilter
688 689 690
		compile(project(":spring-context"))
		compile(project(":spring-core"))
		provided("javax.servlet:javax.servlet-api:3.0.1")
691
		optional(project(":spring-oxm"))  // for MarshallingHttpMessageConverter
692
		optional("javax.servlet.jsp:javax.servlet.jsp-api:2.2.1")
693
		optional("javax.portlet:portlet-api:2.0")
694 695
		optional("javax.el:javax.el-api:2.2.5")
		optional("javax.faces:javax.faces-api:2.2")
696
		optional("javax.validation:validation-api:1.0.0.GA")
697 698
		optional("org.codehaus.groovy:groovy-all:${groovyVersion}")
		optional("com.caucho:hessian:4.0.38")
699 700 701
		optional("commons-fileupload:commons-fileupload:${fileuploadVersion}")
		optional("org.apache.httpcomponents:httpclient:${httpclientVersion}")
		optional("org.apache.httpcomponents:httpasyncclient:${httpasyncVersion}")
702
		optional("io.netty:netty-all:${nettyVersion}")
703
		optional("com.squareup.okhttp:okhttp:${okhttpVersion}")
704
		optional("com.squareup.okhttp3:okhttp:${okhttp3Version}")
705
		optional("com.fasterxml.jackson.core:jackson-databind:${jackson2Version}")
706
		optional("com.fasterxml.jackson.dataformat:jackson-dataformat-xml:2.8.11")
707
		optional("com.google.code.gson:gson:${gsonVersion}")
708
		optional("com.rometools:rome:${romeVersion}")
709 710
		optional("org.eclipse.jetty:jetty-servlet:${jettyVersion}") {
			exclude group: "javax.servlet", module: "javax.servlet-api"
711
		}
712 713
		optional("org.eclipse.jetty:jetty-server:${jettyVersion}") {
			exclude group: "javax.servlet", module: "javax.servlet-api"
714
		}
715
		optional("log4j:log4j:${log4jVersion}")
716
		optional("com.google.protobuf:protobuf-java:2.6.1")
717
		optional("com.googlecode.protobuf-java-format:protobuf-java-format:1.4")
718
		optional("javax.mail:javax.mail-api:${javamailVersion}")
719
		testCompile(project(":spring-context-support"))  // for JafMediaTypeFactory
720
		testCompile("xmlunit:xmlunit:${xmlunitVersion}")
721
		testCompile("org.slf4j:slf4j-jcl:${slf4jVersion}")
722
		testCompile("org.skyscreamer:jsonassert:1.4.0")
723 724 725
		testCompile("org.apache.taglibs:taglibs-standard-jstlel:1.2.1") {
			exclude group: "org.apache.taglibs", module: "taglibs-standard-spec"
		}
726 727
		testCompile("com.fasterxml.jackson.datatype:jackson-datatype-joda:2.8.11")
		testCompile("com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.8.11")
728
		testCompile("com.fasterxml.jackson.module:jackson-module-kotlin:2.8.11.1")
729
    	testCompile("com.squareup.okhttp3:mockwebserver:${okhttp3Version}")
730
		testRuntime("com.sun.mail:javax.mail:${javamailVersion}")
731
	}
732 733 734 735
}

project("spring-orm") {
	description = "Spring Object/Relational Mapping"
736 737 738 739 740 741 742 743 744

	dependencies {
		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"))
745
		optional("org.eclipse.persistence:javax.persistence:2.0.5")
746 747
		optional("org.eclipse.persistence:org.eclipse.persistence.core:${eclipselinkVersion}")
		optional("org.eclipse.persistence:org.eclipse.persistence.jpa:${eclipselinkVersion}") {
748 749 750 751 752 753 754 755 756
			exclude group: 'org.eclipse.persistence', module: 'javax.persistence'
		}
		optional("org.hibernate:hibernate-core:${hibernate3Version}") {
			exclude group: 'org.hibernate.javax.persistence', module: 'hibernate-jpa-2.0-api'
			exclude group: 'javax.transaction', module: 'jta'
		}
		optional("org.hibernate:hibernate-entitymanager:${hibernate3Version}") {
			exclude group: 'org.hibernate.javax.persistence', module: 'hibernate-jpa-2.0-api'
		}
757
		optional("org.apache.openjpa:openjpa:${openjpaVersion}") {
758 759 760 761 762
			exclude group: 'junit', module: 'junit'
			exclude group: 'org.apache.geronimo.specs', module: 'geronimo-jpa_2.0_spec'
			exclude group: 'org.apache.geronimo.specs', module: 'geronimo-jta_1.1_spec'
			exclude group: 'org.apache.geronimo.specs', module: 'geronimo-jms_1.1_spec'
		}
763
		optional("javax.jdo:jdo-api:3.1") {
764 765 766 767
			exclude group: 'javax.transaction', module: 'transaction-api'
		}
		optional("javax.servlet:javax.servlet-api:3.0.1")
		testCompile("commons-dbcp:commons-dbcp:1.4")
768
		testCompile("org.aspectj:aspectjweaver:${aspectjVersion}")
769
		testCompile("org.hsqldb:hsqldb:${hsqldbVersion}")
770 771 772 773 774 775 776 777 778 779 780 781
		testCompile("org.slf4j:slf4j-jcl:${slf4jVersion}")
	}
}

project("spring-orm-hibernate4") {
	description = "Spring Object/Relational Mapping - Hibernate 4 support"
	merge.into = project(":spring-orm")

	dependencies {
		provided(project(":spring-jdbc"))
		provided(project(":spring-tx"))
		optional(project(":spring-web"))
782 783 784
		optional("org.hibernate:hibernate-core:${hibernate4Version}")
		optional("org.hibernate:hibernate-entitymanager:${hibernate4Version}")
		optional("javax.servlet:javax.servlet-api:3.0.1")
785
		testCompile("javax.validation:validation-api:1.1.0.GA")
786
		testCompile("org.hibernate:hibernate-validator:${hibval5Version}")
787 788
		testCompile("javax.el:javax.el-api:2.2.5")
		testCompile("org.glassfish.web:javax.el:2.2.6")
789 790 791
	}
}

792 793 794 795 796 797 798 799 800 801 802 803 804 805
project("spring-orm-hibernate5") {
	description = "Spring Object/Relational Mapping - Hibernate 5 support"
	merge.into = project(":spring-orm")

	dependencies {
		provided(project(":spring-jdbc"))
		provided(project(":spring-tx"))
		optional(project(":spring-web"))
		optional("org.hibernate:hibernate-core:${hibernate5Version}")
		optional("javax.servlet:javax.servlet-api:3.0.1")
		optional("javax.transaction:javax.transaction-api:${jtaVersion}")
	}
}

806 807 808 809
project("spring-webmvc") {
	description = "Spring Web MVC"

	dependencies {
810
		compile(project(":spring-aop"))
811 812 813
		compile(project(":spring-beans"))
		compile(project(":spring-context"))
		compile(project(":spring-core"))
814
		compile(files(project(":spring-core").objenesisRepackJar))
815 816
		compile(project(":spring-expression"))
		compile(project(":spring-web"))
817
		provided("javax.servlet:javax.servlet-api:3.1.0")
818 819
		optional(project(":spring-context-support"))  // for Velocity support
		optional(project(":spring-oxm"))  // for MarshallingView
820 821
		optional("javax.servlet.jsp:javax.servlet.jsp-api:2.2.1")
		optional("javax.servlet.jsp.jstl:javax.servlet.jsp.jstl-api:1.2.1")
822
		optional("net.sourceforge.jexcelapi:jxl:2.6.12")
823 824
		optional("org.apache.poi:poi:${poiVersion}")
		optional("org.apache.poi:poi-ooxml:${poiVersion}")
825
		optional("org.apache.velocity:velocity:1.7")
826
		optional("velocity-tools:velocity-tools-view:1.4")
827
		optional("org.freemarker:freemarker:${freemarkerVersion}")
828
		optional("org.codehaus.groovy:groovy-all:${groovyVersion}")
829
		optional("com.lowagie:itext:2.1.7")
830
		optional("net.sf.jasperreports:jasperreports:$jasperreportsVersion") {
831 832 833 834
			exclude group: "com.fasterxml.jackson.core", module: "jackson-annotations"
			exclude group: "com.fasterxml.jackson.core", module: "jackson-core"
			exclude group: "com.fasterxml.jackson.core", module: "jackson-databind"
			exclude group: "org.olap4j", module: "olap4j"
835
			exclude group: "xml-apis", module: "xml-apis"
836
			exclude group: "org.springframework", module: "spring-context"
837
		}
838
		optional("com.fasterxml.jackson.core:jackson-databind:${jackson2Version}")
839
		optional("com.fasterxml.jackson.dataformat:jackson-dataformat-xml:2.8.11")
840
		optional("com.rometools:rome:${romeVersion}")
841 842 843
		optional("javax.el:javax.el-api:2.2.5")
		optional("org.apache.tiles:tiles-api:${tiles3Version}")
		optional("org.apache.tiles:tiles-core:${tiles3Version}") {
844 845
			exclude group: "org.slf4j", module: "jcl-over-slf4j"
		}
846
		optional("org.apache.tiles:tiles-servlet:${tiles3Version}") {
847 848
			exclude group: "org.slf4j", module: "jcl-over-slf4j"
		}
849
		optional("org.apache.tiles:tiles-jsp:${tiles3Version}") {
850 851
			exclude group: "org.slf4j", module: "jcl-over-slf4j"
		}
852
		optional("org.apache.tiles:tiles-el:${tiles3Version}") {
853 854
			exclude group: "org.slf4j", module: "jcl-over-slf4j"
		}
855
		optional("org.apache.tiles:tiles-extras:${tiles3Version}") {
856 857 858
			exclude group: "org.slf4j", module: "jcl-over-slf4j"
			exclude group: "org.springframework", module: "spring-web"
		}
859
		optional('org.webjars:webjars-locator:0.32-1')
860
		testCompile("xmlunit:xmlunit:${xmlunitVersion}")
861 862 863 864 865 866 867 868
		testCompile("dom4j:dom4j:1.6.1") {
			exclude group: "xml-apis", module: "xml-apis"
		}
		testCompile("jaxen:jaxen:1.1.1") {
			exclude group: "xml-apis", module: "xml-apis"
			exclude group: "xom", module: "xom"
			exclude group: "xerces", module: "xercesImpl"
		}
869 870
		testCompile("org.eclipse.jetty:jetty-servlet:${jettyVersion}") {
			exclude group: "javax.servlet", module: "javax.servlet"
871
		}
872 873
		testCompile("org.eclipse.jetty:jetty-server:${jettyVersion}") {
			exclude group: "javax.servlet", module: "javax.servlet"
874 875
		}
		testCompile("javax.validation:validation-api:1.0.0.GA")
876 877 878
		testCompile("org.hibernate:hibernate-validator:${hibval4Version}")
		testCompile("org.apache.httpcomponents:httpclient:${httpclientVersion}")
		testCompile("commons-fileupload:commons-fileupload:${fileuploadVersion}")
879
		testCompile("commons-io:commons-io:1.4")
880
		testCompile("joda-time:joda-time:${jodaVersion}")
881
		testCompile("org.slf4j:slf4j-jcl:${slf4jVersion}")
882
		testCompile("org.mozilla:rhino:1.7.7.2")
883 884 885
		testRuntime("org.jruby:jruby:${jrubyVersion}")
		testRuntime("org.python:jython-standalone:2.5.3")
		testRuntime("org.webjars:underscorejs:1.8.3")
886 887 888
	}
}

889 890
project("spring-webmvc-tiles2") {
	description = "Spring Framework Tiles2 Integration"
891 892 893 894 895 896
	merge.into = project(":spring-webmvc")

	dependencies {
		provided(project(":spring-context"))
		provided(project(":spring-web"))
		provided("javax.servlet:javax.servlet-api:3.0.1")
897 898
		optional("javax.servlet.jsp:javax.servlet.jsp-api:2.2.1")
		optional("javax.servlet.jsp.jstl:javax.servlet.jsp.jstl-api:1.2.1")
899 900
		optional("org.apache.tiles:tiles-api:${tiles2Version}")
		optional("org.apache.tiles:tiles-core:${tiles2Version}") {
901 902
			exclude group: "org.slf4j", module: "jcl-over-slf4j"
		}
903
		optional("org.apache.tiles:tiles-servlet:${tiles2Version}") {
904 905
			exclude group: "org.slf4j", module: "jcl-over-slf4j"
		}
906
		optional("org.apache.tiles:tiles-jsp:${tiles2Version}") {
907 908
			exclude group: "org.slf4j", module: "jcl-over-slf4j"
		}
909
		optional("org.apache.tiles:tiles-el:${tiles2Version}") {
910 911
			exclude group: "org.slf4j", module: "jcl-over-slf4j"
		}
912
		optional("org.apache.tiles:tiles-extras:${tiles2Version}") {
913
			exclude group: "org.slf4j", module: "jcl-over-slf4j"
914
			exclude group: "org.apache.velocity", module: "velocity-tools"
915 916 917 918 919 920 921 922 923 924 925 926 927 928 929
			exclude group: "org.springframework", module: "spring-web"
		}
		testCompile("org.slf4j:slf4j-jcl:${slf4jVersion}")
	}
}

project("spring-webmvc-portlet") {
	description = "Spring Web Portlet"

	dependencies {
		compile(project(":spring-beans"))
		compile(project(":spring-context"))
		compile(project(":spring-core"))
		compile(project(":spring-web"))
		compile(project(":spring-webmvc"))
930
		provided("javax.servlet:javax.servlet-api:3.0.1")
931
		provided("javax.portlet:portlet-api:2.0")
932
		optional("commons-fileupload:commons-fileupload:${fileuploadVersion}")
933
	}
934
}
935

936 937 938 939 940
project("spring-websocket") {
	description = "Spring WebSocket"

	dependencies {
		compile(project(":spring-context"))
941
		compile(project(":spring-core"))
942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957
		compile(project(":spring-web"))
		optional(project(":spring-messaging"))
		optional(project(":spring-webmvc"))
		optional("javax.servlet:javax.servlet-api:3.1.0")
		optional("javax.websocket:javax.websocket-api:1.0")
		optional("org.apache.tomcat:tomcat-websocket:${tomcatVersion}") {
			exclude group: "org.apache.tomcat", module: "tomcat-websocket-api"
			exclude group: "org.apache.tomcat", module: "tomcat-servlet-api"
		}
		optional("org.glassfish.tyrus:tyrus-spi:${tyrusVersion}")
		optional("org.glassfish.tyrus:tyrus-core:${tyrusVersion}")
		optional("org.glassfish.tyrus:tyrus-server:${tyrusVersion}")
		optional("org.glassfish.tyrus:tyrus-container-servlet:${tyrusVersion}")
		optional("org.eclipse.jetty:jetty-webapp:${jettyVersion}") {
			exclude group: "javax.servlet", module: "javax.servlet"
		}
958
		optional("org.eclipse.jetty.websocket:websocket-server:${jetty94Version}") {
959 960
			exclude group: "javax.servlet", module: "javax.servlet"
		}
961 962
		optional("org.eclipse.jetty.websocket:websocket-client:${jetty94Version}")
		optional("org.eclipse.jetty:jetty-client:${jetty94Version}")
963 964 965 966 967 968 969 970 971 972 973 974 975
		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"
		}
		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}")
		testCompile("io.projectreactor:reactor-net:${reactorVersion}")
		testCompile("io.netty:netty-all:${nettyVersion}")
976
		testCompile("log4j:log4j:${log4jVersion}")
977 978
		testCompile("org.slf4j:slf4j-jcl:${slf4jVersion}")
	}
979 980 981 982 983 984 985
}

project("spring-test") {
	description = "Spring TestContext Framework"

	dependencies {
		compile(project(":spring-core"))
986
		optional(project(":spring-aop"))
987 988 989 990
		optional(project(":spring-beans"))
		optional(project(":spring-context"))
		optional(project(":spring-jdbc"))
		optional(project(":spring-orm"))
991
		optional(project(":spring-tx"))
992 993 994
		optional(project(":spring-web"))
		optional(project(":spring-webmvc"))
		optional(project(":spring-webmvc-portlet"))
995
		optional(project(":spring-websocket"))
996
		optional("junit:junit:${junitVersion}")
997
		optional("org.testng:testng:${testngVersion}")
998
		optional("javax.inject:javax.inject:1")
999 1000 1001 1002 1003 1004
		optional("javax.servlet:javax.servlet-api:3.0.1")
		optional("javax.servlet.jsp:javax.servlet.jsp-api:2.2.1")
		optional("javax.servlet.jsp.jstl:javax.servlet.jsp.jstl-api:1.2.1")
		optional("org.apache.taglibs:taglibs-standard-jstlel:1.2.1") {
			exclude group: "org.apache.taglibs", module: "taglibs-standard-spec"
		}
1005
		optional("javax.portlet:portlet-api:2.0")
1006
		optional("javax.el:javax.el-api:2.2.5")
1007
		optional("javax.websocket:javax.websocket-api:1.0")
1008
		optional("org.aspectj:aspectjweaver:${aspectjVersion}")
1009
		optional("org.codehaus.groovy:groovy-all:${groovyVersion}")
1010 1011
		optional("org.hamcrest:hamcrest-core:${hamcrestVersion}")
		optional("xmlunit:xmlunit:${xmlunitVersion}")
1012 1013
		optional("net.sourceforge.htmlunit:htmlunit:2.23")
		optional("org.seleniumhq.selenium:htmlunit-driver:2.23.2")
1014
		optional("org.seleniumhq.selenium:selenium-java:2.53.1")
1015
		optional("org.skyscreamer:jsonassert:1.4.0")
1016
		optional("com.jayway.jsonpath:json-path:2.3.0")
1017 1018
		testCompile(project(":spring-context-support"))
		testCompile(project(":spring-oxm"))
1019 1020
		testCompile("javax.mail:javax.mail-api:${javamailVersion}")
		testCompile("javax.ejb:ejb-api:${ejbVersion}")
1021 1022
		testCompile("org.hibernate:hibernate-core:${hibernate4Version}")
		testCompile("org.hibernate:hibernate-entitymanager:${hibernate4Version}")
1023
		testCompile("org.hibernate:hibernate-validator:${hibval5Version}")
1024 1025
		testCompile("com.thoughtworks.xstream:xstream:${xstreamVersion}")
		testCompile("com.fasterxml.jackson.core:jackson-databind:${jackson2Version}")
1026
		testCompile("com.rometools:rome:${romeVersion}")
1027 1028 1029 1030 1031 1032 1033 1034
		testCompile("org.apache.tiles:tiles-api:${tiles3Version}")
		testCompile("org.apache.tiles:tiles-core:${tiles3Version}") {
			exclude group: "org.slf4j", module: "jcl-over-slf4j"
		}
		testCompile("org.apache.tiles:tiles-servlet:${tiles3Version}") {
			exclude group: "org.slf4j", module: "jcl-over-slf4j"
		}
		testCompile("org.hsqldb:hsqldb:${hsqldbVersion}")
1035 1036 1037
		testCompile("org.slf4j:slf4j-jcl:${slf4jVersion}")
		testCompile("org.apache.httpcomponents:httpclient:${httpclientVersion}")
		testCompile("javax.cache:cache-api:1.0.0")
1038
		testRuntime("log4j:log4j:${log4jVersion}")
1039 1040 1041
	}

	task testNG(type: Test) {
1042
		description = 'Runs TestNG tests.'
1043 1044
		useTestNG()
		scanForTestClasses = false
1045 1046
		include(["**/testng/**/*Tests.class", "**/testng/**/*Test.class"])
		// Show STD_OUT & STD_ERR of the test JVM(s) on the console:
1047
		// testLogging.showStandardStreams = true
1048
		// forkEvery 1
1049 1050 1051
	}

	test {
1052
		description = 'Runs JUnit tests.'
1053 1054 1055 1056 1057
		dependsOn testNG
		useJUnit()
		exclude "**/testng/**/*.*"
	}

1058 1059 1060 1061
	task aggregateTestReports(type: TestReport) {
		description = 'Aggregates JUnit and TestNG test reports.'
		destinationDir = test.reports.html.destination
		reportOn test, testNG
1062 1063
	}

1064
	check.dependsOn aggregateTestReports
1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075
}

project("spring-aspects") {
	description = "Spring Aspects"
	apply from: "aspects.gradle"

	dependencies {
		aspects(project(":spring-orm"))
		ajc("org.aspectj:aspectjtools:${aspectjVersion}")
		rt("org.aspectj:aspectjrt:${aspectjVersion}")
		compile("org.aspectj:aspectjweaver:${aspectjVersion}")
1076
		provided("org.eclipse.persistence:javax.persistence:2.0.0")
1077 1078 1079
		optional(project(":spring-aop"))  // for @Async support
		optional(project(":spring-beans"))  // for @Configurable support
		optional(project(":spring-context"))  // for @Enable* support
1080
		optional(project(":spring-context-support"))  // for JavaMail and JSR-107 support
1081 1082
		optional(project(":spring-orm"))  // for JPA exception translation support
		optional(project(":spring-tx"))  // for JPA, @Transactional support
1083
		optional("javax.transaction:javax.transaction-api:${jtaVersion}")  // for @javax.transaction.Transactional support
1084
		optional("javax.cache:cache-api:1.0.0")
1085
		testCompile(project(":spring-core"))  // for CodeStyleAspect
1086
		testCompile(project(":spring-test"))
1087
		testCompile("javax.mail:javax.mail-api:${javamailVersion}")
1088 1089 1090 1091
	}

	eclipse.project {
		natures += "org.eclipse.ajdt.ui.ajnature"
1092
		buildCommands = [new org.gradle.plugins.ide.eclipse.model.BuildCommand("org.eclipse.ajdt.core.ajbuilder")]
1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130
	}
}

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)
										}
									}
								}
							}
						}
					}
				}
			}
		}
	}
}

1131 1132
sonarqube {
	properties {
1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144
		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"
	}
}

1145 1146 1147
configure(rootProject) {
	description = "Spring Framework"

1148
	apply plugin: "org.asciidoctor.convert"
1149 1150 1151 1152 1153 1154
	apply plugin: "docbook-reference"
	apply plugin: "groovy"

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

1155
	asciidoctor {
1156 1157 1158 1159 1160
		sourceDir project.file('src/asciidoc')
		separateOutputDirs = false
		backends = ['docbook']
		options doctype: 'book', eruby: 'erubis'
		attributes 'spring-version': project.version, 'revnumber': project.version, 'docinfo': ""
1161 1162
	}

1163
	reference {
1164
		sourceDir = asciidoctor.outputDir
1165
		pdfFilename = "spring-framework-reference.pdf"
1166
		epubFilename = "spring-framework-reference.epub"
1167 1168 1169 1170 1171
		expandPlaceholders = ""
	}

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

	// TODO: DetectSplitPackagesPlugin fails in line 154 due to method not found on java.io.File.
1175
	// TODO: Possibly related to user rights or OS differences; passes on local Windows machine.
1176 1177 1178 1179 1180 1181 1182
	// detectSplitPackages {
	//	projectsToScan -= project(":spring-instrument-tomcat")
	// }

	// don't publish the default jar for the root project
	configurations.archives.artifacts.clear()

1183
	dependencies {  // for integration tests
1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194
		testCompile(project(":spring-aop"))
		testCompile(project(":spring-beans"))
		testCompile(project(":spring-context"))
		testCompile(project(":spring-core"))
		testCompile(project(":spring-expression"))
		testCompile(project(":spring-jdbc"))
		testCompile(project(":spring-orm"))
		testCompile(project(":spring-test"))
		testCompile(project(":spring-tx"))
		testCompile(project(":spring-web"))
		testCompile(project(":spring-webmvc-portlet"))
1195
		testCompile("javax.servlet:javax.servlet-api:3.0.1")
1196 1197 1198 1199
		testCompile("javax.portlet:portlet-api:2.0")
		testCompile("javax.inject:javax.inject:1")
		testCompile("javax.resource:connector-api:1.5")
		testCompile("org.aspectj:aspectjweaver:${aspectjVersion}")
1200 1201
		testCompile("org.hibernate:hibernate-core:${hibernate4Version}")
		testCompile("org.hsqldb:hsqldb:${hsqldbVersion}")
1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220
	}

	task api(type: Javadoc) {
		group = "Documentation"
		description = "Generates aggregated Javadoc API documentation."
		title = "${rootProject.description} ${version} API"

		dependsOn {
			subprojects.collect {
				it.tasks.getByName("jar")
			}
		}
		options.memberLevel = org.gradle.external.javadoc.JavadocMemberLevel.PROTECTED
		options.author = true
		options.header = rootProject.description
		options.overview = "src/api/overview.html"
		options.stylesheetFile = file("src/api/stylesheet.css")
		options.splitIndex = true
		options.links(project.ext.javadocLinks)
1221
		options.addStringOption('Xdoclint:none', '-quiet')
1222 1223 1224 1225 1226 1227 1228 1229 1230 1231

		source subprojects.collect { project ->
			project.sourceSets.main.allJava
		}

		maxMemory = "1024m"
		destinationDir = new File(buildDir, "api")

		doFirst {
			classpath = files(
1232
				// Ensure Servlet 3.x and Hibernate 4.x have precedence on the javadoc
1233 1234 1235
				// classpath over their respective 2.5 and 3.x variants
				project(":spring-webmvc").sourceSets.main.compileClasspath.files.find { it =~ "servlet-api" },
				rootProject.sourceSets.test.compileClasspath.files.find { it =~ "hibernate-core" },
1236
				// Ensure the javadoc process can resolve types compiled from .aj sources
1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295
				project(":spring-aspects").sourceSets.main.output
			)
			classpath += files(subprojects.collect { it.sourceSets.main.compileClasspath })
		}
	}

	task docsZip(type: Zip, dependsOn: 'reference') {
		group = "Distribution"
		baseName = "spring-framework"
		classifier = "docs"
		description = "Builds -${classifier} archive containing api and reference " +
			"for deployment at http://static.springframework.org/spring-framework/docs."

		from("src/dist") {
			include "changelog.txt"
		}

		from (api) {
			into "javadoc-api"
		}

		from (reference) {
			into "spring-framework-reference"
		}
	}

	task schemaZip(type: Zip) {
		group = "Distribution"
		baseName = "spring-framework"
		classifier = "schema"
		description = "Builds -${classifier} archive containing all " +
			"XSDs for deployment at http://springframework.org/schema."
		duplicatesStrategy 'exclude'
		moduleProjects.each { subproject ->
			def Properties schemas = new Properties();

			subproject.sourceSets.main.resources.find {
				it.path.endsWith("META-INF/spring.schemas")
			}?.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]) {
		group = "Distribution"
		baseName = "spring-framework"
		classifier = "dist"
		description = "Builds -${classifier} archive, containing all jars and docs, " +
1296
			"suitable for community download page."
1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328

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

		from("src/dist") {
			include "readme.txt"
			include "license.txt"
			include "notice.txt"
			into "${baseDir}"
			expand(copyright: new Date().format("yyyy"), version: project.version)
		}

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

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

		moduleProjects.each { subproject ->
			into ("${baseDir}/libs") {
				from subproject.jar
				if (subproject.tasks.findByPath("sourcesJar")) {
					from subproject.sourcesJar
				}
				if (subproject.tasks.findByPath("javadocJar")) {
					from subproject.javadocJar
				}
			}
		}
	}

1329
	// Create a distribution that contains all dependencies (required and optional).
1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368
	// Not published by default; only for use when building from source.
	task depsZip(type: Zip, dependsOn: distZip) { zipTask ->
		group = "Distribution"
		baseName = "spring-framework"
		classifier = "dist-with-deps"
		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 ->
					(subproject.configurations.runtime.resolvedConfiguration.resolvedArtifacts +
					subproject.configurations.optional.resolvedConfiguration.resolvedArtifacts).each { artifact ->
						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) {
		description = "Generates gradlew[.bat] scripts"
1369
		gradleVersion = "2.14.1"
1370 1371

		doLast() {
1372
			def gradleOpts = "-XX:MaxMetaspaceSize=1024m -Xmx1024m"
1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384
			def gradleBatOpts = "$gradleOpts -XX:MaxHeapSize=256m"
			File wrapperFile = file("gradlew")
			wrapperFile.text = wrapperFile.text.replace("DEFAULT_JVM_OPTS=",
				"GRADLE_OPTS=\"$gradleOpts \$GRADLE_OPTS\"\nDEFAULT_JVM_OPTS=")
			File wrapperBatFile = file("gradlew.bat")
			wrapperBatFile.text = wrapperBatFile.text.replace("set DEFAULT_JVM_OPTS=",
				"set GRADLE_OPTS=$gradleBatOpts %GRADLE_OPTS%\nset DEFAULT_JVM_OPTS=")
		}
	}

}

1385
configure([project(':spring-build-src'), project(':spring-framework-bom')]) {
1386
	sonarqube {
1387 1388 1389 1390 1391
		skipProject = true
	}
}

configure(project(':spring-core')) {
1392 1393
	sonarqube {
		properties {
1394 1395 1396 1397 1398 1399
			property "sonar.exclusions",
					"src/main/java/org/springframework/cglib/**/*,src/main/java/org/springframework/asm/**/*"
		}
	}
}

1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415
/*
 * 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-")) {
			return version.replace('BUILD', qualifier)
		}
	}
	return version
}