build.gradle 43.7 KB
Newer Older
1
buildscript {
2
	repositories {
P
Phillip Webb 已提交
3
		maven { url "http://repo.springsource.org/plugins-release" }
4 5
	}
	dependencies {
S
Sam Brannen 已提交
6
		classpath("org.springframework.build.gradle:propdeps-plugin:0.0.7")
R
Rob Winch 已提交
7
		classpath("org.asciidoctor:asciidoctor-gradle-plugin:0.7.0")
8
		classpath("org.springframework.build.gradle:docbook-reference-plugin:0.2.8")
9
	}
10 11
}

C
Chris Beams 已提交
12
configure(allprojects) { project ->
13 14
	group = "org.springframework"
	version = qualifyVersionIfNecessary(version)
15

16
	ext.aspectjVersion       = "1.8.1"
17
	ext.eclipseLinkVersion   = "2.4.2"
18 19
	ext.ehcacheVersion       = "2.8.3"
	ext.ehcacheJCacheVersion = "1.0.0"
B
Brian Clozel 已提交
20
	ext.groovyVersion        = "2.3.3"
21
	ext.hibernate3Version    = "3.6.10.Final"
22 23
	ext.hibernate4Version    = "4.3.5.Final"
	ext.hibVal4Version       = "4.3.1.Final"
24
	ext.hibVal5Version       = "5.1.1.Final"
25
	ext.hsqldbVersion        = "2.3.2"
26
	ext.jackson2Version      = "2.4.1"
R
Roy Clarkson 已提交
27
	ext.gsonVersion          = "2.2.4"
28
	ext.jasperReportsVersion = "5.6.0"
29
	ext.jettyVersion         = "9.2.1.v20140609"
30 31
	ext.jodaVersion          = "2.3"
	ext.junitVersion         = "4.11"
32
	ext.openJpaVersion       = "2.2.2"  // 2.3.0 not Java 8 compatible (based on ASM 4)
33
	ext.slf4jVersion         = "1.7.7"
S
Stephane Nicoll 已提交
34
	ext.snakeYamlVersion     = "1.13"
35
	ext.snifferVersion       = "1.11"
36
	ext.tiles2Version        = "2.2.2"
37
	ext.tiles3Version        = "3.0.4"
38
	ext.tomcatVersion        = "8.0.9"
39
	ext.xstreamVersion       = "1.4.7"
40

41
	ext.gradleScriptDir = "${rootProject.projectDir}/gradle"
42

43
	apply plugin: "propdeps"
P
Phillip Webb 已提交
44
	apply plugin: "java"
45
	apply plugin: "test-source-set-dependencies"
46
	apply from: "${gradleScriptDir}/ide.gradle"
C
Chris Beams 已提交
47

S
Stephane Nicoll 已提交
48 49 50 51 52
	configurations {
		sniffer
		javaApiSignature
	}

P
Phillip Webb 已提交
53 54 55
	compileJava.options*.compilerArgs = [
		"-Xlint:serial", "-Xlint:varargs", "-Xlint:cast", "-Xlint:classfile",
		"-Xlint:dep-ann", "-Xlint:divzero", "-Xlint:empty", "-Xlint:finally",
56
		"-Xlint:overrides", "-Xlint:path", "-Xlint:-processing", "-Xlint:static",
P
Phillip Webb 已提交
57 58
		"-Xlint:try", "-Xlint:fallthrough", "-Xlint:rawtypes", "-Xlint:deprecation",
		"-Xlint:unchecked", "-Xlint:-options", "-Werror"
59
	]
C
Chris Beams 已提交
60

P
Phillip Webb 已提交
61 62 63
	compileTestJava.options*.compilerArgs = [
		"-Xlint:serial", "-Xlint:varargs", "-Xlint:cast", "-Xlint:classfile",
		"-Xlint:dep-ann", "-Xlint:divzero", "-Xlint:empty", "-Xlint:finally",
64
		"-Xlint:overrides", "-Xlint:path", "-Xlint:-processing", "-Xlint:static",
P
Phillip Webb 已提交
65 66 67
		"-Xlint:try", "-Xlint:-fallthrough", "-Xlint:-rawtypes", "-Xlint:-deprecation",
		"-Xlint:-unchecked", "-Xlint:-options"]

68 69 70 71 72 73
	compileJava {
		sourceCompatibility=1.6
		targetCompatibility=1.6
	}

	compileTestJava {
74 75 76
		sourceCompatibility=1.8
		targetCompatibility=1.8
		options.compilerArgs += "-parameters"
J
Juergen Hoeller 已提交
77 78
	}

P
Phillip Webb 已提交
79
	sourceSets.test.resources.srcDirs = ["src/test/resources", "src/test/java"]
C
Chris Beams 已提交
80

C
Chris Beams 已提交
81 82
	test {
		systemProperty("java.awt.headless", "true")
83
		systemProperty("testGroups", project.properties.get("testGroups"))
84
		scanForTestClasses = false
85
		include(["**/*Tests.class", "**/*Test.class"])
86 87
		// Since we set scanForTestClasses to false, we need to filter out inner
		// classes with the "$" pattern; otherwise, using -Dtest.single=MyTests to
88
		// run MyTests by itself will fail if MyTests contains any inner classes.
89
		exclude(["**/Abstract*.class", '**/*$*'])
C
Chris Beams 已提交
90
	}
C
Chris Beams 已提交
91

92
	repositories {
93
		maven { url "http://repo.spring.io/libs-release" }
94
	}
C
Chris Beams 已提交
95

96
	dependencies {
97 98 99 100 101 102
		testCompile("junit:junit:${junitVersion}") {
			exclude group:'org.hamcrest', module:'hamcrest-core'
		}
		testCompile("org.mockito:mockito-core:1.9.5") {
			exclude group:'org.hamcrest', module:'hamcrest-core'
		}
103
		testCompile("org.hamcrest:hamcrest-all:1.3")
S
Stephane Nicoll 已提交
104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139
		testCompile("org.mockito:mockito-core:1.9.5")

		sniffer("org.codehaus.mojo:animal-sniffer-ant-tasks:${snifferVersion}")
		javaApiSignature("org.codehaus.mojo.signature:java16:1.1@signature") // As from Java6_18
	}

	task copyJavaApiSignature(type: Copy) {
		ext.to = file("$buildDir/javaApiSignature/")
		description "Copy the resolved Animal Sniffer signature dependency artifact to a known location and name"
		from configurations.javaApiSignature
		into to
		rename '.*signature', 'javaApi.signature'
	}

	task sniff {
		group = "Verification"
		description = "Checks the Java API signatures"

		dependsOn compileJava
		dependsOn copyJavaApiSignature

		inputs.dir sourceSets.main.output.classesDir
		inputs.dir copyJavaApiSignature.to
		outputs.upToDateWhen { true }
		
		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)
140 141 142
				annotation(className: "org.springframework.lang.UsesJava7")
				annotation(className: "org.springframework.lang.UsesJava8")
				annotation(className: "org.springframework.lang.UsesSunHttpServer")
S
Stephane Nicoll 已提交
143 144
			}
		}
145
	}
