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

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

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

C
Chris Beams 已提交
26
configure(allprojects) { project ->
27 28
	group = "org.springframework"
	version = qualifyVersionIfNecessary(version)
29

30
	ext.aspectjVersion       = "1.8.5"
31
	ext.eclipselinkVersion   = "2.4.2"
32
	ext.ehcacheVersion       = "2.9.1"
33 34 35
	ext.ehcachejcacheVersion = "1.0.1"
	ext.fileuploadVersion    = "1.3.1"
	ext.freemarkerVersion    = "2.3.22"
36
	ext.groovyVersion        = "2.4.3"
37
	ext.gsonVersion          = "2.3.1"
38
	ext.hibernate3Version    = "3.6.10.Final"
39
	ext.hibernate4Version    = "4.3.9.Final"
40
	ext.hibval4Version       = "4.3.2.Final"
J
Juergen Hoeller 已提交
41
	ext.hibval5Version       = "5.2.0.Beta1"  // to be upgraded to 5.2 final in time for Spring Framework 4.2 GA
42
	ext.hsqldbVersion        = "2.3.2"
43 44
	ext.httpclientVersion    = "4.4"
	ext.httpasyncVersion     = "4.0.2"
45
	ext.jackson2Version      = "2.5.2"
46
	ext.jasperreportsVersion = "6.0.3"
47
	ext.javamailVersion      = "1.5.3"
48
	ext.jettyVersion         = "9.2.10.v20150310"
49
	ext.jodaVersion          = "2.7"
50
	ext.jrubyVersion         = "1.7.19"
51
	ext.jtaVersion           = "1.2"
J
Juergen Hoeller 已提交
52
	ext.junitVersion         = "4.12"
53
	ext.nettyVersion         = "4.0.26.Final"
54
	ext.openjpaVersion       = "2.2.2"  // 2.3.0 not Java 8 compatible (based on ASM 4)
55
	ext.protobufVersion      = "2.6.1"
56 57
	ext.reactorVersion       = "1.1.6.RELEASE"
	ext.slf4jVersion         = "1.7.11"
58
	ext.snakeyamlVersion     = "1.15"
S
Stephane Nicoll 已提交
59
	ext.snifferVersion       = "1.14"
60
	ext.testngVersion        = "6.8.21"
61
	ext.tiles2Version        = "2.2.2"
62
	ext.tiles3Version        = "3.0.5"
63
	ext.tomcatVersion        = "8.0.21"
64
	ext.tyrusVersion         = "1.3.5"  // constrained by WebLogic 12.1.3 support
65
	ext.undertowVersion      = "1.1.3.Final"
66
	ext.woodstoxVersion      = "4.4.1"
67
	ext.xmlunitVersion       = "1.6"
68
	ext.xstreamVersion       = "1.4.8"
69

70
	ext.gradleScriptDir = "${rootProject.projectDir}/gradle"
71

72
	apply plugin: "propdeps"
P
Phillip Webb 已提交
73
	apply plugin: "java"
74
	apply plugin: "test-source-set-dependencies"
75
	apply from: "${gradleScriptDir}/ide.gradle"
C
Chris Beams 已提交
76

S
Stephane Nicoll 已提交
77 78 79 80 81
	configurations {
		sniffer
		javaApiSignature
	}

P
Phillip Webb 已提交
82 83 84
	compileJava.options*.compilerArgs = [
		"-Xlint:serial", "-Xlint:varargs", "-Xlint:cast", "-Xlint:classfile",
		"-Xlint:dep-ann", "-Xlint:divzero", "-Xlint:empty", "-Xlint:finally",
S
Stephane Nicoll 已提交
85
		"-Xlint:overrides", "-Xlint:path", "-Xlint:processing", "-Xlint:static",
P
Phillip Webb 已提交
86 87
		"-Xlint:try", "-Xlint:fallthrough", "-Xlint:rawtypes", "-Xlint:deprecation",
		"-Xlint:unchecked", "-Xlint:-options", "-Werror"
88
	]
C
Chris Beams 已提交
89

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

97
	compileJava {
J
Juergen Hoeller 已提交
98 99
		sourceCompatibility = 1.6
		targetCompatibility = 1.6
100 101 102
	}

	compileTestJava {
J
Juergen Hoeller 已提交
103 104
		sourceCompatibility = 1.8
		targetCompatibility = 1.8
105
		options.compilerArgs += "-parameters"
J
Juergen Hoeller 已提交
106 107
	}

C
Chris Beams 已提交
108 109
	test {
		systemProperty("java.awt.headless", "true")
110
		systemProperty("testGroups", project.properties.get("testGroups"))
111
		scanForTestClasses = false
112
		include(["**/*Tests.class", "**/*Test.class"])
113 114
		// Since we set scanForTestClasses to false, we need to filter out inner
		// classes with the "$" pattern; otherwise, using -Dtest.single=MyTests to
115
		// run MyTests by itself will fail if MyTests contains any inner classes.
116
		exclude(["**/Abstract*.class", '**/*$*'])
C
Chris Beams 已提交
117
	}
C
Chris Beams 已提交
118

119
	repositories {
B
Brian Clozel 已提交
120
		maven { url "https://repo.spring.io/libs-release" }
121
		maven { url "https://repo.spring.io/milestone" }
122
	}
C
Chris Beams 已提交
123

124
	dependencies {
125 126 127 128 129 130
		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'
		}
131
		testCompile("org.hamcrest:hamcrest-all:1.3")
S
Stephane Nicoll 已提交
132 133

		sniffer("org.codehaus.mojo:animal-sniffer-ant-tasks:${snifferVersion}")
134
		javaApiSignature("org.codehaus.mojo.signature:java16:1.1@signature")  // as from JDK 6 update 18
S
Stephane Nicoll 已提交
135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153
	}

	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
154

S
Stephane Nicoll 已提交
155 156 157 158 159 160 161 162 163 164 165
		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)
166 167 168
				annotation(className: "org.springframework.lang.UsesJava7")
				annotation(className: "org.springframework.lang.UsesJava8")
				annotation(className: "org.springframework.lang.UsesSunHttpServer")
S
Stephane Nicoll 已提交
169 170
			}
		}
171
	}
