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

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

S
Stephane Nicoll 已提交
17 18 19 20 21 22
ext {
	linkHomepage = 'https://projects.spring.io/spring-framework'
	linkCi = 'https://build.spring.io/browse/SPR'
	linkIssue = 'https://jira.spring.io/browse/SPR'
	linkScmUrl = 'https://github.com/spring-projects/spring-framework'
	linkScmConnection = 'scm:git:git://github.com/spring-projects/spring-framework.git'
23
	linkScmDevConnection = 'scm:git:ssh://git@github.com:spring-projects/spring-framework.git'
24

25
	moduleProjects = subprojects.findAll {
26 27
		!it.name.equals('spring-build-src') && !it.name.equals('spring-framework-bom')
	}
S
Stephane Nicoll 已提交
28 29
}

C
Chris Beams 已提交
30
configure(allprojects) { project ->
31 32
	group = "org.springframework"
	version = qualifyVersionIfNecessary(version)
33

34
	ext.activationApiVersion   = "1.1.1"
35
	ext.annotationApiVersion   = "1.2"
J
Juergen Hoeller 已提交
36
	ext.aspectjVersion         = "1.9.0.BETA-5"
37 38 39 40 41 42 43
	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.1"
	ext.ejbApiVersion          = "3.2"
J
Juergen Hoeller 已提交
44
	ext.elApiVersion           = "3.0.1-b04"
45 46 47 48 49 50 51 52 53 54 55
	ext.fileuploadVersion      = "1.3.2"
	ext.freemarkerVersion      = "2.3.25-incubating"
	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"
J
Juergen Hoeller 已提交
56
	ext.jackson2Version        = "2.8.1"
57 58
	ext.javamailVersion        = "1.5.5"
	ext.jaxbVersion            = "2.2.11"
59
	ext.jaxwsVersion           = "2.2.11"
60
	ext.jcaVersion             = "1.7"
J
Juergen Hoeller 已提交
61
	ext.jettyVersion           = "9.3.11.v20160721"
62 63 64 65 66
	ext.jodaVersion            = "2.9.4"
	ext.jpaVersion             = "2.1.1"
	ext.jspVersion             = "2.3.2-b02"
	ext.jtaVersion             = "1.2"
	ext.junitVersion           = "4.12"
S
Sam Brannen 已提交
67 68
	ext.junitJupiterVersion    = '5.0.0-M2'
	ext.junitPlatformVersion   = '1.0.0-M2'
69
	ext.log4jVersion           = '2.6.2'
J
Juergen Hoeller 已提交
70
	ext.nettyVersion           = "4.1.4.Final"
71 72 73
	ext.okhttpVersion          = "2.7.5"
	ext.okhttp3Version         = "3.4.1"
	ext.poiVersion             = "3.14"
B
Brian Clozel 已提交
74
	ext.protobufVersion        = "3.0.0"
75 76
	ext.reactivestreamsVersion = "1.0.0"
	ext.reactorVersion         = "2.0.8.RELEASE"
77 78
	ext.reactorCoreVersion     = '3.0.0.RC1'
	ext.reactorNettyVersion    = '0.5.0.M2'
79
	ext.romeVersion            = "1.6.0"
J
Juergen Hoeller 已提交
80
	ext.rxjavaVersion          = '1.1.8'
81
	ext.rxnettyVersion         = '0.5.2-rc.3'
82 83 84 85 86 87 88 89
	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"
J
Juergen Hoeller 已提交
90
	ext.undertowVersion        = "1.4.0.CR4"
91 92
	ext.websocketVersion       = "1.1"
	ext.woodstoxVersion        = "5.0.2"
93
	ext.xmlunitVersion         = "2.2.1"
94
	ext.xstreamVersion         = "1.4.9"
95

96
	ext.gradleScriptDir = "${rootProject.projectDir}/gradle"
97

98
	apply plugin: "propdeps"
P
Phillip Webb 已提交
99
	apply plugin: "java"
100
	apply plugin: "test-source-set-dependencies"
101
	apply from: "${gradleScriptDir}/ide.gradle"
C
Chris Beams 已提交
102

S
Stephane Nicoll 已提交
103 104 105 106 107
	configurations {
		sniffer
		javaApiSignature
	}

108 109 110 111 112 113 114 115 116 117 118 119
	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
			}
		}
	}

S
Stephane Nicoll 已提交
120 121
	compileJava.options.encoding = 'UTF-8'

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

P
Phillip Webb 已提交
130
	compileTestJava.options*.compilerArgs = [
131
		"-Xlint:serial", "-Xlint:-varargs", "-Xlint:cast", "-Xlint:classfile",
P
Phillip Webb 已提交
132
		"-Xlint:dep-ann", "-Xlint:divzero", "-Xlint:empty", "-Xlint:finally",
S
Stephane Nicoll 已提交
133
		"-Xlint:overrides", "-Xlint:path", "-Xlint:processing", "-Xlint:static",
P
Phillip Webb 已提交
134 135 136
		"-Xlint:try", "-Xlint:-fallthrough", "-Xlint:-rawtypes", "-Xlint:-deprecation",
		"-Xlint:-unchecked", "-Xlint:-options"]

137
	compileJava {
138 139
		sourceCompatibility = 1.8
		targetCompatibility = 1.8
140 141 142
	}

	compileTestJava {
J
Juergen Hoeller 已提交
143 144
		sourceCompatibility = 1.8
		targetCompatibility = 1.8
145
		options.compilerArgs += "-parameters"
J
Juergen Hoeller 已提交
146 147
	}

C
Chris Beams 已提交
148 149
	test {
		systemProperty("java.awt.headless", "true")
150
		systemProperty("testGroups", project.properties.get("testGroups"))
151
		scanForTestClasses = false
152
		include(["**/*Tests.class", "**/*Test.class"])
153 154
		// Since we set scanForTestClasses to false, we need to filter out inner
		// classes with the "$" pattern; otherwise, using -Dtest.single=MyTests to
155
		// run MyTests by itself will fail if MyTests contains any inner classes.
156
		exclude(["**/Abstract*.class", '**/*$*'])
C
Chris Beams 已提交
157
	}
C
Chris Beams 已提交
158

159
	repositories {
B
Brian Clozel 已提交
160
		maven { url "https://repo.spring.io/libs-release" }
161
		maven { url "https://repo.spring.io/milestone" }
162
	}
C
Chris Beams 已提交
163

164
	dependencies {
165 166 167
		testCompile("junit:junit:${junitVersion}") {
			exclude group:'org.hamcrest', module:'hamcrest-core'
		}
168
		testCompile("org.mockito:mockito-core:1.10.19") {
169 170
			exclude group:'org.hamcrest', module:'hamcrest-core'
		}
171
		testCompile("org.hamcrest:hamcrest-all:${hamcrestVersion}")
172 173
		testRuntime("org.apache.logging.log4j:log4j-core:${log4jVersion}")
		testRuntime("org.apache.logging.log4j:log4j-jcl:${log4jVersion}")
174

S
Stephane Nicoll 已提交
175
		sniffer("org.codehaus.mojo:animal-sniffer-ant-tasks:${snifferVersion}")
176
		javaApiSignature("org.codehaus.mojo.signature:java18:1.0@signature")
S
Stephane Nicoll 已提交
177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195
	}

	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
