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

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
	moduleProjects = subprojects.findAll {
22 23
		!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.7"
31
	ext.eclipselinkVersion   = "2.4.2"
32
	ext.ehcacheVersion       = "2.10.0"
33
	ext.ehcachejcacheVersion = "1.0.1"
34
	ext.ehcache3Version      = "3.0.0.m3"
35
	ext.ejbApiVersion        = "3.0"
36
	ext.fileuploadVersion    = "1.3.1"
37
	ext.freemarkerVersion    = "2.3.23"
B
Brian Clozel 已提交
38
	ext.groovyVersion        = "2.4.4"
39
	ext.gsonVersion          = "2.3.1"
40
	ext.hamcrestVersion      = "1.3"
41
	ext.hibernate3Version    = "3.6.10.Final"
42
	ext.hibernate4Version    = "4.3.11.Final"
43
	ext.hibernate5Version    = "5.0.1.Final"
44
	ext.hibval4Version       = "4.3.2.Final"
45
	ext.hibval5Version       = "5.2.1.Final"
46
	ext.hsqldbVersion        = "2.3.3"
47 48
	ext.httpclientVersion    = "4.5"
	ext.httpasyncVersion     = "4.1"
49
	ext.jackson2Version      = "2.6.2"
50 51
	ext.jsonassertVersion    = "1.2.3"
	ext.jsonpathVersion      = "2.0.0"
S
Sam Brannen 已提交
52
	ext.htmlunitVersion      = "2.18"
53
	ext.jasperreportsVersion = "6.1.1"
54
	ext.javamailVersion      = "1.5.4"
55
	ext.jettyVersion         = "9.3.3.v20150827"
56
	ext.jodaVersion          = "2.8.2"
57
	ext.jrubyVersion         = "1.7.22"  // JRuby 9.0.0.0 only supported through JSR-223 (StandardScriptFactory)
58
	ext.jtaVersion           = "1.2"
J
Juergen Hoeller 已提交
59
	ext.junitVersion         = "4.12"
60
	ext.nettyVersion         = "4.0.31.Final"
61
	ext.openjpaVersion       = "2.4.0"
62
	ext.poiVersion           = "3.12"
63
	ext.protobufVersion      = "2.6.1"
J
Juergen Hoeller 已提交
64
	ext.reactorVersion       = "2.0.5.RELEASE"
65
	ext.romeVersion          = "1.5.1"
66
	ext.seleniumVersion      = "2.47.1"
67
	ext.slf4jVersion         = "1.7.12"
68
	ext.snakeyamlVersion     = "1.16"
S
Stephane Nicoll 已提交
69
	ext.snifferVersion       = "1.14"
S
Sam Brannen 已提交
70
	ext.testngVersion        = "6.9.6"
71
	ext.tiles2Version        = "2.2.2"
72
	ext.tiles3Version        = "3.0.5"
73
	ext.tomcatVersion        = "8.0.26"
74
	ext.tyrusVersion         = "1.3.5"  // constrained by WebLogic 12.1.3 support
75
	ext.undertowVersion      = "1.3.0.CR2"
76
	ext.woodstoxVersion      = "5.0.1"
77
	ext.xmlunitVersion       = "1.6"
78
	ext.xstreamVersion       = "1.4.8"
79

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

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

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

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

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

107
	compileJava {
J
Juergen Hoeller 已提交
108 109
		sourceCompatibility = 1.6
		targetCompatibility = 1.6
110 111 112
	}

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

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

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

134
	dependencies {
135 136 137
		testCompile("junit:junit:${junitVersion}") {
			exclude group:'org.hamcrest', module:'hamcrest-core'
		}
138
		testCompile("org.mockito:mockito-core:1.10.19") {
139 140
			exclude group:'org.hamcrest', module:'hamcrest-core'
		}
141
		testCompile("org.hamcrest:hamcrest-all:${hamcrestVersion}")
S
Stephane Nicoll 已提交
142 143

		sniffer("org.codehaus.mojo:animal-sniffer-ant-tasks:${snifferVersion}")
144
		javaApiSignature("org.codehaus.mojo.signature:java16:1.1@signature")  // API level from JDK 6 update 18
S
Stephane Nicoll 已提交
145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163
	}

	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
164

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

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

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

S
Stephane Nicoll 已提交
212 213 214 215 216 217 218 219 220 221 222 223 224 225
	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.*"
		}
	}

226
	jar {
P
Phillip Webb 已提交
227 228 229 230
		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
231 232 233 234 235

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

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

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

		// 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
253 254
	}

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

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

	artifacts {
		archives sourcesJar
		archives javadocJar
	}
C
Chris Beams 已提交
270 271
}

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

	dependencies {
		compile gradleApi()
R
Rob Winch 已提交
278
		compile localGroovy()
279 280 281 282 283
	}

	configurations.archives.artifacts.clear()
}

P
Phillip Webb 已提交
284 285
project("spring-core") {
	description = "Spring Core"
286

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

	configurations {
		jarjar
		cglib
297
		objenesis
298 299 300 301 302 303 304 305 306 307 308 309 310 311 312
	}

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

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

342
	dependencies {
343
		cglib("cglib:cglib:${cglibVersion}@jar")
344
		objenesis("org.objenesis:objenesis:${objenesisVersion}@jar")
345
		jarjar("com.googlecode.jarjar:jarjar:1.3")
346

P
Phillip Webb 已提交
347
		compile(files(cglibRepackJar))
348
		compile(files(objenesisRepackJar))
349 350
		compile("commons-logging:commons-logging:1.2")
		optional("commons-codec:commons-codec:1.10")
351
		optional("org.aspectj:aspectjweaver:${aspectjVersion}")
352
		optional("net.sf.jopt-simple:jopt-simple:4.9")
353
		optional("log4j:log4j:1.2.17")
354
		testCompile("org.apache.tomcat.embed:tomcat-embed-core:${tomcatVersion}")
355
		testCompile("xmlunit:xmlunit:${xmlunitVersion}")
356
		testCompile("com.fasterxml.woodstox:woodstox-core:${woodstoxVersion}") {
P
Phillip Webb 已提交
357 358
			exclude group: "stax", module: "stax-api"
		}
359 360 361
	}

	jar {
362
		// inline repackaged cglib classes directly into the spring-core jar
363 364
		dependsOn cglibRepackJar
		from(zipTree(cglibRepackJar.archivePath)) {
P
Phillip Webb 已提交
365
			include "org/springframework/cglib/**"
366
		}
367 368 369 370 371

		dependsOn objenesisRepackJar
		from(zipTree(objenesisRepackJar.archivePath)) {
			include "org/springframework/objenesis/**"
		}
372
	}
C
Chris Beams 已提交
373 374
}