C
Chris Beams 已提交
146 147

	ext.javadocLinks = [
P
Phillip Webb 已提交
148
		"http://docs.oracle.com/javase/7/docs/api/",
149
		"http://docs.oracle.com/javaee/7/api/",
J
Juergen Hoeller 已提交
150 151 152
		"http://docs.oracle.com/cd/E13222_01/wls/docs90/javadocs/", // CommonJ
		"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 已提交
153 154
		"http://docs.jboss.org/jbossas/javadoc/4.0.5/connector/",
		"http://docs.jboss.org/jbossas/javadoc/7.1.2.Final/",
J
Juergen Hoeller 已提交
155 156 157 158
		"http://commons.apache.org/proper/commons-lang/javadocs/api-2.5/",
		"http://commons.apache.org/proper/commons-codec/apidocs/",
		"http://commons.apache.org/proper/commons-dbcp/apidocs/",
		"http://portals.apache.org/pluto/portlet-2.0-apidocs/",
159
		"http://tiles.apache.org/tiles-request/apidocs/",
J
Juergen Hoeller 已提交
160
		"http://tiles.apache.org/framework/apidocs/",
P
Phillip Webb 已提交
161
		"http://aopalliance.sourceforge.net/doc/",
C
Chris Beams 已提交
162
		"http://www.eclipse.org/aspectj/doc/released/aspectj5rt-api/",
J
Juergen Hoeller 已提交
163
		"http://ehcache.org/apidocs/",
164
		"http://quartz-scheduler.org/api/2.2.0/",
165 166
		"http://fasterxml.github.com/jackson-core/javadoc/2.3.0/",
		"http://fasterxml.github.com/jackson-databind/javadoc/2.3.0/",
P
Phillip Webb 已提交
167
		"http://hc.apache.org/httpcomponents-client-ga/httpclient/apidocs"
C
Chris Beams 已提交
168
	] as String[]
169 170
}

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

	jar {
P
Phillip Webb 已提交
176 177 178 179
		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
180 181 182 183 184

		from("${rootProject.projectDir}/src/dist") {
			include "license.txt"
			include "notice.txt"
			into "META-INF"
P
Phillip Webb 已提交
185
			expand(copyright: new Date().format("yyyy"), version: project.version)
186 187 188 189
		}
	}

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

192 193 194
		options.memberLevel = org.gradle.external.javadoc.JavadocMemberLevel.PROTECTED
		options.author = true
		options.header = project.name
C
Chris Beams 已提交
195
		options.links(project.ext.javadocLinks)
196
		options.addStringOption('Xdoclint:none', '-quiet')
C
Chris Beams 已提交
197 198 199 200 201

		// 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
202 203 204
	}

	task sourcesJar(type: Jar, dependsOn:classes) {
P
Phillip Webb 已提交
205
		classifier = "sources"
206
		from sourceSets.main.allJava.srcDirs
P
Phillip Webb 已提交
207
		include "**/*.java", "**/*.aj"
208 209 210
	}

	task javadocJar(type: Jar) {
P
Phillip Webb 已提交
211
		classifier = "javadoc"
212 213 214 215 216 217 218
		from javadoc
	}

	artifacts {
		archives sourcesJar
		archives javadocJar
	}
C
Chris Beams 已提交
219 220
}

221 222
project("spring-build-src") {
	description = "Exposes gradle buildSrc for IDE support"
223
	apply plugin: "groovy"
224 225 226

	dependencies {
		compile gradleApi()
R
Rob Winch 已提交
227
		compile localGroovy()
228 229 230 231 232
	}

	configurations.archives.artifacts.clear()
}

P
Phillip Webb 已提交
233 234
project("spring-core") {
	description = "Spring Core"
235

236 237
	// As of Spring 4.0.3, spring-core includes asm 5.0 and repackages cglib 3.1, inlining
	// both into the spring-core jar. cglib 3.1 itself depends on asm 4+, and is therefore
238
	// further transformed by the JarJar task to depend on org.springframework.asm; this
239
	// avoids including two different copies of asm unnecessarily.
240 241
	def cglibVersion = "3.1"
	def objenesisVersion = "2.1"
242 243 244 245

	configurations {
		jarjar
		cglib
246
		objenesis
247 248 249 250 251 252 253 254 255 256 257 258 259 260 261
	}

	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 已提交
262 263
					rule(pattern: "net.sf.cglib.**", result: "org.springframework.cglib.@1")
					// as mentioned above, transform cglib"s internal asm dependencies from
264 265
					// 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 已提交
266
					rule(pattern: "org.objectweb.asm.**", result: "org.springframework.asm.@1")
267 268 269 270 271
				}
			}
		}
	}

272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290
	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")
				}
			}
		}
	}

291
	dependencies {
292
		cglib("cglib:cglib:${cglibVersion}@jar")
293
		objenesis("org.objenesis:objenesis:${objenesisVersion}@jar")
294
		jarjar("com.googlecode.jarjar:jarjar:1.3")
295

P
Phillip Webb 已提交
296
		compile(files(cglibRepackJar))
297
		compile("commons-logging:commons-logging:1.1.3")
298
		optional("commons-codec:commons-codec:1.9")
299
		optional("org.aspectj:aspectjweaver:${aspectjVersion}")
300
		optional("net.sf.jopt-simple:jopt-simple:4.6")
301
		optional("log4j:log4j:1.2.17")
302
		testCompile("org.apache.tomcat.embed:tomcat-embed-core:${tomcatVersion}")
A
Arjen Poutsma 已提交
303
		testCompile("xmlunit:xmlunit:1.5")
P
Phillip Webb 已提交
304 305 306
		testCompile("org.codehaus.woodstox:wstx-asl:3.2.7") {
			exclude group: "stax", module: "stax-api"
		}
307 308 309
	}

	jar {
310
		// inline repackaged cglib classes directly into the spring-core jar
311 312
		dependsOn cglibRepackJar
		from(zipTree(cglibRepackJar.archivePath)) {
P
Phillip Webb 已提交
313
			include "org/springframework/cglib/**"
314
		}
315 316 317 318 319

		dependsOn objenesisRepackJar
		from(zipTree(objenesisRepackJar.archivePath)) {
			include "org/springframework/objenesis/**"
		}
320
	}
C
Chris Beams 已提交
321 322
}

P
Phillip Webb 已提交
323 324
project("spring-beans") {
	description = "Spring Beans"
325

326
	dependencies {
327 328
		compile(project(":spring-core"))
		compile(files(project(":spring-core").cglibRepackJar))
329
		optional("javax.inject:javax.inject:1")
330
		optional("javax.el:javax.el-api:2.2.5")
S
Stephane Nicoll 已提交
331
		optional("org.yaml:snakeyaml:${snakeYamlVersion}")
332
		testCompile("log4j:log4j:1.2.17")
333
		testCompile("org.apache.tomcat.embed:tomcat-embed-core:${tomcatVersion}")
S
Stephane Nicoll 已提交
334
    }
C
Chris Beams 已提交
335 336
}

