build.gradle 50.4 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.9.0.BETA-3"
S
Stephane Nicoll 已提交
31
	ext.caffeineVersion      = "2.0.3"
32
	ext.eclipselinkVersion   = "2.4.2"
33
	ext.ehcacheVersion       = "2.10.1"
34
	ext.ehcachejcacheVersion = "1.0.1"
J
Juergen Hoeller 已提交
35
	ext.ehcache3Version      = "3.0.0.m4"
36
	ext.ejbApiVersion        = "3.0"
37
	ext.fileuploadVersion    = "1.3.1"
38
	ext.freemarkerVersion    = "2.3.23"
39
	ext.groovyVersion        = "2.4.5"
40
	ext.gsonVersion          = "2.5"
41
	ext.guavaVersion         = "19.0"
42
	ext.hamcrestVersion      = "1.3"
43
	ext.hibernate3Version    = "3.6.10.Final"
44
	ext.hibernate4Version    = "4.3.11.Final"
45
	ext.hibernate5Version    = "5.0.7.Final"
46
	ext.hibval4Version       = "4.3.2.Final"
47
	ext.hibval5Version       = "5.2.2.Final"
48
	ext.hsqldbVersion        = "2.3.3"
J
Juergen Hoeller 已提交
49
	ext.htmlunitVersion      = "2.19"
50
	ext.httpasyncVersion     = "4.1.1"
51
	ext.httpclientVersion    = "4.5.1"
S
Sebastien Deleuze 已提交
52
	ext.jackson2Version      = "2.7.0"
53
	ext.jasperreportsVersion = "6.2.0"
54
	ext.javamailVersion      = "1.5.5"
55
	ext.jettyVersion         = "9.3.7.v20160115"
56
	ext.jodaVersion          = "2.9.1"
57
	ext.jrubyVersion         = "1.7.23"  // JRuby 9000 only supported through JSR-223 (StandardScriptFactory)
58
	ext.jsonassertVersion    = "1.2.3"
59
	ext.jsonpathVersion      = "2.1.0"
60
	ext.jtaVersion           = "1.2"
J
Juergen Hoeller 已提交
61
	ext.junitVersion         = "4.12"
62
	ext.nettyVersion         = "4.0.33.Final"
63
	ext.okhttpVersion        = "2.7.0"
64
	ext.openjpaVersion       = "2.4.0"
65
	ext.poiVersion           = "3.13"
66
	ext.protobufVersion      = "2.6.1"
R
Rossen Stoyanchev 已提交
67
	ext.reactorVersion       = "2.0.7.RELEASE"
68
	ext.romeVersion          = "1.5.1"
69
	ext.seleniumVersion      = "2.48.2"
70
	ext.slf4jVersion         = "1.7.14"
71
	ext.snakeyamlVersion     = "1.16"
S
Stephane Nicoll 已提交
72
	ext.snifferVersion       = "1.14"
73
	ext.testngVersion        = "6.9.10"
74
	ext.tiles2Version        = "2.2.2"
75
	ext.tiles3Version        = "3.0.5"
76
	ext.tomcatVersion        = "8.0.30"
77
	ext.tyrusVersion         = "1.3.5"  // constrained by WebLogic 12.1.3 support
78
	ext.undertowVersion      = "1.3.14.Final"
79
	ext.woodstoxVersion      = "5.0.1"
80
	ext.xmlunitVersion       = "1.6"
81
	ext.xstreamVersion       = "1.4.8"
82

83
	ext.gradleScriptDir = "${rootProject.projectDir}/gradle"
84

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

S
Stephane Nicoll 已提交
90 91 92 93 94
	configurations {
		sniffer
		javaApiSignature
	}

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

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

110
	compileJava {
J
Juergen Hoeller 已提交
111 112
		sourceCompatibility = 1.6
		targetCompatibility = 1.6
113 114 115
	}

	compileTestJava {
J
Juergen Hoeller 已提交
116 117
		sourceCompatibility = 1.8
		targetCompatibility = 1.8
118
		options.compilerArgs += "-parameters"
J
Juergen Hoeller 已提交
119 120
	}

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