P
Phillip Webb 已提交
375 376
project("spring-beans") {
	description = "Spring Beans"
377

378
	dependencies {
379 380
		compile(project(":spring-core"))
		compile(files(project(":spring-core").cglibRepackJar))
381
		optional("javax.inject:javax.inject:1")
382
		optional("javax.el:javax.el-api:2.2.5")
383
		optional("org.yaml:snakeyaml:${snakeyamlVersion}")
384
		testCompile("log4j:log4j:1.2.17")
385
		testCompile("org.apache.tomcat.embed:tomcat-embed-core:${tomcatVersion}")
S
Stephane Nicoll 已提交
386
    }
C
Chris Beams 已提交
387 388
}

389 390
project("spring-beans-groovy") {
	description "Groovy Bean Definitions"
J
Juergen Hoeller 已提交
391
	merge.into = project(":spring-beans")
392
	apply plugin: "groovy"
J
Juergen Hoeller 已提交
393 394 395

	dependencies {
		compile(project(":spring-core"))
396
		optional("org.codehaus.groovy:groovy-all:${groovyVersion}")
J
Juergen Hoeller 已提交
397 398 399 400 401 402 403
	}

	// this module's Java and Groovy sources need to be compiled together
	compileJava.enabled=false
	sourceSets {
		main {
			groovy {
404
				srcDir "src/main/java"
J
Juergen Hoeller 已提交
405 406 407
			}
		}
	}
408 409

	compileGroovy {
J
Juergen Hoeller 已提交
410 411
		sourceCompatibility = 1.6
		targetCompatibility = 1.6
412
	}
J
Juergen Hoeller 已提交
413 414
}

P
Phillip Webb 已提交
415 416
project("spring-aop") {
	description = "Spring AOP"
417

418
	dependencies {
419
		compile(project(":spring-beans"))
420 421
		compile(project(":spring-core"))
		compile(files(project(":spring-core").cglibRepackJar))
422
		compile(files(project(":spring-core").objenesisRepackJar))
423
		compile("aopalliance:aopalliance:1.0")
424
		optional("org.aspectj:aspectjweaver:${aspectjVersion}")
425
		optional("commons-pool:commons-pool:1.6")
426
		optional("org.apache.commons:commons-pool2:2.4.2")
427
		optional("com.jamonapi:jamon:2.81")
428
	}
C
Chris Beams 已提交
429 430
}

P
Phillip Webb 已提交
431 432
project("spring-expression") {
	description = "Spring Expression Language (SpEL)"
433

434
	dependencies {
435
		compile(project(":spring-core"))
436
	}
C
Chris Beams 已提交
437 438
}

P
Phillip Webb 已提交
439 440
project("spring-instrument") {
	description = "Spring Instrument"
441

442
	jar {
P
Phillip Webb 已提交
443 444
		manifest.attributes["Premain-Class"] =
			"org.springframework.instrument.InstrumentationSavingAgent"
445 446
		manifest.attributes["Agent-Class"] =
			"org.springframework.instrument.InstrumentationSavingAgent"
447 448 449
		manifest.attributes["Can-Redefine-Classes"] = "true"
		manifest.attributes["Can-Retransform-Classes"] = "true"
		manifest.attributes["Can-Set-Native-Method-Prefix"] = "false"
450
	}
C
Chris Beams 已提交
451 452
}

P
Phillip Webb 已提交
453 454
project("spring-instrument-tomcat") {
	description = "Spring Instrument Tomcat"
455

456
	dependencies {
457
		provided("org.apache.tomcat:catalina:6.0.16")
458
	}
459 460 461 462

	jar {
		exclude("org/apache/**")  // exclude the mock used to bridge between pre-7.0.63 and 7.0.63+
	}
C
Chris Beams 已提交
463 464
}

P
Phillip Webb 已提交
465 466
project("spring-context") {
	description = "Spring Context"
467
	apply plugin: "groovy"
468

469
	dependencies {
470 471 472 473 474
		compile(project(":spring-aop"))
		compile(project(":spring-beans"))
		compile(project(":spring-expression"))
		compile(project(":spring-core"))
		compile(files(project(":spring-core").cglibRepackJar))
475
		optional(project(":spring-instrument"))
476
		optional("javax.inject:javax.inject:1")
477
		optional("javax.ejb:ejb-api:${ejbApiVersion}")
478
		optional("javax.enterprise.concurrent:javax.enterprise.concurrent-api:1.0")
479
		optional("javax.money:money-api:1.0")
480
		optional("org.eclipse.persistence:javax.persistence:2.0.0")
481
		optional("javax.validation:validation-api:1.0.0.GA")
482
		optional("org.hibernate:hibernate-validator:${hibval4Version}")
483 484
		optional("joda-time:joda-time:${jodaVersion}")
		optional("org.aspectj:aspectjweaver:${aspectjVersion}")
J
Juergen Hoeller 已提交
485
		optional("org.codehaus.groovy:groovy-all:${groovyVersion}")
486
		optional("org.beanshell:bsh:2.0b4")
487
		optional("org.jruby:jruby:${jrubyVersion}")
488
		testCompile("javax.inject:javax.inject-tck:1")
489
		testCompile("org.javamoney:moneta:1.0")
490
		testCompile("commons-dbcp:commons-dbcp:1.4")
491
		testCompile("org.apache.commons:commons-pool2:2.4.2")
492
		testCompile("org.slf4j:slf4j-api:${slf4jVersion}")
493
	}
494 495 496 497 498 499 500 501 502
}

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

	dependencies {
		compile(project(":spring-beans"))
		compile(project(":spring-core"))
		compile(project(":spring-context"))
503
		optional(project(":spring-oxm"))
R
Rossen Stoyanchev 已提交
504
		optional("io.projectreactor:reactor-core:${reactorVersion}")
S
Stephane Maldini 已提交
505
		optional("io.projectreactor:reactor-net:${reactorVersion}") {
506 507
			exclude group: "io.netty", module: "netty-all"
		}
S
Stephane Maldini 已提交
508
		optional "io.netty:netty-all:$nettyVersion"
B
Brian Clozel 已提交
509
		optional("org.eclipse.jetty.websocket:websocket-server:${jettyVersion}") {
B
Brian Clozel 已提交
510 511
			exclude group: "javax.servlet", module: "javax.servlet-api"
		}
B
Brian Clozel 已提交
512
		optional("org.eclipse.jetty.websocket:websocket-client:${jettyVersion}")
513
		optional("com.fasterxml.jackson.core:jackson-databind:${jackson2Version}")
514
		testCompile(project(":spring-test"))
515
		testCompile("javax.inject:javax.inject-tck:1")
516
		testCompile("javax.servlet:javax.servlet-api:3.1.0")
517
		testCompile("javax.validation:validation-api:1.0.0.GA")
518
		testCompile("com.thoughtworks.xstream:xstream:${xstreamVersion}")
519 520 521 522 523
		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 已提交
524
		testCompile("org.eclipse.jetty:jetty-webapp:${jettyVersion}") {
B
Brian Clozel 已提交
525
			exclude group: "javax.servlet", module: "javax.servlet-api"
526
		}
527 528 529
		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}")