337 338
project("spring-beans-groovy") {
	description "Groovy Bean Definitions"
J
Juergen Hoeller 已提交
339
	merge.into = project(":spring-beans")
340
	apply plugin: "groovy"
J
Juergen Hoeller 已提交
341 342 343

	dependencies {
		compile(project(":spring-core"))
344
		optional("org.codehaus.groovy:groovy-all:${groovyVersion}")
J
Juergen Hoeller 已提交
345 346 347 348 349 350 351
	}

	// this module's Java and Groovy sources need to be compiled together
	compileJava.enabled=false
	sourceSets {
		main {
			groovy {
352
				srcDir "src/main/java"
J
Juergen Hoeller 已提交
353 354 355
			}
		}
	}
356 357 358 359 360

	compileGroovy {
		sourceCompatibility=1.6
		targetCompatibility=1.6
	}
J
Juergen Hoeller 已提交
361 362
}

P
Phillip Webb 已提交
363 364
project("spring-aop") {
	description = "Spring AOP"
365

366
	dependencies {
367
		compile(project(":spring-beans"))
368 369
		compile(project(":spring-core"))
		compile(files(project(":spring-core").cglibRepackJar))
370
		compile(files(project(":spring-core").objenesisRepackJar))
371
		compile("aopalliance:aopalliance:1.0")
372
		optional("org.aspectj:aspectjweaver:${aspectjVersion}")
373
		optional("commons-pool:commons-pool:1.6")
374
		optional("com.jamonapi:jamon:2.76")
375
	}
C
Chris Beams 已提交
376 377
}

P
Phillip Webb 已提交
378 379
project("spring-expression") {
	description = "Spring Expression Language (SpEL)"
380

381
	dependencies {
382
		compile(project(":spring-core"))
383
	}
C
Chris Beams 已提交
384 385
}

P
Phillip Webb 已提交
386 387
project("spring-instrument") {
	description = "Spring Instrument"
388

389
	jar {
P
Phillip Webb 已提交
390 391
		manifest.attributes["Premain-Class"] =
			"org.springframework.instrument.InstrumentationSavingAgent"
392 393
		manifest.attributes["Agent-Class"] =
			"org.springframework.instrument.InstrumentationSavingAgent"
394 395 396
		manifest.attributes["Can-Redefine-Classes"] = "true"
		manifest.attributes["Can-Retransform-Classes"] = "true"
		manifest.attributes["Can-Set-Native-Method-Prefix"] = "false"
397
	}
C
Chris Beams 已提交
398 399
}

P
Phillip Webb 已提交
400 401
project("spring-instrument-tomcat") {
	description = "Spring Instrument Tomcat"
402

403
	dependencies {
404
		provided("org.apache.tomcat:catalina:6.0.16")
405
	}
C
Chris Beams 已提交
406 407
}

P
Phillip Webb 已提交
408 409
project("spring-context") {
	description = "Spring Context"
410
	apply plugin: "groovy"
411

412
	dependencies {
413 414 415 416 417
		compile(project(":spring-aop"))
		compile(project(":spring-beans"))
		compile(project(":spring-expression"))
		compile(project(":spring-core"))
		compile(files(project(":spring-core").cglibRepackJar))
418
		optional(project(":spring-instrument"))
419
		optional("javax.inject:javax.inject:1")
420
		optional("javax.ejb:ejb-api:3.0")
421
		optional("javax.enterprise.concurrent:javax.enterprise.concurrent-api:1.0")
422
		optional("org.eclipse.persistence:javax.persistence:2.0.0")
423
		optional("javax.validation:validation-api:1.0.0.GA")
424
		optional("org.hibernate:hibernate-validator:${hibVal4Version}")
425 426
		optional("joda-time:joda-time:${jodaVersion}")
		optional("org.aspectj:aspectjweaver:${aspectjVersion}")
J
Juergen Hoeller 已提交
427
		optional("org.codehaus.groovy:groovy-all:${groovyVersion}")
428
		optional("org.beanshell:bsh:2.0b4")
429
		optional("org.jruby:jruby:1.7.12")
430
		testCompile("javax.inject:javax.inject-tck:1")
431 432
		testCompile("commons-dbcp:commons-dbcp:1.4")
		testCompile("org.slf4j:slf4j-api:${slf4jVersion}")
433 434
	}

435 436 437
	// pick up RmiInvocationWrapperRTD.xml in src/main
	sourceSets.main.resources.srcDirs += "src/main/java"

438
	test {
P
Phillip Webb 已提交
439
		jvmArgs = ["-disableassertions:org.aspectj.weaver.UnresolvedType"] // SPR-7989
440
	}
441 442 443 444 445 446 447 448 449
}

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

	dependencies {
		compile(project(":spring-beans"))
		compile(project(":spring-core"))
		compile(project(":spring-context"))
J
Juergen Hoeller 已提交
450 451
		optional("org.projectreactor:reactor-core:1.1.3.RELEASE")
		optional("org.projectreactor:reactor-net:1.1.3.RELEASE")
B
Brian Clozel 已提交
452
		optional("org.eclipse.jetty.websocket:websocket-server:${jettyVersion}") {
B
Brian Clozel 已提交
453 454
			exclude group: "javax.servlet", module: "javax.servlet-api"
		}
B
Brian Clozel 已提交
455
		optional("org.eclipse.jetty.websocket:websocket-client:${jettyVersion}")
456
		optional("com.fasterxml.jackson.core:jackson-databind:${jackson2Version}")
457
		testCompile(project(":spring-test"))
458
		testCompile("javax.inject:javax.inject-tck:1")
459
		testCompile("javax.servlet:javax.servlet-api:3.1.0")
460
		testCompile("javax.validation:validation-api:1.0.0.GA")
461
		testCompile("com.thoughtworks.xstream:xstream:${xstreamVersion}")
462 463 464 465 466
		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 已提交
467
		testCompile("org.eclipse.jetty:jetty-webapp:${jettyVersion}") {
B
Brian Clozel 已提交
468
			exclude group: "javax.servlet", module: "javax.servlet-api"
469
		}
470 471 472
		testCompile("org.apache.tomcat.embed:tomcat-embed-core:${tomcatVersion}")
		testCompile("org.apache.tomcat.embed:tomcat-embed-websocket:${tomcatVersion}")
		testCompile("org.apache.tomcat.embed:tomcat-embed-logging-juli:${tomcatVersion}")
473
		testCompile("commons-dbcp:commons-dbcp:1.4")
474
		testCompile("log4j:log4j:1.2.17")
475
		testCompile("org.slf4j:slf4j-jcl:${slf4jVersion}")
476
	}
C
Chris Beams 已提交
477 478
}

P
Phillip Webb 已提交
479 480
project("spring-tx") {
	description = "Spring Transaction"
481

482
	dependencies {
483 484
		compile(project(":spring-beans"))
		compile(project(":spring-core"))
485 486 487
		optional(project(":spring-aop"))
		optional(project(":spring-context")) // for JCA, @EnableTransactionManagement
		optional("aopalliance:aopalliance:1.0")
488
		optional("javax.transaction:javax.transaction-api:1.2")
489
		optional("javax.resource:connector-api:1.5")
490
		optional("javax.ejb:ejb-api:3.0")
491
		optional("com.ibm.websphere:uow:6.0.2.17")
492
		testCompile("org.aspectj:aspectjweaver:${aspectjVersion}")
493
		testCompile("org.eclipse.persistence:javax.persistence:2.0.0")
494
	}
C
Chris Beams 已提交
495 496
}

