build.gradle 44.6 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
		classpath("ws.antonov.gradle.plugins:gradle-plugin-protobuf:0.9.1")
10
	}
11 12
}

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

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

43
	ext.gradleScriptDir = "${rootProject.projectDir}/gradle"
44

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

S
Stephane Nicoll 已提交
50 51 52 53 54
	configurations {
		sniffer
		javaApiSignature
	}

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

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

70 71 72 73 74 75
	compileJava {
		sourceCompatibility=1.6
		targetCompatibility=1.6
	}

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

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

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

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

98
	dependencies {
99 100 101 102 103 104
		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'
		}
105
		testCompile("org.hamcrest:hamcrest-all:1.3")
S
Stephane Nicoll 已提交
106 107 108
		testCompile("org.mockito:mockito-core:1.9.5")

		sniffer("org.codehaus.mojo:animal-sniffer-ant-tasks:${snifferVersion}")
109
		javaApiSignature("org.codehaus.mojo.signature:java16:1.1@signature")  // as from JDK 6 update 18
S
Stephane Nicoll 已提交
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 140 141
	}

	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)
142 143 144
				annotation(className: "org.springframework.lang.UsesJava7")
				annotation(className: "org.springframework.lang.UsesJava8")
				annotation(className: "org.springframework.lang.UsesSunHttpServer")
S
Stephane Nicoll 已提交
145 146
			}
		}
147
	}
C
Chris Beams 已提交
148 149

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

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

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

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

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

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

		// 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
204 205 206
	}

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

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

	artifacts {
		archives sourcesJar
		archives javadocJar
	}
C
Chris Beams 已提交
221 222
}

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

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

	configurations.archives.artifacts.clear()
}

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

238 239
	// 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
240
	// further transformed by the JarJar task to depend on org.springframework.asm; this
241
	// avoids including two different copies of asm unnecessarily.
242 243
	def cglibVersion = "3.1"
	def objenesisVersion = "2.1"
244 245 246 247

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

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

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

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

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

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

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

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

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

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

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

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

	compileGroovy {
		sourceCompatibility=1.6
		targetCompatibility=1.6
	}
J
Juergen Hoeller 已提交
363 364
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

510
	dependencies {
511 512
		compile(project(":spring-beans"))
		compile(project(":spring-core"))
513
		optional("org.codehaus.castor:castor-xml:1.3.3")  {
514
			exclude group: 'stax', module: 'stax-api'
515
			exclude group: "org.springframework", module: "spring-context"
516 517 518 519 520 521 522 523
		}
		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'
		}
524
		optional("org.jibx:jibx-run:1.2.5")
525
		testCompile(project(":spring-context"))
A
Arjen Poutsma 已提交
526
		testCompile("xmlunit:xmlunit:1.5")
527 528 529 530
		testCompile("xpp3:xpp3:1.1.3.4.O")
		testCompile("org.codehaus.jettison:jettison:1.0.1") {
			exclude group: 'stax', module: 'stax-api'
		}
531 532 533 534
		testCompile(files(genCastor.classesDir).builtBy(genCastor))
		testCompile(files(genJaxb.classesDir).builtBy(genJaxb))
		testCompile(files(genXmlbeans.classesDir).builtBy(genXmlbeans))
	}
C
Chris Beams 已提交
535 536
}

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

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

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

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

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

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

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

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

616 617 618 619 620 621 622 623 624 625 626 627 628 629 630
	// 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"
	}

