build.gradle 43.4 KB
Newer Older
1
buildscript {
2
	repositories {
P
Phillip Webb 已提交
3
		maven { url "http://repo.springsource.org/plugins-release" }
4 5
	}
	dependencies {
6
		classpath("org.springframework.build.gradle:propdeps-plugin:0.0.6")
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.0"
17
	ext.eclipseLinkVersion   = "2.4.2"
B
Brian Clozel 已提交
18
	ext.groovyVersion        = "2.3.3"
19
	ext.hibernate3Version    = "3.6.10.Final"
20 21
	ext.hibernate4Version    = "4.3.5.Final"
	ext.hibVal4Version       = "4.3.1.Final"
22
	ext.hibVal5Version       = "5.1.1.Final"
23
	ext.hsqldbVersion        = "2.3.2"
24
	ext.jackson2Version      = "2.4.0"
R
Roy Clarkson 已提交
25
	ext.gsonVersion          = "2.2.4"
26
	ext.jasperReportsVersion = "5.6.0"
27
	ext.jettyVersion         = "9.2.1.v20140609"
28 29
	ext.jodaVersion          = "2.3"
	ext.junitVersion         = "4.11"
30
	ext.openJpaVersion       = "2.2.2"  // 2.3.0 not Java 8 compatible (based on ASM 4)
31
	ext.slf4jVersion         = "1.7.7"
S
Stephane Nicoll 已提交
32
	ext.snakeYamlVersion     = "1.13"
33
	ext.snifferVersion       = "1.11"
34
	ext.tiles2Version        = "2.2.2"
35
	ext.tiles3Version        = "3.0.4"
36
	ext.tomcatVersion        = "8.0.8"
37
	ext.xstreamVersion       = "1.4.7"
38

39
	ext.gradleScriptDir = "${rootProject.projectDir}/gradle"
40

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

S
Stephane Nicoll 已提交
46 47 48 49 50
	configurations {
		sniffer
		javaApiSignature
	}

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

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

66 67 68 69 70 71
	compileJava {
		sourceCompatibility=1.6
		targetCompatibility=1.6
	}

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

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

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

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

94
	dependencies {
95 96 97 98 99 100
		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'
		}
101
		testCompile("org.hamcrest:hamcrest-all:1.3")
S
Stephane Nicoll 已提交
102 103 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
		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)
138 139 140
				annotation(className: "org.springframework.lang.UsesJava7")
				annotation(className: "org.springframework.lang.UsesJava8")
				annotation(className: "org.springframework.lang.UsesSunHttpServer")
S
Stephane Nicoll 已提交
141 142
			}
		}
143
	}
C
Chris Beams 已提交
144 145

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

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

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

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

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

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

		// 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
200 201 202
	}

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

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

	artifacts {
		archives sourcesJar
		archives javadocJar
	}
C
Chris Beams 已提交
217 218
}

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

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

	configurations.archives.artifacts.clear()
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

	compileGroovy {
		sourceCompatibility=1.6
		targetCompatibility=1.6
	}
J
Juergen Hoeller 已提交
359 360
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

P
Phillip Webb 已提交
606 607
project("spring-web") {
	description = "Spring Web"
608
	apply plugin: "groovy"
609

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

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

649
project("spring-websocket") {
650
	description = "Spring WebSocket"
651 652 653 654 655

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

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

695
	dependencies {
696 697 698 699 700 701 702 703
		compile(project(":spring-beans"))
		compile(project(":spring-core"))
		compile(project(":spring-jdbc"))
		compile(project(":spring-tx"))
		optional(project(":spring-aop"))
		optional(project(":spring-context"))
		optional(project(":spring-web"))
		optional("aopalliance:aopalliance:1.0")
704 705 706
		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}") {
707 708 709 710 711 712 713 714 715
			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'
		}
716
		optional("org.apache.openjpa:openjpa:${openJpaVersion}") {
717 718 719 720 721
			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'
		}
722
		optional("javax.jdo:jdo-api:3.0.1") {
723 724
			exclude group: 'javax.transaction', module: 'transaction-api'
		}
725
		optional("javax.servlet:javax.servlet-api:3.0.1")
726
		testCompile("commons-dbcp:commons-dbcp:1.4")
P
Phillip Webb 已提交
727
		testCompile("org.hsqldb:hsqldb:${hsqldbVersion}")
728
		testCompile("org.slf4j:slf4j-jcl:${slf4jVersion}")
729
	}
C
Chris Beams 已提交
730 731
}