P
Phillip Webb 已提交
497 498 499
project("spring-oxm") {
	description = "Spring Object/XML Marshalling"
	apply from: "oxm.gradle"
500

P
Phillip Webb 已提交
501
	compileTestJava {
502 503 504 505 506 507
		// necessary to avoid java.lang.VerifyError on jibx compilation
		// see http://jira.codehaus.org/browse/JIBX-465
		sourceCompatibility=1.6
		targetCompatibility=1.6
	}

508
	dependencies {
509 510
		compile(project(":spring-beans"))
		compile(project(":spring-core"))
511
		optional("org.codehaus.castor:castor-xml:1.3.3")  {
512
			exclude group: 'stax', module: 'stax-api'
513
			exclude group: "org.springframework", module: "spring-context"
514 515 516 517 518 519 520 521
		}
		optional("org.apache.xmlbeans:xmlbeans:2.6.0") {
			exclude group: 'stax', module: 'stax-api'
		}
		optional("com.thoughtworks.xstream:xstream:${xstreamVersion}") {
			exclude group: 'xpp3', module: 'xpp3_min'
			exclude group: 'xmlpull', module: 'xmlpull'
		}
522
		optional("org.jibx:jibx-run:1.2.5")
523
		testCompile(project(":spring-context"))
A
Arjen Poutsma 已提交
524
		testCompile("xmlunit:xmlunit:1.5")
525 526 527 528
		testCompile("xpp3:xpp3:1.1.3.4.O")
		testCompile("org.codehaus.jettison:jettison:1.0.1") {
			exclude group: 'stax', module: 'stax-api'
		}
529 530 531 532
		testCompile(files(genCastor.classesDir).builtBy(genCastor))
		testCompile(files(genJaxb.classesDir).builtBy(genJaxb))
		testCompile(files(genXmlbeans.classesDir).builtBy(genXmlbeans))
	}
C
Chris Beams 已提交
533 534
}

P
Phillip Webb 已提交
535 536
project("spring-jms") {
	description = "Spring JMS"
537

538
	dependencies {
539 540 541 542
		compile(project(":spring-core"))
		compile(project(":spring-beans"))
		compile(project(":spring-aop"))
		compile(project(":spring-context"))
543
		compile(project(":spring-messaging"))
544
		compile(project(":spring-tx"))
545
		provided("javax.jms:jms-api:1.1-rev-1")
546 547
		optional(project(":spring-oxm"))
		optional("aopalliance:aopalliance:1.0")
548
		optional("javax.transaction:javax.transaction-api:1.2")
549
		optional("javax.resource:connector-api:1.5")
550
		optional("com.fasterxml.jackson.core:jackson-databind:${jackson2Version}")
551
	}
C
Chris Beams 已提交
552 553
}

P
Phillip Webb 已提交
554 555
project("spring-jdbc") {
	description = "Spring JDBC"
556

557
	dependencies {
558
		compile(project(":spring-beans"))
559
		compile(project(":spring-core"))
560
		compile(project(":spring-tx"))
561
		optional(project(":spring-context")) // for JndiDataSourceLookup
562
		optional("javax.transaction:javax.transaction-api:1.2")
563
		optional("com.mchange:c3p0:0.9.2.1")
P
Phillip Webb 已提交
564
		optional("org.hsqldb:hsqldb:${hsqldbVersion}")
565
		optional("com.h2database:h2:1.4.179")
566 567
		optional("org.apache.derby:derby:10.10.2.0")
		optional("org.apache.derby:derbyclient:10.10.2.0")
568
	}
C
Chris Beams 已提交
569 570
}

P
Phillip Webb 已提交
571 572
project("spring-context-support") {
	description = "Spring Context Support"
573

574
	dependencies {
575 576 577
		compile(project(":spring-core"))
		compile(project(":spring-beans"))
		compile(project(":spring-context"))
578 579
		optional(project(":spring-jdbc")) // for Quartz support
		optional(project(":spring-tx")) // for Quartz support
580
		optional("javax.mail:javax.mail-api:1.5.2")
S
Stephane Nicoll 已提交
581
		optional("javax.cache:cache-api:1.0.0")
582
		optional("com.google.guava:guava:17.0")
583
		optional("net.sf.ehcache:ehcache:${ehcacheVersion}")
584
		optional("org.quartz-scheduler:quartz:2.2.1")
585
		optional("org.codehaus.fabric3.api:commonj:1.1.0")
586
		optional("org.apache.velocity:velocity:1.7")
587
		optional("org.freemarker:freemarker:2.3.20")
588
		optional("com.lowagie:itext:2.1.7")
589 590 591 592
		optional("net.sf.jasperreports:jasperreports:$jasperReportsVersion") {
			exclude group: "com.fasterxml.jackson.core", module: "jackson-annotations"
			exclude group: "com.fasterxml.jackson.core", module: "jackson-core"
			exclude group: "com.fasterxml.jackson.core", module: "jackson-databind"
593 594
			exclude group: "org.olap4j", module: "olap4j"
			exclude group: "xml-apis", module: "xml-apis"
595
		}
596
		testCompile(project(":spring-context"))
597
		testCompile("org.apache.poi:poi:3.10-FINAL")
598 599
		testCompile("commons-beanutils:commons-beanutils:1.8.0") // for Velocity/JasperReports
		testCompile("commons-digester:commons-digester:1.8.1") // for Velocity/JasperReports
P
Phillip Webb 已提交
600
		testCompile("org.hsqldb:hsqldb:${hsqldbVersion}")
601
		testCompile("org.slf4j:slf4j-api:${slf4jVersion}")
602
		testCompile("org.ehcache:jcache:${ehcacheJCacheVersion}")
603
		testRuntime("com.sun.mail:javax.mail:1.5.2")
604 605 606
	}

	// pick up **/*.types files in src/main
P
Phillip Webb 已提交
607
	sourceSets.main.resources.srcDirs += "src/main/java"
C
Chris Beams 已提交
608 609
}