530
		testCompile("io.netty:netty-all:${nettyVersion}")
531
		testCompile("commons-dbcp:commons-dbcp:1.4")
532
		testCompile("log4j:log4j:1.2.17")
533
		testCompile("org.slf4j:slf4j-jcl:${slf4jVersion}")
534
		testCompile("xmlunit:xmlunit:${xmlunitVersion}")
535
	}
C
Chris Beams 已提交
536 537
}

P
Phillip Webb 已提交
538 539
project("spring-tx") {
	description = "Spring Transaction"
540

541
	dependencies {
542 543
		compile(project(":spring-beans"))
		compile(project(":spring-core"))
544
		optional(project(":spring-aop"))
545
		optional(project(":spring-context"))  // for JCA, @EnableTransactionManagement
546
		optional("aopalliance:aopalliance:1.0")
547
		optional("javax.transaction:javax.transaction-api:${jtaVersion}")
548
		optional("javax.resource:connector-api:1.5")
549
		optional("javax.ejb:ejb-api:${ejbApiVersion}")
550
		optional("com.ibm.websphere:uow:6.0.2.17")
551
		testCompile("org.aspectj:aspectjweaver:${aspectjVersion}")
552
		testCompile("org.eclipse.persistence:javax.persistence:2.0.0")
553
	}
C
Chris Beams 已提交
554 555
}

P
Phillip Webb 已提交
556 557 558
project("spring-oxm") {
	description = "Spring Object/XML Marshalling"
	apply from: "oxm.gradle"
559

P
Phillip Webb 已提交
560
	compileTestJava {
561 562
		// necessary to avoid java.lang.VerifyError on jibx compilation
		// see http://jira.codehaus.org/browse/JIBX-465
J
Juergen Hoeller 已提交
563 564
		sourceCompatibility = 1.6
		targetCompatibility = 1.6
565 566
	}

567
	if (!System.getProperty("java.version").contains("1.8.")) {
568 569 570 571
		// necessary because castor and xjc tasks cannot find the JDK's compiler on JDK 9
		compileTestJava.enabled = false
	}

572
	dependencies {
573 574
		compile(project(":spring-beans"))
		compile(project(":spring-core"))
575
		optional("org.codehaus.castor:castor-xml:1.3.3")  {
576
			exclude group: 'stax', module: 'stax-api'
577
			exclude group: "org.springframework", module: "spring-context"
578 579 580 581 582 583 584 585
		}
		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'
		}
586
		optional("org.jibx:jibx-run:1.2.6")
587
		testCompile(project(":spring-context"))
588
		testCompile("xmlunit:xmlunit:${xmlunitVersion}")
589 590
		testCompile("xpp3:xpp3:1.1.4c")
		testCompile("org.codehaus.jettison:jettison:1.3.7") {
591 592
			exclude group: 'stax', module: 'stax-api'
		}
593 594 595 596 597
		if (compileTestJava.enabled) {
			testCompile(files(genCastor.classesDir).builtBy(genCastor))
			testCompile(files(genJaxb.classesDir).builtBy(genJaxb))
			testCompile(files(genXmlbeans.classesDir).builtBy(genXmlbeans))
		}
598
	}
C
Chris Beams 已提交
599 600
}

P
Phillip Webb 已提交
601 602
project("spring-jms") {
	description = "Spring JMS"
603

604
	dependencies {
605 606 607 608
		compile(project(":spring-core"))
		compile(project(":spring-beans"))
		compile(project(":spring-aop"))
		compile(project(":spring-context"))
609
		compile(project(":spring-messaging"))
610
		compile(project(":spring-tx"))
611
		provided("javax.jms:jms-api:1.1-rev-1")
612 613
		optional(project(":spring-oxm"))
		optional("aopalliance:aopalliance:1.0")
614
		optional("javax.transaction:javax.transaction-api:${jtaVersion}")
615
		optional("javax.resource:connector-api:1.5")
616
		optional("com.fasterxml.jackson.core:jackson-databind:${jackson2Version}")
617
	}
C
Chris Beams 已提交
618 619
}

P
Phillip Webb 已提交
620 621
project("spring-jdbc") {
	description = "Spring JDBC"
622

623
	dependencies {
624
		compile(project(":spring-beans"))
625
		compile(project(":spring-core"))
626
		compile(project(":spring-tx"))
627
		optional(project(":spring-context"))  // for JndiDataSourceLookup
628
		optional("javax.transaction:javax.transaction-api:${jtaVersion}")
629
		optional("com.mchange:c3p0:0.9.5.1")
P
Phillip Webb 已提交
630
		optional("org.hsqldb:hsqldb:${hsqldbVersion}")
631
		optional("com.h2database:h2:1.4.189")
632 633
		optional("org.apache.derby:derby:10.11.1.1")
		optional("org.apache.derby:derbyclient:10.11.1.1")
634
	}
C
Chris Beams 已提交
635 636
}