196

S
Stephane Nicoll 已提交
197 198 199 200 201 202 203
		doLast {
			ant.taskdef(
				name: 'animalSniffer',
				classname: 'org.codehaus.mojo.animal_sniffer.ant.CheckSignatureTask',
				classpath: configurations.sniffer.asPath
			)

204 205 206 207 208 209 210
			// TODO: Animal Sniffer currently chokes on optional JDK 9 bytecode in AspectJ 1.9 beta 5
			// ant.animalSniffer(
			// 		signature: "$buildDir/javaApiSignature/javaApi.signature",
			// 		classpath: sourceSets.main.compileClasspath.asPath) {
			// 	path(path: sourceSets.main.output.classesDir)
			// 	annotation(className: "org.springframework.lang.UsesSunHttpServer")
			// }
S
Stephane Nicoll 已提交
211
		}
212
	}
C
Chris Beams 已提交
213 214

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

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

S
Stephane Nicoll 已提交
239 240 241 242 243
	configurations {
		jacoco
	}

	dependencies {
244
		jacoco("org.jacoco:org.jacoco.agent:0.7.5.201505241946:runtime")
S
Stephane Nicoll 已提交
245 246 247
	}

	gradle.taskGraph.whenReady {taskGraph ->
248
		if (taskGraph.hasTask(':sonarqube')) {
S
Stephane Nicoll 已提交
249 250 251 252
			test.jvmArgs "-javaagent:${configurations.jacoco.asPath}=destfile=${buildDir}/jacoco.exec,includes=org.springframework.*"
		}
	}

253
	jar {
P
Phillip Webb 已提交
254 255 256 257
		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
258 259 260 261 262

		from("${rootProject.projectDir}/src/dist") {
			include "license.txt"
			include "notice.txt"
			into "META-INF"
P
Phillip Webb 已提交
263
			expand(copyright: new Date().format("yyyy"), version: project.version)
264 265 266 267
		}
	}

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

270 271 272
		options.memberLevel = org.gradle.external.javadoc.JavadocMemberLevel.PROTECTED
		options.author = true
		options.header = project.name
C
Chris Beams 已提交
273
		options.links(project.ext.javadocLinks)
274
		options.addStringOption('Xdoclint:none', '-quiet')
C
Chris Beams 已提交
275 276 277 278 279

		// 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
280 281
	}

282 283
	task sourcesJar(type: Jar, dependsOn: classes) {
		classifier = 'sources'
284
		from sourceSets.main.allSource
285
		// don't include or exclude anything explicitly by default. See SPR-12085.
286 287 288
	}

	task javadocJar(type: Jar) {
P
Phillip Webb 已提交
289
		classifier = "javadoc"
290 291 292 293 294 295 296
		from javadoc
	}

	artifacts {
		archives sourcesJar
		archives javadocJar
	}
C
Chris Beams 已提交
297 298
}

299 300
project("spring-build-src") {
	description = "Exposes gradle buildSrc for IDE support"
301
	apply plugin: "groovy"
302 303 304

	dependencies {
		compile gradleApi()
R
Rob Winch 已提交
305
		compile localGroovy()
306 307 308 309 310
	}

	configurations.archives.artifacts.clear()
}

P
Phillip Webb 已提交
311 312
project("spring-core") {
	description = "Spring Core"
313

314 315
	// 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
316
	// further transformed by the JarJar task to depend on org.springframework.asm; this
317
	// avoids including two different copies of asm unnecessarily.
J
Juergen Hoeller 已提交
318
	def cglibVersion = "3.2.4"
319
	def objenesisVersion = "2.4"
320 321 322 323

	configurations {
		jarjar
		cglib
324
		objenesis
325 326 327 328 329 330 331 332 333 334 335 336 337 338 339
	}

	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 已提交
340 341
					rule(pattern: "net.sf.cglib.**", result: "org.springframework.cglib.@1")
					// as mentioned above, transform cglib"s internal asm dependencies from
342 343
					// 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 已提交
344
					rule(pattern: "org.objectweb.asm.**", result: "org.springframework.asm.@1")
345 346 347 348 349
				}
			}
		}
	}

350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368
	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")
				}
			}
		}
	}

369
	dependencies {
370
		cglib("cglib:cglib:${cglibVersion}@jar")
371
		objenesis("org.objenesis:objenesis:${objenesisVersion}@jar")
372
		jarjar("com.googlecode.jarjar:jarjar:1.3")
373

P
Phillip Webb 已提交
374
		compile(files(cglibRepackJar))
375
		compile(files(objenesisRepackJar))
376
		compile("commons-logging:commons-logging:1.2")
377
		optional("org.aspectj:aspectjweaver:${aspectjVersion}")
378
		optional("net.sf.jopt-simple:jopt-simple:5.0.2")
379
		optional("org.reactivestreams:reactive-streams:${reactivestreamsVersion}")
380
		optional("io.projectreactor:reactor-core:${reactorCoreVersion}")
381
		optional "io.reactivex:rxjava:${rxjavaVersion}"
382
		optional("io.netty:netty-buffer:${nettyVersion}")
383
		testCompile("javax.xml.bind:jaxb-api:${jaxbVersion}")
384
		testCompile("org.apache.tomcat.embed:tomcat-embed-core:${tomcatVersion}")
385
		testCompile("org.xmlunit:xmlunit-matchers:${xmlunitVersion}")
386
		testCompile("com.fasterxml.woodstox:woodstox-core:${woodstoxVersion}") {
P
Phillip Webb 已提交
387 388
			exclude group: "stax", module: "stax-api"
		}
389 390 391
	}

	jar {
392
		// inline repackaged cglib classes directly into the spring-core jar
393 394
		dependsOn cglibRepackJar
		from(zipTree(cglibRepackJar.archivePath)) {
P
Phillip Webb 已提交
395
			include "org/springframework/cglib/**"
396
		}
397 398 399 400 401

		dependsOn objenesisRepackJar
		from(zipTree(objenesisRepackJar.archivePath)) {
			include "org/springframework/objenesis/**"
		}
402
	}
C
Chris Beams 已提交
403 404
}

P
Phillip Webb 已提交
405 406
project("spring-beans") {
	description = "Spring Beans"
407

408
	dependencies {
409 410
		compile(project(":spring-core"))
		compile(files(project(":spring-core").cglibRepackJar))
411
		optional("javax.inject:javax.inject:1")
412
		optional("javax.el:javax.el-api:${elApiVersion}")
413
		optional("org.yaml:snakeyaml:${snakeyamlVersion}")
414
		testCompile("org.apache.tomcat.embed:tomcat-embed-core:${tomcatVersion}")
J
Juergen Hoeller 已提交
415
	}
C
Chris Beams 已提交
416 417
}