P
Phillip Webb 已提交
610 611
project("spring-web") {
	description = "Spring Web"
612
	apply plugin: "groovy"
613

614
	dependencies {
615
		compile(project(":spring-aop")) // for JaxWsPortProxyFactoryBean
616
		compile(project(":spring-beans")) // for MultiPartFilter
617
		compile(project(":spring-context"))
618
		compile(project(":spring-core"))
619
		provided("javax.servlet:javax.servlet-api:3.0.1")
620
		optional(project(":spring-oxm")) // for MarshallingHttpMessageConverter
621
		optional("javax.servlet.jsp:javax.servlet.jsp-api:2.2.1")
622
		optional("javax.portlet:portlet-api:2.0")
623
		optional("javax.el:javax.el-api:2.2.5")
624
		optional("javax.faces:javax.faces-api:2.2")
625
		optional("aopalliance:aopalliance:1.0")
626
		optional("org.codehaus.groovy:groovy-all:${groovyVersion}")
627
		optional("com.caucho:hessian:4.0.38")
628
		optional("commons-fileupload:commons-fileupload:1.3.1")
629
		optional("org.apache.httpcomponents:httpclient:4.3.4")
630
		optional("org.apache.httpcomponents:httpasyncclient:4.0.1")
631
		optional("com.fasterxml.jackson.core:jackson-databind:${jackson2Version}")
R
Roy Clarkson 已提交
632
		optional("com.google.code.gson:gson:${gsonVersion}")
633
		optional("com.rometools:rome:1.5.0")
B
Brian Clozel 已提交
634
		optional("org.eclipse.jetty:jetty-servlet:${jettyVersion}") {
B
Brian Clozel 已提交
635
			exclude group: "javax.servlet", module: "javax.servlet-api"
636
		}
B
Brian Clozel 已提交
637
		optional("org.eclipse.jetty:jetty-server:${jettyVersion}") {
B
Brian Clozel 已提交
638
			exclude group: "javax.servlet", module: "javax.servlet-api"
639
		}
640
		optional("log4j:log4j:1.2.17")
641
		testCompile(project(":spring-context-support"))  // for JafMediaTypeFactory
A
Arjen Poutsma 已提交
642
		testCompile("xmlunit:xmlunit:1.5")
643
		testCompile("org.slf4j:slf4j-jcl:${slf4jVersion}")
644 645 646
		testCompile("org.apache.taglibs:taglibs-standard-jstlel:1.2.1") {
			exclude group: "org.apache.taglibs", module: "taglibs-standard-spec"
		}
647 648 649
	}

	// pick up ContextLoader.properties in src/main
P
Phillip Webb 已提交
650
	sourceSets.main.resources.srcDirs += "src/main/java"
C
Chris Beams 已提交
651 652
}

653
project("spring-websocket") {
654
	description = "Spring WebSocket"
655 656 657 658 659

	dependencies {
		compile(project(":spring-core"))
		compile(project(":spring-context"))
		compile(project(":spring-web"))
660
		optional(project(":spring-messaging"))
661
		optional(project(":spring-webmvc"))
662
		optional("javax.servlet:javax.servlet-api:3.1.0")
663
		optional("javax.websocket:javax.websocket-api:1.0")
664
		optional("org.apache.tomcat:tomcat-websocket:${tomcatVersion}") {
665 666 667
			exclude group: "org.apache.tomcat", module: "tomcat-websocket-api"
			exclude group: "org.apache.tomcat", module: "tomcat-servlet-api"
		}
668 669
		optional("org.glassfish.tyrus:tyrus-websocket-core:1.2.1")
		optional("org.glassfish.tyrus:tyrus-container-servlet:1.2.1")
B
Brian Clozel 已提交
670
		optional("org.eclipse.jetty:jetty-webapp:${jettyVersion}") {
B
Brian Clozel 已提交
671 672
			exclude group: "javax.servlet", module: "javax.servlet"
		}
B
Brian Clozel 已提交
673
		optional("org.eclipse.jetty.websocket:websocket-server:${jettyVersion}") {
B
Brian Clozel 已提交
674
			exclude group: "javax.servlet", module: "javax.servlet"
675
		}
B
Brian Clozel 已提交
676
		optional("org.eclipse.jetty.websocket:websocket-client:${jettyVersion}")
R
Rossen Stoyanchev 已提交
677
		optional("org.eclipse.jetty:jetty-client:${jettyVersion}")
678 679
		optional("io.undertow:undertow-core:1.0.15.Final")
		optional("io.undertow:undertow-servlet:1.0.15.Final") {
680
			exclude group: "org.jboss.spec.javax.servlet", module: "jboss-servlet-api_3.1_spec"
681
			exclude group: "org.jboss.spec.javax.annotation", module: "jboss-annotations-api_1.2_spec"
682
		}
683
		optional("io.undertow:undertow-websockets-jsr:1.0.15.Final") {
684 685
			exclude group: "org.jboss.spec.javax.websocket", module: "jboss-websocket-api_1.0_spec"
		}
686
		optional("com.fasterxml.jackson.core:jackson-databind:${jackson2Version}")
687 688 689
		testCompile("org.apache.tomcat.embed:tomcat-embed-core:${tomcatVersion}")
		testCompile("org.apache.tomcat.embed:tomcat-embed-websocket:${tomcatVersion}")
		testCompile("org.apache.tomcat.embed:tomcat-embed-logging-juli:${tomcatVersion}")
J
Juergen Hoeller 已提交
690 691
		testCompile("org.projectreactor:reactor-core:1.1.3.RELEASE")
		testCompile("org.projectreactor:reactor-net:1.1.3.RELEASE")
692 693
		testCompile("log4j:log4j:1.2.17")
		testCompile("org.slf4j:slf4j-jcl:${slf4jVersion}")
694 695 696
	}
}

P
Phillip Webb 已提交
697 698
project("spring-orm") {
	description = "Spring Object/Relational Mapping"
699

700
	dependencies {
701 702 703 704 705 706 707 708
		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"))
		optional("aopalliance:aopalliance:1.0")
709 710 711
		optional("org.eclipse.persistence:javax.persistence:2.0.5")
		optional("org.eclipse.persistence:org.eclipse.persistence.core:${eclipseLinkVersion}")
		optional("org.eclipse.persistence:org.eclipse.persistence.jpa:${eclipseLinkVersion}") {
712 713 714 715 716 717 718 719 720
			exclude group: 'org.eclipse.persistence', module: 'javax.persistence'
		}
		optional("org.hibernate:hibernate-core:${hibernate3Version}") {
			exclude group: 'org.hibernate.javax.persistence', module: 'hibernate-jpa-2.0-api'
			exclude group: 'javax.transaction', module: 'jta'
		}
		optional("org.hibernate:hibernate-entitymanager:${hibernate3Version}") {
			exclude group: 'org.hibernate.javax.persistence', module: 'hibernate-jpa-2.0-api'
		}
721
		optional("org.apache.openjpa:openjpa:${openJpaVersion}") {
722 723 724 725 726
			exclude group: 'junit', module: 'junit'
			exclude group: 'org.apache.geronimo.specs', module: 'geronimo-jpa_2.0_spec'
			exclude group: 'org.apache.geronimo.specs', module: 'geronimo-jta_1.1_spec'
			exclude group: 'org.apache.geronimo.specs', module: 'geronimo-jms_1.1_spec'
		}
727
		optional("javax.jdo:jdo-api:3.0.1") {
728 729
			exclude group: 'javax.transaction', module: 'transaction-api'
		}
730
		optional("javax.servlet:javax.servlet-api:3.0.1")
731
		testCompile("commons-dbcp:commons-dbcp:1.4")
S
Sam Brannen 已提交
732
		testCompile("org.aspectj:aspectjweaver:${aspectjVersion}")
P
Phillip Webb 已提交
733
		testCompile("org.hsqldb:hsqldb:${hsqldbVersion}")
734
		testCompile("org.slf4j:slf4j-jcl:${slf4jVersion}")
735
	}
C
Chris Beams 已提交
736 737
}

