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

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

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

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

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

34
	ext.aspectjVersion       = "1.8.9"
J
Juergen Hoeller 已提交
35
	ext.beanvalVersion       = "1.1.0.Final"
36
	ext.caffeineVersion      = "2.3.1"
37
	ext.eclipselinkVersion   = "2.6.3"
38
	ext.ehcacheVersion       = "2.10.2"
39
	ext.ehcachejcacheVersion = "1.0.1"
40
	ext.ehcache3Version      = "3.1.0"
41
	ext.ejbVersion           = "3.0"
42
	ext.fileuploadVersion    = "1.3.2"
43
	ext.freemarkerVersion    = "2.3.23"
J
Juergen Hoeller 已提交
44
	ext.groovyVersion        = "2.4.7"
45
	ext.gsonVersion          = "2.7"
46
	ext.hamcrestVersion      = "1.3"
J
Juergen Hoeller 已提交
47
	ext.hibernate5Version    = "5.2.1.Final"
48
	ext.hibval5Version       = "5.2.4.Final"
49
	ext.hsqldbVersion        = "2.3.4"
50
	ext.httpasyncVersion     = "4.1.2"
51
	ext.httpclientVersion    = "4.5.2"
52
	ext.jackson2Version      = "2.8.0"
53
	ext.javamailVersion      = "1.5.5"
J
Juergen Hoeller 已提交
54
	ext.jcaVersion           = "1.7"
55
	ext.jettyVersion         = "9.3.10.v20160621"
56
	ext.jodaVersion          = "2.9.4"
J
Juergen Hoeller 已提交
57
	ext.jpaVersion           = "2.1.1"
58
	ext.jtaVersion           = "1.2"
J
Juergen Hoeller 已提交
59
	ext.junitVersion         = "4.12"
S
Sam Brannen 已提交
60 61
	ext.junitJupiterVersion  = '5.0.0-M1'
	ext.junitPlatformVersion = '1.0.0-M1'
62
	ext.log4jVersion         = '2.6.1'
63
	ext.nettyVersion         = "4.1.1.Final"
64
	ext.okhttpVersion        = "2.7.5"
65
	ext.okhttp3Version       = "3.3.1"
66
	ext.poiVersion           = "3.14"
R
Rossen Stoyanchev 已提交
67
	ext.reactorVersion       = "2.0.8.RELEASE"
68 69
	ext.romeVersion          = "1.6.0"
	ext.slf4jVersion         = "1.7.21"
70
	ext.snakeyamlVersion     = "1.17"
71
	ext.snifferVersion       = "1.15"
72
	ext.testngVersion        = "6.9.10"
73
	ext.tiles3Version        = "3.0.5"
74
	ext.tomcatVersion        = "8.5.3"
75
	ext.tyrusVersion         = "1.13"
76
	ext.undertowVersion      = "1.4.0.CR3"
77
	ext.xmlunitVersion       = "1.6"
J
Juergen Hoeller 已提交
78
	ext.xstreamVersion       = "1.4.9"
79

80
	ext.gradleScriptDir = "${rootProject.projectDir}/gradle"
81

82
	apply plugin: "propdeps"
P
Phillip Webb 已提交
83
	apply plugin: "java"
84
	apply plugin: "test-source-set-dependencies"
85
	apply from: "${gradleScriptDir}/ide.gradle"
C
Chris Beams 已提交
86

S
Stephane Nicoll 已提交
87 88 89 90 91
	configurations {
		sniffer
		javaApiSignature
	}

P
Phillip Webb 已提交
92 93 94
	compileJava.options*.compilerArgs = [
		"-Xlint:serial", "-Xlint:varargs", "-Xlint:cast", "-Xlint:classfile",
		"-Xlint:dep-ann", "-Xlint:divzero", "-Xlint:empty", "-Xlint:finally",
S
Stephane Nicoll 已提交
95
		"-Xlint:overrides", "-Xlint:path", "-Xlint:processing", "-Xlint:static",
P
Phillip Webb 已提交
96
		"-Xlint:try", "-Xlint:fallthrough", "-Xlint:rawtypes", "-Xlint:deprecation",
97
		"-Xlint:unchecked", "-Xlint:-options", "-Werror"
98
	]
C
Chris Beams 已提交
99

P
Phillip Webb 已提交
100
	compileTestJava.options*.compilerArgs = [
101
		"-Xlint:serial", "-Xlint:-varargs", "-Xlint:cast", "-Xlint:classfile",
P
Phillip Webb 已提交
102
		"-Xlint:dep-ann", "-Xlint:divzero", "-Xlint:empty", "-Xlint:finally",
S
Stephane Nicoll 已提交
103
		"-Xlint:overrides", "-Xlint:path", "-Xlint:processing", "-Xlint:static",
P
Phillip Webb 已提交
104 105 106
		"-Xlint:try", "-Xlint:-fallthrough", "-Xlint:-rawtypes", "-Xlint:-deprecation",
		"-Xlint:-unchecked", "-Xlint:-options"]

107
	compileJava {
108 109
		sourceCompatibility = 1.8
		targetCompatibility = 1.8
110 111 112
	}

	compileTestJava {
J
Juergen Hoeller 已提交
113 114
		sourceCompatibility = 1.8
		targetCompatibility = 1.8
115
		options.compilerArgs += "-parameters"
J
Juergen Hoeller 已提交
116 117
	}

C
Chris Beams 已提交
118 119
	test {
		systemProperty("java.awt.headless", "true")
120
		systemProperty("testGroups", project.properties.get("testGroups"))
121
		scanForTestClasses = false
122
		include(["**/*Tests.class", "**/*Test.class"])
123 124
		// Since we set scanForTestClasses to false, we need to filter out inner
		// classes with the "$" pattern; otherwise, using -Dtest.single=MyTests to
125
		// run MyTests by itself will fail if MyTests contains any inner classes.
126
		exclude(["**/Abstract*.class", '**/*$*'])
C
Chris Beams 已提交
127
	}
C
Chris Beams 已提交
128

129
	repositories {
B
Brian Clozel 已提交
130
		maven { url "https://repo.spring.io/libs-release" }
131
	}
C
Chris Beams 已提交
132

133
	dependencies {
134 135 136
		testCompile("junit:junit:${junitVersion}") {
			exclude group:'org.hamcrest', module:'hamcrest-core'
		}
137
		testCompile("org.mockito:mockito-core:1.10.19") {
138 139
			exclude group:'org.hamcrest', module:'hamcrest-core'
		}
140
		testCompile("org.hamcrest:hamcrest-all:${hamcrestVersion}")
141 142
		testRuntime("org.apache.logging.log4j:log4j-core:${log4jVersion}")
		testRuntime("org.apache.logging.log4j:log4j-jcl:${log4jVersion}")
143

S
Stephane Nicoll 已提交
144
		sniffer("org.codehaus.mojo:animal-sniffer-ant-tasks:${snifferVersion}")
145
		javaApiSignature("org.codehaus.mojo.signature:java18:1.0@signature")
S
Stephane Nicoll 已提交
146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164
	}

	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