418 419
project("spring-beans-groovy") {
	description "Groovy Bean Definitions"
J
Juergen Hoeller 已提交
420
	merge.into = project(":spring-beans")
421
	apply plugin: "groovy"
J
Juergen Hoeller 已提交
422 423 424

	dependencies {
		compile(project(":spring-core"))
425
		optional("org.codehaus.groovy:groovy-all:${groovyVersion}")
J
Juergen Hoeller 已提交
426 427 428 429 430 431 432
	}

	// this module's Java and Groovy sources need to be compiled together
	compileJava.enabled=false
	sourceSets {
		main {
			groovy {
433
				srcDir "src/main/java"
J
Juergen Hoeller 已提交
434 435 436
			}
		}
	}
437 438

	compileGroovy {
439 440
		sourceCompatibility = 1.8
		targetCompatibility = 1.8
441
	}
J
Juergen Hoeller 已提交
442 443
}

P
Phillip Webb 已提交
444 445
project("spring-aop") {
	description = "Spring AOP"
446

447
	dependencies {
448
		compile(project(":spring-beans"))
449 450
		compile(project(":spring-core"))
		compile(files(project(":spring-core").cglibRepackJar))
451
		compile(files(project(":spring-core").objenesisRepackJar))
452
		optional("org.aspectj:aspectjweaver:${aspectjVersion}")
453
		optional("org.apache.commons:commons-pool2:2.4.2")
454
		optional("com.jamonapi:jamon:2.81")
455
	}
C
Chris Beams 已提交
456 457
}

P
Phillip Webb 已提交
458 459
project("spring-expression") {
	description = "Spring Expression Language (SpEL)"
460

461
	dependencies {
462
		compile(project(":spring-core"))
463
	}
C
Chris Beams 已提交
464 465
}

P
Phillip Webb 已提交
466 467
project("spring-instrument") {
	description = "Spring Instrument"
468

469
	jar {
P
Phillip Webb 已提交
470 471
		manifest.attributes["Premain-Class"] =
			"org.springframework.instrument.InstrumentationSavingAgent"
472 473
		manifest.attributes["Agent-Class"] =
			"org.springframework.instrument.InstrumentationSavingAgent"
474 475 476
		manifest.attributes["Can-Redefine-Classes"] = "true"
		manifest.attributes["Can-Retransform-Classes"] = "true"
		manifest.attributes["Can-Set-Native-Method-Prefix"] = "false"
477
	}
C
Chris Beams 已提交
478 479
}

P
Phillip Webb 已提交
480 481
project("spring-context") {
	description = "Spring Context"
482
	apply plugin: "groovy"
483

484
	dependencies {
485 486 487 488 489
		compile(project(":spring-aop"))
		compile(project(":spring-beans"))
		compile(project(":spring-expression"))
		compile(project(":spring-core"))
		compile(files(project(":spring-core").cglibRepackJar))
490
		optional(project(":spring-instrument"))
491
		optional("javax.inject:javax.inject:1")
492 493
		optional("javax.annotation:javax.annotation-api:${annotationApiVersion}")
		optional("javax.xml.ws:jaxws-api:${jaxwsVersion}")
494
		optional("javax.ejb:javax.ejb-api:${ejbApiVersion}")
S
Stephane Nicoll 已提交
495
		optional("javax.interceptor:javax.interceptor-api:${interceptorApiVersion}")
496
		optional("javax.enterprise.concurrent:javax.enterprise.concurrent-api:1.0")
497
		optional("javax.money:money-api:1.0")
J
Juergen Hoeller 已提交
498 499
		optional("org.eclipse.persistence:javax.persistence:${jpaVersion}")
		optional("javax.validation:validation-api:${beanvalVersion}")
500
		optional("org.hibernate:hibernate-validator:${hibval5Version}")
501 502
		optional("joda-time:joda-time:${jodaVersion}")
		optional("org.aspectj:aspectjweaver:${aspectjVersion}")
J
Juergen Hoeller 已提交
503
		optional("org.codehaus.groovy:groovy-all:${groovyVersion}")
504
		optional("org.beanshell:bsh:2.0b4")
505
		testCompile("javax.inject:javax.inject-tck:1")
506 507
		testCompile("javax.el:javax.el-api:${elApiVersion}")
		testCompile("org.glassfish:javax.el:3.0.1-b08")
508
		testCompile("org.javamoney:moneta:1.1")
509
		testCompile("org.apache.commons:commons-pool2:2.4.2")
510
		testCompile("org.slf4j:slf4j-api:${slf4jVersion}")
511 512 513 514 515 516 517 518 519 520 521
		testRuntime("javax.xml.bind:jaxb-api:${jaxbVersion}")
	}
}

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

	dependencies {
		compile(project(":spring-beans"))
		compile(project(":spring-core"))
522 523
		optional("javax.xml.bind:jaxb-api:${jaxbVersion}")
		optional("javax.activation:activation:${activationApiVersion}")
524 525 526 527 528 529 530 531 532 533 534 535 536 537
		optional("org.codehaus.castor:castor-xml:1.4.1")  {
			exclude group: 'stax', module: 'stax-api'
			exclude group: "org.springframework", module: "spring-context"
		}
		optional("com.thoughtworks.xstream:xstream:${xstreamVersion}") {
			exclude group: 'xpp3', module: 'xpp3_min'
			exclude group: 'xmlpull', module: 'xmlpull'
		}
		optional("org.jibx:jibx-run:1.2.6")
		testCompile(project(":spring-context"))
		testCompile("xpp3:xpp3:1.1.4c")
		testCompile("org.codehaus.jettison:jettison:1.3.7") {
			exclude group: 'stax', module: 'stax-api'
		}
538
		testCompile("org.xmlunit:xmlunit-matchers:${xmlunitVersion}")
539 540
        testCompile(files(genCastor.classesDir).builtBy(genCastor))
        testCompile(files(genJaxb.classesDir).builtBy(genJaxb))
541 542 543
		testRuntime("xerces:xercesImpl:2.11.0")  // for Castor
		testRuntime("com.sun.xml.bind:jaxb-core:${jaxbVersion}")
		testRuntime("com.sun.xml.bind:jaxb-impl:${jaxbVersion}")
544
	}
545 546 547 548 549 550 551 552 553
}

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

	dependencies {
		compile(project(":spring-beans"))
		compile(project(":spring-core"))
		compile(project(":spring-context"))
554
		optional(project(":spring-oxm"))
555
		optional("io.projectreactor:reactor-core:${reactorVersion}") {
556
			force = true  // enforce 2.0.x
557
		}
S
Stephane Maldini 已提交
558
		optional("io.projectreactor:reactor-net:${reactorVersion}") {
559 560
			exclude group: "io.netty", module: "netty-all"
		}
561
		optional("io.netty:netty-all:${nettyVersion}")
B
Brian Clozel 已提交
562
		optional("org.eclipse.jetty.websocket:websocket-server:${jettyVersion}") {
B
Brian Clozel 已提交
563 564
			exclude group: "javax.servlet", module: "javax.servlet-api"
		}
B
Brian Clozel 已提交
565
		optional("org.eclipse.jetty.websocket:websocket-client:${jettyVersion}")
566
		optional("com.fasterxml.jackson.core:jackson-databind:${jackson2Version}")
567
		optional("javax.xml.bind:jaxb-api:${jaxbVersion}")
568
		testCompile("javax.inject:javax.inject-tck:1")
569
		testCompile("javax.servlet:javax.servlet-api:${servletVersion}")
J
Juergen Hoeller 已提交
570
		testCompile("javax.validation:validation-api:${beanvalVersion}")
571
		testCompile("com.thoughtworks.xstream:xstream:${xstreamVersion}")
572 573 574 575 576
		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 已提交
577
		testCompile("org.eclipse.jetty:jetty-webapp:${jettyVersion}") {
B
Brian Clozel 已提交
578
			exclude group: "javax.servlet", module: "javax.servlet-api"
579
		}
580 581
		testCompile("org.apache.tomcat.embed:tomcat-embed-core:${tomcatVersion}")
		testCompile("org.apache.tomcat.embed:tomcat-embed-websocket:${tomcatVersion}")
582
		testCompile("io.netty:netty-all:${nettyVersion}")
583
		testCompile("org.xmlunit:xmlunit-matchers:${xmlunitVersion}")
584 585
		testCompile("org.slf4j:slf4j-jcl:${slf4jVersion}")
		testRuntime("javax.activation:activation:${activationApiVersion}")
586 587
		testRuntime("com.sun.xml.bind:jaxb-core:${jaxbVersion}")
		testRuntime("com.sun.xml.bind:jaxb-impl:${jaxbVersion}")
588
	}