C
Chris Beams 已提交
172 173

	ext.javadocLinks = [
174
		"http://docs.oracle.com/javase/8/docs/api/",
175
		"http://docs.oracle.com/javaee/7/api/",
176
		"http://docs.oracle.com/cd/E13222_01/wls/docs90/javadocs/",  // CommonJ
J
Juergen Hoeller 已提交
177 178
		"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 已提交
179 180
		"http://docs.jboss.org/jbossas/javadoc/4.0.5/connector/",
		"http://docs.jboss.org/jbossas/javadoc/7.1.2.Final/",
J
Juergen Hoeller 已提交
181 182 183 184
		"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/",
185
		"http://tiles.apache.org/tiles-request/apidocs/",
J
Juergen Hoeller 已提交
186
		"http://tiles.apache.org/framework/apidocs/",
P
Phillip Webb 已提交
187
		"http://aopalliance.sourceforge.net/doc/",
C
Chris Beams 已提交
188
		"http://www.eclipse.org/aspectj/doc/released/aspectj5rt-api/",
J
Juergen Hoeller 已提交
189
		"http://ehcache.org/apidocs/",
190
		"http://quartz-scheduler.org/api/2.2.0/",
191 192
		"http://fasterxml.github.com/jackson-core/javadoc/2.3.0/",
		"http://fasterxml.github.com/jackson-databind/javadoc/2.3.0/",
193
		"http://fasterxml.github.io/jackson-dataformat-xml/javadoc/2.3.0/",
194
		"http://hc.apache.org/httpcomponents-client-ga/httpclient/apidocs/"
C
Chris Beams 已提交
195
	] as String[]
196 197
}

198
configure(subprojects - project(":spring-build-src")) { subproject ->
199
	apply plugin: "merge"
200 201
	apply from: "${gradleScriptDir}/publish-maven.gradle"

S
Stephane Nicoll 已提交
202 203 204 205 206 207 208 209 210 211 212 213 214 215
	configurations {
		jacoco
	}

	dependencies {
		jacoco("org.jacoco:org.jacoco.agent:0.7.1.201405082137:runtime")
	}

	gradle.taskGraph.whenReady {taskGraph ->
		if (taskGraph.hasTask(':sonarRunner')) {
			test.jvmArgs "-javaagent:${configurations.jacoco.asPath}=destfile=${buildDir}/jacoco.exec,includes=org.springframework.*"
		}
	}

216
	jar {
P
Phillip Webb 已提交
217 218 219 220
		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
221 222 223 224 225

		from("${rootProject.projectDir}/src/dist") {
			include "license.txt"
			include "notice.txt"
			into "META-INF"
P
Phillip Webb 已提交
226
			expand(copyright: new Date().format("yyyy"), version: project.version)
227 228 229 230
		}
	}

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

233 234 235
		options.memberLevel = org.gradle.external.javadoc.JavadocMemberLevel.PROTECTED
		options.author = true
		options.header = project.name
C
Chris Beams 已提交
236
		options.links(project.ext.javadocLinks)
237
		options.addStringOption('Xdoclint:none', '-quiet')
C
Chris Beams 已提交
238 239 240 241 242

		// 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
243 244
	}

245 246
	task sourcesJar(type: Jar, dependsOn: classes) {
		classifier = 'sources'
247
		from sourceSets.main.allSource
248
		// don't include or exclude anything explicitly by default. See SPR-12085.
249 250 251
	}

	task javadocJar(type: Jar) {
P
Phillip Webb 已提交
252
		classifier = "javadoc"
253 254 255 256 257 258 259
		from javadoc
	}

	artifacts {
		archives sourcesJar
		archives javadocJar
	}
C
Chris Beams 已提交
260 261
}

262 263
project("spring-build-src") {
	description = "Exposes gradle buildSrc for IDE support"
264
	apply plugin: "groovy"
265 266 267

	dependencies {
		compile gradleApi()
R
Rob Winch 已提交
268
		compile localGroovy()
269 270 271 272 273
	}

	configurations.archives.artifacts.clear()
}

P
Phillip Webb 已提交
274 275
project("spring-core") {
	description = "Spring Core"
276

277 278
	// 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
279
	// further transformed by the JarJar task to depend on org.springframework.asm; this
280
	// avoids including two different copies of asm unnecessarily.
281 282
	def cglibVersion = "3.1"
	def objenesisVersion = "2.1"
283 284 285 286

	configurations {
		jarjar
		cglib
287
		objenesis
288 289 290 291 292 293 294 295 296 297 298 299 300 301 302
	}

	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 已提交
303 304
					rule(pattern: "net.sf.cglib.**", result: "org.springframework.cglib.@1")
					// as mentioned above, transform cglib"s internal asm dependencies from
305 306
					// 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 已提交
307
					rule(pattern: "org.objectweb.asm.**", result: "org.springframework.asm.@1")
308 309 310 311 312
				}
			}
		}
	}

313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331
	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")
				}
			}
		}
	}

332
	dependencies {
333
		cglib("cglib:cglib:${cglibVersion}@jar")
334
		objenesis("org.objenesis:objenesis:${objenesisVersion}@jar")
335
		jarjar("com.googlecode.jarjar:jarjar:1.3")
336

P
Phillip Webb 已提交
337
		compile(files(cglibRepackJar))
338
		compile(files(objenesisRepackJar))
339 340
		compile("commons-logging:commons-logging:1.2")
		optional("commons-codec:commons-codec:1.10")
341
		optional("org.aspectj:aspectjweaver:${aspectjVersion}")
342
		optional("net.sf.jopt-simple:jopt-simple:4.8")
343
		optional("log4j:log4j:1.2.17")
344
		testCompile("org.apache.tomcat.embed:tomcat-embed-core:${tomcatVersion}")
345
		testCompile("xmlunit:xmlunit:${xmlunitVersion}")
346
		testCompile("org.codehaus.woodstox:woodstox-core-asl:${woodstoxVersion}") {
P
Phillip Webb 已提交
347 348
			exclude group: "stax", module: "stax-api"
		}
349 350 351
	}

	jar {
352
		// inline repackaged cglib classes directly into the spring-core jar
353 354
		dependsOn cglibRepackJar
		from(zipTree(cglibRepackJar.archivePath)) {
P
Phillip Webb 已提交
355
			include "org/springframework/cglib/**"
356
		}
357 358 359 360 361

		dependsOn objenesisRepackJar
		from(zipTree(objenesisRepackJar.archivePath)) {
			include "org/springframework/objenesis/**"
		}
362
	}
C
Chris Beams 已提交
363 364
}

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

368
	dependencies {
369 370
		compile(project(":spring-core"))
		compile(files(project(":spring-core").cglibRepackJar))
371
		optional("javax.inject:javax.inject:1")
372
		optional("javax.el:javax.el-api:2.2.5")
373
		optional("org.yaml:snakeyaml:${snakeyamlVersion}")
374
		testCompile("log4j:log4j:1.2.17")
375
		testCompile("org.apache.tomcat.embed:tomcat-embed-core:${tomcatVersion}")
S
Stephane Nicoll 已提交
376
    }
C
Chris Beams 已提交
377 378
}