631
	dependencies {
632
		compile(project(":spring-aop")) // for JaxWsPortProxyFactoryBean
633
		compile(project(":spring-beans")) // for MultiPartFilter
634
		compile(project(":spring-context"))
635
		compile(project(":spring-core"))
636
		provided("javax.servlet:javax.servlet-api:3.0.1")
637
		optional(project(":spring-oxm")) // for MarshallingHttpMessageConverter
638
		optional("javax.servlet.jsp:javax.servlet.jsp-api:2.2.1")
639
		optional("javax.portlet:portlet-api:2.0")
640
		optional("javax.el:javax.el-api:2.2.5")
641
		optional("javax.faces:javax.faces-api:2.2")
642
		optional("aopalliance:aopalliance:1.0")
643
		optional("org.codehaus.groovy:groovy-all:${groovyVersion}")
644
		optional("com.caucho:hessian:4.0.38")
645
		optional("commons-fileupload:commons-fileupload:1.3.1")
646
		optional("org.apache.httpcomponents:httpclient:4.3.4")
647
		optional("org.apache.httpcomponents:httpasyncclient:4.0.1")
648
		optional("com.fasterxml.jackson.core:jackson-databind:${jackson2Version}")
R
Roy Clarkson 已提交
649
		optional("com.google.code.gson:gson:${gsonVersion}")
650
		optional("com.rometools:rome:1.5.0")
B
Brian Clozel 已提交
651
		optional("org.eclipse.jetty:jetty-servlet:${jettyVersion}") {
B
Brian Clozel 已提交
652
			exclude group: "javax.servlet", module: "javax.servlet-api"
653
		}
B
Brian Clozel 已提交
654
		optional("org.eclipse.jetty:jetty-server:${jettyVersion}") {
B
Brian Clozel 已提交
655
			exclude group: "javax.servlet", module: "javax.servlet-api"
656
		}
657
		optional("log4j:log4j:1.2.17")
R
Polish  
Rossen Stoyanchev 已提交
658 659
		optional("com.googlecode.protobuf-java-format:protobuf-java-format:1.2")
		optional("com.google.protobuf:protobuf-java:${protobufVersion}")
660
		testCompile(project(":spring-context-support"))  // for JafMediaTypeFactory
A
Arjen Poutsma 已提交
661
		testCompile("xmlunit:xmlunit:1.5")
662
		testCompile("org.slf4j:slf4j-jcl:${slf4jVersion}")
663 664 665
		testCompile("org.apache.taglibs:taglibs-standard-jstlel:1.2.1") {
			exclude group: "org.apache.taglibs", module: "taglibs-standard-spec"
		}
666 667 668
	}

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

672
project("spring-websocket") {
673
	description = "Spring WebSocket"
674 675 676 677 678

	dependencies {
		compile(project(":spring-core"))
		compile(project(":spring-context"))
		compile(project(":spring-web"))
679
		optional(project(":spring-messaging"))
680
		optional(project(":spring-webmvc"))
681
		optional("javax.servlet:javax.servlet-api:3.1.0")
682
		optional("javax.websocket:javax.websocket-api:1.0")
683
		optional("org.apache.tomcat:tomcat-websocket:${tomcatVersion}") {
684 685 686
			exclude group: "org.apache.tomcat", module: "tomcat-websocket-api"
			exclude group: "org.apache.tomcat", module: "tomcat-servlet-api"
		}
687 688 689 690
		optional("org.glassfish.tyrus:tyrus-spi:1.3.5")
		optional("org.glassfish.tyrus:tyrus-core:1.3.5")
		optional("org.glassfish.tyrus:tyrus-server:1.3.5")
		optional("org.glassfish.tyrus:tyrus-container-servlet:1.3.5")
B
Brian Clozel 已提交
691
		optional("org.eclipse.jetty:jetty-webapp:${jettyVersion}") {
B
Brian Clozel 已提交
692 693
			exclude group: "javax.servlet", module: "javax.servlet"
		}
B
Brian Clozel 已提交
694
		optional("org.eclipse.jetty.websocket:websocket-server:${jettyVersion}") {
B
Brian Clozel 已提交
695
			exclude group: "javax.servlet", module: "javax.servlet"
696
		}
B
Brian Clozel 已提交
697
		optional("org.eclipse.jetty.websocket:websocket-client:${jettyVersion}")
R
Rossen Stoyanchev 已提交
698
		optional("org.eclipse.jetty:jetty-client:${jettyVersion}")
699 700
		optional("io.undertow:undertow-core:1.0.15.Final")
		optional("io.undertow:undertow-servlet:1.0.15.Final") {
701
			exclude group: "org.jboss.spec.javax.servlet", module: "jboss-servlet-api_3.1_spec"
702
			exclude group: "org.jboss.spec.javax.annotation", module: "jboss-annotations-api_1.2_spec"
703
		}
704
		optional("io.undertow:undertow-websockets-jsr:1.0.15.Final") {
705 706
			exclude group: "org.jboss.spec.javax.websocket", module: "jboss-websocket-api_1.0_spec"
		}
707
		optional("com.fasterxml.jackson.core:jackson-databind:${jackson2Version}")
708 709 710
		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 已提交
711 712
		testCompile("org.projectreactor:reactor-core:1.1.3.RELEASE")
		testCompile("org.projectreactor:reactor-net:1.1.3.RELEASE")
713 714
		testCompile("log4j:log4j:1.2.17")
		testCompile("org.slf4j:slf4j-jcl:${slf4jVersion}")
715 716 717
	}
}