C
Chris Beams 已提交
589 590
}

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

594
	dependencies {
595 596
		compile(project(":spring-beans"))
		compile(project(":spring-core"))
597
		optional(project(":spring-aop"))
598
		optional(project(":spring-context"))  // for JCA, @EnableTransactionManagement
599
		optional("javax.transaction:javax.transaction-api:${jtaVersion}")
J
Juergen Hoeller 已提交
600
		optional("javax.resource:javax.resource-api:${jcaVersion}")
601
		optional("javax.ejb:javax.ejb-api:${ejbApiVersion}")
S
Stephane Nicoll 已提交
602
		optional("javax.interceptor:javax.interceptor-api:${interceptorApiVersion}")
603
		optional("com.ibm.websphere:uow:6.0.2.17")
604
		testCompile("org.aspectj:aspectjweaver:${aspectjVersion}")
J
Juergen Hoeller 已提交
605
		testCompile("org.eclipse.persistence:javax.persistence:${jpaVersion}")
606
		testCompile("org.codehaus.groovy:groovy-all:${groovyVersion}")
607
	}
C
Chris Beams 已提交
608 609
}

P
Phillip Webb 已提交
610 611
project("spring-jms") {
	description = "Spring JMS"
612

613
	dependencies {
614 615 616 617
		compile(project(":spring-core"))
		compile(project(":spring-beans"))
		compile(project(":spring-aop"))
		compile(project(":spring-context"))
618
		compile(project(":spring-messaging"))
619
		compile(project(":spring-tx"))
J
Juergen Hoeller 已提交
620
		provided("javax.jms:javax.jms-api:2.0.1")
621
		optional(project(":spring-oxm"))
622
		optional("javax.transaction:javax.transaction-api:${jtaVersion}")
J
Juergen Hoeller 已提交
623
		optional("javax.resource:javax.resource-api:${jcaVersion}")
624
		optional("com.fasterxml.jackson.core:jackson-databind:${jackson2Version}")
625
		testRuntime("javax.activation:activation:${activationApiVersion}")
626
	}
C
Chris Beams 已提交
627 628
}

P
Phillip Webb 已提交
629 630
project("spring-jdbc") {
	description = "Spring JDBC"
631

632
	dependencies {
633
		compile(project(":spring-beans"))
634
		compile(project(":spring-core"))
635
		compile(project(":spring-tx"))
636
		optional(project(":spring-context"))  // for JndiDataSourceLookup
637
		optional("javax.transaction:javax.transaction-api:${jtaVersion}")
638
		optional("com.mchange:c3p0:0.9.5.2")
P
Phillip Webb 已提交
639
		optional("org.hsqldb:hsqldb:${hsqldbVersion}")
640
		optional("com.h2database:h2:1.4.192")
641 642
		optional("org.apache.derby:derby:10.12.1.1")
		optional("org.apache.derby:derbyclient:10.12.1.1")
643
	}
C
Chris Beams 已提交
644 645
}

P
Phillip Webb 已提交
646 647
project("spring-context-support") {
	description = "Spring Context Support"
648

649
	dependencies {
650 651 652
		compile(project(":spring-core"))
		compile(project(":spring-beans"))
		compile(project(":spring-context"))
653 654
		optional(project(":spring-jdbc"))  // for Quartz support
		optional(project(":spring-tx"))  // for Quartz support
655
		optional("javax.activation:activation:${activationApiVersion}")
656
		optional("javax.mail:javax.mail-api:${javamailVersion}")
S
Stephane Nicoll 已提交
657
		optional("javax.cache:cache-api:1.0.0")
B
Ben Manes 已提交
658
		optional("com.github.ben-manes.caffeine:caffeine:${caffeineVersion}")
659
		optional("net.sf.ehcache:ehcache:${ehcacheVersion}")
660
		optional("org.quartz-scheduler:quartz:2.2.3")
661
		optional("org.codehaus.fabric3.api:commonj:1.1.0")
662
		optional("org.freemarker:freemarker:${freemarkerVersion}")
663
		optional("com.lowagie:itext:2.1.7")
664
		testCompile(project(":spring-context"))
665
		testCompile("org.apache.poi:poi:${poiVersion}")
P
Phillip Webb 已提交
666
		testCompile("org.hsqldb:hsqldb:${hsqldbVersion}")
667
		testCompile("org.slf4j:slf4j-api:${slf4jVersion}")
668
		testRuntime("com.sun.mail:javax.mail:${javamailVersion}")
669
		testRuntime("org.ehcache:jcache:${ehcachejcacheVersion}")
670
	}
C
Chris Beams 已提交
671 672
}

P
Phillip Webb 已提交
673 674
project("spring-web") {
	description = "Spring Web"
675
	apply plugin: "groovy"
676

677 678 679 680 681 682 683 684 685 686 687 688 689 690 691
	// 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"
	}