379 380
project("spring-beans-groovy") {
	description "Groovy Bean Definitions"
J
Juergen Hoeller 已提交
381
	merge.into = project(":spring-beans")
382
	apply plugin: "groovy"
J
Juergen Hoeller 已提交
383 384 385

	dependencies {
		compile(project(":spring-core"))
386
		optional("org.codehaus.groovy:groovy-all:${groovyVersion}")
J
Juergen Hoeller 已提交
387 388 389 390 391 392 393
	}

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

	compileGroovy {
J
Juergen Hoeller 已提交
400 401
		sourceCompatibility = 1.6
		targetCompatibility = 1.6
402
	}
J
Juergen Hoeller 已提交
403 404
}

P
Phillip Webb 已提交
405 406
project("spring-aop") {
	description = "Spring AOP"
407

408
	dependencies {
409
		compile(project(":spring-beans"))
410 411
		compile(project(":spring-core"))
		compile(files(project(":spring-core").cglibRepackJar))
412
		compile(files(project(":spring-core").objenesisRepackJar))
413
		compile("aopalliance:aopalliance:1.0")
414
		optional("org.aspectj:aspectjweaver:${aspectjVersion}")
415
		optional("commons-pool:commons-pool:1.6")
S
Stephane Nicoll 已提交
416
		optional("org.apache.commons:commons-pool2:2.2")
417
		optional("com.jamonapi:jamon:2.81")
418
	}
C
Chris Beams 已提交
419 420
}

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

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

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

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

P
Phillip Webb 已提交
443 444
project("spring-instrument-tomcat") {
	description = "Spring Instrument Tomcat"
445

446
	dependencies {
447
		provided("org.apache.tomcat:catalina:6.0.16")
448
	}
C
Chris Beams 已提交
449 450
}

P
Phillip Webb 已提交
451 452
project("spring-context") {
	description = "Spring Context"
453
	apply plugin: "groovy"
454

455
	dependencies {
456 457 458 459 460
		compile(project(":spring-aop"))
		compile(project(":spring-beans"))
		compile(project(":spring-expression"))
		compile(project(":spring-core"))
		compile(files(project(":spring-core").cglibRepackJar))
461
		optional(project(":spring-instrument"))
462
		optional("javax.inject:javax.inject:1")
463
		optional("javax.ejb:ejb-api:3.0")
464
		optional("javax.enterprise.concurrent:javax.enterprise.concurrent-api:1.0")
465
		optional("javax.money:money-api:1.0-RC3")
466
		optional("org.eclipse.persistence:javax.persistence:2.0.0")
467
		optional("javax.validation:validation-api:1.0.0.GA")
468
		optional("org.hibernate:hibernate-validator:${hibval4Version}")
469 470
		optional("joda-time:joda-time:${jodaVersion}")
		optional("org.aspectj:aspectjweaver:${aspectjVersion}")
J
Juergen Hoeller 已提交
471
		optional("org.codehaus.groovy:groovy-all:${groovyVersion}")
472
		optional("org.beanshell:bsh:2.0b4")
473
		optional("org.jruby:jruby:${jrubyVersion}")
474
		testCompile("javax.inject:javax.inject-tck:1")
475
		testCompile("org.javamoney:moneta:1.0-RC3")
476
		testCompile("commons-dbcp:commons-dbcp:1.4")
S
Stephane Nicoll 已提交
477
		testCompile("org.apache.commons:commons-pool2:2.2")
478
		testCompile("org.slf4j:slf4j-api:${slf4jVersion}")
479
	}
480 481 482 483 484 485 486 487 488
}

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

	dependencies {
		compile(project(":spring-beans"))
		compile(project(":spring-core"))
		compile(project(":spring-context"))
489
		optional("org.projectreactor:reactor-core:${reactorVersion}")
490 491 492
		optional("org.projectreactor:reactor-net:${reactorVersion}") {
			exclude group: "io.netty", module: "netty-all"
		}
B
Brian Clozel 已提交
493
		optional("org.eclipse.jetty.websocket:websocket-server:${jettyVersion}") {
B
Brian Clozel 已提交
494 495
			exclude group: "javax.servlet", module: "javax.servlet-api"
		}
B
Brian Clozel 已提交
496
		optional("org.eclipse.jetty.websocket:websocket-client:${jettyVersion}")
497
		optional("com.fasterxml.jackson.core:jackson-databind:${jackson2Version}")
498
		testCompile(project(":spring-test"))
499
		testCompile("javax.inject:javax.inject-tck:1")
500
		testCompile("javax.servlet:javax.servlet-api:3.1.0")
501
		testCompile("javax.validation:validation-api:1.0.0.GA")
502
		testCompile("com.thoughtworks.xstream:xstream:${xstreamVersion}")
503 504 505 506 507
		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 已提交
508
		testCompile("org.eclipse.jetty:jetty-webapp:${jettyVersion}") {
B
Brian Clozel 已提交
509
			exclude group: "javax.servlet", module: "javax.servlet-api"
510
		}
511 512 513
		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}")
514
		testCompile("io.netty:netty-all:${nettyVersion}")
515
		testCompile("commons-dbcp:commons-dbcp:1.4")
516
		testCompile("log4j:log4j:1.2.17")
517
		testCompile("org.slf4j:slf4j-jcl:${slf4jVersion}")
518
	}
C
Chris Beams 已提交
519 520
}

P
Phillip Webb 已提交
521 522
project("spring-tx") {
	description = "Spring Transaction"
523

524
	dependencies {
525 526
		compile(project(":spring-beans"))
		compile(project(":spring-core"))
527
		optional(project(":spring-aop"))
528
		optional(project(":spring-context"))  // for JCA, @EnableTransactionManagement
529
		optional("aopalliance:aopalliance:1.0")
530
		optional("javax.transaction:javax.transaction-api:${jtaVersion}")
531
		optional("javax.resource:connector-api:1.5")
532
		optional("javax.ejb:ejb-api:3.0")
533
		optional("com.ibm.websphere:uow:6.0.2.17")
534
		testCompile("org.aspectj:aspectjweaver:${aspectjVersion}")
535
		testCompile("org.eclipse.persistence:javax.persistence:2.0.0")
536
	}
C
Chris Beams 已提交
537 538
}