P
Phillip Webb 已提交
637 638
project("spring-context-support") {
	description = "Spring Context Support"
639

640
	dependencies {
641 642 643
		compile(project(":spring-core"))
		compile(project(":spring-beans"))
		compile(project(":spring-context"))
644 645
		optional(project(":spring-jdbc"))  // for Quartz support
		optional(project(":spring-tx"))  // for Quartz support
646
		optional("javax.mail:javax.mail-api:${javamailVersion}")
S
Stephane Nicoll 已提交
647
		optional("javax.cache:cache-api:1.0.0")
648
		optional("com.google.guava:guava:18.0")
649
		optional("net.sf.ehcache:ehcache:${ehcacheVersion}")
650
		optional("org.quartz-scheduler:quartz:2.2.1")
651
		optional("org.codehaus.fabric3.api:commonj:1.1.0")
652
		optional("org.apache.velocity:velocity:1.7")
653
		optional("org.freemarker:freemarker:${freemarkerVersion}")
654
		optional("com.lowagie:itext:2.1.7")
655
		optional("net.sf.jasperreports:jasperreports:$jasperreportsVersion") {
656 657 658
			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"
659 660
			exclude group: "org.olap4j", module: "olap4j"
			exclude group: "xml-apis", module: "xml-apis"
A
Andy Wilkinson 已提交
661
			exclude group: "org.springframework", module: "spring-context"
662
		}
663
		testCompile(project(":spring-context"))
664
		testCompile("org.apache.poi:poi:${poiVersion}")
665 666
		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 已提交
667
		testCompile("org.hsqldb:hsqldb:${hsqldbVersion}")
668
		testCompile("org.slf4j:slf4j-api:${slf4jVersion}")
669
		testRuntime("com.sun.mail:javax.mail:${javamailVersion}")
670
		testRuntime("org.ehcache:jcache:${ehcachejcacheVersion}")
671
	}
C
Chris Beams 已提交
672 673
}

P
Phillip Webb 已提交
674 675
project("spring-web") {
	description = "Spring Web"
676
	apply plugin: "groovy"
677

678 679 680 681 682 683 684 685 686 687 688 689 690 691 692
	// 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"
	}

693
	dependencies {
694 695
		compile(project(":spring-aop"))  // for JaxWsPortProxyFactoryBean
		compile(project(":spring-beans"))  // for MultipartFilter
696
		compile(project(":spring-context"))
697
		compile(project(":spring-core"))
698
		provided("javax.servlet:javax.servlet-api:3.0.1")
699
		optional(project(":spring-oxm"))  // for MarshallingHttpMessageConverter
700
		optional("javax.servlet.jsp:javax.servlet.jsp-api:2.2.1")
701
		optional("javax.portlet:portlet-api:2.0")
702
		optional("javax.el:javax.el-api:2.2.5")
703
		optional("javax.faces:javax.faces-api:2.2")
704
		optional("javax.validation:validation-api:1.0.0.GA")
705
		optional("aopalliance:aopalliance:1.0")
706
		optional("org.codehaus.groovy:groovy-all:${groovyVersion}")
707
		optional("com.caucho:hessian:4.0.38")
708 709 710
		optional("commons-fileupload:commons-fileupload:${fileuploadVersion}")
		optional("org.apache.httpcomponents:httpclient:${httpclientVersion}")
		optional("org.apache.httpcomponents:httpasyncclient:${httpasyncVersion}")
711
		optional("io.netty:netty-all:${nettyVersion}")
712
		optional("com.squareup.okhttp:okhttp:2.5.0")
713
		optional("com.fasterxml.jackson.core:jackson-databind:${jackson2Version}")
714
		optional("com.fasterxml.jackson.dataformat:jackson-dataformat-xml:${jackson2Version}")
R
Roy Clarkson 已提交
715
		optional("com.google.code.gson:gson:${gsonVersion}")
716
		optional("com.rometools:rome:${romeVersion}")
B
Brian Clozel 已提交
717
		optional("org.eclipse.jetty:jetty-servlet:${jettyVersion}") {
B
Brian Clozel 已提交
718
			exclude group: "javax.servlet", module: "javax.servlet-api"
719
		}
B
Brian Clozel 已提交
720
		optional("org.eclipse.jetty:jetty-server:${jettyVersion}") {
B
Brian Clozel 已提交
721
			exclude group: "javax.servlet", module: "javax.servlet-api"
722
		}
723
		optional("log4j:log4j:1.2.17")
R
Polish  
Rossen Stoyanchev 已提交
724 725
		optional("com.googlecode.protobuf-java-format:protobuf-java-format:1.2")
		optional("com.google.protobuf:protobuf-java:${protobufVersion}")
726
		optional("javax.mail:javax.mail-api:${javamailVersion}")
727
		testCompile(project(":spring-context-support"))  // for JafMediaTypeFactory
728
		testCompile("xmlunit:xmlunit:${xmlunitVersion}")
729
		testCompile("org.slf4j:slf4j-jcl:${slf4jVersion}")
730 731 732
		testCompile("org.apache.taglibs:taglibs-standard-jstlel:1.2.1") {
			exclude group: "org.apache.taglibs", module: "taglibs-standard-spec"
		}
733
		testCompile("com.fasterxml.jackson.datatype:jackson-datatype-joda:${jackson2Version}")
734
		testCompile("com.fasterxml.jackson.datatype:jackson-datatype-jdk7:${jackson2Version}")
735
		testCompile("com.fasterxml.jackson.datatype:jackson-datatype-jdk8:${jackson2Version}")
736
		testRuntime("com.sun.mail:javax.mail:${javamailVersion}")
737
	}
C
Chris Beams 已提交
738 739
}

740
project("spring-websocket") {
741
	description = "Spring WebSocket"
742 743 744 745 746

	dependencies {
		compile(project(":spring-core"))
		compile(project(":spring-context"))
		compile(project(":spring-web"))
747
		optional(project(":spring-messaging"))
748
		optional(project(":spring-webmvc"))
749
		optional("javax.servlet:javax.servlet-api:3.1.0")
750
		optional("javax.websocket:javax.websocket-api:1.0")
751
		optional("org.apache.tomcat:tomcat-websocket:${tomcatVersion}") {
752 753 754
			exclude group: "org.apache.tomcat", module: "tomcat-websocket-api"
			exclude group: "org.apache.tomcat", module: "tomcat-servlet-api"
		}
755 756 757 758
		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 已提交
759
		optional("org.eclipse.jetty:jetty-webapp:${jettyVersion}") {
B
Brian Clozel 已提交
760 761
			exclude group: "javax.servlet", module: "javax.servlet"
		}
B
Brian Clozel 已提交
762
		optional("org.eclipse.jetty.websocket:websocket-server:${jettyVersion}") {
B
Brian Clozel 已提交
763
			exclude group: "javax.servlet", module: "javax.servlet"
764
		}
B
Brian Clozel 已提交
765
		optional("org.eclipse.jetty.websocket:websocket-client:${jettyVersion}")
R
Rossen Stoyanchev 已提交
766
		optional("org.eclipse.jetty:jetty-client:${jettyVersion}")
767 768
		optional("io.undertow:undertow-core:${undertowVersion}")
		optional("io.undertow:undertow-servlet:${undertowVersion}") {
769
			exclude group: "org.jboss.spec.javax.servlet", module: "jboss-servlet-api_3.1_spec"
770
			exclude group: "org.jboss.spec.javax.annotation", module: "jboss-annotations-api_1.2_spec"
771
		}
772
		optional("io.undertow:undertow-websockets-jsr:${undertowVersion}") {
773
			exclude group: "org.jboss.spec.javax.websocket", module: "jboss-websocket-api_1.1_spec"
774
		}
775
		optional("com.fasterxml.jackson.core:jackson-databind:${jackson2Version}")
776 777 778
		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}")
S
Stephane Maldini 已提交
779
		testCompile("io.projectreactor:reactor-net:${reactorVersion}")
780
		testCompile("io.netty:netty-all:${nettyVersion}")
781 782
		testCompile("log4j:log4j:1.2.17")
		testCompile("org.slf4j:slf4j-jcl:${slf4jVersion}")
783 784 785
	}
}