692
	dependencies {
693 694
		compile(project(":spring-aop"))  // for JaxWsPortProxyFactoryBean
		compile(project(":spring-beans"))  // for MultipartFilter
695
		compile(project(":spring-context"))
696
		compile(project(":spring-core"))
697
		provided "javax.servlet:javax.servlet-api:${servletVersion}"
698
		optional(project(":spring-oxm"))  // for MarshallingHttpMessageConverter
699
		optional("javax.servlet.jsp:javax.servlet.jsp-api:${jspVersion}")
700
		optional("javax.el:javax.el-api:${elApiVersion}")
701
		optional("javax.faces:javax.faces-api:2.2")
J
Juergen Hoeller 已提交
702
		optional("javax.validation:validation-api:${beanvalVersion}")
703
		optional("javax.activation:activation:${activationApiVersion}")
704
		optional("org.codehaus.groovy:groovy-all:${groovyVersion}")
705
		optional("com.caucho:hessian:4.0.38")
706
		optional("commons-fileupload:commons-fileupload:${fileuploadVersion}")
707
		optional("org.reactivestreams:reactive-streams:${reactivestreamsVersion}")
708
		optional("io.projectreactor:reactor-core:${reactorCoreVersion}")
709
		optional("io.projectreactor.ipc:reactor-netty:${reactorNettyVersion}")
J
Juergen Hoeller 已提交
710
		optional("io.reactivex:rxnetty-http:${rxnettyVersion}") {
711 712
			exclude group: 'io.reactivex', module: 'rxjava'
		}
713 714
		optional("io.reactivex:rxjava:${rxjavaVersion}")
		optional("io.undertow:undertow-core:${undertowVersion}")
715
		optional("org.jboss.xnio:xnio-api:3.3.7.Final")
716
		optional("io.netty:netty-buffer:${nettyVersion}") // Temporarily for JsonObjectDecoder
717 718 719
	  	optional("com.fasterxml.woodstox:woodstox-core:${woodstoxVersion}") { // woodstox before aalto
			exclude group: "stax", module: "stax-api"
		}
720
		optional("com.fasterxml:aalto-xml:1.0.0")
721 722
		optional("org.apache.httpcomponents:httpclient:${httpclientVersion}")
		optional("org.apache.httpcomponents:httpasyncclient:${httpasyncVersion}")
723
		optional("io.netty:netty-all:${nettyVersion}")
724
		optional("com.squareup.okhttp:okhttp:${okhttpVersion}")
725
		optional("com.squareup.okhttp3:okhttp:${okhttp3Version}")
726
		optional("com.fasterxml.jackson.core:jackson-databind:${jackson2Version}")
727
		optional("com.fasterxml.jackson.dataformat:jackson-dataformat-xml:${jackson2Version}")
R
Roy Clarkson 已提交
728
		optional("com.google.code.gson:gson:${gsonVersion}")
729
		optional("com.rometools:rome:${romeVersion}")
B
Brian Clozel 已提交
730
		optional("org.eclipse.jetty:jetty-servlet:${jettyVersion}") {
B
Brian Clozel 已提交
731
			exclude group: "javax.servlet", module: "javax.servlet-api"
732
		}
B
Brian Clozel 已提交
733
		optional("org.eclipse.jetty:jetty-server:${jettyVersion}") {
B
Brian Clozel 已提交
734
			exclude group: "javax.servlet", module: "javax.servlet-api"
735
		}
736 737
		optional("com.google.protobuf:protobuf-java:${protobufVersion}")
		optional("com.google.protobuf:protobuf-java-util:${protobufVersion}")
738
		optional("com.googlecode.protobuf-java-format:protobuf-java-format:1.4")
739 740
		optional("javax.xml.bind:jaxb-api:${jaxbVersion}")
		optional("javax.xml.ws:jaxws-api:${jaxwsVersion}")
741
		optional("javax.mail:javax.mail-api:${javamailVersion}")
742
		testCompile(project(":spring-context-support"))  // for JafMediaTypeFactory
743 744 745
		testCompile("org.apache.taglibs:taglibs-standard-jstlel:1.2.1") {
			exclude group: "org.apache.taglibs", module: "taglibs-standard-spec"
		}
746
		testCompile("com.fasterxml.jackson.datatype:jackson-datatype-joda:${jackson2Version}")
747
		testCompile("com.fasterxml.jackson.datatype:jackson-datatype-jdk8:${jackson2Version}")
748
		testCompile("com.fasterxml.jackson.module:jackson-module-kotlin:${jackson2Version}")
749 750 751 752
		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}")
753 754 755 756
		testCompile("com.squareup.okhttp3:mockwebserver:${okhttp3Version}")
		testCompile("org.xmlunit:xmlunit-matchers:${xmlunitVersion}")
		testCompile("org.slf4j:slf4j-jcl:${slf4jVersion}")
		testRuntime("com.sun.mail:javax.mail:${javamailVersion}")
757 758
		testRuntime("com.sun.xml.bind:jaxb-core:${jaxbVersion}")
		testRuntime("com.sun.xml.bind:jaxb-impl:${jaxbVersion}")
759 760
		testRuntime("org.jboss.xnio:xnio-nio:3.3.7.Final")
		testRuntime("org.jboss.logging:jboss-logging:3.3.0.Final")
761 762 763 764 765
	}
}

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

767 768 769 770 771 772 773
	dependencies {
		compile(project(":spring-core"))
		compile(project(":spring-web"))
		compile "org.reactivestreams:reactive-streams:${reactivestreamsVersion}"
		compile "io.projectreactor:reactor-core:${reactorCoreVersion}"
		optional(project(":spring-context-support"))  // for FreeMarker support
		provided "javax.servlet:javax.servlet-api:${servletVersion}"
774
		optional("javax.xml.bind:jaxb-api:${jaxbVersion}")
775 776 777
		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
778
		testCompile("javax.validation:validation-api:${beanvalVersion}")
779 780 781 782
		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}")
783
		testCompile("io.projectreactor.ipc:reactor-netty:${reactorNettyVersion}")
J
Juergen Hoeller 已提交
784
		testCompile("io.reactivex:rxnetty-http:${rxnettyVersion}") {
785 786 787
			exclude group: 'io.reactivex', module: 'rxjava'
		}
		testCompile("io.reactivex:rxjava:${rxjavaVersion}")
788 789
		testCompile("io.undertow:undertow-core:${undertowVersion}")
		testCompile("org.jboss.xnio:xnio-api:3.3.7.Final")
790
		testCompile("com.fasterxml:aalto-xml:1.0.0")
791
		testCompile("org.xmlunit:xmlunit-matchers:${xmlunitVersion}")
792
		testCompile("org.slf4j:slf4j-jcl:${slf4jVersion}")
793 794 795
		testRuntime("com.sun.xml.bind:jaxb-core:${jaxbVersion}")
		testRuntime("com.sun.xml.bind:jaxb-impl:${jaxbVersion}")
		testRuntime("javax.activation:activation:${activationApiVersion}")
796 797
		testRuntime("org.jboss.xnio:xnio-nio:3.3.7.Final")
		testRuntime("org.jboss.logging:jboss-logging:3.3.0.Final")
798
	}
C
Chris Beams 已提交
799 800
}

P
Phillip Webb 已提交
801 802
project("spring-orm") {
	description = "Spring Object/Relational Mapping"
803

804
	dependencies {
805 806 807 808 809 810 811
		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 已提交
812
		optional("org.eclipse.persistence:javax.persistence:${jpaVersion}")
813 814
		optional("org.eclipse.persistence:org.eclipse.persistence.core:${eclipselinkVersion}")
		optional("org.eclipse.persistence:org.eclipse.persistence.jpa:${eclipselinkVersion}") {
815 816
			exclude group: 'org.eclipse.persistence', module: 'javax.persistence'
		}
817
		optional("org.hibernate:hibernate-core:${hibernate5Version}")
818
		optional("javax.servlet:javax.servlet-api:${servletVersion}")
S
Sam Brannen 已提交
819
		testCompile("org.aspectj:aspectjweaver:${aspectjVersion}")
P
Phillip Webb 已提交
820
		testCompile("org.hsqldb:hsqldb:${hsqldbVersion}")
821
		testCompile("org.slf4j:slf4j-jcl:${slf4jVersion}")
822
		testRuntime("javax.xml.bind:jaxb-api:${jaxbVersion}")
823
	}
C
Chris Beams 已提交
824 825
}