P
Phillip Webb 已提交
738 739
project("spring-orm-hibernate4") {
	description = "Spring Object/Relational Mapping - Hibernate 4 support"
740
	merge.into = project(":spring-orm")
741

742
	dependencies {
743
		provided(project(":spring-jdbc"))
744
		provided(project(":spring-tx"))
745
		optional(project(":spring-web"))
746 747
		optional("org.hibernate:hibernate-core:${hibernate4Version}")
		optional("org.hibernate:hibernate-entitymanager:${hibernate4Version}")
748
		optional("javax.servlet:javax.servlet-api:3.0.1")
749
        optional("aopalliance:aopalliance:1.0")
750 751
		testCompile("javax.validation:validation-api:1.1.0.GA")
		testCompile("org.hibernate:hibernate-validator:${hibVal5Version}")
752 753
		testCompile("javax.el:javax.el-api:2.2.5")
		testCompile("org.glassfish.web:javax.el:2.2.6")
754
	}
755 756
}

P
Phillip Webb 已提交
757 758
project("spring-webmvc") {
	description = "Spring Web MVC"
759

760
	dependencies {
761 762
		compile(project(":spring-beans"))
		compile(project(":spring-context"))
763
		compile(project(":spring-core"))
764
		compile(files(project(":spring-core").objenesisRepackJar))
765 766
		compile(project(":spring-expression"))
		compile(project(":spring-web"))
767
		provided("javax.servlet:javax.servlet-api:3.0.1")
768 769
		optional(project(":spring-context-support")) // for Velocity support
		optional(project(":spring-oxm")) // for MarshallingView
770 771
		optional("javax.servlet.jsp:javax.servlet.jsp-api:2.2.1")
		optional("javax.servlet.jsp.jstl:javax.servlet.jsp.jstl-api:1.2.1")
772
		optional("net.sourceforge.jexcelapi:jxl:2.6.12")
773
		optional("org.apache.poi:poi:3.10-FINAL")
774 775
		optional("org.apache.velocity:velocity:1.7")
		optional("velocity-tools:velocity-tools-view:1.4")
776
		optional("org.freemarker:freemarker:2.3.20")
777
		optional("org.codehaus.groovy:groovy-all:${groovyVersion}")
778
		optional("com.lowagie:itext:2.1.7")
779
		optional("net.sf.jasperreports:jasperreports:$jasperReportsVersion") {
780 781 782
			exclude group: "com.fasterxml.jackson.core", module: "jackson-annotations"
			exclude group: "com.fasterxml.jackson.core", module: "jackson-core"
			exclude group: "com.fasterxml.jackson.core", module: "jackson-databind"
783 784
			exclude group: "org.olap4j", module: "olap4j"
			exclude group: "xml-apis", module: "xml-apis"
785 786
		}
		optional("com.fasterxml.jackson.core:jackson-databind:${jackson2Version}")
787
		optional("com.rometools:rome:1.5.0")
788 789 790
		optional("javax.el:javax.el-api:2.2.5")
		optional("org.apache.tiles:tiles-api:${tiles3Version}")
		optional("org.apache.tiles:tiles-core:${tiles3Version}") {
791 792
			exclude group: "org.slf4j", module: "jcl-over-slf4j"
		}
793
		optional("org.apache.tiles:tiles-servlet:${tiles3Version}") {
794 795
			exclude group: "org.slf4j", module: "jcl-over-slf4j"
		}
796
		optional("org.apache.tiles:tiles-jsp:${tiles3Version}") {
797 798
			exclude group: "org.slf4j", module: "jcl-over-slf4j"
		}
799
		optional("org.apache.tiles:tiles-el:${tiles3Version}") {
800 801
			exclude group: "org.slf4j", module: "jcl-over-slf4j"
		}
802
		optional("org.apache.tiles:tiles-extras:${tiles3Version}") {
803 804 805
			exclude group: "org.slf4j", module: "jcl-over-slf4j"
			exclude group: "org.springframework", module: "spring-web"
		}
806 807
		testCompile(project(":spring-aop"))
		testCompile("rhino:js:1.7R1")
A
Arjen Poutsma 已提交
808
		testCompile("xmlunit:xmlunit:1.5")
809
		testCompile("dom4j:dom4j:1.6.1") {
P
Phillip Webb 已提交
810
			exclude group: "xml-apis", module: "xml-apis"
811 812
		}
		testCompile("jaxen:jaxen:1.1.1") {
P
Phillip Webb 已提交
813 814 815
			exclude group: "xml-apis", module: "xml-apis"
			exclude group: "xom", module: "xom"
			exclude group: "xerces", module: "xercesImpl"
816
		}
B
Brian Clozel 已提交
817
		testCompile("org.eclipse.jetty:jetty-servlet:${jettyVersion}") {
B
Brian Clozel 已提交
818
			exclude group: "javax.servlet", module: "javax.servlet"
819
		}
B
Brian Clozel 已提交
820
		testCompile("org.eclipse.jetty:jetty-server:${jettyVersion}") {
B
Brian Clozel 已提交
821
			exclude group: "javax.servlet", module: "javax.servlet"
822 823
		}
		testCompile("javax.validation:validation-api:1.0.0.GA")
824
		testCompile("org.hibernate:hibernate-validator:${hibVal4Version}")
825
		testCompile("org.apache.httpcomponents:httpclient:4.3.4")
826
		testCompile("commons-fileupload:commons-fileupload:1.3.1")
827
		testCompile("commons-io:commons-io:1.3")
828
		testCompile("joda-time:joda-time:${jodaVersion}")
829
		testCompile("org.slf4j:slf4j-jcl:${slf4jVersion}")
830 831 832
	}

	// pick up DispatcherServlet.properties in src/main
P
Phillip Webb 已提交
833
	sourceSets.main.resources.srcDirs += "src/main/java"
C
Chris Beams 已提交
834 835
}

836 837
project("spring-webmvc-tiles2") {
	description = "Spring Framework Tiles2 Integration"
838
	merge.into = project(":spring-webmvc")
839

840
	dependencies {
841 842
		provided(project(":spring-context"))
		provided(project(":spring-web"))
843
		provided("javax.servlet:javax.servlet-api:3.0.1")
844 845
		optional("javax.servlet.jsp:javax.servlet.jsp-api:2.2.1")
		optional("javax.servlet.jsp.jstl:javax.servlet.jsp.jstl-api:1.2.1")
846 847
		optional("org.apache.tiles:tiles-api:${tiles2Version}")
		optional("org.apache.tiles:tiles-core:${tiles2Version}") {
P
Phillip Webb 已提交
848
			exclude group: "org.slf4j", module: "jcl-over-slf4j"
849
		}
850
		optional("org.apache.tiles:tiles-servlet:${tiles2Version}") {
P
Phillip Webb 已提交
851
			exclude group: "org.slf4j", module: "jcl-over-slf4j"
852
		}
853
		optional("org.apache.tiles:tiles-jsp:${tiles2Version}") {
P
Phillip Webb 已提交
854
			exclude group: "org.slf4j", module: "jcl-over-slf4j"
855
		}
856
		optional("org.apache.tiles:tiles-el:${tiles2Version}") {
857
			exclude group: "org.slf4j", module: "jcl-over-slf4j"
858
		}
859
		optional("org.apache.tiles:tiles-extras:${tiles2Version}") {
P
Phillip Webb 已提交
860
			exclude group: "org.slf4j", module: "jcl-over-slf4j"
861
			exclude group: "org.apache.velocity", module: "velocity-tools"
862
			exclude group: "org.springframework", module: "spring-web"
863
		}
864
		testCompile("org.slf4j:slf4j-jcl:${slf4jVersion}")
865
	}
866 867
}