P
Phillip Webb 已提交
786 787
project("spring-orm") {
	description = "Spring Object/Relational Mapping"
788

789
	dependencies {
790 791 792 793 794 795 796 797
		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")
798
		optional("org.eclipse.persistence:javax.persistence:2.0.5")
799 800
		optional("org.eclipse.persistence:org.eclipse.persistence.core:${eclipselinkVersion}")
		optional("org.eclipse.persistence:org.eclipse.persistence.jpa:${eclipselinkVersion}") {
801 802 803 804 805 806 807 808 809
			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'
		}
810
		optional("org.apache.openjpa:openjpa:${openjpaVersion}") {
811 812 813 814 815
			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'
		}
816
		optional("javax.jdo:jdo-api:3.1") {
817 818
			exclude group: 'javax.transaction', module: 'transaction-api'
		}
819
		optional("javax.servlet:javax.servlet-api:3.0.1")
820
		testCompile("commons-dbcp:commons-dbcp:1.4")
S
Sam Brannen 已提交
821
		testCompile("org.aspectj:aspectjweaver:${aspectjVersion}")
P
Phillip Webb 已提交
822
		testCompile("org.hsqldb:hsqldb:${hsqldbVersion}")
823
		testCompile("org.slf4j:slf4j-jcl:${slf4jVersion}")
824
	}
C
Chris Beams 已提交
825 826
}

P
Phillip Webb 已提交
827 828
project("spring-orm-hibernate4") {
	description = "Spring Object/Relational Mapping - Hibernate 4 support"
829
	merge.into = project(":spring-orm")
830

831
	dependencies {
832
		provided(project(":spring-jdbc"))
833
		provided(project(":spring-tx"))
834
		optional(project(":spring-web"))
835 836
		optional("org.hibernate:hibernate-core:${hibernate4Version}")
		optional("org.hibernate:hibernate-entitymanager:${hibernate4Version}")
837
		optional("javax.servlet:javax.servlet-api:3.0.1")
838
        optional("aopalliance:aopalliance:1.0")
839
		testCompile("javax.validation:validation-api:1.1.0.GA")
840
		testCompile("org.hibernate:hibernate-validator:${hibval5Version}")
841 842
		testCompile("javax.el:javax.el-api:2.2.5")
		testCompile("org.glassfish.web:javax.el:2.2.6")
843
	}
844 845
}

846 847 848 849 850 851 852 853
project("spring-orm-hibernate5") {
	description = "Spring Object/Relational Mapping - Hibernate 5 support"
	merge.into = project(":spring-orm")

	dependencies {
		provided(project(":spring-jdbc"))
		provided(project(":spring-tx"))
		optional(project(":spring-web"))
854 855
		optional("org.hibernate:hibernate-core:${hibernate5Version}")
		optional("org.hibernate:hibernate-entitymanager:${hibernate5Version}")
856 857 858 859 860
		optional("javax.servlet:javax.servlet-api:3.0.1")
		optional("aopalliance:aopalliance:1.0")
	}
}

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