P
Phillip Webb 已提交
826 827
project("spring-webmvc") {
	description = "Spring Web MVC"
828

829
	dependencies {
830
		compile(project(":spring-aop"))
831 832
		compile(project(":spring-beans"))
		compile(project(":spring-context"))
833
		compile(project(":spring-core"))
834
		compile(files(project(":spring-core").objenesisRepackJar))
835 836
		compile(project(":spring-expression"))
		compile(project(":spring-web"))
837
		provided("javax.servlet:javax.servlet-api:${servletVersion}")
838
		optional(project(":spring-context-support"))  // for FreeMarker support
839
		optional(project(":spring-oxm"))  // for MarshallingView
840
		optional("javax.servlet.jsp:javax.servlet.jsp-api:${jspVersion}")
841
		optional("javax.servlet.jsp.jstl:javax.servlet.jsp.jstl-api:1.2.1")
842
		optional("javax.xml.bind:jaxb-api:${jaxbVersion}")
843 844
		optional("org.apache.poi:poi:${poiVersion}")
		optional("org.apache.poi:poi-ooxml:${poiVersion}")
845
		optional("org.freemarker:freemarker:${freemarkerVersion}")
846
		optional("org.codehaus.groovy:groovy-all:${groovyVersion}")
847 848
		optional("com.lowagie:itext:2.1.7")
		optional("com.fasterxml.jackson.core:jackson-databind:${jackson2Version}")
849
		optional("com.fasterxml.jackson.dataformat:jackson-dataformat-xml:${jackson2Version}")
850
		optional("com.rometools:rome:${romeVersion}")
851
		optional("javax.el:javax.el-api:${elApiVersion}")
852 853
		optional("org.apache.tiles:tiles-api:${tiles3Version}")
		optional("org.apache.tiles:tiles-core:${tiles3Version}") {
854 855
			exclude group: "org.slf4j", module: "jcl-over-slf4j"
		}
856
		optional("org.apache.tiles:tiles-servlet:${tiles3Version}") {
857 858
			exclude group: "org.slf4j", module: "jcl-over-slf4j"
		}
859
		optional("org.apache.tiles:tiles-jsp:${tiles3Version}") {
860 861
			exclude group: "org.slf4j", module: "jcl-over-slf4j"
		}
862
		optional("org.apache.tiles:tiles-el:${tiles3Version}") {
863 864
			exclude group: "org.slf4j", module: "jcl-over-slf4j"
		}
865
		optional("org.apache.tiles:tiles-extras:${tiles3Version}") {
866 867 868
			exclude group: "org.slf4j", module: "jcl-over-slf4j"
			exclude group: "org.springframework", module: "spring-web"
		}
869
		optional('org.webjars:webjars-locator:0.32')
870
		testCompile("org.xmlunit:xmlunit-matchers:${xmlunitVersion}")
871
		testCompile("dom4j:dom4j:1.6.1") {
P
Phillip Webb 已提交
872
			exclude group: "xml-apis", module: "xml-apis"
873 874
		}
		testCompile("jaxen:jaxen:1.1.1") {
P
Phillip Webb 已提交
875 876 877
			exclude group: "xml-apis", module: "xml-apis"
			exclude group: "xom", module: "xom"
			exclude group: "xerces", module: "xercesImpl"
878
		}
B
Brian Clozel 已提交
879
		testCompile("org.eclipse.jetty:jetty-servlet:${jettyVersion}") {
B
Brian Clozel 已提交
880
			exclude group: "javax.servlet", module: "javax.servlet"
881
		}
B
Brian Clozel 已提交
882
		testCompile("org.eclipse.jetty:jetty-server:${jettyVersion}") {
B
Brian Clozel 已提交
883
			exclude group: "javax.servlet", module: "javax.servlet"
884
		}
J
Juergen Hoeller 已提交
885
		testCompile("javax.validation:validation-api:${beanvalVersion}")
886
		testCompile("org.hibernate:hibernate-validator:${hibval5Version}")
887 888
		testCompile("org.apache.httpcomponents:httpclient:${httpclientVersion}")
		testCompile("commons-fileupload:commons-fileupload:${fileuploadVersion}")
889
		testCompile("commons-io:commons-io:1.3")
890
		testCompile("joda-time:joda-time:${jodaVersion}")
891
		testCompile("org.slf4j:slf4j-jcl:${slf4jVersion}")
892
		testCompile("org.mozilla:rhino:1.7.7.1")
893 894 895
		testRuntime("org.jruby:jruby:9.1.2.0")
		testRuntime("org.python:jython-standalone:2.5.3")
		testRuntime("org.webjars:underscorejs:1.8.3")
896 897 898
		testRuntime("com.sun.xml.bind:jaxb-core:${jaxbVersion}")
		testRuntime("com.sun.xml.bind:jaxb-impl:${jaxbVersion}")
		testRuntime("javax.activation:activation:${activationApiVersion}")
899 900 901
	}
}

902 903 904 905 906 907 908 909 910
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"))
911 912
		optional("javax.servlet:javax.servlet-api:${servletVersion}")
		optional("javax.websocket:javax.websocket-api:${websocketVersion}")
913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936
		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"
		}
937
		optional("org.jboss.xnio:xnio-api:3.3.7.Final")
938 939 940
		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}")
941
		testCompile("io.projectreactor:reactor-core:${reactorVersion}") {
942
			force = true  // enforce 2.0.x
943
		}
944 945 946
		testCompile("io.projectreactor:reactor-net:${reactorVersion}")
		testCompile("io.netty:netty-all:${nettyVersion}")
		testCompile("org.slf4j:slf4j-jcl:${slf4jVersion}")
947 948
		testRuntime("org.jboss.xnio:xnio-nio:3.3.7.Final")
		testRuntime("org.jboss.logging:jboss-logging:3.3.0.Final")
949 950 951
	}
}