P
Phillip Webb 已提交
539 540 541
project("spring-oxm") {
	description = "Spring Object/XML Marshalling"
	apply from: "oxm.gradle"
542

P
Phillip Webb 已提交
543
	compileTestJava {
544 545
		// necessary to avoid java.lang.VerifyError on jibx compilation
		// see http://jira.codehaus.org/browse/JIBX-465
J
Juergen Hoeller 已提交
546 547
		sourceCompatibility = 1.6
		targetCompatibility = 1.6
548 549
	}

550 551 552 553 554
	if (System.getProperty("java.version").contains("1.9.")) {
		// necessary because castor and xjc tasks cannot find the JDK's compiler on JDK 9
		compileTestJava.enabled = false
	}

555
	dependencies {
556 557
		compile(project(":spring-beans"))
		compile(project(":spring-core"))
558
		optional("org.codehaus.castor:castor-xml:1.3.3")  {
559
			exclude group: 'stax', module: 'stax-api'
560
			exclude group: "org.springframework", module: "spring-context"
561 562 563 564 565 566 567 568
		}
		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'
		}
569
		optional("org.jibx:jibx-run:1.2.6")
570
		testCompile(project(":spring-context"))
571
		testCompile("xmlunit:xmlunit:${xmlunitVersion}")
572 573
		testCompile("xpp3:xpp3:1.1.4c")
		testCompile("org.codehaus.jettison:jettison:1.3.7") {
574 575
			exclude group: 'stax', module: 'stax-api'
		}
576 577 578 579 580
		if (compileTestJava.enabled) {
			testCompile(files(genCastor.classesDir).builtBy(genCastor))
			testCompile(files(genJaxb.classesDir).builtBy(genJaxb))
			testCompile(files(genXmlbeans.classesDir).builtBy(genXmlbeans))
		}
581
	}
C
Chris Beams 已提交
582 583
}

P
Phillip Webb 已提交
584 585
project("spring-jms") {
	description = "Spring JMS"
586

587
	dependencies {
588 589 590 591
		compile(project(":spring-core"))
		compile(project(":spring-beans"))
		compile(project(":spring-aop"))
		compile(project(":spring-context"))
592
		compile(project(":spring-messaging"))
593
		compile(project(":spring-tx"))
594
		provided("javax.jms:jms-api:1.1-rev-1")
595 596
		optional(project(":spring-oxm"))
		optional("aopalliance:aopalliance:1.0")
597
		optional("javax.transaction:javax.transaction-api:${jtaVersion}")
598
		optional("javax.resource:connector-api:1.5")
599
		optional("com.fasterxml.jackson.core:jackson-databind:${jackson2Version}")
600
	}
C
Chris Beams 已提交
601 602
}

P
Phillip Webb 已提交
603 604
project("spring-jdbc") {
	description = "Spring JDBC"
605

606
	dependencies {
607
		compile(project(":spring-beans"))
608
		compile(project(":spring-core"))
609
		compile(project(":spring-tx"))
610
		optional(project(":spring-context"))  // for JndiDataSourceLookup
611
		optional("javax.transaction:javax.transaction-api:${jtaVersion}")
612
		optional("com.mchange:c3p0:0.9.2.1")
P
Phillip Webb 已提交
613
		optional("org.hsqldb:hsqldb:${hsqldbVersion}")
S
Stephane Nicoll 已提交
614
		optional("com.h2database:h2:1.4.186")
615 616
		optional("org.apache.derby:derby:10.11.1.1")
		optional("org.apache.derby:derbyclient:10.11.1.1")
617
	}
C
Chris Beams 已提交
618 619
}

P
Phillip Webb 已提交
620 621
project("spring-context-support") {
	description = "Spring Context Support"
622

623
	dependencies {
624 625 626
		compile(project(":spring-core"))
		compile(project(":spring-beans"))
		compile(project(":spring-context"))
627 628
		optional(project(":spring-jdbc"))  // for Quartz support
		optional(project(":spring-tx"))  // for Quartz support
629
		optional("javax.mail:javax.mail-api:${javamailVersion}")
S
Stephane Nicoll 已提交
630
		optional("javax.cache:cache-api:1.0.0")
631
		optional("com.google.guava:guava:18.0")
632
		optional("net.sf.ehcache:ehcache:${ehcacheVersion}")
633
		optional("org.quartz-scheduler:quartz:2.2.1")
634
		optional("org.codehaus.fabric3.api:commonj:1.1.0")
635
		optional("org.apache.velocity:velocity:1.7")
636
		optional("org.freemarker:freemarker:${freemarkerVersion}")
637
		optional("com.lowagie:itext:2.1.7")
638
		optional("net.sf.jasperreports:jasperreports:$jasperreportsVersion") {
639 640 641
			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"
642 643
			exclude group: "org.olap4j", module: "olap4j"
			exclude group: "xml-apis", module: "xml-apis"
A
Andy Wilkinson 已提交
644
			exclude group: "org.springframework", module: "spring-context"
645
		}
646
		testCompile(project(":spring-context"))
647
		testCompile("org.apache.poi:poi:3.11")
648 649
		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 已提交
650
		testCompile("org.hsqldb:hsqldb:${hsqldbVersion}")
651
		testCompile("org.slf4j:slf4j-api:${slf4jVersion}")
652
		testRuntime("com.sun.mail:javax.mail:${javamailVersion}")
653 654
		testCompile("org.ehcache:jcache:${ehcachejcacheVersion}")
		// testCompile("org.ehcache:ehcache:3.0.0.m1")  // alternative to ehcache-jcache above
655
	}
C
Chris Beams 已提交
656 657
}

P
Phillip Webb 已提交
658 659
project("spring-web") {
	description = "Spring Web"
660
	apply plugin: "groovy"
661

662 663 664 665 666 667 668 669 670 671 672 673 674 675 676
	// 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"
	}

677
	dependencies {
678 679
		compile(project(":spring-aop"))  // for JaxWsPortProxyFactoryBean
		compile(project(":spring-beans"))  // for MultipartFilter
680
		compile(project(":spring-context"))
681
		compile(project(":spring-core"))
682
		provided("javax.servlet:javax.servlet-api:3.0.1")
683
		optional(project(":spring-oxm"))  // for MarshallingHttpMessageConverter
684
		optional("javax.servlet.jsp:javax.servlet.jsp-api:2.2.1")
685
		optional("javax.portlet:portlet-api:2.0")
686
		optional("javax.el:javax.el-api:2.2.5")
687
		optional("javax.faces:javax.faces-api:2.2")
688
		optional("aopalliance:aopalliance:1.0")
689
		optional("org.codehaus.groovy:groovy-all:${groovyVersion}")
690
		optional("com.caucho:hessian:4.0.38")
691 692 693
		optional("commons-fileupload:commons-fileupload:${fileuploadVersion}")
		optional("org.apache.httpcomponents:httpclient:${httpclientVersion}")
		optional("org.apache.httpcomponents:httpasyncclient:${httpasyncVersion}")
694
		optional("io.netty:netty-all:${nettyVersion}")
695
		optional("com.fasterxml.jackson.core:jackson-databind:${jackson2Version}")
696
		optional("com.fasterxml.jackson.dataformat:jackson-dataformat-xml:${jackson2Version}")
R
Roy Clarkson 已提交
697
		optional("com.google.code.gson:gson:${gsonVersion}")
698
		optional("com.rometools:rome:1.5.0")
B
Brian Clozel 已提交
699
		optional("org.eclipse.jetty:jetty-servlet:${jettyVersion}") {
B
Brian Clozel 已提交
700
			exclude group: "javax.servlet", module: "javax.servlet-api"
701
		}
B
Brian Clozel 已提交
702
		optional("org.eclipse.jetty:jetty-server:${jettyVersion}") {
B
Brian Clozel 已提交
703
			exclude group: "javax.servlet", module: "javax.servlet-api"
704
		}
705
		optional("log4j:log4j:1.2.17")
R
Polish  
Rossen Stoyanchev 已提交
706 707
		optional("com.googlecode.protobuf-java-format:protobuf-java-format:1.2")
		optional("com.google.protobuf:protobuf-java:${protobufVersion}")
708
		optional("javax.mail:javax.mail-api:${javamailVersion}")
709
		testCompile(project(":spring-context-support"))  // for JafMediaTypeFactory
710
		testCompile("xmlunit:xmlunit:${xmlunitVersion}")
711
		testCompile("org.slf4j:slf4j-jcl:${slf4jVersion}")
712 713 714
		testCompile("org.apache.taglibs:taglibs-standard-jstlel:1.2.1") {
			exclude group: "org.apache.taglibs", module: "taglibs-standard-spec"
		}
715
		testCompile("com.fasterxml.jackson.datatype:jackson-datatype-joda:${jackson2Version}")
716
		testRuntime("com.sun.mail:javax.mail:${javamailVersion}")
717
	}