P
Phillip Webb 已提交
732 733
project("spring-orm-hibernate4") {
	description = "Spring Object/Relational Mapping - Hibernate 4 support"
734
	merge.into = project(":spring-orm")
735

736
	dependencies {
737
		provided(project(":spring-jdbc"))
738
		provided(project(":spring-tx"))
739
		optional(project(":spring-web"))
740 741
		optional("org.hibernate:hibernate-core:${hibernate4Version}")
		optional("org.hibernate:hibernate-entitymanager:${hibernate4Version}")
742
		optional("javax.servlet:javax.servlet-api:3.0.1")
743
        optional("aopalliance:aopalliance:1.0")
744 745
		testCompile("javax.validation:validation-api:1.1.0.GA")
		testCompile("org.hibernate:hibernate-validator:${hibVal5Version}")
746 747
		testCompile("javax.el:javax.el-api:2.2.5")
		testCompile("org.glassfish.web:javax.el:2.2.6")
748
	}
749 750
}

P
Phillip Webb 已提交
751 752
project("spring-webmvc") {
	description = "Spring Web MVC"
753

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

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

P
Phillip Webb 已提交
830 831
project("spring-webmvc-tiles3") {
	description = "Spring Framework Tiles3 Integration"
832
	merge.into = project(":spring-webmvc")
833

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

P
Phillip Webb 已提交
862 863
project("spring-webmvc-portlet") {
	description = "Spring Web Portlet"
864

865
	dependencies {
866 867
		compile(project(":spring-beans"))
		compile(project(":spring-context"))
868
		compile(project(":spring-core"))
869 870
		compile(project(":spring-web"))
		compile(project(":spring-webmvc"))
871 872
		provided("javax.servlet:javax.servlet-api:3.0.1")
		provided("javax.portlet:portlet-api:2.0")
873
		optional("commons-fileupload:commons-fileupload:1.3.1")
874 875 876
	}

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

P
Phillip Webb 已提交
880 881
project("spring-test") {
	description = "Spring TestContext Framework"
882

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

	task testNG(type: Test) {
		useTestNG()
932
		scanForTestClasses = false
933 934
		include(["**/testng/**/*Tests.class", "**/testng/**/*Test.class"])
		// Show STD_OUT & STD_ERR of the test JVM(s) on the console:
935
		// testLogging.showStandardStreams = true
936
		// forkEvery 1
937 938 939 940 941
	}

	test {
		dependsOn testNG
		useJUnit()
942
		exclude "**/testng/**/*.*"
943
	}
944 945 946 947 948 949 950

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

	check.dependsOn aggregateTestReports
C
Chris Beams 已提交
951 952
}

P
Phillip Webb 已提交
953 954 955
project("spring-aspects") {
	description = "Spring Aspects"
	apply from: "aspects.gradle"
956

957
	dependencies {
958
		aspects(project(":spring-orm"))
959 960
		ajc("org.aspectj:aspectjtools:${aspectjVersion}")
		rt("org.aspectj:aspectjrt:${aspectjVersion}")
961
		compile("org.aspectj:aspectjweaver:${aspectjVersion}") // exposing regular AspectJ version to users
962 963 964 965
		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
966
		optional(project(":spring-context-support")) // for JavaMail and JSR-107 support
967 968
		optional(project(":spring-orm")) // for JPA exception translation support
		optional(project(":spring-tx")) // for JPA, @Transactional support
S
Stephane Nicoll 已提交
969
		optional("javax.cache:cache-api:1.0.0")
970 971
		testCompile(project(":spring-core")) // for CodeStyleAspect
		testCompile(project(":spring-test"))
972
		testCompile("javax.mail:javax.mail-api:1.5.2")
973
	}
974

975
	eclipse.project {
P
Phillip Webb 已提交
976
		natures += "org.eclipse.ajdt.ui.ajnature"
977
		buildCommands = [new org.gradle.plugins.ide.eclipse.model.
P
Phillip Webb 已提交
978
				BuildCommand("org.eclipse.ajdt.core.ajbuilder")]
979
	}
C
Chris Beams 已提交
980 981
}

982 983 984 985 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
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)
										}
									}
								}
							}
						}
					}
				}
			}
		}
	}
}