864
	dependencies {
865 866
		compile(project(":spring-beans"))
		compile(project(":spring-context"))
867
		compile(project(":spring-core"))
868
		compile(files(project(":spring-core").objenesisRepackJar))
869 870
		compile(project(":spring-expression"))
		compile(project(":spring-web"))
871
		provided("javax.servlet:javax.servlet-api:3.0.1")
872 873
		optional(project(":spring-context-support"))  // for Velocity support
		optional(project(":spring-oxm"))  // for MarshallingView
874 875
		optional("javax.servlet.jsp:javax.servlet.jsp-api:2.2.1")
		optional("javax.servlet.jsp.jstl:javax.servlet.jsp.jstl-api:1.2.1")
876
		optional("net.sourceforge.jexcelapi:jxl:2.6.12")
877 878
		optional("org.apache.poi:poi:${poiVersion}")
		optional("org.apache.poi:poi-ooxml:${poiVersion}")
879 880
		optional("org.apache.velocity:velocity:1.7")
		optional("velocity-tools:velocity-tools-view:1.4")
881
		optional("org.freemarker:freemarker:${freemarkerVersion}")
882
		optional("org.codehaus.groovy:groovy-all:${groovyVersion}")
883
		optional("com.lowagie:itext:2.1.7")
884
		optional("net.sf.jasperreports:jasperreports:$jasperreportsVersion") {
885 886 887
			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"
888 889
			exclude group: "org.olap4j", module: "olap4j"
			exclude group: "xml-apis", module: "xml-apis"
A
Andy Wilkinson 已提交
890
			exclude group: "org.springframework", module: "spring-context"
891 892
		}
		optional("com.fasterxml.jackson.core:jackson-databind:${jackson2Version}")
893
		optional("com.fasterxml.jackson.dataformat:jackson-dataformat-xml:${jackson2Version}")
894
		optional("com.rometools:rome:${romeVersion}")
895 896 897
		optional("javax.el:javax.el-api:2.2.5")
		optional("org.apache.tiles:tiles-api:${tiles3Version}")
		optional("org.apache.tiles:tiles-core:${tiles3Version}") {
898 899
			exclude group: "org.slf4j", module: "jcl-over-slf4j"
		}
900
		optional("org.apache.tiles:tiles-servlet:${tiles3Version}") {
901 902
			exclude group: "org.slf4j", module: "jcl-over-slf4j"
		}
903
		optional("org.apache.tiles:tiles-jsp:${tiles3Version}") {
904 905
			exclude group: "org.slf4j", module: "jcl-over-slf4j"
		}
906
		optional("org.apache.tiles:tiles-el:${tiles3Version}") {
907 908
			exclude group: "org.slf4j", module: "jcl-over-slf4j"
		}
909
		optional("org.apache.tiles:tiles-extras:${tiles3Version}") {
910 911 912
			exclude group: "org.slf4j", module: "jcl-over-slf4j"
			exclude group: "org.springframework", module: "spring-web"
		}
913
		optional 'org.webjars:webjars-locator:0.28'
914 915
		testCompile(project(":spring-aop"))
		testCompile("rhino:js:1.7R1")
916
		testCompile("xmlunit:xmlunit:${xmlunitVersion}")
917
		testCompile("dom4j:dom4j:1.6.1") {
P
Phillip Webb 已提交
918
			exclude group: "xml-apis", module: "xml-apis"
919 920
		}
		testCompile("jaxen:jaxen:1.1.1") {
P
Phillip Webb 已提交
921 922 923
			exclude group: "xml-apis", module: "xml-apis"
			exclude group: "xom", module: "xom"
			exclude group: "xerces", module: "xercesImpl"
924
		}
B
Brian Clozel 已提交
925
		testCompile("org.eclipse.jetty:jetty-servlet:${jettyVersion}") {
B
Brian Clozel 已提交
926
			exclude group: "javax.servlet", module: "javax.servlet"
927
		}
B
Brian Clozel 已提交
928
		testCompile("org.eclipse.jetty:jetty-server:${jettyVersion}") {
B
Brian Clozel 已提交
929
			exclude group: "javax.servlet", module: "javax.servlet"
930 931
		}
		testCompile("javax.validation:validation-api:1.0.0.GA")
932 933 934
		testCompile("org.hibernate:hibernate-validator:${hibval4Version}")
		testCompile("org.apache.httpcomponents:httpclient:${httpclientVersion}")
		testCompile("commons-fileupload:commons-fileupload:${fileuploadVersion}")
935
		testCompile("commons-io:commons-io:1.3")
936
		testCompile("joda-time:joda-time:${jodaVersion}")
937
		testCompile("org.slf4j:slf4j-jcl:${slf4jVersion}")
938 939
		testCompile("org.jruby:jruby:${jrubyVersion}")
		testCompile("org.python:jython-standalone:2.5.3")
940
		testCompile("org.webjars:underscorejs:1.8.3")
941
	}
C
Chris Beams 已提交
942 943
}

944 945
project("spring-webmvc-tiles2") {
	description = "Spring Framework Tiles2 Integration"
946
	merge.into = project(":spring-webmvc")
947

948
	dependencies {
949 950
		provided(project(":spring-context"))
		provided(project(":spring-web"))
951
		provided("javax.servlet:javax.servlet-api:3.0.1")
952 953
		optional("javax.servlet.jsp:javax.servlet.jsp-api:2.2.1")
		optional("javax.servlet.jsp.jstl:javax.servlet.jsp.jstl-api:1.2.1")
954 955
		optional("org.apache.tiles:tiles-api:${tiles2Version}")
		optional("org.apache.tiles:tiles-core:${tiles2Version}") {
P
Phillip Webb 已提交
956
			exclude group: "org.slf4j", module: "jcl-over-slf4j"
957
		}
958
		optional("org.apache.tiles:tiles-servlet:${tiles2Version}") {
P
Phillip Webb 已提交
959
			exclude group: "org.slf4j", module: "jcl-over-slf4j"
960
		}
961
		optional("org.apache.tiles:tiles-jsp:${tiles2Version}") {
P
Phillip Webb 已提交
962
			exclude group: "org.slf4j", module: "jcl-over-slf4j"
963
		}
964
		optional("org.apache.tiles:tiles-el:${tiles2Version}") {
965
			exclude group: "org.slf4j", module: "jcl-over-slf4j"
966
		}
967
		optional("org.apache.tiles:tiles-extras:${tiles2Version}") {
P
Phillip Webb 已提交
968
			exclude group: "org.slf4j", module: "jcl-over-slf4j"
969
			exclude group: "org.apache.velocity", module: "velocity-tools"
970
			exclude group: "org.springframework", module: "spring-web"
971
		}
972
		testCompile("org.slf4j:slf4j-jcl:${slf4jVersion}")
973
	}
974 975
}

P
Phillip Webb 已提交
976 977
project("spring-webmvc-portlet") {
	description = "Spring Web Portlet"
978

979
	dependencies {
980 981
		compile(project(":spring-beans"))
		compile(project(":spring-context"))
982
		compile(project(":spring-core"))
983 984
		compile(project(":spring-web"))
		compile(project(":spring-webmvc"))
985 986
		provided("javax.servlet:javax.servlet-api:3.0.1")
		provided("javax.portlet:portlet-api:2.0")
987
		optional("commons-fileupload:commons-fileupload:${fileuploadVersion}")
988
	}
C
Chris Beams 已提交
989 990
}