165

S
Stephane Nicoll 已提交
166 167 168 169 170 171 172 173 174 175 176
		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)
177 178 179
				annotation(className: "org.springframework.lang.UsesJava7")
				annotation(className: "org.springframework.lang.UsesJava8")
				annotation(className: "org.springframework.lang.UsesSunHttpServer")
S
Stephane Nicoll 已提交
180 181
			}
		}
182
	}
C
Chris Beams 已提交
183 184

	ext.javadocLinks = [
185
		"http://docs.oracle.com/javase/8/docs/api/",
186
		"http://docs.oracle.com/javaee/7/api/",
187
		"http://docs.oracle.com/cd/E13222_01/wls/docs90/javadocs/",  // CommonJ
J
Juergen Hoeller 已提交
188 189
		"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 已提交
190 191
		"http://docs.jboss.org/jbossas/javadoc/4.0.5/connector/",
		"http://docs.jboss.org/jbossas/javadoc/7.1.2.Final/",
192
		"http://tiles.apache.org/tiles-request/apidocs/",
J
Juergen Hoeller 已提交
193
		"http://tiles.apache.org/framework/apidocs/",
C
Chris Beams 已提交
194
		"http://www.eclipse.org/aspectj/doc/released/aspectj5rt-api/",
B
Brian Clozel 已提交
195 196
		"http://ehcache.org/apidocs/${ehcacheVersion}",
		"http://ehcache.org/apidocs/${ehcache3Version}",
197
		"http://quartz-scheduler.org/api/2.2.1/",
B
Brian Clozel 已提交
198 199 200
		"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/",
201
		"http://hc.apache.org/httpcomponents-client-ga/httpclient/apidocs/"
C
Chris Beams 已提交
202
	] as String[]
203 204
}

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

S
Stephane Nicoll 已提交
209 210 211 212 213
	configurations {
		jacoco
	}

	dependencies {
214
		jacoco("org.jacoco:org.jacoco.agent:0.7.5.201505241946:runtime")
S
Stephane Nicoll 已提交
215 216 217
	}

	gradle.taskGraph.whenReady {taskGraph ->
218
		if (taskGraph.hasTask(':sonarqube')) {
S
Stephane Nicoll 已提交
219 220 221 222
			test.jvmArgs "-javaagent:${configurations.jacoco.asPath}=destfile=${buildDir}/jacoco.exec,includes=org.springframework.*"
		}
	}

223
	jar {
P
Phillip Webb 已提交
224 225 226 227
		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
228 229 230 231 232

		from("${rootProject.projectDir}/src/dist") {
			include "license.txt"
			include "notice.txt"
			into "META-INF"
P
Phillip Webb 已提交
233
			expand(copyright: new Date().format("yyyy"), version: project.version)
234 235 236 237
		}
	}

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

240 241 242
		options.memberLevel = org.gradle.external.javadoc.JavadocMemberLevel.PROTECTED
		options.author = true
		options.header = project.name
C
Chris Beams 已提交
243
		options.links(project.ext.javadocLinks)
244
		options.addStringOption('Xdoclint:none', '-quiet')
C
Chris Beams 已提交
245 246 247 248 249

		// 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
250 251
	}

252 253
	task sourcesJar(type: Jar, dependsOn: classes) {
		classifier = 'sources'
254
		from sourceSets.main.allSource
255
		// don't include or exclude anything explicitly by default. See SPR-12085.
256 257 258
	}

	task javadocJar(type: Jar) {
P
Phillip Webb 已提交
259
		classifier = "javadoc"
260 261 262 263 264 265 266
		from javadoc
	}

	artifacts {
		archives sourcesJar
		archives javadocJar
	}
C
Chris Beams 已提交
267 268
}

269 270
project("spring-build-src") {
	description = "Exposes gradle buildSrc for IDE support"
271
	apply plugin: "groovy"
272 273 274

	dependencies {
		compile gradleApi()
R
Rob Winch 已提交
275
		compile localGroovy()
276 277 278 279 280
	}

	configurations.archives.artifacts.clear()
}

P
Phillip Webb 已提交
281 282
project("spring-core") {
	description = "Spring Core"
283

284 285
	// 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
286
	// further transformed by the JarJar task to depend on org.springframework.asm; this
287
	// avoids including two different copies of asm unnecessarily.
J
Juergen Hoeller 已提交
288
	def cglibVersion = "3.2.4"
289
	def objenesisVersion = "2.4"
290 291 292 293

	configurations {
		jarjar
		cglib
294
		objenesis
295 296 297 298 299 300 301 302 303 304 305 306 307 308 309
	}

	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 已提交
310 311
					rule(pattern: "net.sf.cglib.**", result: "org.springframework.cglib.@1")
					// as mentioned above, transform cglib"s internal asm dependencies from
312 313
					// 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 已提交
314
					rule(pattern: "org.objectweb.asm.**", result: "org.springframework.asm.@1")
315 316 317 318 319
				}
			}
		}
	}

320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338
	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")
				}
			}
		}
	}

339
	dependencies {
340
		cglib("cglib:cglib:${cglibVersion}@jar")
341
		objenesis("org.objenesis:objenesis:${objenesisVersion}@jar")
342
		jarjar("com.googlecode.jarjar:jarjar:1.3")
343

P
Phillip Webb 已提交
344
		compile(files(cglibRepackJar))
345
		compile(files(objenesisRepackJar))
346
		compile("commons-logging:commons-logging:1.2")
347
		optional("org.aspectj:aspectjweaver:${aspectjVersion}")
348
		optional("net.sf.jopt-simple:jopt-simple:5.0.2")
349
		testCompile("org.apache.tomcat.embed:tomcat-embed-core:${tomcatVersion}")
350
		testCompile("xmlunit:xmlunit:${xmlunitVersion}")
351
		testCompile("com.fasterxml.woodstox:woodstox-core:5.0.2") {
P
Phillip Webb 已提交
352 353
			exclude group: "stax", module: "stax-api"
		}
354 355 356
	}

	jar {
357
		// inline repackaged cglib classes directly into the spring-core jar
358 359
		dependsOn cglibRepackJar
		from(zipTree(cglibRepackJar.archivePath)) {
P
Phillip Webb 已提交
360
			include "org/springframework/cglib/**"
361
		}
362 363 364 365 366

		dependsOn objenesisRepackJar
		from(zipTree(objenesisRepackJar.archivePath)) {
			include "org/springframework/objenesis/**"
		}
367
	}