P
Phillip Webb 已提交
868 869
project("spring-webmvc-portlet") {
	description = "Spring Web Portlet"
870

871
	dependencies {
872 873
		compile(project(":spring-beans"))
		compile(project(":spring-context"))
874
		compile(project(":spring-core"))
875 876
		compile(project(":spring-web"))
		compile(project(":spring-webmvc"))
877 878
		provided("javax.servlet:javax.servlet-api:3.0.1")
		provided("javax.portlet:portlet-api:2.0")
879
		optional("commons-fileupload:commons-fileupload:1.3.1")
880 881 882
	}

	// pick up DispatcherPortlet.properties in src/main
P
Phillip Webb 已提交
883
	sourceSets.main.resources.srcDirs += "src/main/java"
C
Chris Beams 已提交
884 885
}

P
Phillip Webb 已提交
886 887
project("spring-test") {
	description = "Spring TestContext Framework"
888

889
	dependencies {
890
		compile(project(":spring-core"))
891 892 893 894 895 896 897
		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"))
B
Brian Clozel 已提交
898
		optional(project(":spring-webmvc-portlet"))
899
		optional("junit:junit:${junitVersion}")
S
Sam Brannen 已提交
900
		optional("org.testng:testng:6.8.8")
901
		optional("javax.inject:javax.inject:1")
902
		optional("javax.servlet:javax.servlet-api:3.0.1")
903 904 905 906 907
		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"
		}
908
		optional("javax.portlet:portlet-api:2.0")
909
		optional("javax.el:javax.el-api:2.2.5")
910
		optional("org.aspectj:aspectjweaver:${aspectjVersion}")
911 912
		optional("org.hamcrest:hamcrest-core:1.3")
		optional("com.jayway.jsonpath:json-path:0.9.0")
913
		optional("org.skyscreamer:jsonassert:1.2.3")
A
Arjen Poutsma 已提交
914
		optional("xmlunit:xmlunit:1.5")
915 916
		testCompile(project(":spring-context-support"))
		testCompile(project(":spring-oxm"))
917
		testCompile("javax.mail:javax.mail-api:1.5.2")
918
		testCompile("javax.ejb:ejb-api:3.0")
919 920 921
		testCompile("org.hibernate:hibernate-core:${hibernate4Version}")
		testCompile("org.hibernate:hibernate-entitymanager:${hibernate4Version}")
		testCompile("org.hibernate:hibernate-validator:${hibVal5Version}")
922
		testCompile("com.thoughtworks.xstream:xstream:${xstreamVersion}")
923
		testCompile("com.fasterxml.jackson.core:jackson-databind:${jackson2Version}")
924
		testCompile("com.rometools:rome:1.5.0")
925 926
		testCompile("org.apache.tiles:tiles-api:${tiles3Version}")
		testCompile("org.apache.tiles:tiles-core:${tiles3Version}") {
927 928
			exclude group: "org.slf4j", module: "jcl-over-slf4j"
		}
929
		testCompile("org.apache.tiles:tiles-servlet:${tiles3Version}") {
930 931
			exclude group: "org.slf4j", module: "jcl-over-slf4j"
		}
932 933
		testCompile("org.hsqldb:hsqldb:${hsqldbVersion}")
		testCompile "org.slf4j:slf4j-jcl:${slf4jVersion}"
934
	}
935 936 937

	task testNG(type: Test) {
		useTestNG()
938
		scanForTestClasses = false
939 940
		include(["**/testng/**/*Tests.class", "**/testng/**/*Test.class"])
		// Show STD_OUT & STD_ERR of the test JVM(s) on the console:
941
		// testLogging.showStandardStreams = true
942
		// forkEvery 1
943 944 945 946 947
	}

	test {
		dependsOn testNG
		useJUnit()
948
		exclude "**/testng/**/*.*"
949
	}
950 951 952 953 954 955 956

	task aggregateTestReports(type: TestReport) {
		destinationDir = test.reports.html.destination
		reportOn test, testNG
	}

	check.dependsOn aggregateTestReports
C
Chris Beams 已提交
957 958
}

P
Phillip Webb 已提交
959 960 961
project("spring-aspects") {
	description = "Spring Aspects"
	apply from: "aspects.gradle"
962

963
	dependencies {
964
		aspects(project(":spring-orm"))
965 966
		ajc("org.aspectj:aspectjtools:${aspectjVersion}")
		rt("org.aspectj:aspectjrt:${aspectjVersion}")
967
		compile("org.aspectj:aspectjweaver:${aspectjVersion}")
968 969 970 971
		provided("org.eclipse.persistence:javax.persistence:2.0.0")
		optional(project(":spring-aop")) // for @Async support
		optional(project(":spring-beans")) // for @Configurable support
		optional(project(":spring-context")) // for @Enable* support
972
		optional(project(":spring-context-support")) // for JavaMail and JSR-107 support
973 974
		optional(project(":spring-orm")) // for JPA exception translation support
		optional(project(":spring-tx")) // for JPA, @Transactional support
S
Stephane Nicoll 已提交
975
		optional("javax.cache:cache-api:1.0.0")
976 977
		testCompile(project(":spring-core")) // for CodeStyleAspect
		testCompile(project(":spring-test"))
978
		testCompile("javax.mail:javax.mail-api:1.5.2")
979
	}
980

981
	eclipse.project {
P
Phillip Webb 已提交
982
		natures += "org.eclipse.ajdt.ui.ajnature"
983
		buildCommands = [new org.gradle.plugins.ide.eclipse.model.
P
Phillip Webb 已提交
984
				BuildCommand("org.eclipse.ajdt.core.ajbuilder")]
985
	}
C
Chris Beams 已提交
986 987
}

988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022
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)
										}
									}
								}
							}
						}
					}
				}
			}
		}
	}
}