P
Phillip Webb 已提交
718 719
project("spring-orm") {
	description = "Spring Object/Relational Mapping"
720

721
	dependencies {
722 723 724 725 726 727 728 729
		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")
730 731 732
		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}") {
733 734 735 736 737 738 739 740 741
			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'
		}
742
		optional("org.apache.openjpa:openjpa:${openJpaVersion}") {
743 744 745 746 747
			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'
		}
748
		optional("javax.jdo:jdo-api:3.0.1") {
749 750
			exclude group: 'javax.transaction', module: 'transaction-api'
		}
751
		optional("javax.servlet:javax.servlet-api:3.0.1")
752
		testCompile("commons-dbcp:commons-dbcp:1.4")
S
Sam Brannen 已提交
753
		testCompile("org.aspectj:aspectjweaver:${aspectjVersion}")
P
Phillip Webb 已提交
754
		testCompile("org.hsqldb:hsqldb:${hsqldbVersion}")
755
		testCompile("org.slf4j:slf4j-jcl:${slf4jVersion}")
756
	}
C
Chris Beams 已提交
757 758
}

P
Phillip Webb 已提交
759 760
project("spring-orm-hibernate4") {
	description = "Spring Object/Relational Mapping - Hibernate 4 support"
761
	merge.into = project(":spring-orm")
762

763
	dependencies {
764
		provided(project(":spring-jdbc"))
765
		provided(project(":spring-tx"))
766
		optional(project(":spring-web"))
767 768
		optional("org.hibernate:hibernate-core:${hibernate4Version}")
		optional("org.hibernate:hibernate-entitymanager:${hibernate4Version}")
769
		optional("javax.servlet:javax.servlet-api:3.0.1")
770
        optional("aopalliance:aopalliance:1.0")
771 772
		testCompile("javax.validation:validation-api:1.1.0.GA")
		testCompile("org.hibernate:hibernate-validator:${hibVal5Version}")
773 774
		testCompile("javax.el:javax.el-api:2.2.5")
		testCompile("org.glassfish.web:javax.el:2.2.6")
775
	}
776 777
}

