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

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

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

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

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

68
	ext.gradleScriptDir = "${rootProject.projectDir}/gradle"
69

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

S
Stephane Nicoll 已提交
75 76 77 78 79
	configurations {
		sniffer
		javaApiSignature
	}

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

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

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

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

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

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

122
	dependencies {
123 124 125 126 127 128
		testCompile("junit:junit:${junitVersion}") {
			exclude group:'org.hamcrest', module:'hamcrest-core'
		}
		testCompile("org.mockito:mockito-core:1.9.5") {
			exclude group:'org.hamcrest', module:'hamcrest-core'
		}
129
		testCompile("org.hamcrest:hamcrest-all:1.3")
S
Stephane Nicoll 已提交
130 131

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

	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
152

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

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

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

S
Stephane Nicoll 已提交
200 201 202 203 204 205 206 207 208 209 210 211 212 213
	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.*"
		}
	}

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

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

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

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

		// 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
241 242
	}

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

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

	artifacts {
		archives sourcesJar
		archives javadocJar
	}
C
Chris Beams 已提交
258 259
}

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

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

	configurations.archives.artifacts.clear()
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

903 904
project("spring-webmvc-tiles2") {
	description = "Spring Framework Tiles2 Integration"
905
	merge.into = project(":spring-webmvc")
906

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

P
Phillip Webb 已提交
935 936
project("spring-webmvc-portlet") {
	description = "Spring Web Portlet"
937

938
	dependencies {
939 940
		compile(project(":spring-beans"))
		compile(project(":spring-context"))
941
		compile(project(":spring-core"))
942 943
		compile(project(":spring-web"))
		compile(project(":spring-webmvc"))
944 945
		provided("javax.servlet:javax.servlet-api:3.0.1")
		provided("javax.portlet:portlet-api:2.0")
946
		optional("commons-fileupload:commons-fileupload:${fileuploadVersion}")
947
	}
C
Chris Beams 已提交
948 949
}

P
Phillip Webb 已提交
950 951
project("spring-test") {
	description = "Spring TestContext Framework"
952

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

	task testNG(type: Test) {
1002
		description = 'Runs TestNG tests.'
1003
		useTestNG()
1004
		scanForTestClasses = false
1005 1006
		include(["**/testng/**/*Tests.class", "**/testng/**/*Test.class"])
		// Show STD_OUT & STD_ERR of the test JVM(s) on the console:
1007
		// testLogging.showStandardStreams = true
1008
		// forkEvery 1
1009 1010 1011
	}

	test {
1012
		description = 'Runs JUnit tests.'
1013 1014
		dependsOn testNG
		useJUnit()
1015
		exclude "**/testng/**/*.*"
1016
	}
1017 1018

	task aggregateTestReports(type: TestReport) {
1019
		description = 'Aggregates JUnit and TestNG test reports.'
1020 1021 1022 1023 1024
		destinationDir = test.reports.html.destination
		reportOn test, testNG
	}

	check.dependsOn aggregateTestReports
C
Chris Beams 已提交
1025 1026
}

P
Phillip Webb 已提交
1027 1028 1029
project("spring-aspects") {
	description = "Spring Aspects"
	apply from: "aspects.gradle"
1030

1031
	dependencies {
1032
		aspects(project(":spring-orm"))
1033
		ajc("org.aspectj:aspectjtools:1.9.0.BETA-1")  // for the ability to build on JDK 9, not exposed in the POMs yet
J
Juergen Hoeller 已提交
1034
		rt("org.aspectj:aspectjrt:${aspectjVersion}")  // regular AspectJ version here, to be exposed in the POMs
1035
		compile("org.aspectj:aspectjweaver:${aspectjVersion}")
1036
		provided("org.eclipse.persistence:javax.persistence:2.0.0")
1037 1038 1039 1040 1041 1042
		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
1043
		optional("javax.transaction:javax.transaction-api:${jtaVersion}")  // for @javax.transaction.Transactional support
S
Stephane Nicoll 已提交
1044
		optional("javax.cache:cache-api:1.0.0")
1045
		testCompile(project(":spring-core"))  // for CodeStyleAspect
1046
		testCompile(project(":spring-test"))
1047
		testCompile("javax.mail:javax.mail-api:1.5.2")
1048
	}
1049

1050
	eclipse.project {
P
Phillip Webb 已提交
1051
		natures += "org.eclipse.ajdt.ui.ajnature"
1052
		buildCommands = [new org.gradle.plugins.ide.eclipse.model.
P
Phillip Webb 已提交
1053
				BuildCommand("org.eclipse.ajdt.core.ajbuilder")]
1054
	}
C
Chris Beams 已提交
1055 1056
}

1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091
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 已提交
1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107
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"
	}
}