132
	repositories {
B
Brian Clozel 已提交
133
		maven { url "https://repo.spring.io/libs-release" }
134
		maven { url "https://repo.spring.io/milestone" }
R
Rossen Stoyanchev 已提交
135
		maven { url "https://repo.spring.io/snapshot" }   // reactor 2.0.6 snapshot
136
	}
C
Chris Beams 已提交
137

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

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

	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
168

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

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

212
configure(subprojects - project(":spring-build-src")) { subproject ->
213
	apply plugin: "merge"
214 215
	apply from: "${gradleScriptDir}/publish-maven.gradle"

S
Stephane Nicoll 已提交
216 217 218 219 220 221 222 223 224 225 226 227 228 229
	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.*"
		}
	}

230
	jar {
P
Phillip Webb 已提交
231 232 233 234
		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
235 236 237 238 239

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

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

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

		// 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
257 258
	}

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

	task javadocJar(type: Jar) {
P
Phillip Webb 已提交
266
		classifier = "javadoc"
267 268 269 270 271 272 273
		from javadoc
	}

	artifacts {
		archives sourcesJar
		archives javadocJar
	}
C
Chris Beams 已提交
274 275
}

276 277
project("spring-build-src") {
	description = "Exposes gradle buildSrc for IDE support"
278
	apply plugin: "groovy"
279 280 281

	dependencies {
		compile gradleApi()
R
Rob Winch 已提交
282
		compile localGroovy()
283 284 285 286 287
	}

	configurations.archives.artifacts.clear()
}

P
Phillip Webb 已提交
288 289
project("spring-core") {
	description = "Spring Core"
290

J
Juergen Hoeller 已提交
291 292
	// As of Spring 4.0.3, spring-core includes asm 5.0 and repackages cglib 3.2, inlining
	// both into the spring-core jar. cglib 3.2 itself depends on asm 5.0 and is therefore
293
	// further transformed by the JarJar task to depend on org.springframework.asm; this
294
	// avoids including two different copies of asm unnecessarily.
J
Juergen Hoeller 已提交
295
	def cglibVersion = "3.2.0"
J
Juergen Hoeller 已提交
296
	def objenesisVersion = "2.2"
297 298 299 300

	configurations {
		jarjar
		cglib
301
		objenesis
302 303 304 305 306 307 308 309 310 311 312 313 314 315 316
	}

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

327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345
	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")
				}
			}
		}
	}

346
	dependencies {
347
		cglib("cglib:cglib:${cglibVersion}@jar")
348
		objenesis("org.objenesis:objenesis:${objenesisVersion}@jar")
349
		jarjar("com.googlecode.jarjar:jarjar:1.3")
350

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

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

		dependsOn objenesisRepackJar
		from(zipTree(objenesisRepackJar.archivePath)) {
			include "org/springframework/objenesis/**"
		}
376
	}
C
Chris Beams 已提交
377 378
}