C
Chris Beams 已提交
718 719
}

720
project("spring-websocket") {
721
	description = "Spring WebSocket"
722 723 724 725 726

	dependencies {
		compile(project(":spring-core"))
		compile(project(":spring-context"))
		compile(project(":spring-web"))
727
		optional(project(":spring-messaging"))
728
		optional(project(":spring-webmvc"))
729
		optional("javax.servlet:javax.servlet-api:3.1.0")
730
		optional("javax.websocket:javax.websocket-api:1.0")
731
		optional("org.apache.tomcat:tomcat-websocket:${tomcatVersion}") {
732 733 734
			exclude group: "org.apache.tomcat", module: "tomcat-websocket-api"
			exclude group: "org.apache.tomcat", module: "tomcat-servlet-api"
		}
735 736 737 738
		optional("org.glassfish.tyrus:tyrus-spi:${tyrusVersion}")
		optional("org.glassfish.tyrus:tyrus-core:${tyrusVersion}")
		optional("org.glassfish.tyrus:tyrus-server:${tyrusVersion}")
		optional("org.glassfish.tyrus:tyrus-container-servlet:${tyrusVersion}")
B
Brian Clozel 已提交
739
		optional("org.eclipse.jetty:jetty-webapp:${jettyVersion}") {
B
Brian Clozel 已提交
740 741
			exclude group: "javax.servlet", module: "javax.servlet"
		}
B
Brian Clozel 已提交
742
		optional("org.eclipse.jetty.websocket:websocket-server:${jettyVersion}") {
B
Brian Clozel 已提交
743
			exclude group: "javax.servlet", module: "javax.servlet"
744
		}
B
Brian Clozel 已提交
745
		optional("org.eclipse.jetty.websocket:websocket-client:${jettyVersion}")
R
Rossen Stoyanchev 已提交
746
		optional("org.eclipse.jetty:jetty-client:${jettyVersion}")
747 748
		optional("io.undertow:undertow-core:${undertowVersion}")
		optional("io.undertow:undertow-servlet:${undertowVersion}") {
749
			exclude group: "org.jboss.spec.javax.servlet", module: "jboss-servlet-api_3.1_spec"
750
			exclude group: "org.jboss.spec.javax.annotation", module: "jboss-annotations-api_1.2_spec"
751
		}
752
		optional("io.undertow:undertow-websockets-jsr:${undertowVersion}") {
753
			exclude group: "org.jboss.spec.javax.websocket", module: "jboss-websocket-api_1.1_spec"
754
		}
755
		optional("com.fasterxml.jackson.core:jackson-databind:${jackson2Version}")
756 757 758
		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}")
759 760
		testCompile("org.projectreactor:reactor-core:${reactorVersion}")
		testCompile("org.projectreactor:reactor-net:${reactorVersion}")
761 762
		testCompile("log4j:log4j:1.2.17")
		testCompile("org.slf4j:slf4j-jcl:${slf4jVersion}")
763 764 765
	}
}

P
Phillip Webb 已提交
766 767
project("spring-orm") {
	description = "Spring Object/Relational Mapping"
768

769
	dependencies {
770 771 772 773 774 775 776 777
		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")
778
		optional("org.eclipse.persistence:javax.persistence:2.0.5")
779 780
		optional("org.eclipse.persistence:org.eclipse.persistence.core:${eclipselinkVersion}")
		optional("org.eclipse.persistence:org.eclipse.persistence.jpa:${eclipselinkVersion}") {
781 782 783 784 785 786 787 788 789
			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'
		}
790
		optional("org.apache.openjpa:openjpa:${openjpaVersion}") {
791 792 793 794 795
			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'
		}
796
		optional("javax.jdo:jdo-api:3.0.1") {
797 798
			exclude group: 'javax.transaction', module: 'transaction-api'
		}
799
		optional("javax.servlet:javax.servlet-api:3.0.1")
800
		testCompile("commons-dbcp:commons-dbcp:1.4")
S
Sam Brannen 已提交
801
		testCompile("org.aspectj:aspectjweaver:${aspectjVersion}")
P
Phillip Webb 已提交
802
		testCompile("org.hsqldb:hsqldb:${hsqldbVersion}")
803
		testCompile("org.slf4j:slf4j-jcl:${slf4jVersion}")
804
	}
C
Chris Beams 已提交
805 806
}

P
Phillip Webb 已提交
807 808
project("spring-orm-hibernate4") {
	description = "Spring Object/Relational Mapping - Hibernate 4 support"
809
	merge.into = project(":spring-orm")
810

811
	dependencies {
812
		provided(project(":spring-jdbc"))
813
		provided(project(":spring-tx"))
814
		optional(project(":spring-web"))
815 816
		optional("org.hibernate:hibernate-core:${hibernate4Version}")
		optional("org.hibernate:hibernate-entitymanager:${hibernate4Version}")
817
		optional("javax.servlet:javax.servlet-api:3.0.1")
818
        optional("aopalliance:aopalliance:1.0")
819
		testCompile("javax.validation:validation-api:1.1.0.GA")
820
		testCompile("org.hibernate:hibernate-validator:${hibval5Version}")
821 822
		testCompile("javax.el:javax.el-api:2.2.5")
		testCompile("org.glassfish.web:javax.el:2.2.6")
823
	}
824 825
}

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