C
Chris Beams 已提交
368 369
}

P
Phillip Webb 已提交
370 371
project("spring-beans") {
	description = "Spring Beans"
372

373
	dependencies {
374 375
		compile(project(":spring-core"))
		compile(files(project(":spring-core").cglibRepackJar))
376
		optional("javax.inject:javax.inject:1")
377
		optional("javax.el:javax.el-api:2.2.5")
378
		optional("org.yaml:snakeyaml:${snakeyamlVersion}")
379
		testCompile("org.apache.tomcat.embed:tomcat-embed-core:${tomcatVersion}")
J
Juergen Hoeller 已提交
380
	}
C
Chris Beams 已提交
381 382
}

383 384
project("spring-beans-groovy") {
	description "Groovy Bean Definitions"
J
Juergen Hoeller 已提交
385
	merge.into = project(":spring-beans")
386
	apply plugin: "groovy"
J
Juergen Hoeller 已提交
387 388 389

	dependencies {
		compile(project(":spring-core"))
390
		optional("org.codehaus.groovy:groovy-all:${groovyVersion}")
J
Juergen Hoeller 已提交
391 392 393 394 395 396 397
	}

	// this module's Java and Groovy sources need to be compiled together
	compileJava.enabled=false
	sourceSets {
		main {
			groovy {
398
				srcDir "src/main/java"
J
Juergen Hoeller 已提交
399 400 401
			}
		}
	}
402 403

	compileGroovy {
404 405
		sourceCompatibility = 1.8
		targetCompatibility = 1.8
406
	}
J
Juergen Hoeller 已提交
407 408
}

P
Phillip Webb 已提交
409 410
project("spring-aop") {
	description = "Spring AOP"
411

412
	dependencies {
413
		compile(project(":spring-beans"))
414 415
		compile(project(":spring-core"))
		compile(files(project(":spring-core").cglibRepackJar))
416
		compile(files(project(":spring-core").objenesisRepackJar))
417
		optional("org.aspectj:aspectjweaver:${aspectjVersion}")
418
		optional("org.apache.commons:commons-pool2:2.4.2")
419
		optional("com.jamonapi:jamon:2.81")
420
	}
C
Chris Beams 已提交
421 422
}

P
Phillip Webb 已提交
423 424
project("spring-expression") {
	description = "Spring Expression Language (SpEL)"
425

426
	dependencies {
427
		compile(project(":spring-core"))
428
	}
C
Chris Beams 已提交
429 430
}

P
Phillip Webb 已提交
431 432
project("spring-instrument") {
	description = "Spring Instrument"
433

434
	jar {
P
Phillip Webb 已提交
435 436
		manifest.attributes["Premain-Class"] =
			"org.springframework.instrument.InstrumentationSavingAgent"
437 438
		manifest.attributes["Agent-Class"] =
			"org.springframework.instrument.InstrumentationSavingAgent"
439 440 441
		manifest.attributes["Can-Redefine-Classes"] = "true"
		manifest.attributes["Can-Retransform-Classes"] = "true"
		manifest.attributes["Can-Set-Native-Method-Prefix"] = "false"
442
	}
C
Chris Beams 已提交
443 444
}

P
Phillip Webb 已提交
445 446
project("spring-context") {
	description = "Spring Context"
447
	apply plugin: "groovy"
448

449
	dependencies {
450 451 452 453 454
		compile(project(":spring-aop"))
		compile(project(":spring-beans"))
		compile(project(":spring-expression"))
		compile(project(":spring-core"))
		compile(files(project(":spring-core").cglibRepackJar))
455
		optional(project(":spring-instrument"))
456
		optional("javax.inject:javax.inject:1")
457
		optional("javax.ejb:ejb-api:${ejbVersion}")
458
		optional("javax.enterprise.concurrent:javax.enterprise.concurrent-api:1.0")
459
		optional("javax.money:money-api:1.0")
J
Juergen Hoeller 已提交
460 461
		optional("org.eclipse.persistence:javax.persistence:${jpaVersion}")
		optional("javax.validation:validation-api:${beanvalVersion}")
462
		optional("org.hibernate:hibernate-validator:${hibval5Version}")
463 464
		optional("joda-time:joda-time:${jodaVersion}")
		optional("org.aspectj:aspectjweaver:${aspectjVersion}")
J
Juergen Hoeller 已提交
465
		optional("org.codehaus.groovy:groovy-all:${groovyVersion}")
466
		optional("org.beanshell:bsh:2.0b4")
467
		testCompile("javax.inject:javax.inject-tck:1")
468 469
		testCompile("javax.el:javax.el-api:2.2.5")
		testCompile("org.glassfish.web:javax.el:2.2.6")
470
		testCompile("org.javamoney:moneta:1.1")
471
		testCompile("org.apache.commons:commons-pool2:2.4.2")
472
		testCompile("org.slf4j:slf4j-api:${slf4jVersion}")
473
	}
474 475 476 477 478 479 480 481 482
}

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

	dependencies {
		compile(project(":spring-beans"))
		compile(project(":spring-core"))
		compile(project(":spring-context"))
483
		optional(project(":spring-oxm"))
R
Rossen Stoyanchev 已提交
484
		optional("io.projectreactor:reactor-core:${reactorVersion}")
S
Stephane Maldini 已提交
485
		optional("io.projectreactor:reactor-net:${reactorVersion}") {
486 487
			exclude group: "io.netty", module: "netty-all"
		}
488
		optional("io.netty:netty-all:${nettyVersion}")
B
Brian Clozel 已提交
489
		optional("org.eclipse.jetty.websocket:websocket-server:${jettyVersion}") {
B
Brian Clozel 已提交
490 491
			exclude group: "javax.servlet", module: "javax.servlet-api"
		}
B
Brian Clozel 已提交
492
		optional("org.eclipse.jetty.websocket:websocket-client:${jettyVersion}")
493
		optional("com.fasterxml.jackson.core:jackson-databind:${jackson2Version}")
494
		testCompile("javax.inject:javax.inject-tck:1")
495
		testCompile("javax.servlet:javax.servlet-api:3.1.0")
J
Juergen Hoeller 已提交
496
		testCompile("javax.validation:validation-api:${beanvalVersion}")
497
		testCompile("com.thoughtworks.xstream:xstream:${xstreamVersion}")
498 499 500 501 502
		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 已提交
503
		testCompile("org.eclipse.jetty:jetty-webapp:${jettyVersion}") {
B
Brian Clozel 已提交
504
			exclude group: "javax.servlet", module: "javax.servlet-api"
505
		}
506 507
		testCompile("org.apache.tomcat.embed:tomcat-embed-core:${tomcatVersion}")
		testCompile("org.apache.tomcat.embed:tomcat-embed-websocket:${tomcatVersion}")
508
		testCompile("io.netty:netty-all:${nettyVersion}")
509
		testCompile("org.slf4j:slf4j-jcl:${slf4jVersion}")
510
		testCompile("xmlunit:xmlunit:${xmlunitVersion}")
511
	}