P
Phillip Webb 已提交
778 779
project("spring-webmvc") {
	description = "Spring Web MVC"
780

781
	dependencies {
782 783
		compile(project(":spring-beans"))
		compile(project(":spring-context"))
784
		compile(project(":spring-core"))
785
		compile(files(project(":spring-core").objenesisRepackJar))
786 787
		compile(project(":spring-expression"))
		compile(project(":spring-web"))
788
		provided("javax.servlet:javax.servlet-api:3.0.1")
789 790
		optional(project(":spring-context-support")) // for Velocity support
		optional(project(":spring-oxm")) // for MarshallingView
791 792
		optional("javax.servlet.jsp:javax.servlet.jsp-api:2.2.1")
		optional("javax.servlet.jsp.jstl:javax.servlet.jsp.jstl-api:1.2.1")
793
		optional("net.sourceforge.jexcelapi:jxl:2.6.12")
794
		optional("org.apache.poi:poi:3.10-FINAL")
795 796
		optional("org.apache.velocity:velocity:1.7")
		optional("velocity-tools:velocity-tools-view:1.4")
797
		optional("org.freemarker:freemarker:2.3.20")
798
		optional("org.codehaus.groovy:groovy-all:${groovyVersion}")
799
		optional("com.lowagie:itext:2.1.7")
800
		optional("net.sf.jasperreports:jasperreports:$jasperReportsVersion") {
801 802 803
			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"
804 805
			exclude group: "org.olap4j", module: "olap4j"
			exclude group: "xml-apis", module: "xml-apis"
806 807
		}
		optional("com.fasterxml.jackson.core:jackson-databind:${jackson2Version}")
808
		optional("com.rometools:rome:1.5.0")
809 810 811
		optional("javax.el:javax.el-api:2.2.5")
		optional("org.apache.tiles:tiles-api:${tiles3Version}")
		optional("org.apache.tiles:tiles-core:${tiles3Version}") {
812 813
			exclude group: "org.slf4j", module: "jcl-over-slf4j"
		}
814
		optional("org.apache.tiles:tiles-servlet:${tiles3Version}") {
815 816
			exclude group: "org.slf4j", module: "jcl-over-slf4j"
		}
817
		optional("org.apache.tiles:tiles-jsp:${tiles3Version}") {
818 819
			exclude group: "org.slf4j", module: "jcl-over-slf4j"
		}
820
		optional("org.apache.tiles:tiles-el:${tiles3Version}") {
821 822
			exclude group: "org.slf4j", module: "jcl-over-slf4j"
		}
823
		optional("org.apache.tiles:tiles-extras:${tiles3Version}") {
824 825 826
			exclude group: "org.slf4j", module: "jcl-over-slf4j"
			exclude group: "org.springframework", module: "spring-web"
		}
827 828
		testCompile(project(":spring-aop"))
		testCompile("rhino:js:1.7R1")
A
Arjen Poutsma 已提交
829
		testCompile("xmlunit:xmlunit:1.5")
830
		testCompile("dom4j:dom4j:1.6.1") {
P
Phillip Webb 已提交
831
			exclude group: "xml-apis", module: "xml-apis"
832 833
		}
		testCompile("jaxen:jaxen:1.1.1") {
P
Phillip Webb 已提交
834 835 836
			exclude group: "xml-apis", module: "xml-apis"
			exclude group: "xom", module: "xom"
			exclude group: "xerces", module: "xercesImpl"
837
		}
B
Brian Clozel 已提交
838
		testCompile("org.eclipse.jetty:jetty-servlet:${jettyVersion}") {
B
Brian Clozel 已提交
839
			exclude group: "javax.servlet", module: "javax.servlet"
840
		}
B
Brian Clozel 已提交
841
		testCompile("org.eclipse.jetty:jetty-server:${jettyVersion}") {
B
Brian Clozel 已提交
842
			exclude group: "javax.servlet", module: "javax.servlet"
843 844
		}
		testCompile("javax.validation:validation-api:1.0.0.GA")
845
		testCompile("org.hibernate:hibernate-validator:${hibVal4Version}")
846
		testCompile("org.apache.httpcomponents:httpclient:4.3.4")
847
		testCompile("commons-fileupload:commons-fileupload:1.3.1")
848
		testCompile("commons-io:commons-io:1.3")
849
		testCompile("joda-time:joda-time:${jodaVersion}")
850
		testCompile("org.slf4j:slf4j-jcl:${slf4jVersion}")
851 852 853
	}

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

857 858
project("spring-webmvc-tiles2") {
	description = "Spring Framework Tiles2 Integration"
859
	merge.into = project(":spring-webmvc")
860

861
	dependencies {
862 863
		provided(project(":spring-context"))
		provided(project(":spring-web"))
864
		provided("javax.servlet:javax.servlet-api:3.0.1")
865 866
		optional("javax.servlet.jsp:javax.servlet.jsp-api:2.2.1")
		optional("javax.servlet.jsp.jstl:javax.servlet.jsp.jstl-api:1.2.1")
867 868
		optional("org.apache.tiles:tiles-api:${tiles2Version}")
		optional("org.apache.tiles:tiles-core:${tiles2Version}") {
P
Phillip Webb 已提交
869
			exclude group: "org.slf4j", module: "jcl-over-slf4j"
870
		}
871
		optional("org.apache.tiles:tiles-servlet:${tiles2Version}") {
P
Phillip Webb 已提交
872
			exclude group: "org.slf4j", module: "jcl-over-slf4j"
873
		}
874
		optional("org.apache.tiles:tiles-jsp:${tiles2Version}") {
P
Phillip Webb 已提交
875
			exclude group: "org.slf4j", module: "jcl-over-slf4j"
876
		}
877
		optional("org.apache.tiles:tiles-el:${tiles2Version}") {
878
			exclude group: "org.slf4j", module: "jcl-over-slf4j"
879
		}
880
		optional("org.apache.tiles:tiles-extras:${tiles2Version}") {
P
Phillip Webb 已提交
881
			exclude group: "org.slf4j", module: "jcl-over-slf4j"
882
			exclude group: "org.apache.velocity", module: "velocity-tools"
883
			exclude group: "org.springframework", module: "spring-web"
884
		}
885
		testCompile("org.slf4j:slf4j-jcl:${slf4jVersion}")
886
	}
887 888
}

P
Phillip Webb 已提交
889 890
project("spring-webmvc-portlet") {
	description = "Spring Web Portlet"
891

892
	dependencies {
893 894
		compile(project(":spring-beans"))
		compile(project(":spring-context"))
895
		compile(project(":spring-core"))
896 897
		compile(project(":spring-web"))
		compile(project(":spring-webmvc"))
898 899
		provided("javax.servlet:javax.servlet-api:3.0.1")
		provided("javax.portlet:portlet-api:2.0")
900
		optional("commons-fileupload:commons-fileupload:1.3.1")
901 902 903
	}

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

P
Phillip Webb 已提交
907 908
project("spring-test") {
	description = "Spring TestContext Framework"
909

910
	dependencies {
911
		compile(project(":spring-core"))
912 913 914 915 916 917 918
		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 已提交
919
		optional(project(":spring-webmvc-portlet"))
920
		optional("junit:junit:${junitVersion}")
S
Sam Brannen 已提交
921
		optional("org.testng:testng:6.8.8")
922
		optional("javax.inject:javax.inject:1")
923
		optional("javax.servlet:javax.servlet-api:3.0.1")
924 925 926 927 928
		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"
		}
929
		optional("javax.portlet:portlet-api:2.0")
930
		optional("javax.el:javax.el-api:2.2.5")
931
		optional("org.aspectj:aspectjweaver:${aspectjVersion}")
S
Sam Brannen 已提交
932
		optional("org.codehaus.groovy:groovy-all:${groovyVersion}")
933 934
		optional("org.hamcrest:hamcrest-core:1.3")
		optional("com.jayway.jsonpath:json-path:0.9.0")
935
		optional("org.skyscreamer:jsonassert:1.2.3")
A
Arjen Poutsma 已提交
936
		optional("xmlunit:xmlunit:1.5")
937 938
		testCompile(project(":spring-context-support"))
		testCompile(project(":spring-oxm"))
939
		testCompile("javax.mail:javax.mail-api:1.5.2")
940
		testCompile("javax.ejb:ejb-api:3.0")
941 942 943
		testCompile("org.hibernate:hibernate-core:${hibernate4Version}")
		testCompile("org.hibernate:hibernate-entitymanager:${hibernate4Version}")
		testCompile("org.hibernate:hibernate-validator:${hibVal5Version}")
944
		testCompile("com.thoughtworks.xstream:xstream:${xstreamVersion}")
945
		testCompile("com.fasterxml.jackson.core:jackson-databind:${jackson2Version}")
946
		testCompile("com.rometools:rome:1.5.0")
947 948
		testCompile("org.apache.tiles:tiles-api:${tiles3Version}")
		testCompile("org.apache.tiles:tiles-core:${tiles3Version}") {
949 950
			exclude group: "org.slf4j", module: "jcl-over-slf4j"
		}
951
		testCompile("org.apache.tiles:tiles-servlet:${tiles3Version}") {
952 953
			exclude group: "org.slf4j", module: "jcl-over-slf4j"
		}
954 955
		testCompile("org.hsqldb:hsqldb:${hsqldbVersion}")
		testCompile "org.slf4j:slf4j-jcl:${slf4jVersion}"
956
	}
957 958 959

	task testNG(type: Test) {
		useTestNG()
960
		scanForTestClasses = false
961 962
		include(["**/testng/**/*Tests.class", "**/testng/**/*Test.class"])
		// Show STD_OUT & STD_ERR of the test JVM(s) on the console:
963
		// testLogging.showStandardStreams = true
964
		// forkEvery 1
965 966 967 968 969
	}

	test {
		dependsOn testNG
		useJUnit()
970
		exclude "**/testng/**/*.*"
971
	}
972 973 974 975 976 977 978

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

	check.dependsOn aggregateTestReports
C
Chris Beams 已提交
979 980
}

P
Phillip Webb 已提交
981 982 983
project("spring-aspects") {
	description = "Spring Aspects"
	apply from: "aspects.gradle"
984

985
	dependencies {
986
		aspects(project(":spring-orm"))
987 988
		ajc("org.aspectj:aspectjtools:${aspectjVersion}")
		rt("org.aspectj:aspectjrt:${aspectjVersion}")
989
		compile("org.aspectj:aspectjweaver:${aspectjVersion}")
990 991 992 993
		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
994
		optional(project(":spring-context-support")) // for JavaMail and JSR-107 support
995 996
		optional(project(":spring-orm")) // for JPA exception translation support
		optional(project(":spring-tx")) // for JPA, @Transactional support
S
Stephane Nicoll 已提交
997
		optional("javax.cache:cache-api:1.0.0")
998 999
		testCompile(project(":spring-core")) // for CodeStyleAspect
		testCompile(project(":spring-test"))
1000
		testCompile("javax.mail:javax.mail-api:1.5.2")
1001
	}
1002

1003
	eclipse.project {
P
Phillip Webb 已提交
1004
		natures += "org.eclipse.ajdt.ui.ajnature"
1005
		buildCommands = [new org.gradle.plugins.ide.eclipse.model.
P
Phillip Webb 已提交
1006
				BuildCommand("org.eclipse.ajdt.core.ajbuilder")]
1007
	}
C
Chris Beams 已提交
1008 1009
}

1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044
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)
										}
									}
								}
							}
						}
					}
				}
			}
		}
	}
}