P
Phillip Webb 已提交
991 992
project("spring-test") {
	description = "Spring TestContext Framework"
993

994
	dependencies {
995
		compile(project(":spring-core"))
996 997 998 999 1000 1001 1002
		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 已提交
1003
		optional(project(":spring-webmvc-portlet"))
1004
		optional("junit:junit:${junitVersion}")
1005
		optional("org.testng:testng:${testngVersion}")
1006
		optional("javax.inject:javax.inject:1")
1007
		optional("javax.servlet:javax.servlet-api:3.0.1")
1008 1009 1010 1011 1012
		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"
		}
1013
		optional("javax.portlet:portlet-api:2.0")
1014
		optional("javax.el:javax.el-api:2.2.5")
1015
		optional("org.aspectj:aspectjweaver:${aspectjVersion}")
S
Sam Brannen 已提交
1016
		optional("org.codehaus.groovy:groovy-all:${groovyVersion}")
1017 1018 1019
		optional("org.hamcrest:hamcrest-core:${hamcrestVersion}")
		optional("com.jayway.jsonpath:json-path:${jsonpathVersion}")
		optional("org.skyscreamer:jsonassert:${jsonassertVersion}")
1020
		optional("xmlunit:xmlunit:${xmlunitVersion}")
1021 1022
		optional("net.sourceforge.htmlunit:htmlunit:${htmlunitVersion}")
		optional("org.seleniumhq.selenium:selenium-htmlunit-driver:${seleniumVersion}")
1023 1024
		testCompile(project(":spring-context-support"))
		testCompile(project(":spring-oxm"))
1025
		testCompile("javax.mail:javax.mail-api:${javamailVersion}")
1026
		testCompile("javax.ejb:ejb-api:${ejbApiVersion}")
1027 1028
		testCompile("org.hibernate:hibernate-core:${hibernate4Version}")
		testCompile("org.hibernate:hibernate-entitymanager:${hibernate4Version}")
1029
		testCompile("org.hibernate:hibernate-validator:${hibval5Version}")
1030
		testCompile("com.thoughtworks.xstream:xstream:${xstreamVersion}")
1031
		testCompile("com.fasterxml.jackson.core:jackson-databind:${jackson2Version}")
1032
		testCompile("com.rometools:rome:${romeVersion}")
1033 1034
		testCompile("org.apache.tiles:tiles-api:${tiles3Version}")
		testCompile("org.apache.tiles:tiles-core:${tiles3Version}") {
1035 1036
			exclude group: "org.slf4j", module: "jcl-over-slf4j"
		}
1037
		testCompile("org.apache.tiles:tiles-servlet:${tiles3Version}") {
1038 1039
			exclude group: "org.slf4j", module: "jcl-over-slf4j"
		}
1040
		testCompile("org.hsqldb:hsqldb:${hsqldbVersion}")
S
Sam Brannen 已提交
1041
		testCompile("org.slf4j:slf4j-jcl:${slf4jVersion}")
1042
		testCompile("org.apache.httpcomponents:httpclient:${httpclientVersion}")
1043 1044
		testCompile("javax.cache:cache-api:1.0.0")
		testRuntime("org.ehcache:ehcache:${ehcache3Version}")
1045
	}
1046 1047

	task testNG(type: Test) {
1048
		description = 'Runs TestNG tests.'
1049
		useTestNG()
1050
		scanForTestClasses = false
1051 1052
		include(["**/testng/**/*Tests.class", "**/testng/**/*Test.class"])
		// Show STD_OUT & STD_ERR of the test JVM(s) on the console:
1053
		// testLogging.showStandardStreams = true
1054
		// forkEvery 1
1055 1056 1057
	}

	test {
1058
		description = 'Runs JUnit tests.'
1059 1060
		dependsOn testNG
		useJUnit()
1061
		exclude "**/testng/**/*.*"
1062
	}
1063 1064

	task aggregateTestReports(type: TestReport) {
1065
		description = 'Aggregates JUnit and TestNG test reports.'
1066 1067 1068 1069 1070
		destinationDir = test.reports.html.destination
		reportOn test, testNG
	}

	check.dependsOn aggregateTestReports
C
Chris Beams 已提交
1071 1072
}

P
Phillip Webb 已提交
1073 1074 1075
project("spring-aspects") {
	description = "Spring Aspects"
	apply from: "aspects.gradle"
1076

1077
	dependencies {
1078
		aspects(project(":spring-orm"))
1079
		ajc("org.aspectj:aspectjtools:1.9.0.BETA-2")  // for the ability to build on JDK 9, not exposed in the POMs yet
J
Juergen Hoeller 已提交
1080
		rt("org.aspectj:aspectjrt:${aspectjVersion}")  // regular AspectJ version here, to be exposed in the POMs
1081
		compile("org.aspectj:aspectjweaver:${aspectjVersion}")
1082
		provided("org.eclipse.persistence:javax.persistence:2.0.0")
1083 1084 1085 1086 1087 1088
		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
1089
		optional("javax.transaction:javax.transaction-api:${jtaVersion}")  // for @javax.transaction.Transactional support
S
Stephane Nicoll 已提交
1090
		optional("javax.cache:cache-api:1.0.0")
1091
		testCompile(project(":spring-core"))  // for CodeStyleAspect
1092
		testCompile(project(":spring-test"))
1093
		testCompile("javax.mail:javax.mail-api:${javamailVersion}")
1094
	}
1095

1096
	eclipse.project {
P
Phillip Webb 已提交
1097
		natures += "org.eclipse.ajdt.ui.ajnature"
1098
		buildCommands = [new org.gradle.plugins.ide.eclipse.model.
P
Phillip Webb 已提交
1099
				BuildCommand("org.eclipse.ajdt.core.ajbuilder")]
1100
	}
C
Chris Beams 已提交
1101 1102
}

1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137
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 已提交
1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153
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"
	}
}

1154
configure(rootProject) {
P
Phillip Webb 已提交
1155
	description = "Spring Framework"
1156

B
Brian Clozel 已提交
1157
	apply plugin: "org.asciidoctor.convert"
1158
	apply plugin: "docbook-reference"
1159
	apply plugin: "groovy"
R
Rob Winch 已提交
1160

1161
	// apply plugin: "detect-split-packages"
1162 1163
	apply from: "${gradleScriptDir}/jdiff.gradle"

R
Rob Winch 已提交
1164
	asciidoctor {
B
Brian Clozel 已提交
1165 1166
		sourceDir project.file('src/asciidoc')
		separateOutputDirs = false
1167
		backends = ['docbook']
B
Brian Clozel 已提交
1168
		options doctype: 'book', eruby: 'erubis'
1169 1170
		attributes 	'spring-version': project.version,
					'javadoc-baseurl' : "http://docs.spring.io/spring/docs/current/javadoc-api",
B
Brian Clozel 已提交
1171 1172
					revnumber : project.version,
					docinfo : ""
1173 1174
	}

1175 1176 1177
	reference {
		sourceDir = asciidoctor.outputDir
		pdfFilename = "spring-framework-reference.pdf"
1178
		epubFilename = "spring-framework-reference.epub"
1179 1180 1181 1182 1183 1184 1185
		expandPlaceholders = ""
	}

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

1186 1187 1188 1189 1190
	// 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")
	// }
1191

C
Chris Beams 已提交
1192
	// don't publish the default jar for the root project
1193 1194 1195
	configurations.archives.artifacts.clear()

	dependencies { // for integration tests
1196
		testCompile(project(":spring-aop"))
1197
		testCompile(project(":spring-beans"))
1198
		testCompile(project(":spring-context"))
1199 1200
		testCompile(project(":spring-core"))
		testCompile(project(":spring-expression"))
1201
		testCompile(project(":spring-jdbc"))
1202
		testCompile(project(":spring-orm"))
1203
		testCompile(project(":spring-test"))
1204
		testCompile(project(":spring-tx"))
1205 1206
		testCompile(project(":spring-web"))
		testCompile(project(":spring-webmvc-portlet"))
1207
		testCompile("javax.servlet:javax.servlet-api:3.0.1")
1208 1209 1210 1211
		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}")
1212
		testCompile("org.hibernate:hibernate-core:${hibernate4Version}")
P
Phillip Webb 已提交
1213
		testCompile("org.hsqldb:hsqldb:${hsqldbVersion}")
1214 1215 1216
	}

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