1023
configure(rootProject) {
P
Phillip Webb 已提交
1024
	description = "Spring Framework"
1025

P
Phillip Webb 已提交
1026
	apply plugin: "asciidoctor"
1027
	apply plugin: "docbook-reference"
1028
	apply plugin: "groovy"
R
Rob Winch 已提交
1029

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

R
Rob Winch 已提交
1033
	asciidoctor {
1034 1035
		baseDir = project.file('src/asciidoc')
		backend = 'docbook5'
R
Rob Winch 已提交
1036
		options = [
1037 1038 1039 1040 1041 1042 1043
			eruby: 'erubis',
			attributes: [
				doctype: 'book',
				'spring-version' : project.version,
				revnumber : project.version,
				docinfo : ""
			]
R
Rob Winch 已提交
1044
		]
1045 1046
	}

1047 1048 1049 1050 1051 1052 1053 1054 1055 1056
	reference {
		sourceDir = asciidoctor.outputDir
		pdfFilename = "spring-framework-reference.pdf"
		expandPlaceholders = ""
	}

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

1057 1058 1059 1060 1061
	// 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")
	// }
1062

C
Chris Beams 已提交
1063
	// don't publish the default jar for the root project
1064 1065 1066
	configurations.archives.artifacts.clear()

	dependencies { // for integration tests
1067
		testCompile(project(":spring-aop"))
1068
		testCompile(project(":spring-beans"))
1069
		testCompile(project(":spring-context"))
1070 1071
		testCompile(project(":spring-core"))
		testCompile(project(":spring-expression"))
1072
		testCompile(project(":spring-jdbc"))
1073
		testCompile(project(":spring-orm"))
1074
		testCompile(project(":spring-test"))
1075
		testCompile(project(":spring-tx"))
1076 1077
		testCompile(project(":spring-web"))
		testCompile(project(":spring-webmvc-portlet"))
1078
		testCompile("javax.servlet:javax.servlet-api:3.0.1")
1079 1080 1081 1082
		testCompile("javax.portlet:portlet-api:2.0")
		testCompile("javax.inject:javax.inject:1")
		testCompile("javax.resource:connector-api:1.5")
		testCompile("org.aspectj:aspectjweaver:${aspectjVersion}")
1083
		testCompile("org.hibernate:hibernate-core:${hibernate4Version}")
P
Phillip Webb 已提交
1084
		testCompile("org.hsqldb:hsqldb:${hsqldbVersion}")
1085 1086 1087
	}

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

1092 1093 1094 1095 1096
		dependsOn {
			subprojects.collect {
				it.tasks.getByName("jar")
			}
		}
1097 1098 1099
		options.memberLevel = org.gradle.external.javadoc.JavadocMemberLevel.PROTECTED
		options.author = true
		options.header = rootProject.description
P
Phillip Webb 已提交
1100
		options.overview = "src/api/overview.html"
1101
		options.stylesheetFile = file("src/api/stylesheet.css")
1102
		options.splitIndex = true
C
Chris Beams 已提交
1103
		options.links(project.ext.javadocLinks)
1104
		options.addStringOption('Xdoclint:none', '-quiet')
C
Chris Beams 已提交
1105

1106 1107 1108
		source subprojects.collect { project ->
			project.sourceSets.main.allJava
		}
C
Chris Beams 已提交
1109

P
Phillip Webb 已提交
1110
		maxMemory = "1024m"
C
Chris Beams 已提交
1111
		destinationDir = new File(buildDir, "api")
1112 1113 1114

		doFirst {
			classpath = files(
1115
				// ensure Servlet 3.x and Hibernate 4.x have precedence on the javadoc
1116 1117 1118 1119 1120 1121 1122 1123
				// classpath over their respective 2.5 and 3.x variants
				project(":spring-webmvc").sourceSets.main.compileClasspath.files.find { it =~ "servlet-api" },
				rootProject.sourceSets.test.compileClasspath.files.find { it =~ "hibernate-core" },
				// 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 })
		}
1124 1125
	}

1126
	task docsZip(type: Zip, dependsOn: 'reference') {
P
Phillip Webb 已提交
1127 1128 1129
		group = "Distribution"
		baseName = "spring-framework"
		classifier = "docs"
1130 1131 1132
		description = "Builds -${classifier} archive containing api and reference " +
			"for deployment at http://static.springframework.org/spring-framework/docs."

P
Phillip Webb 已提交
1133 1134
		from("src/dist") {
			include "changelog.txt"
1135 1136 1137
		}

		from (api) {
1138
			into "javadoc-api"
1139 1140
		}

1141 1142
		from (reference) {
			into "spring-framework-reference"
1143 1144 1145 1146
		}
	}

	task schemaZip(type: Zip) {
P
Phillip Webb 已提交
1147 1148 1149
		group = "Distribution"
		baseName = "spring-framework"
		classifier = "schema"
1150 1151 1152 1153 1154 1155 1156
		description = "Builds -${classifier} archive containing all " +
			"XSDs for deployment at http://springframework.org/schema."

		subprojects.each { subproject ->
			def Properties schemas = new Properties();

			subproject.sourceSets.main.resources.find {
P
Phillip Webb 已提交
1157
				it.path.endsWith("META-INF/spring.schemas")
1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174
			}?.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 已提交
1175 1176 1177
		group = "Distribution"
		baseName = "spring-framework"
		classifier = "dist"
1178 1179 1180 1181 1182
		description = "Builds -${classifier} archive, containing all jars and docs, " +
					"suitable for community download page."

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

P
Phillip Webb 已提交
1183 1184 1185 1186
		from("src/dist") {
			include "readme.txt"
			include "license.txt"
			include "notice.txt"
1187
			into "${baseDir}"
P
Phillip Webb 已提交
1188
			expand(copyright: new Date().format("yyyy"), version: project.version)
1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201
		}

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

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

		subprojects.each { subproject ->
			into ("${baseDir}/libs") {
				from subproject.jar
P
Phillip Webb 已提交
1202
				if (subproject.tasks.findByPath("sourcesJar")) {
1203 1204
					from subproject.sourcesJar
				}
P
Phillip Webb 已提交
1205
				if (subproject.tasks.findByPath("javadocJar")) {
1206 1207 1208 1209 1210 1211 1212 1213 1214
					from subproject.javadocJar
				}
			}
		}
	}

	// Create an distribution that contains all dependencies (required and optional).
	// Not published by default; only for use when building from source.
	task depsZip(type: Zip, dependsOn: distZip) { zipTask ->
P
Phillip Webb 已提交
1215 1216 1217
		group = "Distribution"
		baseName = "spring-framework"
		classifier = "dist-with-deps"
1218 1219 1220 1221 1222 1223 1224 1225 1226 1227
		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 ->
1228 1229
					(subproject.configurations.runtime.resolvedConfiguration.resolvedArtifacts +
					subproject.configurations.optional.resolvedConfiguration.resolvedArtifacts).each { artifact ->
1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250
						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 已提交
1251
		description = "Generates gradlew[.bat] scripts"
1252
		gradleVersion = "1.12"
1253 1254

		doLast() {
1255
			def gradleOpts = "-XX:MaxMetaspaceSize=1024m -Xmx1024m"
1256
			def gradleBatOpts = "$gradleOpts -XX:MaxHeapSize=256m"
P
Phillip Webb 已提交
1257
			File wrapperFile = file("gradlew")
1258 1259
			wrapperFile.text = wrapperFile.text.replace("DEFAULT_JVM_OPTS=",
				"GRADLE_OPTS=\"$gradleOpts \$GRADLE_OPTS\"\nDEFAULT_JVM_OPTS=")
P
Phillip Webb 已提交
1260
			File wrapperBatFile = file("gradlew.bat")
1261 1262 1263 1264
			wrapperBatFile.text = wrapperBatFile.text.replace("set DEFAULT_JVM_OPTS=",
				"set GRADLE_OPTS=$gradleBatOpts %GRADLE_OPTS%\nset DEFAULT_JVM_OPTS=")
		}
	}
1265

1266
}
1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278

/*
 * 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-")) {
1279
			return version.replace('BUILD', qualifier)
1280 1281
		}
	}
1282
	return version
1283
}