P
Phillip Webb 已提交
379 380
project("spring-beans") {
	description = "Spring Beans"
381

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

393 394
project("spring-beans-groovy") {
	description "Groovy Bean Definitions"
J
Juergen Hoeller 已提交
395
	merge.into = project(":spring-beans")
396
	apply plugin: "groovy"
J
Juergen Hoeller 已提交
397 398 399

	dependencies {
		compile(project(":spring-core"))
400
		optional("org.codehaus.groovy:groovy-all:${groovyVersion}")
J
Juergen Hoeller 已提交
401 402 403 404 405 406 407
	}

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

	compileGroovy {
J
Juergen Hoeller 已提交
414 415
		sourceCompatibility = 1.6
		targetCompatibility = 1.6
416
	}
J
Juergen Hoeller 已提交
417 418
}

P
Phillip Webb 已提交
419 420
project("spring-aop") {
	description = "Spring AOP"
421

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

P
Phillip Webb 已提交
435 436
project("spring-expression") {
	description = "Spring Expression Language (SpEL)"
437

438
	dependencies {
439
		compile(project(":spring-core"))
440
	}
C
Chris Beams 已提交
441 442
}

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

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

P
Phillip Webb 已提交
457 458
project("spring-instrument-tomcat") {
	description = "Spring Instrument Tomcat"
459

460
	dependencies {
461
		provided("org.apache.tomcat:catalina:6.0.16")
462
	}
463 464 465 466

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

P
Phillip Webb 已提交
469 470
project("spring-context") {
	description = "Spring Context"
471
	apply plugin: "groovy"
472

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

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

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

P
Phillip Webb 已提交
541 542
project("spring-tx") {
	description = "Spring Transaction"
543

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

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

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

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

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

P
Phillip Webb 已提交
604 605
project("spring-jms") {
	description = "Spring JMS"
606

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

P
Phillip Webb 已提交
623 624
project("spring-jdbc") {
	description = "Spring JDBC"
625

626
	dependencies {
627
		compile(project(":spring-beans"))
628
		compile(project(":spring-core"))
629
		compile(project(":spring-tx"))
630
		optional(project(":spring-context"))  // for JndiDataSourceLookup
631
		optional("javax.transaction:javax.transaction-api:${jtaVersion}")
632
		optional("com.mchange:c3p0:0.9.5.2")
P
Phillip Webb 已提交
633
		optional("org.hsqldb:hsqldb:${hsqldbVersion}")
S
Stephane Nicoll 已提交
634
		optional("com.h2database:h2:1.4.190")
635 636
		optional("org.apache.derby:derby:10.12.1.1")
		optional("org.apache.derby:derbyclient:10.12.1.1")
637
	}
C
Chris Beams 已提交
638 639
}

P
Phillip Webb 已提交
640 641
project("spring-context-support") {
	description = "Spring Context Support"
642

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

P
Phillip Webb 已提交
678 679
project("spring-web") {
	description = "Spring Web"
680
	apply plugin: "groovy"
681

682 683 684 685 686 687 688 689 690 691 692 693 694 695 696
	// 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"
	}

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

743
project("spring-websocket") {
744
	description = "Spring WebSocket"
745 746 747 748 749

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

P
Phillip Webb 已提交
789 790
project("spring-orm") {
	description = "Spring Object/Relational Mapping"
791

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

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

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

849 850 851 852 853 854 855 856
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"))
857 858
		optional("org.hibernate:hibernate-core:${hibernate5Version}")
		optional("org.hibernate:hibernate-entitymanager:${hibernate5Version}")
859
		optional("javax.servlet:javax.servlet-api:3.0.1")
860
		optional("javax.transaction:javax.transaction-api:${jtaVersion}")
861 862 863 864
		optional("aopalliance:aopalliance:1.0")
	}
}

P
Phillip Webb 已提交
865 866
project("spring-webmvc") {
	description = "Spring Web MVC"
867

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

948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979
project("spring-webmvc-tiles2") {
	description = "Spring Framework Tiles2 Integration"
	merge.into = project(":spring-webmvc")

	dependencies {
		provided(project(":spring-context"))
		provided(project(":spring-web"))
		provided("javax.servlet:javax.servlet-api:3.0.1")
		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.tiles:tiles-api:${tiles2Version}")
		optional("org.apache.tiles:tiles-core:${tiles2Version}") {
			exclude group: "org.slf4j", module: "jcl-over-slf4j"
		}
		optional("org.apache.tiles:tiles-servlet:${tiles2Version}") {
			exclude group: "org.slf4j", module: "jcl-over-slf4j"
		}
		optional("org.apache.tiles:tiles-jsp:${tiles2Version}") {
			exclude group: "org.slf4j", module: "jcl-over-slf4j"
		}
		optional("org.apache.tiles:tiles-el:${tiles2Version}") {
			exclude group: "org.slf4j", module: "jcl-over-slf4j"
		}
		optional("org.apache.tiles:tiles-extras:${tiles2Version}") {
			exclude group: "org.slf4j", module: "jcl-over-slf4j"
			exclude group: "org.apache.velocity", module: "velocity-tools"
			exclude group: "org.springframework", module: "spring-web"
		}
		testCompile("org.slf4j:slf4j-jcl:${slf4jVersion}")
	}
}

P
Phillip Webb 已提交
980 981
project("spring-webmvc-portlet") {
	description = "Spring Web Portlet"
982

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

P
Phillip Webb 已提交
995 996
project("spring-test") {
	description = "Spring TestContext Framework"
997

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

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

	test {
1063
		description = 'Runs JUnit tests.'
1064 1065
		dependsOn testNG
		useJUnit()
1066
		exclude "**/testng/**/*.*"
1067
	}
1068 1069

	task aggregateTestReports(type: TestReport) {
1070
		description = 'Aggregates JUnit and TestNG test reports.'
1071 1072 1073 1074 1075
		destinationDir = test.reports.html.destination
		reportOn test, testNG
	}

	check.dependsOn aggregateTestReports
C
Chris Beams 已提交
1076 1077
}

P
Phillip Webb 已提交
1078 1079 1080
project("spring-aspects") {
	description = "Spring Aspects"
	apply from: "aspects.gradle"
1081

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

1101
	eclipse.project {
P
Phillip Webb 已提交
1102
		natures += "org.eclipse.ajdt.ui.ajnature"
1103
		buildCommands = [new org.gradle.plugins.ide.eclipse.model.
P
Phillip Webb 已提交
1104
				BuildCommand("org.eclipse.ajdt.core.ajbuilder")]
1105
	}
C
Chris Beams 已提交
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 1138 1139 1140 1141 1142
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 已提交
1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158
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"
	}
}

1159
configure(rootProject) {
P
Phillip Webb 已提交
1160
	description = "Spring Framework"
1161

B
Brian Clozel 已提交
1162
	apply plugin: "org.asciidoctor.convert"
1163
	apply plugin: "docbook-reference"
1164
	apply plugin: "groovy"
R
Rob Winch 已提交
1165

1166
	// apply plugin: "detect-split-packages"
1167 1168
	apply from: "${gradleScriptDir}/jdiff.gradle"

R
Rob Winch 已提交
1169
	asciidoctor {
B
Brian Clozel 已提交
1170 1171
		sourceDir project.file('src/asciidoc')
		separateOutputDirs = false
1172
		backends = ['docbook']
B
Brian Clozel 已提交
1173
		options doctype: 'book', eruby: 'erubis'
1174
		attributes 	'spring-version': project.version,
1175 1176
					'revnumber' : project.version,
					'docinfo' : ""
1177 1178
	}

1179 1180 1181
	reference {
		sourceDir = asciidoctor.outputDir
		pdfFilename = "spring-framework-reference.pdf"
1182
		epubFilename = "spring-framework-reference.epub"
1183 1184 1185 1186 1187 1188 1189
		expandPlaceholders = ""
	}

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

1190 1191 1192 1193 1194
	// 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")
	// }
1195

C
Chris Beams 已提交
1196
	// don't publish the default jar for the root project
1197 1198 1199
	configurations.archives.artifacts.clear()

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

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

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

1239 1240 1241
		source subprojects.collect { project ->
			project.sourceSets.main.allJava
		}
C
Chris Beams 已提交
1242

P
Phillip Webb 已提交
1243
		maxMemory = "1024m"
C
Chris Beams 已提交
1244
		destinationDir = new File(buildDir, "api")
1245 1246 1247

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

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

P
Phillip Webb 已提交
1266 1267
		from("src/dist") {
			include "changelog.txt"
1268 1269 1270
		}

		from (api) {
1271
			into "javadoc-api"
1272 1273
		}

1274 1275
		from (reference) {
			into "spring-framework-reference"
1276 1277 1278 1279
		}
	}

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

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

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

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

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

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

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

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

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

1399
}
1400

S
Stephane Nicoll 已提交
1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415
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/**/*"
		}
	}
}

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