C
Chris Beams 已提交
512 513
}

P
Phillip Webb 已提交
514 515
project("spring-tx") {
	description = "Spring Transaction"
516

517
	dependencies {
518 519
		compile(project(":spring-beans"))
		compile(project(":spring-core"))
520
		optional(project(":spring-aop"))
521
		optional(project(":spring-context"))  // for JCA, @EnableTransactionManagement
522
		optional("javax.transaction:javax.transaction-api:${jtaVersion}")
J
Juergen Hoeller 已提交
523
		optional("javax.resource:javax.resource-api:${jcaVersion}")
524
		optional("javax.ejb:ejb-api:${ejbVersion}")
525
		optional("com.ibm.websphere:uow:6.0.2.17")
526
		testCompile("org.aspectj:aspectjweaver:${aspectjVersion}")
J
Juergen Hoeller 已提交
527
		testCompile("org.eclipse.persistence:javax.persistence:${jpaVersion}")
528
		testCompile("org.codehaus.groovy:groovy-all:${groovyVersion}")
529
	}
C
Chris Beams 已提交
530 531
}

P
Phillip Webb 已提交
532 533 534
project("spring-oxm") {
	description = "Spring Object/XML Marshalling"
	apply from: "oxm.gradle"
535

P
Phillip Webb 已提交
536
	compileTestJava {
537 538
		// necessary to avoid java.lang.VerifyError on jibx compilation
		// see http://jira.codehaus.org/browse/JIBX-465
539 540
		sourceCompatibility = 1.8
		targetCompatibility = 1.8
541 542
	}

543
	dependencies {
544 545
		compile(project(":spring-beans"))
		compile(project(":spring-core"))
546
		optional("org.codehaus.castor:castor-xml:1.4.1")  {
547
			exclude group: 'stax', module: 'stax-api'
548
			exclude group: "org.springframework", module: "spring-context"
549 550 551 552 553
		}
		optional("com.thoughtworks.xstream:xstream:${xstreamVersion}") {
			exclude group: 'xpp3', module: 'xpp3_min'
			exclude group: 'xmlpull', module: 'xmlpull'
		}
554
		optional("org.jibx:jibx-run:1.2.6")
555
		testCompile(project(":spring-context"))
556
		testCompile("xmlunit:xmlunit:${xmlunitVersion}")
557 558
		testCompile("xpp3:xpp3:1.1.4c")
		testCompile("org.codehaus.jettison:jettison:1.3.7") {
559 560
			exclude group: 'stax', module: 'stax-api'
		}
561 562 563 564
		if (compileTestJava.enabled) {
			testCompile(files(genCastor.classesDir).builtBy(genCastor))
			testCompile(files(genJaxb.classesDir).builtBy(genJaxb))
		}
565
	}
C
Chris Beams 已提交
566 567
}

P
Phillip Webb 已提交
568 569
project("spring-jms") {
	description = "Spring JMS"
570

571
	dependencies {
572 573 574 575
		compile(project(":spring-core"))
		compile(project(":spring-beans"))
		compile(project(":spring-aop"))
		compile(project(":spring-context"))
576
		compile(project(":spring-messaging"))
577
		compile(project(":spring-tx"))
J
Juergen Hoeller 已提交
578
		provided("javax.jms:javax.jms-api:2.0.1")
579
		optional(project(":spring-oxm"))
580
		optional("javax.transaction:javax.transaction-api:${jtaVersion}")
J
Juergen Hoeller 已提交
581
		optional("javax.resource:javax.resource-api:${jcaVersion}")
582
		optional("com.fasterxml.jackson.core:jackson-databind:${jackson2Version}")
583
	}
C
Chris Beams 已提交
584 585
}

P
Phillip Webb 已提交
586 587
project("spring-jdbc") {
	description = "Spring JDBC"
588

589
	dependencies {
590
		compile(project(":spring-beans"))
591
		compile(project(":spring-core"))
592
		compile(project(":spring-tx"))
593
		optional(project(":spring-context"))  // for JndiDataSourceLookup
594
		optional("javax.transaction:javax.transaction-api:${jtaVersion}")
595
		optional("com.mchange:c3p0:0.9.5.2")
P
Phillip Webb 已提交
596
		optional("org.hsqldb:hsqldb:${hsqldbVersion}")
597
		optional("com.h2database:h2:1.4.192")
598 599
		optional("org.apache.derby:derby:10.12.1.1")
		optional("org.apache.derby:derbyclient:10.12.1.1")
600
	}
C
Chris Beams 已提交
601 602
}

P
Phillip Webb 已提交
603 604
project("spring-context-support") {
	description = "Spring Context Support"
605

606
	dependencies {
607 608 609
		compile(project(":spring-core"))
		compile(project(":spring-beans"))
		compile(project(":spring-context"))
610 611
		optional(project(":spring-jdbc"))  // for Quartz support
		optional(project(":spring-tx"))  // for Quartz support
612
		optional("javax.mail:javax.mail-api:${javamailVersion}")
S
Stephane Nicoll 已提交
613
		optional("javax.cache:cache-api:1.0.0")
B
Ben Manes 已提交
614
		optional("com.github.ben-manes.caffeine:caffeine:${caffeineVersion}")
615
		optional("net.sf.ehcache:ehcache:${ehcacheVersion}")
616
		optional("org.quartz-scheduler:quartz:2.2.3")
617
		optional("org.codehaus.fabric3.api:commonj:1.1.0")
618
		optional("org.freemarker:freemarker:${freemarkerVersion}")
619
		optional("com.lowagie:itext:2.1.7")
620
		testCompile(project(":spring-context"))
621
		testCompile("org.apache.poi:poi:${poiVersion}")
P
Phillip Webb 已提交
622
		testCompile("org.hsqldb:hsqldb:${hsqldbVersion}")
623
		testCompile("org.slf4j:slf4j-api:${slf4jVersion}")
624
		testRuntime("com.sun.mail:javax.mail:${javamailVersion}")
625
		testRuntime("org.ehcache:jcache:${ehcachejcacheVersion}")
626
	}
C
Chris Beams 已提交
627 628
}