829
	dependencies {
830 831
		compile(project(":spring-beans"))
		compile(project(":spring-context"))
832
		compile(project(":spring-core"))
833
		compile(files(project(":spring-core").objenesisRepackJar))
834 835
		compile(project(":spring-expression"))
		compile(project(":spring-web"))
836
		provided("javax.servlet:javax.servlet-api:3.0.1")
837 838
		optional(project(":spring-context-support"))  // for Velocity support
		optional(project(":spring-oxm"))  // for MarshallingView
839 840
		optional("javax.servlet.jsp:javax.servlet.jsp-api:2.2.1")
		optional("javax.servlet.jsp.jstl:javax.servlet.jsp.jstl-api:1.2.1")
841
		optional("net.sourceforge.jexcelapi:jxl:2.6.12")
842
		optional("org.apache.poi:poi:3.11")
843
		optional("org.apache.poi:poi-ooxml:3.11")
844 845
		optional("org.apache.velocity:velocity:1.7")
		optional("velocity-tools:velocity-tools-view:1.4")
846
		optional("org.freemarker:freemarker:${freemarkerVersion}")
847
		optional("org.codehaus.groovy:groovy-all:${groovyVersion}")
848
		optional("com.lowagie:itext:2.1.7")
849
		optional("net.sf.jasperreports:jasperreports:$jasperreportsVersion") {
850 851 852
			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"
853 854
			exclude group: "org.olap4j", module: "olap4j"
			exclude group: "xml-apis", module: "xml-apis"
A
Andy Wilkinson 已提交
855
			exclude group: "org.springframework", module: "spring-context"
856 857
		}
		optional("com.fasterxml.jackson.core:jackson-databind:${jackson2Version}")
858
		optional("com.fasterxml.jackson.dataformat:jackson-dataformat-xml:${jackson2Version}")
859
		optional("com.rometools:rome:1.5.0")
860 861 862
		optional("javax.el:javax.el-api:2.2.5")
		optional("org.apache.tiles:tiles-api:${tiles3Version}")
		optional("org.apache.tiles:tiles-core:${tiles3Version}") {
863 864
			exclude group: "org.slf4j", module: "jcl-over-slf4j"
		}
865
		optional("org.apache.tiles:tiles-servlet:${tiles3Version}") {
866 867
			exclude group: "org.slf4j", module: "jcl-over-slf4j"
		}
868
		optional("org.apache.tiles:tiles-jsp:${tiles3Version}") {
869 870
			exclude group: "org.slf4j", module: "jcl-over-slf4j"
		}
871
		optional("org.apache.tiles:tiles-el:${tiles3Version}") {
872 873
			exclude group: "org.slf4j", module: "jcl-over-slf4j"
		}
874
		optional("org.apache.tiles:tiles-extras:${tiles3Version}") {
875 876 877
			exclude group: "org.slf4j", module: "jcl-over-slf4j"
			exclude group: "org.springframework", module: "spring-web"
		}
878 879
		testCompile(project(":spring-aop"))
		testCompile("rhino:js:1.7R1")
880
		testCompile("xmlunit:xmlunit:${xmlunitVersion}")
881
		testCompile("dom4j:dom4j:1.6.1") {
P
Phillip Webb 已提交
882
			exclude group: "xml-apis", module: "xml-apis"
883 884
		}
		testCompile("jaxen:jaxen:1.1.1") {
P
Phillip Webb 已提交
885 886 887
			exclude group: "xml-apis", module: "xml-apis"
			exclude group: "xom", module: "xom"
			exclude group: "xerces", module: "xercesImpl"
888
		}
B
Brian Clozel 已提交
889
		testCompile("org.eclipse.jetty:jetty-servlet:${jettyVersion}") {
B
Brian Clozel 已提交
890
			exclude group: "javax.servlet", module: "javax.servlet"
891
		}
B
Brian Clozel 已提交
892
		testCompile("org.eclipse.jetty:jetty-server:${jettyVersion}") {
B
Brian Clozel 已提交
893
			exclude group: "javax.servlet", module: "javax.servlet"
894 895
		}
		testCompile("javax.validation:validation-api:1.0.0.GA")
896 897 898
		testCompile("org.hibernate:hibernate-validator:${hibval4Version}")
		testCompile("org.apache.httpcomponents:httpclient:${httpclientVersion}")
		testCompile("commons-fileupload:commons-fileupload:${fileuploadVersion}")
899
		testCompile("commons-io:commons-io:1.3")
900
		testCompile("joda-time:joda-time:${jodaVersion}")
901
		testCompile("org.slf4j:slf4j-jcl:${slf4jVersion}")
902 903 904 905 906 907
		testCompile("org.webjars:mustachejs:0.8.2")
		testCompile("org.webjars:handlebars:3.0.0-1")
		testCompile("org.webjars:react:0.12.2")
		testCompile("org.webjars:underscorejs:1.8.2")
		testCompile("org.jruby:jruby:${jrubyVersion}")
		testCompile("org.python:jython-standalone:2.5.3")
908
	}
C
Chris Beams 已提交
909 910
}

911 912
project("spring-webmvc-tiles2") {
	description = "Spring Framework Tiles2 Integration"
913
	merge.into = project(":spring-webmvc")
914

915
	dependencies {
916 917
		provided(project(":spring-context"))
		provided(project(":spring-web"))
918
		provided("javax.servlet:javax.servlet-api:3.0.1")
919 920
		optional("javax.servlet.jsp:javax.servlet.jsp-api:2.2.1")
		optional("javax.servlet.jsp.jstl:javax.servlet.jsp.jstl-api:1.2.1")
921 922
		optional("org.apache.tiles:tiles-api:${tiles2Version}")
		optional("org.apache.tiles:tiles-core:${tiles2Version}") {
P
Phillip Webb 已提交
923
			exclude group: "org.slf4j", module: "jcl-over-slf4j"
924
		}
925
		optional("org.apache.tiles:tiles-servlet:${tiles2Version}") {
P
Phillip Webb 已提交
926
			exclude group: "org.slf4j", module: "jcl-over-slf4j"
927
		}
928
		optional("org.apache.tiles:tiles-jsp:${tiles2Version}") {
P
Phillip Webb 已提交
929
			exclude group: "org.slf4j", module: "jcl-over-slf4j"
930
		}
931
		optional("org.apache.tiles:tiles-el:${tiles2Version}") {
932
			exclude group: "org.slf4j", module: "jcl-over-slf4j"
933
		}
934
		optional("org.apache.tiles:tiles-extras:${tiles2Version}") {
P
Phillip Webb 已提交
935
			exclude group: "org.slf4j", module: "jcl-over-slf4j"
936
			exclude group: "org.apache.velocity", module: "velocity-tools"
937
			exclude group: "org.springframework", module: "spring-web"
938
		}
939
		testCompile("org.slf4j:slf4j-jcl:${slf4jVersion}")
940
	}
941 942
}