1221 1222 1223 1224 1225
		dependsOn {
			subprojects.collect {
				it.tasks.getByName("jar")
			}
		}
1226 1227 1228
		options.memberLevel = org.gradle.external.javadoc.JavadocMemberLevel.PROTECTED
		options.author = true
		options.header = rootProject.description
P
Phillip Webb 已提交
1229
		options.overview = "src/api/overview.html"
1230
		options.stylesheetFile = file("src/api/stylesheet.css")
1231
		options.splitIndex = true
C
Chris Beams 已提交
1232
		options.links(project.ext.javadocLinks)
1233
		options.addStringOption('Xdoclint:none', '-quiet')
C
Chris Beams 已提交
1234

1235 1236 1237
		source subprojects.collect { project ->
			project.sourceSets.main.allJava
		}
C
Chris Beams 已提交
1238

P
Phillip Webb 已提交
1239
		maxMemory = "1024m"
C
Chris Beams 已提交
1240
		destinationDir = new File(buildDir, "api")
1241 1242 1243

		doFirst {
			classpath = files(
1244
				// ensure Servlet 3.x and Hibernate 4.x have precedence on the javadoc
1245 1246 1247 1248 1249 1250 1251 1252
				// 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 })
		}
1253 1254
	}

1255
	task docsZip(type: Zip, dependsOn: 'reference') {
P
Phillip Webb 已提交
1256 1257 1258
		group = "Distribution"
		baseName = "spring-framework"
		classifier = "docs"
1259 1260 1261
		description = "Builds -${classifier} archive containing api and reference " +
			"for deployment at http://static.springframework.org/spring-framework/docs."

P
Phillip Webb 已提交
1262 1263
		from("src/dist") {
			include "changelog.txt"
1264 1265 1266
		}

		from (api) {
1267
			into "javadoc-api"
1268 1269
		}

1270 1271
		from (reference) {
			into "spring-framework-reference"
1272 1273 1274 1275
		}
	}

	task schemaZip(type: Zip) {
P
Phillip Webb 已提交
1276 1277 1278
		group = "Distribution"
		baseName = "spring-framework"
		classifier = "schema"
1279 1280
		description = "Builds -${classifier} archive containing all " +
			"XSDs for deployment at http://springframework.org/schema."
S
Stephane Nicoll 已提交
1281
		duplicatesStrategy 'exclude'
1282
		moduleProjects.each { subproject ->
1283 1284 1285
			def Properties schemas = new Properties();

			subproject.sourceSets.main.resources.find {
P
Phillip Webb 已提交
1286
				it.path.endsWith("META-INF/spring.schemas")
1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303
			}?.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 已提交
1304 1305 1306
		group = "Distribution"
		baseName = "spring-framework"
		classifier = "dist"
1307 1308 1309 1310 1311
		description = "Builds -${classifier} archive, containing all jars and docs, " +
					"suitable for community download page."

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

P
Phillip Webb 已提交
1312 1313 1314 1315
		from("src/dist") {
			include "readme.txt"
			include "license.txt"
			include "notice.txt"
1316
			into "${baseDir}"
P
Phillip Webb 已提交
1317
			expand(copyright: new Date().format("yyyy"), version: project.version)
1318 1319 1320 1321 1322 1323 1324 1325 1326 1327
		}

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

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

1328
		moduleProjects.each { subproject ->
1329 1330
			into ("${baseDir}/libs") {
				from subproject.jar
P
Phillip Webb 已提交
1331
				if (subproject.tasks.findByPath("sourcesJar")) {
1332 1333
					from subproject.sourcesJar
				}
P
Phillip Webb 已提交
1334
				if (subproject.tasks.findByPath("javadocJar")) {
1335 1336 1337 1338 1339 1340
					from subproject.javadocJar
				}
			}
		}
	}

1341
	// Create a distribution that contains all dependencies (required and optional).
1342 1343
	// Not published by default; only for use when building from source.
	task depsZip(type: Zip, dependsOn: distZip) { zipTask ->
P
Phillip Webb 已提交
1344 1345 1346
		group = "Distribution"
		baseName = "spring-framework"
		classifier = "dist-with-deps"
1347 1348 1349 1350 1351 1352 1353 1354 1355 1356
		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 ->
1357 1358
					(subproject.configurations.runtime.resolvedConfiguration.resolvedArtifacts +
					subproject.configurations.optional.resolvedConfiguration.resolvedArtifacts).each { artifact ->
1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379
						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 已提交
1380
		description = "Generates gradlew[.bat] scripts"
S
Sam Brannen 已提交
1381
		gradleVersion = "2.5"
1382 1383

		doLast() {
1384
			def gradleOpts = "-XX:MaxMetaspaceSize=1024m -Xmx1024m"
1385
			def gradleBatOpts = "$gradleOpts -XX:MaxHeapSize=256m"
P
Phillip Webb 已提交
1386
			File wrapperFile = file("gradlew")
1387 1388
			wrapperFile.text = wrapperFile.text.replace("DEFAULT_JVM_OPTS=",
				"GRADLE_OPTS=\"$gradleOpts \$GRADLE_OPTS\"\nDEFAULT_JVM_OPTS=")
P
Phillip Webb 已提交
1389
			File wrapperBatFile = file("gradlew.bat")
1390 1391 1392 1393
			wrapperBatFile.text = wrapperBatFile.text.replace("set DEFAULT_JVM_OPTS=",
				"set GRADLE_OPTS=$gradleBatOpts %GRADLE_OPTS%\nset DEFAULT_JVM_OPTS=")
		}
	}
1394

1395
}
1396

S
Stephane Nicoll 已提交
1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411
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/**/*"
		}
	}
}

1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422
/*
 * 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-")) {
1423
			return version.replace('BUILD', qualifier)
1424 1425
		}
	}
1426
	return version
1427
}