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"
36 37 38 39 40 41 42 43
	ext.aspectjVersion         = "1.9.0.BETA-4"
	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 61 62 63 64 65 66
	ext.jcaVersion             = "1.7"
	ext.jettyVersion           = "9.3.10.v20160621"
	ext.jodaVersion            = "2.9.4"
	ext.jpaVersion             = "2.1.1"
	ext.jspVersion             = "2.3.2-b02"
	ext.jtaVersion             = "1.2"
	ext.junitVersion           = "4.12"
S
Sam Brannen 已提交
67 68
	ext.junitJupiterVersion    = '5.0.0-M2'
	ext.junitPlatformVersion   = '1.0.0-M2'
69 70 71 72 73
	ext.log4jVersion           = '2.6.2'
	ext.nettyVersion           = "4.1.3.Final"
	ext.okhttpVersion          = "2.7.5"
	ext.okhttp3Version         = "3.4.1"
	ext.poiVersion             = "3.14"
74
	ext.protobufVersion        = "3.0.0-beta-4"
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 90 91 92
	ext.servletVersion         = "3.1.0"
	ext.slf4jVersion           = "1.7.21"
	ext.snakeyamlVersion       = "1.17"
	ext.snifferVersion         = "1.15"
	ext.testngVersion          = "6.9.10"
	ext.tiles3Version          = "3.0.5"
	ext.tomcatVersion          = "8.5.4"
	ext.tyrusVersion           = "1.13"
	ext.undertowVersion        = "1.4.0.CR3"
	ext.websocketVersion       = "1.1"
	ext.woodstoxVersion        = "5.0.2"
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 204 205 206 207
		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)
208 209 210
				annotation(className: "org.springframework.lang.UsesJava7")
				annotation(className: "org.springframework.lang.UsesJava8")
				annotation(className: "org.springframework.lang.UsesSunHttpServer")
S
Stephane Nicoll 已提交
211 212
			}
		}
213
	}
C
Chris Beams 已提交
214 215

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

	configurations.archives.artifacts.clear()
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

485
	dependencies {
486 487 488 489 490
		compile(project(":spring-aop"))
		compile(project(":spring-beans"))
		compile(project(":spring-expression"))
		compile(project(":spring-core"))
		compile(files(project(":spring-core").cglibRepackJar))
491
		optional(project(":spring-instrument"))
492
		optional("javax.inject:javax.inject:1")
493 494
		optional("javax.annotation:javax.annotation-api:${annotationApiVersion}")
		optional("javax.xml.ws:jaxws-api:${jaxwsVersion}")
495
		optional("javax.ejb:javax.ejb-api:${ejbApiVersion}")
S
Stephane Nicoll 已提交
496
		optional("javax.interceptor:javax.interceptor-api:${interceptorApiVersion}")
497
		optional("javax.enterprise.concurrent:javax.enterprise.concurrent-api:1.0")
498
		optional("javax.money:money-api:1.0")
J
Juergen Hoeller 已提交
499 500
		optional("org.eclipse.persistence:javax.persistence:${jpaVersion}")
		optional("javax.validation:validation-api:${beanvalVersion}")
501
		optional("org.hibernate:hibernate-validator:${hibval5Version}")
502 503
		optional("joda-time:joda-time:${jodaVersion}")
		optional("org.aspectj:aspectjweaver:${aspectjVersion}")
J
Juergen Hoeller 已提交
504
		optional("org.codehaus.groovy:groovy-all:${groovyVersion}")
505
		optional("org.beanshell:bsh:2.0b4")
506
		testCompile("javax.inject:javax.inject-tck:1")
507 508
		testCompile("javax.el:javax.el-api:${elApiVersion}")
		testCompile("org.glassfish:javax.el:3.0.1-b08")
509
		testCompile("org.javamoney:moneta:1.1")
510
		testCompile("org.apache.commons:commons-pool2:2.4.2")
511
		testCompile("org.slf4j:slf4j-api:${slf4jVersion}")
512 513 514 515 516 517 518 519 520 521 522
		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"))
523 524
		optional("javax.xml.bind:jaxb-api:${jaxbVersion}")
		optional("javax.activation:activation:${activationApiVersion}")
525 526 527 528 529 530 531 532 533 534 535 536 537 538
		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'
		}
539
		testCompile("org.xmlunit:xmlunit-matchers:${xmlunitVersion}")
540 541
        testCompile(files(genCastor.classesDir).builtBy(genCastor))
        testCompile(files(genJaxb.classesDir).builtBy(genJaxb))
542 543 544
		testRuntime("xerces:xercesImpl:2.11.0")  // for Castor
		testRuntime("com.sun.xml.bind:jaxb-core:${jaxbVersion}")
		testRuntime("com.sun.xml.bind:jaxb-impl:${jaxbVersion}")
545
	}
546 547 548 549 550 551 552 553 554
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

1364
}
1365

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

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

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