P
Phillip Webb 已提交
629 630
project("spring-web") {
	description = "Spring Web"
631
	apply plugin: "groovy"
632

633 634 635 636 637 638 639 640 641 642 643 644 645 646 647
	// 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"
	}

648
	dependencies {
649 650
		compile(project(":spring-aop"))  // for JaxWsPortProxyFactoryBean
		compile(project(":spring-beans"))  // for MultipartFilter
651
		compile(project(":spring-context"))
652
		compile(project(":spring-core"))
653
		provided("javax.servlet:javax.servlet-api:3.0.1")
654
		optional(project(":spring-oxm"))  // for MarshallingHttpMessageConverter
655
		optional("javax.servlet.jsp:javax.servlet.jsp-api:2.2.1")
656
		optional("javax.el:javax.el-api:2.2.5")
657
		optional("javax.faces:javax.faces-api:2.2")
J
Juergen Hoeller 已提交
658
		optional("javax.validation:validation-api:${beanvalVersion}")
659
		optional("org.codehaus.groovy:groovy-all:${groovyVersion}")
660
		optional("com.caucho:hessian:4.0.38")
661 662 663
		optional("commons-fileupload:commons-fileupload:${fileuploadVersion}")
		optional("org.apache.httpcomponents:httpclient:${httpclientVersion}")
		optional("org.apache.httpcomponents:httpasyncclient:${httpasyncVersion}")
664
		optional("io.netty:netty-all:${nettyVersion}")
665
		optional("com.squareup.okhttp:okhttp:${okhttpVersion}")
666
		optional("com.squareup.okhttp3:okhttp:${okhttp3Version}")
667
		optional("com.fasterxml.jackson.core:jackson-databind:${jackson2Version}")
668
		optional("com.fasterxml.jackson.dataformat:jackson-dataformat-xml:${jackson2Version}")
R
Roy Clarkson 已提交
669
		optional("com.google.code.gson:gson:${gsonVersion}")
670
		optional("com.rometools:rome:${romeVersion}")
B
Brian Clozel 已提交
671
		optional("org.eclipse.jetty:jetty-servlet:${jettyVersion}") {
B
Brian Clozel 已提交
672
			exclude group: "javax.servlet", module: "javax.servlet-api"
673
		}
B
Brian Clozel 已提交
674
		optional("org.eclipse.jetty:jetty-server:${jettyVersion}") {
B
Brian Clozel 已提交
675
			exclude group: "javax.servlet", module: "javax.servlet-api"
676
		}
677 678
		optional("com.google.protobuf:protobuf-java:2.6.1")
		optional("com.googlecode.protobuf-java-format:protobuf-java-format:1.4")
679
		optional("javax.mail:javax.mail-api:${javamailVersion}")
680
		testCompile(project(":spring-context-support"))  // for JafMediaTypeFactory
681
		testCompile("xmlunit:xmlunit:${xmlunitVersion}")
682
		testCompile("org.slf4j:slf4j-jcl:${slf4jVersion}")
683 684 685
		testCompile("org.apache.taglibs:taglibs-standard-jstlel:1.2.1") {
			exclude group: "org.apache.taglibs", module: "taglibs-standard-spec"
		}
686
		testCompile("com.fasterxml.jackson.datatype:jackson-datatype-joda:${jackson2Version}")
687
		testCompile("com.fasterxml.jackson.datatype:jackson-datatype-jdk8:${jackson2Version}")
688
		testCompile("com.fasterxml.jackson.module:jackson-module-kotlin:${jackson2Version}")
689
		testRuntime("com.sun.mail:javax.mail:${javamailVersion}")
690
	}
C
Chris Beams 已提交
691 692
}

P
Phillip Webb 已提交
693 694
project("spring-orm") {
	description = "Spring Object/Relational Mapping"
695

696
	dependencies {
697 698 699 700 701 702 703
		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 已提交
704
		optional("org.eclipse.persistence:javax.persistence:${jpaVersion}")
705 706
		optional("org.eclipse.persistence:org.eclipse.persistence.core:${eclipselinkVersion}")
		optional("org.eclipse.persistence:org.eclipse.persistence.jpa:${eclipselinkVersion}") {
707 708
			exclude group: 'org.eclipse.persistence', module: 'javax.persistence'
		}
709
		optional("org.hibernate:hibernate-core:${hibernate5Version}")
710
		optional("javax.servlet:javax.servlet-api:3.0.1")
S
Sam Brannen 已提交
711
		testCompile("org.aspectj:aspectjweaver:${aspectjVersion}")
P
Phillip Webb 已提交
712
		testCompile("org.hsqldb:hsqldb:${hsqldbVersion}")
713
		testCompile("org.slf4j:slf4j-jcl:${slf4jVersion}")
714
	}
C
Chris Beams 已提交
715 716
}