1045
configure(rootProject) {
P
Phillip Webb 已提交
1046
	description = "Spring Framework"
1047

P
Phillip Webb 已提交
1048
	apply plugin: "asciidoctor"
1049
	apply plugin: "docbook-reference"
1050
	apply plugin: "groovy"
R
Rob Winch 已提交
1051

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

R
Rob Winch 已提交
1055
	asciidoctor {
1056 1057
		baseDir = project.file('src/asciidoc')
		backend = 'docbook5'
R
Rob Winch 已提交
1058
		options = [
1059 1060 1061 1062 1063 1064 1065
			eruby: 'erubis',
			attributes: [
				doctype: 'book',
				'spring-version' : project.version,
				revnumber : project.version,
				docinfo : ""
			]
R
Rob Winch 已提交
1066
		]
1067 1068
	}

1069 1070 1071 1072 1073 1074 1075 1076 1077 1078
	reference {
		sourceDir = asciidoctor.outputDir
		pdfFilename = "spring-framework-reference.pdf"
		expandPlaceholders = ""
	}

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

1079 1080 1081 1082 1083
	// 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")
	// }
1084

C
Chris Beams 已提交
1085
	// don't publish the default jar for the root project
1086 1087 1088
	configurations.archives.artifacts.clear()

	dependencies { // for integration tests
1089
		testCompile(project(":spring-aop"))
1090
		testCompile(project(":spring-beans"))
1091
		testCompile(project(":spring-context"))
1092 1093
		testCompile(project(":spring-core"))
		testCompile(project(":spring-expression"))
1094
		testCompile(project(":spring-jdbc"))
1095
		testCompile(project(":spring-orm"))
1096
		testCompile(project(":spring-test"))
1097
		testCompile(project(":spring-tx"))
1098 1099
		testCompile(project(":spring-web"))
		testCompile(project(":spring-webmvc-portlet"))
1100
		testCompile("javax.servlet:javax.servlet-api:3.0.1")
1101 1102 1103 1104
		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}")
1105
		testCompile("org.hibernate:hibernate-core:${hibernate4Version}")
P
Phillip Webb 已提交
1106
		testCompile("org.hsqldb:hsqldb:${hsqldbVersion}")
1107 1108 1109
	}

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