P
Phillip Webb 已提交
943 944
project("spring-webmvc-portlet") {
	description = "Spring Web Portlet"
945

946
	dependencies {
947 948
		compile(project(":spring-beans"))
		compile(project(":spring-context"))
949
		compile(project(":spring-core"))
950 951
		compile(project(":spring-web"))
		compile(project(":spring-webmvc"))
952 953
		provided("javax.servlet:javax.servlet-api:3.0.1")
		provided("javax.portlet:portlet-api:2.0")
954
		optional("commons-fileupload:commons-fileupload:${fileuploadVersion}")
955
	}
C
Chris Beams 已提交
956 957
}

P
Phillip Webb 已提交
958 959
project("spring-test") {
	description = "Spring TestContext Framework"
960

961
	dependencies {
962
		compile(project(":spring-core"))
963 964 965 966 967 968 969
		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 已提交
970
		optional(project(":spring-webmvc-portlet"))
971
		optional("junit:junit:${junitVersion}")
972
		optional("org.testng:testng:${testngVersion}")
973
		optional("javax.inject:javax.inject:1")
974
		optional("javax.servlet:javax.servlet-api:3.0.1")
975 976 977 978 979
		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"
		}
980
		optional("javax.portlet:portlet-api:2.0")
981
		optional("javax.el:javax.el-api:2.2.5")
982
		optional("org.aspectj:aspectjweaver:${aspectjVersion}")
S
Sam Brannen 已提交
983
		optional("org.codehaus.groovy:groovy-all:${groovyVersion}")
984
		optional("org.hamcrest:hamcrest-core:1.3")
985
		optional("com.jayway.jsonpath:json-path:1.2.0")
986
		optional("org.skyscreamer:jsonassert:1.2.3")
987
		optional("xmlunit:xmlunit:${xmlunitVersion}")
988 989
		testCompile(project(":spring-context-support"))
		testCompile(project(":spring-oxm"))
990
		testCompile("javax.mail:javax.mail-api:${javamailVersion}")
991
		testCompile("javax.ejb:ejb-api:3.0")
992 993
		testCompile("org.hibernate:hibernate-core:${hibernate4Version}")
		testCompile("org.hibernate:hibernate-entitymanager:${hibernate4Version}")
994
		testCompile("org.hibernate:hibernate-validator:${hibval5Version}")
995
		testCompile("com.thoughtworks.xstream:xstream:${xstreamVersion}")
996
		testCompile("com.fasterxml.jackson.core:jackson-databind:${jackson2Version}")
997
		testCompile("com.rometools:rome:1.5.0")
998 999
		testCompile("org.apache.tiles:tiles-api:${tiles3Version}")
		testCompile("org.apache.tiles:tiles-core:${tiles3Version}") {
1000 1001
			exclude group: "org.slf4j", module: "jcl-over-slf4j"
		}
1002
		testCompile("org.apache.tiles:tiles-servlet:${tiles3Version}") {
1003 1004
			exclude group: "org.slf4j", module: "jcl-over-slf4j"
		}
1005 1006
		testCompile("org.hsqldb:hsqldb:${hsqldbVersion}")
		testCompile "org.slf4j:slf4j-jcl:${slf4jVersion}"
1007
	}
1008 1009

	task testNG(type: Test) {
1010
		description = 'Runs TestNG tests.'
1011
		useTestNG()
1012
		scanForTestClasses = false
1013 1014
		include(["**/testng/**/*Tests.class", "**/testng/**/*Test.class"])
		// Show STD_OUT & STD_ERR of the test JVM(s) on the console:
1015
		// testLogging.showStandardStreams = true
1016
		// forkEvery 1
1017 1018 1019
	}

	test {
1020
		description = 'Runs JUnit tests.'
1021 1022
		dependsOn testNG
		useJUnit()
1023
		exclude "**/testng/**/*.*"
1024
	}
1025 1026

	task aggregateTestReports(type: TestReport) {
1027
		description = 'Aggregates JUnit and TestNG test reports.'
1028 1029 1030 1031 1032
		destinationDir = test.reports.html.destination
		reportOn test, testNG
	}

	check.dependsOn aggregateTestReports
C
Chris Beams 已提交
1033 1034
}

P
Phillip Webb 已提交
1035 1036 1037
project("spring-aspects") {
	description = "Spring Aspects"
	apply from: "aspects.gradle"
1038

1039
	dependencies {
1040
		aspects(project(":spring-orm"))
1041
		ajc("org.aspectj:aspectjtools:1.9.0.BETA-1")  // for the ability to build on JDK 9, not exposed in the POMs yet
J
Juergen Hoeller 已提交
1042
		rt("org.aspectj:aspectjrt:${aspectjVersion}")  // regular AspectJ version here, to be exposed in the POMs
1043
		compile("org.aspectj:aspectjweaver:${aspectjVersion}")
1044
		provided("org.eclipse.persistence:javax.persistence:2.0.0")
1045 1046 1047 1048 1049 1050
		optional(project(":spring-aop"))  // for @Async support
		optional(project(":spring-beans"))  // for @Configurable support
		optional(project(":spring-context"))  // for @Enable* support
		optional(project(":spring-context-support"))  // for JavaMail and JSR-107 support
		optional(project(":spring-orm"))  // for JPA exception translation support
		optional(project(":spring-tx"))  // for JPA, @Transactional support
1051
		optional("javax.transaction:javax.transaction-api:${jtaVersion}")  // for @javax.transaction.Transactional support
S
Stephane Nicoll 已提交
1052
		optional("javax.cache:cache-api:1.0.0")
1053
		testCompile(project(":spring-core"))  // for CodeStyleAspect
1054
		testCompile(project(":spring-test"))
1055
		testCompile("javax.mail:javax.mail-api:${javamailVersion}")
1056
	}
1057

1058
	eclipse.project {
P
Phillip Webb 已提交
1059
		natures += "org.eclipse.ajdt.ui.ajnature"
1060
		buildCommands = [new org.gradle.plugins.ide.eclipse.model.
P
Phillip Webb 已提交
1061
				BuildCommand("org.eclipse.ajdt.core.ajbuilder")]
1062
	}
C
Chris Beams 已提交
1063 1064
}

1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099
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)
										}
									}
								}
							}
						}
					}
				}
			}
		}
	}
}

S
Stephane Nicoll 已提交
1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115
apply plugin: 'sonar-runner'

sonarRunner {
	sonarProperties {
		property "sonar.projectName", "Spring Framework"
		property "sonar.profile", "Spring Framework"
		property "sonar.jacoco.reportPath", "${buildDir.name}/jacoco.exec"
		property "sonar.links.homepage", linkHomepage
		property "sonar.links.ci", linkCi
		property "sonar.links.issue", linkIssue
		property "sonar.links.scm", linkScmUrl
		property "sonar.links.scm_dev", linkScmDevConnection
		property "sonar.java.coveragePlugin", "jacoco"
	}
}