P
Phillip Webb 已提交
717 718
project("spring-webmvc") {
	description = "Spring Web MVC"
719

720
	dependencies {
721
		compile(project(":spring-aop"))
722 723
		compile(project(":spring-beans"))
		compile(project(":spring-context"))
724
		compile(project(":spring-core"))
725
		compile(files(project(":spring-core").objenesisRepackJar))
726 727
		compile(project(":spring-expression"))
		compile(project(":spring-web"))
728
		provided("javax.servlet:javax.servlet-api:3.1.0")
729
		optional(project(":spring-context-support"))  // for FreeMarker support
730
		optional(project(":spring-oxm"))  // for MarshallingView
731 732
		optional("javax.servlet.jsp:javax.servlet.jsp-api:2.2.1")
		optional("javax.servlet.jsp.jstl:javax.servlet.jsp.jstl-api:1.2.1")
733 734
		optional("org.apache.poi:poi:${poiVersion}")
		optional("org.apache.poi:poi-ooxml:${poiVersion}")
735
		optional("org.freemarker:freemarker:${freemarkerVersion}")
736
		optional("org.codehaus.groovy:groovy-all:${groovyVersion}")
737 738
		optional("com.lowagie:itext:2.1.7")
		optional("com.fasterxml.jackson.core:jackson-databind:${jackson2Version}")
739
		optional("com.fasterxml.jackson.dataformat:jackson-dataformat-xml:${jackson2Version}")
740
		optional("com.rometools:rome:${romeVersion}")
741 742 743
		optional("javax.el:javax.el-api:2.2.5")
		optional("org.apache.tiles:tiles-api:${tiles3Version}")
		optional("org.apache.tiles:tiles-core:${tiles3Version}") {
744 745
			exclude group: "org.slf4j", module: "jcl-over-slf4j"
		}
746
		optional("org.apache.tiles:tiles-servlet:${tiles3Version}") {
747 748
			exclude group: "org.slf4j", module: "jcl-over-slf4j"
		}
749
		optional("org.apache.tiles:tiles-jsp:${tiles3Version}") {
750 751
			exclude group: "org.slf4j", module: "jcl-over-slf4j"
		}
752
		optional("org.apache.tiles:tiles-el:${tiles3Version}") {
753 754
			exclude group: "org.slf4j", module: "jcl-over-slf4j"
		}
755
		optional("org.apache.tiles:tiles-extras:${tiles3Version}") {
756 757 758
			exclude group: "org.slf4j", module: "jcl-over-slf4j"
			exclude group: "org.springframework", module: "spring-web"
		}
759
		optional('org.webjars:webjars-locator:0.32')
760
		testCompile("xmlunit:xmlunit:${xmlunitVersion}")
761
		testCompile("dom4j:dom4j:1.6.1") {
P
Phillip Webb 已提交
762
			exclude group: "xml-apis", module: "xml-apis"
763 764
		}
		testCompile("jaxen:jaxen:1.1.1") {
P
Phillip Webb 已提交
765 766 767
			exclude group: "xml-apis", module: "xml-apis"
			exclude group: "xom", module: "xom"
			exclude group: "xerces", module: "xercesImpl"
768
		}
B
Brian Clozel 已提交
769
		testCompile("org.eclipse.jetty:jetty-servlet:${jettyVersion}") {
B
Brian Clozel 已提交
770
			exclude group: "javax.servlet", module: "javax.servlet"
771
		}
B
Brian Clozel 已提交
772
		testCompile("org.eclipse.jetty:jetty-server:${jettyVersion}") {
B
Brian Clozel 已提交
773
			exclude group: "javax.servlet", module: "javax.servlet"
774
		}
J
Juergen Hoeller 已提交
775
		testCompile("javax.validation:validation-api:${beanvalVersion}")
776
		testCompile("org.hibernate:hibernate-validator:${hibval5Version}")
777 778
		testCompile("org.apache.httpcomponents:httpclient:${httpclientVersion}")
		testCompile("commons-fileupload:commons-fileupload:${fileuploadVersion}")
779
		testCompile("commons-io:commons-io:1.3")
780
		testCompile("joda-time:joda-time:${jodaVersion}")
781
		testCompile("org.slf4j:slf4j-jcl:${slf4jVersion}")
782
		testCompile("org.mozilla:rhino:1.7.7.1")
783 784 785
		testRuntime("org.jruby:jruby:9.1.2.0")
		testRuntime("org.python:jython-standalone:2.5.3")
		testRuntime("org.webjars:underscorejs:1.8.3")
786
	}
C
Chris Beams 已提交
787 788
}

789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823
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"))
		optional("javax.servlet:javax.servlet-api:3.1.0")
		optional("javax.websocket:javax.websocket-api:1.0")
		optional("org.apache.tomcat:tomcat-websocket:${tomcatVersion}") {
			exclude group: "org.apache.tomcat", module: "tomcat-websocket-api"
			exclude group: "org.apache.tomcat", module: "tomcat-servlet-api"
		}
		optional("org.glassfish.tyrus:tyrus-spi:${tyrusVersion}")
		optional("org.glassfish.tyrus:tyrus-core:${tyrusVersion}")
		optional("org.glassfish.tyrus:tyrus-server:${tyrusVersion}")
		optional("org.glassfish.tyrus:tyrus-container-servlet:${tyrusVersion}")
		optional("org.eclipse.jetty:jetty-webapp:${jettyVersion}") {
			exclude group: "javax.servlet", module: "javax.servlet"
		}
		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"
		}
824
		optional("org.jboss.xnio:xnio-api:3.3.7.Final")
825 826 827 828 829 830
		optional("com.fasterxml.jackson.core:jackson-databind:${jackson2Version}")
		testCompile("org.apache.tomcat.embed:tomcat-embed-core:${tomcatVersion}")
		testCompile("org.apache.tomcat.embed:tomcat-embed-websocket:${tomcatVersion}")
		testCompile("io.projectreactor:reactor-net:${reactorVersion}")
		testCompile("io.netty:netty-all:${nettyVersion}")
		testCompile("org.slf4j:slf4j-jcl:${slf4jVersion}")
831 832
		testRuntime("org.jboss.xnio:xnio-nio:3.3.7.Final")
		testRuntime("org.jboss.logging:jboss-logging:3.3.0.Final")
833 834 835
	}
}