P
Phillip Webb 已提交
952 953
project("spring-test") {
	description = "Spring TestContext Framework"
954

955
	dependencies {
956
		compile(project(":spring-core"))
957 958 959 960 961 962 963
		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"))
964
		optional(project(":spring-websocket"))
965
		optional("junit:junit:${junitVersion}")
966
		optional("org.junit.jupiter:junit-jupiter-api:${junitJupiterVersion}")
967
		optional("org.testng:testng:${testngVersion}")
968
		optional("javax.inject:javax.inject:1")
969 970
		optional("javax.servlet:javax.servlet-api:${servletVersion}")
		optional("javax.servlet.jsp:javax.servlet.jsp-api:${jspVersion}")
971 972 973 974
		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"
		}
975
		optional("javax.el:javax.el-api:${elApiVersion}")
976
		optional("javax.websocket:javax.websocket-api:${websocketVersion}")
977 978
		optional("javax.activation:activation:${activationApiVersion}")
		optional("javax.xml.bind:jaxb-api:${jaxbVersion}")
979
		optional("org.aspectj:aspectjweaver:${aspectjVersion}")
S
Sam Brannen 已提交
980
		optional("org.codehaus.groovy:groovy-all:${groovyVersion}")
981
		optional("org.hamcrest:hamcrest-core:${hamcrestVersion}")
982
		optional("org.xmlunit:xmlunit-matchers:${xmlunitVersion}")
983 984
		optional("net.sourceforge.htmlunit:htmlunit:2.22")
		optional("org.seleniumhq.selenium:htmlunit-driver:2.21")
985 986 987
		optional("org.seleniumhq.selenium:selenium-java:2.53.1") {
			exclude group: "io.netty", module: "netty"
		}
988 989
		optional("org.skyscreamer:jsonassert:1.3.0")
		optional("com.jayway.jsonpath:json-path:2.2.0")
990 991
		testCompile(project(":spring-context-support"))
		testCompile(project(":spring-oxm"))
992
		testCompile("javax.mail:javax.mail-api:${javamailVersion}")
993
		testCompile("javax.ejb:javax.ejb-api:${ejbApiVersion}")
S
Stephane Nicoll 已提交
994
		testCompile("javax.interceptor:javax.interceptor-api:${interceptorApiVersion}")
995
		testCompile("org.hibernate:hibernate-core:${hibernate5Version}")
996
		testCompile("org.hibernate:hibernate-validator:${hibval5Version}")
997 998
		// Enable use of the JUnitPlatform Runner
		testCompile("org.junit.platform:junit-platform-runner:${junitPlatformVersion}")
999
		testCompile("com.thoughtworks.xstream:xstream:${xstreamVersion}")
1000
		testCompile("com.fasterxml.jackson.core:jackson-databind:${jackson2Version}")
1001
		testCompile("com.rometools:rome:${romeVersion}")
1002 1003
		testCompile("org.apache.tiles:tiles-api:${tiles3Version}")
		testCompile("org.apache.tiles:tiles-core:${tiles3Version}") {
1004 1005
			exclude group: "org.slf4j", module: "jcl-over-slf4j"
		}
1006
		testCompile("org.apache.tiles:tiles-servlet:${tiles3Version}") {
1007 1008
			exclude group: "org.slf4j", module: "jcl-over-slf4j"
		}
1009
		testCompile("org.hsqldb:hsqldb:${hsqldbVersion}")
S
Sam Brannen 已提交
1010
		testCompile("org.slf4j:slf4j-jcl:${slf4jVersion}")
1011
		testCompile("org.apache.httpcomponents:httpclient:${httpclientVersion}")
1012
		testCompile("javax.cache:cache-api:1.0.0")
1013
		testRuntime("org.junit.jupiter:junit-jupiter-engine:${junitJupiterVersion}")
1014
		testRuntime("org.apache.logging.log4j:log4j-jul:${log4jVersion}")  // Java Util Logging for JUnit 5
1015
		testRuntime("org.ehcache:ehcache:${ehcache3Version}")
J
Juergen Hoeller 已提交
1016
		testRuntime("org.terracotta:management-model:2.0.0")
1017 1018
		testRuntime("com.sun.xml.bind:jaxb-core:${jaxbVersion}")
		testRuntime("com.sun.xml.bind:jaxb-impl:${jaxbVersion}")
1019
	}
1020 1021

	task testNG(type: Test) {
1022
		description = 'Runs TestNG tests.'
1023
		useTestNG()
1024
		scanForTestClasses = false
1025 1026
		include(["**/testng/**/*Tests.class", "**/testng/**/*Test.class"])
		// Show STD_OUT & STD_ERR of the test JVM(s) on the console:
1027
		// testLogging.showStandardStreams = true
1028
		// forkEvery 1
1029 1030 1031
	}

	test {
1032
		description = 'Runs JUnit tests.'
1033 1034
		dependsOn testNG
		useJUnit()
1035 1036 1037
		scanForTestClasses = false
		include(['**/*Tests.class', '**/*Test.class', '**/SpringJUnitJupiterTestSuite.class'])
		exclude(['**/testng/**/*.*'])
1038 1039
		// Java Util Logging for JUnit 5.
		// systemProperty('java.util.logging.manager', 'org.apache.logging.log4j.jul.LogManager')
1040
	}
1041 1042

	task aggregateTestReports(type: TestReport) {
1043
		description = 'Aggregates JUnit and TestNG test reports.'
1044 1045 1046 1047 1048
		destinationDir = test.reports.html.destination
		reportOn test, testNG
	}

	check.dependsOn aggregateTestReports
C
Chris Beams 已提交
1049 1050
}

P
Phillip Webb 已提交
1051 1052 1053
project("spring-aspects") {
	description = "Spring Aspects"
	apply from: "aspects.gradle"
1054

1055
	dependencies {
1056
		aspects(project(":spring-orm"))
1057 1058 1059
		ajc("org.aspectj:aspectjtools:${aspectjVersion}")
		rt("org.aspectj:aspectjrt:${aspectjVersion}")
		compile("org.aspectj:aspectjweaver:${aspectjVersion}")
J
Juergen Hoeller 已提交
1060
		provided("org.eclipse.persistence:javax.persistence:${jpaVersion}")
1061 1062 1063 1064 1065 1066
		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
1067
		optional("javax.transaction:javax.transaction-api:${jtaVersion}")  // for @javax.transaction.Transactional support
S
Stephane Nicoll 已提交
1068
		optional("javax.cache:cache-api:1.0.0")
1069
		testCompile(project(":spring-core"))  // for CodeStyleAspect
1070
		testCompile(project(":spring-test"))
1071
		testCompile("javax.mail:javax.mail-api:${javamailVersion}")
1072
	}
1073

1074
	eclipse.project {
P
Phillip Webb 已提交
1075
		natures += "org.eclipse.ajdt.ui.ajnature"
1076
		buildCommands = [new org.gradle.plugins.ide.eclipse.model.BuildCommand("org.eclipse.ajdt.core.ajbuilder")]
1077
	}
C
Chris Beams 已提交
1078 1079
}

1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114
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)
										}
									}
								}
							}
						}
					}
				}
			}
		}
	}
}

1115 1116
sonarqube {
	properties {
S
Stephane Nicoll 已提交
1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128
		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"
	}
}