1108
configure(rootProject) {
P
Phillip Webb 已提交
1109
	description = "Spring Framework"
1110

B
Brian Clozel 已提交
1111
	apply plugin: "org.asciidoctor.convert"
1112
	apply plugin: "docbook-reference"
1113
	apply plugin: "groovy"
R
Rob Winch 已提交
1114

1115
	// apply plugin: "detect-split-packages"
1116 1117
	apply from: "${gradleScriptDir}/jdiff.gradle"

R
Rob Winch 已提交
1118
	asciidoctor {
B
Brian Clozel 已提交
1119 1120
		sourceDir project.file('src/asciidoc')
		separateOutputDirs = false
1121
		backends = ['docbook']
B
Brian Clozel 已提交
1122
		options doctype: 'book', eruby: 'erubis'
1123 1124
		attributes 	'spring-version': project.version,
					'javadoc-baseurl' : "http://docs.spring.io/spring/docs/current/javadoc-api",
B
Brian Clozel 已提交
1125 1126
					revnumber : project.version,
					docinfo : ""
1127 1128
	}

1129 1130 1131
	reference {
		sourceDir = asciidoctor.outputDir
		pdfFilename = "spring-framework-reference.pdf"
1132
		epubFilename = "spring-framework-reference.epub"
1133 1134 1135 1136 1137 1138 1139
		expandPlaceholders = ""
	}

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

1140 1141 1142 1143 1144
	// 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")
	// }
1145

C
Chris Beams 已提交
1146
	// don't publish the default jar for the root project
1147 1148 1149
	configurations.archives.artifacts.clear()

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

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

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

1189 1190 1191
		source subprojects.collect { project ->
			project.sourceSets.main.allJava
		}
C
Chris Beams 已提交
1192

P
Phillip Webb 已提交
1193
		maxMemory = "1024m"
C
Chris Beams 已提交
1194
		destinationDir = new File(buildDir, "api")
1195 1196 1197

		doFirst {
			classpath = files(
1198
				// ensure Servlet 3.x and Hibernate 4.x have precedence on the javadoc
1199 1200 1201 1202 1203 1204 1205 1206
				// 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 })
		}
1207 1208
	}

1209
	task docsZip(type: Zip, dependsOn: 'reference') {
P
Phillip Webb 已提交
1210 1211 1212
		group = "Distribution"
		baseName = "spring-framework"
		classifier = "docs"
1213 1214 1215
		description = "Builds -${classifier} archive containing api and reference " +
			"for deployment at http://static.springframework.org/spring-framework/docs."

P
Phillip Webb 已提交
1216 1217
		from("src/dist") {
			include "changelog.txt"
1218 1219 1220
		}

		from (api) {
1221
			into "javadoc-api"
1222 1223
		}

1224 1225
		from (reference) {
			into "spring-framework-reference"
1226 1227 1228 1229
		}
	}

	task schemaZip(type: Zip) {
P
Phillip Webb 已提交
1230 1231 1232
		group = "Distribution"
		baseName = "spring-framework"
		classifier = "schema"
1233 1234
		description = "Builds -${classifier} archive containing all " +
			"XSDs for deployment at http://springframework.org/schema."
S
Stephane Nicoll 已提交
1235
		duplicatesStrategy 'exclude'
1236
		moduleProjects.each { subproject ->
1237 1238 1239
			def Properties schemas = new Properties();

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

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

P
Phillip Webb 已提交
1266 1267 1268 1269
		from("src/dist") {
			include "readme.txt"
			include "license.txt"
			include "notice.txt"
1270
			into "${baseDir}"
P
Phillip Webb 已提交
1271
			expand(copyright: new Date().format("yyyy"), version: project.version)
1272 1273 1274 1275 1276 1277 1278 1279 1280 1281
		}

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

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

1282
		moduleProjects.each { subproject ->
1283 1284
			into ("${baseDir}/libs") {
				from subproject.jar
P
Phillip Webb 已提交
1285
				if (subproject.tasks.findByPath("sourcesJar")) {
1286 1287
					from subproject.sourcesJar
				}
P
Phillip Webb 已提交
1288
				if (subproject.tasks.findByPath("javadocJar")) {
1289 1290 1291 1292 1293 1294
					from subproject.javadocJar
				}
			}
		}
	}

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

		doLast() {
1338
			def gradleOpts = "-XX:MaxMetaspaceSize=1024m -Xmx1024m"
1339
			def gradleBatOpts = "$gradleOpts -XX:MaxHeapSize=256m"
P
Phillip Webb 已提交
1340
			File wrapperFile = file("gradlew")
1341 1342
			wrapperFile.text = wrapperFile.text.replace("DEFAULT_JVM_OPTS=",
				"GRADLE_OPTS=\"$gradleOpts \$GRADLE_OPTS\"\nDEFAULT_JVM_OPTS=")
P
Phillip Webb 已提交
1343
			File wrapperBatFile = file("gradlew.bat")
1344 1345 1346 1347
			wrapperBatFile.text = wrapperBatFile.text.replace("set DEFAULT_JVM_OPTS=",
				"set GRADLE_OPTS=$gradleBatOpts %GRADLE_OPTS%\nset DEFAULT_JVM_OPTS=")
		}
	}
1348

1349
}
1350

S
Stephane Nicoll 已提交
1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365
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/**/*"
		}
	}
}

1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376
/*
 * 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-")) {
1377
			return version.replace('BUILD', qualifier)
1378 1379
		}
	}
1380
	return version
1381
}