1114 1115 1116 1117 1118
		dependsOn {
			subprojects.collect {
				it.tasks.getByName("jar")
			}
		}
1119 1120 1121
		options.memberLevel = org.gradle.external.javadoc.JavadocMemberLevel.PROTECTED
		options.author = true
		options.header = rootProject.description
P
Phillip Webb 已提交
1122
		options.overview = "src/api/overview.html"
1123
		options.stylesheetFile = file("src/api/stylesheet.css")
1124
		options.splitIndex = true
C
Chris Beams 已提交
1125
		options.links(project.ext.javadocLinks)
1126
		options.addStringOption('Xdoclint:none', '-quiet')
C
Chris Beams 已提交
1127

1128 1129 1130
		source subprojects.collect { project ->
			project.sourceSets.main.allJava
		}
C
Chris Beams 已提交
1131

P
Phillip Webb 已提交
1132
		maxMemory = "1024m"
C
Chris Beams 已提交
1133
		destinationDir = new File(buildDir, "api")
1134 1135 1136

		doFirst {
			classpath = files(
1137
				// ensure Servlet 3.x and Hibernate 4.x have precedence on the javadoc
1138 1139 1140 1141 1142 1143 1144 1145
				// 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 })
		}
1146 1147
	}

1148
	task docsZip(type: Zip, dependsOn: 'reference') {
P
Phillip Webb 已提交
1149 1150 1151
		group = "Distribution"
		baseName = "spring-framework"
		classifier = "docs"
1152 1153 1154
		description = "Builds -${classifier} archive containing api and reference " +
			"for deployment at http://static.springframework.org/spring-framework/docs."

P
Phillip Webb 已提交
1155 1156
		from("src/dist") {
			include "changelog.txt"
1157 1158 1159
		}

		from (api) {
1160
			into "javadoc-api"
1161 1162
		}

1163 1164
		from (reference) {
			into "spring-framework-reference"
1165 1166 1167 1168
		}
	}

	task schemaZip(type: Zip) {
P
Phillip Webb 已提交
1169 1170 1171
		group = "Distribution"
		baseName = "spring-framework"
		classifier = "schema"
1172 1173
		description = "Builds -${classifier} archive containing all " +
			"XSDs for deployment at http://springframework.org/schema."
S
Stephane Nicoll 已提交
1174
		duplicatesStrategy 'exclude'
1175 1176 1177 1178
		subprojects.each { subproject ->
			def Properties schemas = new Properties();

			subproject.sourceSets.main.resources.find {
P
Phillip Webb 已提交
1179
				it.path.endsWith("META-INF/spring.schemas")
1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196
			}?.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 已提交
1197 1198 1199
		group = "Distribution"
		baseName = "spring-framework"
		classifier = "dist"
1200 1201 1202 1203 1204
		description = "Builds -${classifier} archive, containing all jars and docs, " +
					"suitable for community download page."

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

P
Phillip Webb 已提交
1205 1206 1207 1208
		from("src/dist") {
			include "readme.txt"
			include "license.txt"
			include "notice.txt"
1209
			into "${baseDir}"
P
Phillip Webb 已提交
1210
			expand(copyright: new Date().format("yyyy"), version: project.version)
1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223
		}

		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 已提交
1224
				if (subproject.tasks.findByPath("sourcesJar")) {
1225 1226
					from subproject.sourcesJar
				}
P
Phillip Webb 已提交
1227
				if (subproject.tasks.findByPath("javadocJar")) {
1228 1229 1230 1231 1232 1233 1234 1235 1236
					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 已提交
1237 1238 1239
		group = "Distribution"
		baseName = "spring-framework"
		classifier = "dist-with-deps"
1240 1241 1242 1243 1244 1245 1246 1247 1248 1249
		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 ->
1250 1251
					(subproject.configurations.runtime.resolvedConfiguration.resolvedArtifacts +
					subproject.configurations.optional.resolvedConfiguration.resolvedArtifacts).each { artifact ->
1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272
						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 已提交
1273
		description = "Generates gradlew[.bat] scripts"
1274
		gradleVersion = "1.12"
1275 1276

		doLast() {
1277
			def gradleOpts = "-XX:MaxMetaspaceSize=1024m -Xmx1024m"
1278
			def gradleBatOpts = "$gradleOpts -XX:MaxHeapSize=256m"
P
Phillip Webb 已提交
1279
			File wrapperFile = file("gradlew")
1280 1281
			wrapperFile.text = wrapperFile.text.replace("DEFAULT_JVM_OPTS=",
				"GRADLE_OPTS=\"$gradleOpts \$GRADLE_OPTS\"\nDEFAULT_JVM_OPTS=")
P
Phillip Webb 已提交
1282
			File wrapperBatFile = file("gradlew.bat")
1283 1284 1285 1286
			wrapperBatFile.text = wrapperBatFile.text.replace("set DEFAULT_JVM_OPTS=",
				"set GRADLE_OPTS=$gradleBatOpts %GRADLE_OPTS%\nset DEFAULT_JVM_OPTS=")
		}
	}
1287

1288
}
1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300

/*
 * 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-")) {
1301
			return version.replace('BUILD', qualifier)
1302 1303
		}
	}
1304
	return version
1305
}