P
Phillip Webb 已提交
836 837
project("spring-test") {
	description = "Spring TestContext Framework"
838

839
	dependencies {
840
		compile(project(":spring-core"))
841 842 843 844 845 846 847
		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"))
848
		optional(project(":spring-websocket"))
849
		optional("junit:junit:${junitVersion}")
850
		optional("org.junit.jupiter:junit-jupiter-api:${junitJupiterVersion}")
851
		optional("org.testng:testng:${testngVersion}")
852
		optional("javax.inject:javax.inject:1")
853
		optional("javax.servlet:javax.servlet-api:3.0.1")
854 855 856 857 858
		optional("javax.servlet.jsp:javax.servlet.jsp-api:2.2.1")
		optional("javax.servlet.jsp.jstl:javax.servlet.jsp.jstl-api:1.2.1")
		optional("org.apache.taglibs:taglibs-standard-jstlel:1.2.1") {
			exclude group: "org.apache.taglibs", module: "taglibs-standard-spec"
		}
859
		optional("javax.el:javax.el-api:2.2.5")
860
		optional("javax.websocket:javax.websocket-api:1.0")
861
		optional("org.aspectj:aspectjweaver:${aspectjVersion}")
S
Sam Brannen 已提交
862
		optional("org.codehaus.groovy:groovy-all:${groovyVersion}")
863
		optional("org.hamcrest:hamcrest-core:${hamcrestVersion}")
864
		optional("xmlunit:xmlunit:${xmlunitVersion}")
865 866 867
		optional("net.sourceforge.htmlunit:htmlunit:2.22")
		optional("org.seleniumhq.selenium:htmlunit-driver:2.21")
		optional("org.seleniumhq.selenium:selenium-java:2.53.1")
868 869
		optional("org.skyscreamer:jsonassert:1.3.0")
		optional("com.jayway.jsonpath:json-path:2.2.0")
870 871
		testCompile(project(":spring-context-support"))
		testCompile(project(":spring-oxm"))
872
		testCompile("javax.mail:javax.mail-api:${javamailVersion}")
873
		testCompile("javax.ejb:ejb-api:${ejbVersion}")
874
		testCompile("org.hibernate:hibernate-core:${hibernate5Version}")
875
		testCompile("org.hibernate:hibernate-validator:${hibval5Version}")
876 877
		// Enable use of the JUnitPlatform Runner
		testCompile("org.junit.platform:junit-platform-runner:${junitPlatformVersion}")
878
		testCompile("com.thoughtworks.xstream:xstream:${xstreamVersion}")
879
		testCompile("com.fasterxml.jackson.core:jackson-databind:${jackson2Version}")
880
		testCompile("com.rometools:rome:${romeVersion}")
881 882
		testCompile("org.apache.tiles:tiles-api:${tiles3Version}")
		testCompile("org.apache.tiles:tiles-core:${tiles3Version}") {
883 884
			exclude group: "org.slf4j", module: "jcl-over-slf4j"
		}
885
		testCompile("org.apache.tiles:tiles-servlet:${tiles3Version}") {
886 887
			exclude group: "org.slf4j", module: "jcl-over-slf4j"
		}
888
		testCompile("org.hsqldb:hsqldb:${hsqldbVersion}")
S
Sam Brannen 已提交
889
		testCompile("org.slf4j:slf4j-jcl:${slf4jVersion}")
890
		testCompile("org.apache.httpcomponents:httpclient:${httpclientVersion}")
891
		testCompile("javax.cache:cache-api:1.0.0")
892
		testRuntime("org.junit.jupiter:junit-jupiter-engine:${junitJupiterVersion}")
893 894
		// Java Util Logging for JUnit 5.
		testRuntime("org.apache.logging.log4j:log4j-jul:${log4jVersion}")
895
		testRuntime("org.ehcache:ehcache:${ehcache3Version}")
J
Juergen Hoeller 已提交
896
		testRuntime("org.terracotta:management-model:2.0.0")
897
	}
898 899

	task testNG(type: Test) {
900
		description = 'Runs TestNG tests.'
901
		useTestNG()
902
		scanForTestClasses = false
903 904
		include(["**/testng/**/*Tests.class", "**/testng/**/*Test.class"])
		// Show STD_OUT & STD_ERR of the test JVM(s) on the console:
905
		// testLogging.showStandardStreams = true
906
		// forkEvery 1
907 908 909
	}

	test {
910
		description = 'Runs JUnit tests.'
911 912
		dependsOn testNG
		useJUnit()
913 914 915
		scanForTestClasses = false
		include(['**/*Tests.class', '**/*Test.class', '**/SpringJUnitJupiterTestSuite.class'])
		exclude(['**/testng/**/*.*'])
916 917
		// Java Util Logging for JUnit 5.
		// systemProperty('java.util.logging.manager', 'org.apache.logging.log4j.jul.LogManager')
918
	}
919 920

	task aggregateTestReports(type: TestReport) {
921
		description = 'Aggregates JUnit and TestNG test reports.'
922 923 924 925 926
		destinationDir = test.reports.html.destination
		reportOn test, testNG
	}

	check.dependsOn aggregateTestReports
C
Chris Beams 已提交
927 928
}

P
Phillip Webb 已提交
929 930 931
project("spring-aspects") {
	description = "Spring Aspects"
	apply from: "aspects.gradle"
932

933
	dependencies {
934
		aspects(project(":spring-orm"))
935 936 937
		ajc("org.aspectj:aspectjtools:${aspectjVersion}")
		rt("org.aspectj:aspectjrt:${aspectjVersion}")
		compile("org.aspectj:aspectjweaver:${aspectjVersion}")
J
Juergen Hoeller 已提交
938
		provided("org.eclipse.persistence:javax.persistence:${jpaVersion}")
939 940 941 942 943 944
		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
945
		optional("javax.transaction:javax.transaction-api:${jtaVersion}")  // for @javax.transaction.Transactional support
S
Stephane Nicoll 已提交
946
		optional("javax.cache:cache-api:1.0.0")
947
		testCompile(project(":spring-core"))  // for CodeStyleAspect
948
		testCompile(project(":spring-test"))
949
		testCompile("javax.mail:javax.mail-api:${javamailVersion}")
950
	}
951

952
	eclipse.project {
P
Phillip Webb 已提交
953
		natures += "org.eclipse.ajdt.ui.ajnature"
954
		buildCommands = [new org.gradle.plugins.ide.eclipse.model.BuildCommand("org.eclipse.ajdt.core.ajbuilder")]
955
	}
C
Chris Beams 已提交
956 957
}

958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992
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)
										}
									}
								}
							}
						}
					}
				}
			}
		}
	}
}

993 994
sonarqube {
	properties {
S
Stephane Nicoll 已提交
995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006
		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"
	}
}