1129
configure(rootProject) {
P
Phillip Webb 已提交
1130
	description = "Spring Framework"
1131

B
Brian Clozel 已提交
1132
	apply plugin: "org.asciidoctor.convert"
1133
	apply plugin: "docbook-reference"
1134
	apply plugin: "groovy"
R
Rob Winch 已提交
1135

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

R
Rob Winch 已提交
1139
	asciidoctor {
B
Brian Clozel 已提交
1140 1141
		sourceDir project.file('src/asciidoc')
		separateOutputDirs = false
1142
		backends = ['docbook']
B
Brian Clozel 已提交
1143
		options doctype: 'book', eruby: 'erubis'
J
Juergen Hoeller 已提交
1144
		attributes 'spring-version': project.version, 'revnumber': project.version, 'docinfo': ""
1145 1146
	}

1147 1148 1149
	reference {
		sourceDir = asciidoctor.outputDir
		pdfFilename = "spring-framework-reference.pdf"
1150
		epubFilename = "spring-framework-reference.epub"
1151 1152 1153 1154 1155 1156 1157
		expandPlaceholders = ""
	}

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

1158 1159 1160 1161 1162
	// 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")
	// }
1163

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

1167
	dependencies {  // for integration tests
1168
		testCompile(project(":spring-aop"))
1169
		testCompile(project(":spring-beans"))
1170
		testCompile(project(":spring-context"))
1171 1172
		testCompile(project(":spring-core"))
		testCompile(project(":spring-expression"))
1173
		testCompile(project(":spring-jdbc"))
1174
		testCompile(project(":spring-orm"))
1175
		testCompile(project(":spring-test"))
1176
		testCompile(project(":spring-tx"))
1177
		testCompile(project(":spring-web"))
1178
		testCompile("javax.servlet:javax.servlet-api:${servletVersion}")
1179
		testCompile("javax.inject:javax.inject:1")
J
Juergen Hoeller 已提交
1180
		testCompile("javax.resource:javax.resource-api:${jcaVersion}")
1181
		testCompile("org.aspectj:aspectjweaver:${aspectjVersion}")
1182
		testCompile("org.hibernate:hibernate-core:${hibernate5Version}")
P
Phillip Webb 已提交
1183
		testCompile("org.hsqldb:hsqldb:${hsqldbVersion}")
1184 1185 1186
	}

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

1191 1192 1193 1194 1195
		dependsOn {
			subprojects.collect {
				it.tasks.getByName("jar")
			}
		}
1196 1197 1198
		options.memberLevel = org.gradle.external.javadoc.JavadocMemberLevel.PROTECTED
		options.author = true
		options.header = rootProject.description
P
Phillip Webb 已提交
1199
		options.overview = "src/api/overview.html"
1200
		options.stylesheetFile = file("src/api/stylesheet.css")
1201
		options.splitIndex = true
C
Chris Beams 已提交
1202
		options.links(project.ext.javadocLinks)
1203
		options.addStringOption('Xdoclint:none', '-quiet')
C
Chris Beams 已提交
1204

1205 1206 1207
		source subprojects.collect { project ->
			project.sourceSets.main.allJava
		}
C
Chris Beams 已提交
1208

P
Phillip Webb 已提交
1209
		maxMemory = "1024m"
C
Chris Beams 已提交
1210
		destinationDir = new File(buildDir, "api")
1211 1212 1213

		doFirst {
			classpath = files(
1214 1215
                // ensure Servlet 3.x has precedence on the javadoc classpath
                project(":spring-webmvc").sourceSets.main.compileClasspath.files.find { it =~ "servlet-api" },
1216 1217 1218 1219 1220
				// 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 })
		}
1221 1222
	}

1223
	task docsZip(type: Zip, dependsOn: 'reference') {
P
Phillip Webb 已提交
1224 1225 1226
		group = "Distribution"
		baseName = "spring-framework"
		classifier = "docs"
1227 1228 1229
		description = "Builds -${classifier} archive containing api and reference " +
			"for deployment at http://static.springframework.org/spring-framework/docs."

P
Phillip Webb 已提交
1230 1231
		from("src/dist") {
			include "changelog.txt"
1232 1233 1234
		}

		from (api) {
1235
			into "javadoc-api"
1236 1237
		}

1238 1239
		from (reference) {
			into "spring-framework-reference"
1240 1241 1242 1243
		}
	}

	task schemaZip(type: Zip) {
P
Phillip Webb 已提交
1244 1245 1246
		group = "Distribution"
		baseName = "spring-framework"
		classifier = "schema"
1247 1248
		description = "Builds -${classifier} archive containing all " +
			"XSDs for deployment at http://springframework.org/schema."
S
Stephane Nicoll 已提交
1249
		duplicatesStrategy 'exclude'
1250
		moduleProjects.each { subproject ->
1251 1252 1253
			def Properties schemas = new Properties();

			subproject.sourceSets.main.resources.find {
P
Phillip Webb 已提交
1254
				it.path.endsWith("META-INF/spring.schemas")
1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271
			}?.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 已提交
1272 1273 1274
		group = "Distribution"
		baseName = "spring-framework"
		classifier = "dist"
1275
		description = "Builds -${classifier} archive, containing all jars and docs, " +
J
Juergen Hoeller 已提交
1276
			"suitable for community download page."
1277 1278 1279

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

P
Phillip Webb 已提交
1280 1281 1282 1283
		from("src/dist") {
			include "readme.txt"
			include "license.txt"
			include "notice.txt"
1284
			into "${baseDir}"
P
Phillip Webb 已提交
1285
			expand(copyright: new Date().format("yyyy"), version: project.version)
1286 1287 1288 1289 1290 1291 1292 1293 1294 1295
		}

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

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

1296
		moduleProjects.each { subproject ->
1297 1298
			into ("${baseDir}/libs") {
				from subproject.jar
P
Phillip Webb 已提交
1299
				if (subproject.tasks.findByPath("sourcesJar")) {
1300 1301
					from subproject.sourcesJar
				}
P
Phillip Webb 已提交
1302
				if (subproject.tasks.findByPath("javadocJar")) {
1303 1304 1305 1306 1307 1308
					from subproject.javadocJar
				}
			}
		}
	}

1309
	// Create a distribution that contains all dependencies (required and optional).
1310 1311
	// Not published by default; only for use when building from source.
	task depsZip(type: Zip, dependsOn: distZip) { zipTask ->
P
Phillip Webb 已提交
1312 1313 1314
		group = "Distribution"
		baseName = "spring-framework"
		classifier = "dist-with-deps"
1315 1316 1317 1318 1319 1320 1321 1322 1323 1324
		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 ->
1325 1326
					(subproject.configurations.runtime.resolvedConfiguration.resolvedArtifacts +
					subproject.configurations.optional.resolvedConfiguration.resolvedArtifacts).each { artifact ->
1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347
						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 已提交
1348
		description = "Generates gradlew[.bat] scripts"
1349
		gradleVersion = "2.14.1"
1350 1351

		doLast() {
1352
			def gradleOpts = "-XX:MaxMetaspaceSize=1024m -Xmx1024m"
1353
			def gradleBatOpts = "$gradleOpts -XX:MaxHeapSize=256m"
P
Phillip Webb 已提交
1354
			File wrapperFile = file("gradlew")
1355 1356
			wrapperFile.text = wrapperFile.text.replace("DEFAULT_JVM_OPTS=",
				"GRADLE_OPTS=\"$gradleOpts \$GRADLE_OPTS\"\nDEFAULT_JVM_OPTS=")
P
Phillip Webb 已提交
1357
			File wrapperBatFile = file("gradlew.bat")
1358 1359 1360 1361
			wrapperBatFile.text = wrapperBatFile.text.replace("set DEFAULT_JVM_OPTS=",
				"set GRADLE_OPTS=$gradleBatOpts %GRADLE_OPTS%\nset DEFAULT_JVM_OPTS=")
		}
	}
1362

1363
}
1364

S
Stephane Nicoll 已提交
1365
configure([project(':spring-build-src'), project(':spring-framework-bom')]) {
1366
	sonarqube {
S
Stephane Nicoll 已提交
1367 1368 1369 1370 1371
		skipProject = true
	}
}

configure(project(':spring-core')) {
1372 1373
	sonarqube {
		properties {
S
Stephane Nicoll 已提交
1374 1375 1376 1377 1378 1379
			property "sonar.exclusions",
					"src/main/java/org/springframework/cglib/**/*,src/main/java/org/springframework/asm/**/*"
		}
	}
}

1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390
/*
 * 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-")) {
1391
			return version.replace('BUILD', qualifier)
1392 1393
		}
	}
1394
	return version
1395
}