1017
configure(rootProject) {
P
Phillip Webb 已提交
1018
	description = "Spring Framework"
1019

P
Phillip Webb 已提交
1020
	apply plugin: "asciidoctor"
1021
	apply plugin: "docbook-reference"
1022
	apply plugin: "groovy"
R
Rob Winch 已提交
1023

1024
	// apply plugin: "detect-split-packages"
1025 1026
	apply from: "${gradleScriptDir}/jdiff.gradle"

R
Rob Winch 已提交
1027
	asciidoctor {
1028 1029
		baseDir = project.file('src/asciidoc')
		backend = 'docbook5'
R
Rob Winch 已提交
1030
		options = [
1031 1032 1033 1034 1035 1036 1037
			eruby: 'erubis',
			attributes: [
				doctype: 'book',
				'spring-version' : project.version,
				revnumber : project.version,
				docinfo : ""
			]
R
Rob Winch 已提交
1038
		]
1039 1040
	}

1041 1042 1043 1044 1045 1046 1047 1048 1049 1050
	reference {
		sourceDir = asciidoctor.outputDir
		pdfFilename = "spring-framework-reference.pdf"
		expandPlaceholders = ""
	}

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

1051 1052 1053 1054 1055
	// 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")
	// }
1056

C
Chris Beams 已提交
1057
	// don't publish the default jar for the root project
1058 1059 1060
	configurations.archives.artifacts.clear()

	dependencies { // for integration tests
1061
		testCompile(project(":spring-aop"))
1062
		testCompile(project(":spring-beans"))
1063
		testCompile(project(":spring-context"))
1064 1065
		testCompile(project(":spring-core"))
		testCompile(project(":spring-expression"))
1066
		testCompile(project(":spring-jdbc"))
1067
		testCompile(project(":spring-orm"))
1068
		testCompile(project(":spring-test"))
1069
		testCompile(project(":spring-tx"))
1070 1071
		testCompile(project(":spring-web"))
		testCompile(project(":spring-webmvc-portlet"))
1072
		testCompile("javax.servlet:javax.servlet-api:3.0.1")
1073 1074 1075 1076
		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}")
1077
		testCompile("org.hibernate:hibernate-core:${hibernate4Version}")
P
Phillip Webb 已提交
1078
		testCompile("org.hsqldb:hsqldb:${hsqldbVersion}")
1079 1080 1081
	}

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

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

1100 1101 1102
		source subprojects.collect { project ->
			project.sourceSets.main.allJava
		}
C
Chris Beams 已提交
1103

P
Phillip Webb 已提交
1104
		maxMemory = "1024m"
C
Chris Beams 已提交
1105
		destinationDir = new File(buildDir, "api")
1106 1107 1108

		doFirst {
			classpath = files(
1109
				// ensure Servlet 3.x and Hibernate 4.x have precedence on the javadoc
1110 1111 1112 1113 1114 1115 1116 1117
				// 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 })
		}
1118 1119
	}

1120
	task docsZip(type: Zip, dependsOn: 'reference') {
P
Phillip Webb 已提交
1121 1122 1123
		group = "Distribution"
		baseName = "spring-framework"
		classifier = "docs"
1124 1125 1126
		description = "Builds -${classifier} archive containing api and reference " +
			"for deployment at http://static.springframework.org/spring-framework/docs."

P
Phillip Webb 已提交
1127 1128
		from("src/dist") {
			include "changelog.txt"
1129 1130 1131
		}

		from (api) {
1132
			into "javadoc-api"
1133 1134
		}

1135 1136
		from (reference) {
			into "spring-framework-reference"
1137 1138 1139 1140
		}
	}

	task schemaZip(type: Zip) {
P
Phillip Webb 已提交
1141 1142 1143
		group = "Distribution"
		baseName = "spring-framework"
		classifier = "schema"
1144 1145 1146 1147 1148 1149 1150
		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 已提交
1151
				it.path.endsWith("META-INF/spring.schemas")
1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168
			}?.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 已提交
1169 1170 1171
		group = "Distribution"
		baseName = "spring-framework"
		classifier = "dist"
1172 1173 1174 1175 1176
		description = "Builds -${classifier} archive, containing all jars and docs, " +
					"suitable for community download page."

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

P
Phillip Webb 已提交
1177 1178 1179 1180
		from("src/dist") {
			include "readme.txt"
			include "license.txt"
			include "notice.txt"
1181
			into "${baseDir}"
P
Phillip Webb 已提交
1182
			expand(copyright: new Date().format("yyyy"), version: project.version)
1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195
		}

		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 已提交
1196
				if (subproject.tasks.findByPath("sourcesJar")) {
1197 1198
					from subproject.sourcesJar
				}
P
Phillip Webb 已提交
1199
				if (subproject.tasks.findByPath("javadocJar")) {
1200 1201 1202 1203 1204 1205 1206 1207 1208
					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 已提交
1209 1210 1211
		group = "Distribution"
		baseName = "spring-framework"
		classifier = "dist-with-deps"
1212 1213 1214 1215 1216 1217 1218 1219 1220 1221
		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 ->
1222 1223
					(subproject.configurations.runtime.resolvedConfiguration.resolvedArtifacts +
					subproject.configurations.optional.resolvedConfiguration.resolvedArtifacts).each { artifact ->
1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244
						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 已提交
1245
		description = "Generates gradlew[.bat] scripts"
1246
		gradleVersion = "1.12"
1247 1248

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

1260
}
1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272

/*
 * 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-")) {
1273
			return version.replace('BUILD', qualifier)
1274 1275
		}
	}
1276
	return version
1277
}