1007
configure(rootProject) {
P
Phillip Webb 已提交
1008
	description = "Spring Framework"
1009

B
Brian Clozel 已提交
1010
	apply plugin: "org.asciidoctor.convert"
1011
	apply plugin: "docbook-reference"
1012
	apply plugin: "groovy"
R
Rob Winch 已提交
1013

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

R
Rob Winch 已提交
1017
	asciidoctor {
B
Brian Clozel 已提交
1018 1019
		sourceDir project.file('src/asciidoc')
		separateOutputDirs = false
1020
		backends = ['docbook']
B
Brian Clozel 已提交
1021
		options doctype: 'book', eruby: 'erubis'
J
Juergen Hoeller 已提交
1022
		attributes 'spring-version': project.version, 'revnumber': project.version, 'docinfo': ""
1023 1024
	}

1025 1026 1027
	reference {
		sourceDir = asciidoctor.outputDir
		pdfFilename = "spring-framework-reference.pdf"
1028
		epubFilename = "spring-framework-reference.epub"
1029 1030 1031 1032 1033 1034 1035
		expandPlaceholders = ""
	}

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

1036 1037 1038 1039 1040
	// 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")
	// }
1041

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

1045
	dependencies {  // for integration tests
1046
		testCompile(project(":spring-aop"))
1047
		testCompile(project(":spring-beans"))
1048
		testCompile(project(":spring-context"))
1049 1050
		testCompile(project(":spring-core"))
		testCompile(project(":spring-expression"))
1051
		testCompile(project(":spring-jdbc"))
1052
		testCompile(project(":spring-orm"))
1053
		testCompile(project(":spring-test"))
1054
		testCompile(project(":spring-tx"))
1055
		testCompile(project(":spring-web"))
1056
		testCompile("javax.servlet:javax.servlet-api:3.0.1")
1057
		testCompile("javax.inject:javax.inject:1")
J
Juergen Hoeller 已提交
1058
		testCompile("javax.resource:javax.resource-api:${jcaVersion}")
1059
		testCompile("org.aspectj:aspectjweaver:${aspectjVersion}")
1060
		testCompile("org.hibernate:hibernate-core:${hibernate5Version}")
P
Phillip Webb 已提交
1061
		testCompile("org.hsqldb:hsqldb:${hsqldbVersion}")
1062 1063 1064
	}

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

1069 1070 1071 1072 1073
		dependsOn {
			subprojects.collect {
				it.tasks.getByName("jar")
			}
		}
1074 1075 1076
		options.memberLevel = org.gradle.external.javadoc.JavadocMemberLevel.PROTECTED
		options.author = true
		options.header = rootProject.description
P
Phillip Webb 已提交
1077
		options.overview = "src/api/overview.html"
1078
		options.stylesheetFile = file("src/api/stylesheet.css")
1079
		options.splitIndex = true
C
Chris Beams 已提交
1080
		options.links(project.ext.javadocLinks)
1081
		options.addStringOption('Xdoclint:none', '-quiet')
C
Chris Beams 已提交
1082

1083 1084 1085
		source subprojects.collect { project ->
			project.sourceSets.main.allJava
		}
C
Chris Beams 已提交
1086

P
Phillip Webb 已提交
1087
		maxMemory = "1024m"
C
Chris Beams 已提交
1088
		destinationDir = new File(buildDir, "api")
1089 1090 1091

		doFirst {
			classpath = files(
1092 1093
                // ensure Servlet 3.x has precedence on the javadoc classpath
                project(":spring-webmvc").sourceSets.main.compileClasspath.files.find { it =~ "servlet-api" },
1094 1095 1096 1097 1098
				// 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 })
		}
1099 1100
	}

1101
	task docsZip(type: Zip, dependsOn: 'reference') {
P
Phillip Webb 已提交
1102 1103 1104
		group = "Distribution"
		baseName = "spring-framework"
		classifier = "docs"
1105 1106 1107
		description = "Builds -${classifier} archive containing api and reference " +
			"for deployment at http://static.springframework.org/spring-framework/docs."

P
Phillip Webb 已提交
1108 1109
		from("src/dist") {
			include "changelog.txt"
1110 1111 1112
		}

		from (api) {
1113
			into "javadoc-api"
1114 1115
		}

1116 1117
		from (reference) {
			into "spring-framework-reference"
1118 1119 1120 1121
		}
	}

	task schemaZip(type: Zip) {
P
Phillip Webb 已提交
1122 1123 1124
		group = "Distribution"
		baseName = "spring-framework"
		classifier = "schema"
1125 1126
		description = "Builds -${classifier} archive containing all " +
			"XSDs for deployment at http://springframework.org/schema."
S
Stephane Nicoll 已提交
1127
		duplicatesStrategy 'exclude'
1128
		moduleProjects.each { subproject ->
1129 1130 1131
			def Properties schemas = new Properties();

			subproject.sourceSets.main.resources.find {
P
Phillip Webb 已提交
1132
				it.path.endsWith("META-INF/spring.schemas")
1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149
			}?.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 已提交
1150 1151 1152
		group = "Distribution"
		baseName = "spring-framework"
		classifier = "dist"
1153
		description = "Builds -${classifier} archive, containing all jars and docs, " +
J
Juergen Hoeller 已提交
1154
			"suitable for community download page."
1155 1156 1157

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

P
Phillip Webb 已提交
1158 1159 1160 1161
		from("src/dist") {
			include "readme.txt"
			include "license.txt"
			include "notice.txt"
1162
			into "${baseDir}"
P
Phillip Webb 已提交
1163
			expand(copyright: new Date().format("yyyy"), version: project.version)
1164 1165 1166 1167 1168 1169 1170 1171 1172 1173
		}

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

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

1174
		moduleProjects.each { subproject ->
1175 1176
			into ("${baseDir}/libs") {
				from subproject.jar
P
Phillip Webb 已提交
1177
				if (subproject.tasks.findByPath("sourcesJar")) {
1178 1179
					from subproject.sourcesJar
				}
P
Phillip Webb 已提交
1180
				if (subproject.tasks.findByPath("javadocJar")) {
1181 1182 1183 1184 1185 1186
					from subproject.javadocJar
				}
			}
		}
	}

1187
	// Create a distribution that contains all dependencies (required and optional).
1188 1189
	// Not published by default; only for use when building from source.
	task depsZip(type: Zip, dependsOn: distZip) { zipTask ->
P
Phillip Webb 已提交
1190 1191 1192
		group = "Distribution"
		baseName = "spring-framework"
		classifier = "dist-with-deps"
1193 1194 1195 1196 1197 1198 1199 1200 1201 1202
		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 ->
1203 1204
					(subproject.configurations.runtime.resolvedConfiguration.resolvedArtifacts +
					subproject.configurations.optional.resolvedConfiguration.resolvedArtifacts).each { artifact ->
1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225
						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 已提交
1226
		description = "Generates gradlew[.bat] scripts"
S
Sam Brannen 已提交
1227
		gradleVersion = "2.14"
1228 1229

		doLast() {
1230
			def gradleOpts = "-XX:MaxMetaspaceSize=1024m -Xmx1024m"
1231
			def gradleBatOpts = "$gradleOpts -XX:MaxHeapSize=256m"
P
Phillip Webb 已提交
1232
			File wrapperFile = file("gradlew")
1233 1234
			wrapperFile.text = wrapperFile.text.replace("DEFAULT_JVM_OPTS=",
				"GRADLE_OPTS=\"$gradleOpts \$GRADLE_OPTS\"\nDEFAULT_JVM_OPTS=")
P
Phillip Webb 已提交
1235
			File wrapperBatFile = file("gradlew.bat")
1236 1237 1238 1239
			wrapperBatFile.text = wrapperBatFile.text.replace("set DEFAULT_JVM_OPTS=",
				"set GRADLE_OPTS=$gradleBatOpts %GRADLE_OPTS%\nset DEFAULT_JVM_OPTS=")
		}
	}
1240

1241
}
1242

S
Stephane Nicoll 已提交
1243
configure([project(':spring-build-src'), project(':spring-framework-bom')]) {
1244
	sonarqube {
S
Stephane Nicoll 已提交
1245 1246 1247 1248 1249
		skipProject = true
	}
}

configure(project(':spring-core')) {
1250 1251
	sonarqube {
		properties {
S
Stephane Nicoll 已提交
1252 1253 1254 1255 1256 1257
			property "sonar.exclusions",
					"src/main/java/org/springframework/cglib/**/*,src/main/java/org/springframework/asm/**/*"
		}
	}
}

1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268
/*
 * 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-")) {
1269
			return version.replace('BUILD', qualifier)
1270 1271
		}
	}
1272
	return version
1273
}