1116
configure(rootProject) {
P
Phillip Webb 已提交
1117
	description = "Spring Framework"
1118

B
Brian Clozel 已提交
1119
	apply plugin: "org.asciidoctor.convert"
1120
	apply plugin: "docbook-reference"
1121
	apply plugin: "groovy"
R
Rob Winch 已提交
1122

1123
	// apply plugin: "detect-split-packages"
1124 1125
	apply from: "${gradleScriptDir}/jdiff.gradle"

R
Rob Winch 已提交
1126
	asciidoctor {
B
Brian Clozel 已提交
1127 1128
		sourceDir project.file('src/asciidoc')
		separateOutputDirs = false
1129
		backends = ['docbook']
B
Brian Clozel 已提交
1130
		options doctype: 'book', eruby: 'erubis'
1131 1132
		attributes 	'spring-version': project.version,
					'javadoc-baseurl' : "http://docs.spring.io/spring/docs/current/javadoc-api",
B
Brian Clozel 已提交
1133 1134
					revnumber : project.version,
					docinfo : ""
1135 1136
	}

1137 1138 1139
	reference {
		sourceDir = asciidoctor.outputDir
		pdfFilename = "spring-framework-reference.pdf"
1140
		epubFilename = "spring-framework-reference.epub"
1141 1142 1143 1144 1145 1146 1147
		expandPlaceholders = ""
	}

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

1148 1149 1150 1151 1152
	// 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")
	// }
1153

C
Chris Beams 已提交
1154
	// don't publish the default jar for the root project
1155 1156 1157
	configurations.archives.artifacts.clear()

	dependencies { // for integration tests
1158
		testCompile(project(":spring-aop"))
1159
		testCompile(project(":spring-beans"))
1160
		testCompile(project(":spring-context"))
1161 1162
		testCompile(project(":spring-core"))
		testCompile(project(":spring-expression"))
1163
		testCompile(project(":spring-jdbc"))
1164
		testCompile(project(":spring-orm"))
1165
		testCompile(project(":spring-test"))
1166
		testCompile(project(":spring-tx"))
1167 1168
		testCompile(project(":spring-web"))
		testCompile(project(":spring-webmvc-portlet"))
1169
		testCompile("javax.servlet:javax.servlet-api:3.0.1")
1170 1171 1172 1173
		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}")
1174
		testCompile("org.hibernate:hibernate-core:${hibernate4Version}")
P
Phillip Webb 已提交
1175
		testCompile("org.hsqldb:hsqldb:${hsqldbVersion}")
1176 1177 1178
	}

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

1183 1184 1185 1186 1187
		dependsOn {
			subprojects.collect {
				it.tasks.getByName("jar")
			}
		}
1188 1189 1190
		options.memberLevel = org.gradle.external.javadoc.JavadocMemberLevel.PROTECTED
		options.author = true
		options.header = rootProject.description
P
Phillip Webb 已提交
1191
		options.overview = "src/api/overview.html"
1192
		options.stylesheetFile = file("src/api/stylesheet.css")
1193
		options.splitIndex = true
C
Chris Beams 已提交
1194
		options.links(project.ext.javadocLinks)
1195
		options.addStringOption('Xdoclint:none', '-quiet')
C
Chris Beams 已提交
1196

1197 1198 1199
		source subprojects.collect { project ->
			project.sourceSets.main.allJava
		}
C
Chris Beams 已提交
1200

P
Phillip Webb 已提交
1201
		maxMemory = "1024m"
C
Chris Beams 已提交
1202
		destinationDir = new File(buildDir, "api")
1203 1204 1205

		doFirst {
			classpath = files(
1206
				// ensure Servlet 3.x and Hibernate 4.x have precedence on the javadoc
1207 1208 1209 1210 1211 1212 1213 1214
				// 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 })
		}
1215 1216
	}

1217
	task docsZip(type: Zip, dependsOn: 'reference') {
P
Phillip Webb 已提交
1218 1219 1220
		group = "Distribution"
		baseName = "spring-framework"
		classifier = "docs"
1221 1222 1223
		description = "Builds -${classifier} archive containing api and reference " +
			"for deployment at http://static.springframework.org/spring-framework/docs."

P
Phillip Webb 已提交
1224 1225
		from("src/dist") {
			include "changelog.txt"
1226 1227 1228
		}

		from (api) {
1229
			into "javadoc-api"
1230 1231
		}

1232 1233
		from (reference) {
			into "spring-framework-reference"
1234 1235 1236 1237
		}
	}

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

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

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

P
Phillip Webb 已提交
1274 1275 1276 1277
		from("src/dist") {
			include "readme.txt"
			include "license.txt"
			include "notice.txt"
1278
			into "${baseDir}"
P
Phillip Webb 已提交
1279
			expand(copyright: new Date().format("yyyy"), version: project.version)
1280 1281 1282 1283 1284 1285 1286 1287 1288 1289
		}

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

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

1290
		moduleProjects.each { subproject ->
1291 1292
			into ("${baseDir}/libs") {
				from subproject.jar
P
Phillip Webb 已提交
1293
				if (subproject.tasks.findByPath("sourcesJar")) {
1294 1295
					from subproject.sourcesJar
				}
P
Phillip Webb 已提交
1296
				if (subproject.tasks.findByPath("javadocJar")) {
1297 1298 1299 1300 1301 1302
					from subproject.javadocJar
				}
			}
		}
	}

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

		doLast() {
1346
			def gradleOpts = "-XX:MaxMetaspaceSize=1024m -Xmx1024m"
1347
			def gradleBatOpts = "$gradleOpts -XX:MaxHeapSize=256m"
P
Phillip Webb 已提交
1348
			File wrapperFile = file("gradlew")
1349 1350
			wrapperFile.text = wrapperFile.text.replace("DEFAULT_JVM_OPTS=",
				"GRADLE_OPTS=\"$gradleOpts \$GRADLE_OPTS\"\nDEFAULT_JVM_OPTS=")
P
Phillip Webb 已提交
1351
			File wrapperBatFile = file("gradlew.bat")
1352 1353 1354 1355
			wrapperBatFile.text = wrapperBatFile.text.replace("set DEFAULT_JVM_OPTS=",
				"set GRADLE_OPTS=$gradleBatOpts %GRADLE_OPTS%\nset DEFAULT_JVM_OPTS=")
		}
	}
1356

1357
}
1358

S
Stephane Nicoll 已提交
1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373
configure([project(':spring-build-src'), project(':spring-framework-bom')]) {
	sonarRunner {
		skipProject = true
	}
}

configure(project(':spring-core')) {
	sonarRunner {
		sonarProperties {
			property "sonar.exclusions",
					"src/main/java/org/springframework/cglib/**/*,src/main/java/org/springframework/asm/**/*"
		}
	}
}

1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384
/*
 * 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-")) {
1385
			return version.replace('BUILD', qualifier)
1386 1387
		}
	}
1388
	return version
1389
}