build.gradle 47.1 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")
R
Rob Winch 已提交
7
		classpath("org.asciidoctor:asciidoctor-gradle-plugin:0.7.0")
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.4"
31
	ext.eclipseLinkVersion   = "2.4.2"
32
	ext.ehcacheVersion       = "2.9.0"
33
	ext.ehcacheJCacheVersion = "1.0.0"
34
	ext.groovyVersion        = "2.3.7"
35
	ext.gsonVersion          = "2.3.1"
36
	ext.hibernate3Version    = "3.6.10.Final"
37
	ext.hibernate4Version    = "4.3.7.Final"
38
	ext.hibVal4Version       = "4.3.2.Final"
39
	ext.hibVal5Version       = "5.1.3.Final"
40
	ext.hsqldbVersion        = "2.3.2"
41 42 43
	ext.jackson2Version      = "2.4.4"
	ext.jasperReportsVersion = "6.0.0"
	ext.jettyVersion         = "9.2.5.v20141112"
44
	ext.jodaVersion          = "2.5"
45
	ext.junitVersion         = "4.11"
46
	ext.nettyVersion         = "4.0.24.Final"
47
	ext.openJpaVersion       = "2.2.2"  // 2.3.0 not Java 8 compatible (based on ASM 4)
48
	ext.protobufVersion      = "2.6.1"
B
Brian Clozel 已提交
49
	ext.reactorVersion       = "1.1.5.RELEASE"
50
	ext.slf4jVersion         = "1.7.7"
51
	ext.snakeYamlVersion     = "1.14"
52
	ext.snifferVersion       = "1.11"
53
	ext.tiles2Version        = "2.2.2"
54
	ext.tiles3Version        = "3.0.5"
55
	ext.tomcatVersion        = "8.0.15"
56
	ext.tyrusVersion         = "1.3.5"  // constrained by WebLogic 12.1.3 support
B
Brian Clozel 已提交
57
	ext.undertowVersion      = "1.1.0.Final"
58
	ext.woodstoxVersion      = "4.4.1"
59
	ext.xstreamVersion       = "1.4.7"
60

61
	ext.gradleScriptDir = "${rootProject.projectDir}/gradle"
62

63
	apply plugin: "propdeps"
P
Phillip Webb 已提交
64
	apply plugin: "java"
65
	apply plugin: "test-source-set-dependencies"
66
	apply from: "${gradleScriptDir}/ide.gradle"
C
Chris Beams 已提交
67

S
Stephane Nicoll 已提交
68 69 70 71 72
	configurations {
		sniffer
		javaApiSignature
	}

P
Phillip Webb 已提交
73 74 75
	compileJava.options*.compilerArgs = [
		"-Xlint:serial", "-Xlint:varargs", "-Xlint:cast", "-Xlint:classfile",
		"-Xlint:dep-ann", "-Xlint:divzero", "-Xlint:empty", "-Xlint:finally",
S
Stephane Nicoll 已提交
76
		"-Xlint:overrides", "-Xlint:path", "-Xlint:processing", "-Xlint:static",
P
Phillip Webb 已提交
77 78
		"-Xlint:try", "-Xlint:fallthrough", "-Xlint:rawtypes", "-Xlint:deprecation",
		"-Xlint:unchecked", "-Xlint:-options", "-Werror"
79
	]
C
Chris Beams 已提交
80

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

88 89 90 91 92 93
	compileJava {
		sourceCompatibility=1.6
		targetCompatibility=1.6
	}

	compileTestJava {
94 95 96
		sourceCompatibility=1.8
		targetCompatibility=1.8
		options.compilerArgs += "-parameters"
J
Juergen Hoeller 已提交
97 98
	}

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

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

112
	repositories {
B
Brian Clozel 已提交
113
		maven { url "https://repo.spring.io/libs-release" }
114
	}
C
Chris Beams 已提交
115

116
	dependencies {
117 118 119 120 121 122
		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'
		}
123
		testCompile("org.hamcrest:hamcrest-all:1.3")
S
Stephane Nicoll 已提交
124 125

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

	task copyJavaApiSignature(type: Copy) {
		ext.to = file("$buildDir/javaApiSignature/")
		description "Copy the resolved Animal Sniffer signature dependency artifact to a known location and name"
		from configurations.javaApiSignature
		into to
		rename '.*signature', 'javaApi.signature'
	}

	task sniff {
		group = "Verification"
		description = "Checks the Java API signatures"

		dependsOn compileJava
		dependsOn copyJavaApiSignature

		inputs.dir sourceSets.main.output.classesDir
		inputs.dir copyJavaApiSignature.to
		outputs.upToDateWhen { true }
147

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

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

191
configure(subprojects - project(":spring-build-src")) { subproject ->
192
	apply plugin: "merge"
193 194
	apply from: "${gradleScriptDir}/publish-maven.gradle"

S
Stephane Nicoll 已提交
195 196 197 198 199 200 201 202 203 204 205 206 207 208
	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.*"
		}
	}

209
	jar {
P
Phillip Webb 已提交
210 211 212 213
		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
214 215 216 217 218

		from("${rootProject.projectDir}/src/dist") {
			include "license.txt"
			include "notice.txt"
			into "META-INF"
P
Phillip Webb 已提交
219
			expand(copyright: new Date().format("yyyy"), version: project.version)
220 221 222 223
		}
	}

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

226 227 228
		options.memberLevel = org.gradle.external.javadoc.JavadocMemberLevel.PROTECTED
		options.author = true
		options.header = project.name
C
Chris Beams 已提交
229
		options.links(project.ext.javadocLinks)
230
		options.addStringOption('Xdoclint:none', '-quiet')
C
Chris Beams 已提交
231 232 233 234 235

		// 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
236 237
	}

238 239
	task sourcesJar(type: Jar, dependsOn: classes) {
		classifier = 'sources'
240
		from sourceSets.main.allSource
241
		// don't include or exclude anything explicitly by default. See SPR-12085.
242 243 244
	}

	task javadocJar(type: Jar) {
P
Phillip Webb 已提交
245
		classifier = "javadoc"
246 247 248 249 250 251 252
		from javadoc
	}

	artifacts {
		archives sourcesJar
		archives javadocJar
	}
C
Chris Beams 已提交
253 254
}

255 256
project("spring-build-src") {
	description = "Exposes gradle buildSrc for IDE support"
257
	apply plugin: "groovy"
258 259 260

	dependencies {
		compile gradleApi()
R
Rob Winch 已提交
261
		compile localGroovy()
262 263 264 265 266
	}

	configurations.archives.artifacts.clear()
}

P
Phillip Webb 已提交
267 268
project("spring-core") {
	description = "Spring Core"
269

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

	configurations {
		jarjar
		cglib
280
		objenesis
281 282 283 284 285 286 287 288 289 290 291 292 293 294 295
	}

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

306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324
	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")
				}
			}
		}
	}

325
	dependencies {
326
		cglib("cglib:cglib:${cglibVersion}@jar")
327
		objenesis("org.objenesis:objenesis:${objenesisVersion}@jar")
328
		jarjar("com.googlecode.jarjar:jarjar:1.3")
329

P
Phillip Webb 已提交
330
		compile(files(cglibRepackJar))
331 332
		compile("commons-logging:commons-logging:1.2")
		optional("commons-codec:commons-codec:1.10")
333
		optional("org.aspectj:aspectjweaver:${aspectjVersion}")
334
		optional("net.sf.jopt-simple:jopt-simple:4.8")
335
		optional("log4j:log4j:1.2.17")
336
		testCompile("org.apache.tomcat.embed:tomcat-embed-core:${tomcatVersion}")
A
Arjen Poutsma 已提交
337
		testCompile("xmlunit:xmlunit:1.5")
338
		testCompile("org.codehaus.woodstox:woodstox-core-asl:${woodstoxVersion}") {
P
Phillip Webb 已提交
339 340
			exclude group: "stax", module: "stax-api"
		}
341 342 343
	}

	jar {
344
		// inline repackaged cglib classes directly into the spring-core jar
345 346
		dependsOn cglibRepackJar
		from(zipTree(cglibRepackJar.archivePath)) {
P
Phillip Webb 已提交
347
			include "org/springframework/cglib/**"
348
		}
349 350 351 352 353

		dependsOn objenesisRepackJar
		from(zipTree(objenesisRepackJar.archivePath)) {
			include "org/springframework/objenesis/**"
		}
354
	}
C
Chris Beams 已提交
355 356
}

P
Phillip Webb 已提交
357 358
project("spring-beans") {
	description = "Spring Beans"
359

360
	dependencies {
361 362
		compile(project(":spring-core"))
		compile(files(project(":spring-core").cglibRepackJar))
363
		optional("javax.inject:javax.inject:1")
364
		optional("javax.el:javax.el-api:2.2.5")
S
Stephane Nicoll 已提交
365
		optional("org.yaml:snakeyaml:${snakeYamlVersion}")
366
		testCompile("log4j:log4j:1.2.17")
367
		testCompile("org.apache.tomcat.embed:tomcat-embed-core:${tomcatVersion}")
S
Stephane Nicoll 已提交
368
    }
C
Chris Beams 已提交
369 370
}

371 372
project("spring-beans-groovy") {
	description "Groovy Bean Definitions"
J
Juergen Hoeller 已提交
373
	merge.into = project(":spring-beans")
374
	apply plugin: "groovy"
J
Juergen Hoeller 已提交
375 376 377

	dependencies {
		compile(project(":spring-core"))
378
		optional("org.codehaus.groovy:groovy-all:${groovyVersion}")
J
Juergen Hoeller 已提交
379 380 381 382 383 384 385
	}

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

	compileGroovy {
		sourceCompatibility=1.6
		targetCompatibility=1.6
	}
J
Juergen Hoeller 已提交
395 396
}

P
Phillip Webb 已提交
397 398
project("spring-aop") {
	description = "Spring AOP"
399

400
	dependencies {
401
		compile(project(":spring-beans"))
402 403
		compile(project(":spring-core"))
		compile(files(project(":spring-core").cglibRepackJar))
404
		compile(files(project(":spring-core").objenesisRepackJar))
405
		compile("aopalliance:aopalliance:1.0")
406
		optional("org.aspectj:aspectjweaver:${aspectjVersion}")
407
		optional("commons-pool:commons-pool:1.6")
408
		optional("com.jamonapi:jamon:2.79")
409
	}
C
Chris Beams 已提交
410 411
}

P
Phillip Webb 已提交
412 413
project("spring-expression") {
	description = "Spring Expression Language (SpEL)"
414

415
	dependencies {
416
		compile(project(":spring-core"))
417
	}
C
Chris Beams 已提交
418 419
}

P
Phillip Webb 已提交
420 421
project("spring-instrument") {
	description = "Spring Instrument"
422

423
	jar {
P
Phillip Webb 已提交
424 425
		manifest.attributes["Premain-Class"] =
			"org.springframework.instrument.InstrumentationSavingAgent"
426 427
		manifest.attributes["Agent-Class"] =
			"org.springframework.instrument.InstrumentationSavingAgent"
428 429 430
		manifest.attributes["Can-Redefine-Classes"] = "true"
		manifest.attributes["Can-Retransform-Classes"] = "true"
		manifest.attributes["Can-Set-Native-Method-Prefix"] = "false"
431
	}
C
Chris Beams 已提交
432 433
}

P
Phillip Webb 已提交
434 435
project("spring-instrument-tomcat") {
	description = "Spring Instrument Tomcat"
436

437
	dependencies {
438
		provided("org.apache.tomcat:catalina:6.0.16")
439
	}
C
Chris Beams 已提交
440 441
}

P
Phillip Webb 已提交
442 443
project("spring-context") {
	description = "Spring Context"
444
	apply plugin: "groovy"
445

446
	dependencies {
447 448 449 450 451
		compile(project(":spring-aop"))
		compile(project(":spring-beans"))
		compile(project(":spring-expression"))
		compile(project(":spring-core"))
		compile(files(project(":spring-core").cglibRepackJar))
452
		optional(project(":spring-instrument"))
453
		optional("javax.inject:javax.inject:1")
454
		optional("javax.ejb:ejb-api:3.0")
455
		optional("javax.enterprise.concurrent:javax.enterprise.concurrent-api:1.0")
456
		optional("org.eclipse.persistence:javax.persistence:2.0.0")
457
		optional("javax.validation:validation-api:1.0.0.GA")
458
		optional("org.hibernate:hibernate-validator:${hibVal4Version}")
459 460
		optional("joda-time:joda-time:${jodaVersion}")
		optional("org.aspectj:aspectjweaver:${aspectjVersion}")
J
Juergen Hoeller 已提交
461
		optional("org.codehaus.groovy:groovy-all:${groovyVersion}")
462
		optional("org.beanshell:bsh:2.0b4")
463
		optional("org.jruby:jruby:1.7.16.1")
464
		testCompile("javax.inject:javax.inject-tck:1")
465 466
		testCompile("commons-dbcp:commons-dbcp:1.4")
		testCompile("org.slf4j:slf4j-api:${slf4jVersion}")
467 468
	}

469 470
	// pick up RmiInvocationWrapperRTD.xml in src/main
	sourceSets.main.resources.srcDirs += "src/main/java"
471 472 473 474 475 476 477 478 479
}

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

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

P
Phillip Webb 已提交
512 513
project("spring-tx") {
	description = "Spring Transaction"
514

515
	dependencies {
516 517
		compile(project(":spring-beans"))
		compile(project(":spring-core"))
518 519 520
		optional(project(":spring-aop"))
		optional(project(":spring-context")) // for JCA, @EnableTransactionManagement
		optional("aopalliance:aopalliance:1.0")
521
		optional("javax.transaction:javax.transaction-api:1.2")
522
		optional("javax.resource:connector-api:1.5")
523
		optional("javax.ejb:ejb-api:3.0")
524
		optional("com.ibm.websphere:uow:6.0.2.17")
525
		testCompile("org.aspectj:aspectjweaver:${aspectjVersion}")
526
		testCompile("org.eclipse.persistence:javax.persistence:2.0.0")
527
	}
C
Chris Beams 已提交
528 529
}

P
Phillip Webb 已提交
530 531 532
project("spring-oxm") {
	description = "Spring Object/XML Marshalling"
	apply from: "oxm.gradle"
533

P
Phillip Webb 已提交
534
	compileTestJava {
535 536 537 538 539 540
		// necessary to avoid java.lang.VerifyError on jibx compilation
		// see http://jira.codehaus.org/browse/JIBX-465
		sourceCompatibility=1.6
		targetCompatibility=1.6
	}

541
	dependencies {
542 543
		compile(project(":spring-beans"))
		compile(project(":spring-core"))
544
		optional("org.codehaus.castor:castor-xml:1.3.3")  {
545
			exclude group: 'stax', module: 'stax-api'
546
			exclude group: "org.springframework", module: "spring-context"
547 548 549 550 551 552 553 554
		}
		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'
		}
555
		optional("org.jibx:jibx-run:1.2.5")
556
		testCompile(project(":spring-context"))
A
Arjen Poutsma 已提交
557
		testCompile("xmlunit:xmlunit:1.5")
558 559 560 561
		testCompile("xpp3:xpp3:1.1.3.4.O")
		testCompile("org.codehaus.jettison:jettison:1.0.1") {
			exclude group: 'stax', module: 'stax-api'
		}
562 563 564 565
		testCompile(files(genCastor.classesDir).builtBy(genCastor))
		testCompile(files(genJaxb.classesDir).builtBy(genJaxb))
		testCompile(files(genXmlbeans.classesDir).builtBy(genXmlbeans))
	}
C
Chris Beams 已提交
566 567
}

P
Phillip Webb 已提交
568 569
project("spring-jms") {
	description = "Spring JMS"
570

571
	dependencies {
572 573 574 575
		compile(project(":spring-core"))
		compile(project(":spring-beans"))
		compile(project(":spring-aop"))
		compile(project(":spring-context"))
576
		compile(project(":spring-messaging"))
577
		compile(project(":spring-tx"))
578
		provided("javax.jms:jms-api:1.1-rev-1")
579 580
		optional(project(":spring-oxm"))
		optional("aopalliance:aopalliance:1.0")
581
		optional("javax.transaction:javax.transaction-api:1.2")
582
		optional("javax.resource:connector-api:1.5")
583
		optional("com.fasterxml.jackson.core:jackson-databind:${jackson2Version}")
584
	}
C
Chris Beams 已提交
585 586
}

P
Phillip Webb 已提交
587 588
project("spring-jdbc") {
	description = "Spring JDBC"
589

590
	dependencies {
591
		compile(project(":spring-beans"))
592
		compile(project(":spring-core"))
593
		compile(project(":spring-tx"))
594
		optional(project(":spring-context")) // for JndiDataSourceLookup
595
		optional("javax.transaction:javax.transaction-api:1.2")
596
		optional("com.mchange:c3p0:0.9.2.1")
P
Phillip Webb 已提交
597
		optional("org.hsqldb:hsqldb:${hsqldbVersion}")
598 599 600
		optional("com.h2database:h2:1.4.181")
		optional("org.apache.derby:derby:10.11.1.1")
		optional("org.apache.derby:derbyclient:10.11.1.1")
601
	}
C
Chris Beams 已提交
602 603
}

P
Phillip Webb 已提交
604 605
project("spring-context-support") {
	description = "Spring Context Support"
606

607
	dependencies {
608 609 610
		compile(project(":spring-core"))
		compile(project(":spring-beans"))
		compile(project(":spring-context"))
611 612
		optional(project(":spring-jdbc")) // for Quartz support
		optional(project(":spring-tx")) // for Quartz support
613
		optional("javax.mail:javax.mail-api:1.5.2")
S
Stephane Nicoll 已提交
614
		optional("javax.cache:cache-api:1.0.0")
615
		optional("com.google.guava:guava:18.0")
616
		optional("net.sf.ehcache:ehcache:${ehcacheVersion}")
617
		optional("org.quartz-scheduler:quartz:2.2.1")
618
		optional("org.codehaus.fabric3.api:commonj:1.1.0")
619
		optional("org.apache.velocity:velocity:1.7")
620
		optional("org.freemarker:freemarker:2.3.21")
621
		optional("com.lowagie:itext:2.1.7")
622 623 624 625
		optional("net.sf.jasperreports:jasperreports:$jasperReportsVersion") {
			exclude group: "com.fasterxml.jackson.core", module: "jackson-annotations"
			exclude group: "com.fasterxml.jackson.core", module: "jackson-core"
			exclude group: "com.fasterxml.jackson.core", module: "jackson-databind"
626 627
			exclude group: "org.olap4j", module: "olap4j"
			exclude group: "xml-apis", module: "xml-apis"
628
		}
629
		testCompile(project(":spring-context"))
630
		testCompile("org.apache.poi:poi:3.10.1")
631 632
		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 已提交
633
		testCompile("org.hsqldb:hsqldb:${hsqldbVersion}")
634
		testCompile("org.slf4j:slf4j-api:${slf4jVersion}")
635
		testCompile("org.ehcache:jcache:${ehcacheJCacheVersion}")
636
		testRuntime("com.sun.mail:javax.mail:1.5.2")
637 638
	}

639
	// pick up **/mime.types files in src/main
P
Phillip Webb 已提交
640
	sourceSets.main.resources.srcDirs += "src/main/java"
C
Chris Beams 已提交
641 642
}

P
Phillip Webb 已提交
643 644
project("spring-web") {
	description = "Spring Web"
645
	apply plugin: "groovy"
646

647 648 649 650 651 652 653 654 655 656 657 658 659 660 661
	// 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"
	}

662
	dependencies {
663
		compile(project(":spring-aop")) // for JaxWsPortProxyFactoryBean
664
		compile(project(":spring-beans")) // for MultiPartFilter
665
		compile(project(":spring-context"))
666
		compile(project(":spring-core"))
667
		provided("javax.servlet:javax.servlet-api:3.0.1")
668
		optional(project(":spring-oxm")) // for MarshallingHttpMessageConverter
669
		optional("javax.servlet.jsp:javax.servlet.jsp-api:2.2.1")
670
		optional("javax.portlet:portlet-api:2.0")
671
		optional("javax.el:javax.el-api:2.2.5")
672
		optional("javax.faces:javax.faces-api:2.2")
673
		optional("aopalliance:aopalliance:1.0")
674
		optional("org.codehaus.groovy:groovy-all:${groovyVersion}")
675
		optional("com.caucho:hessian:4.0.38")
676
		optional("commons-fileupload:commons-fileupload:1.3.1")
677 678
		optional("org.apache.httpcomponents:httpclient:4.3.5")
		optional("org.apache.httpcomponents:httpasyncclient:4.0.2")
679
		optional("io.netty:netty-all:${nettyVersion}")
680
		optional("com.fasterxml.jackson.core:jackson-databind:${jackson2Version}")
681
		optional("com.fasterxml.jackson.dataformat:jackson-dataformat-xml:${jackson2Version}")
R
Roy Clarkson 已提交
682
		optional("com.google.code.gson:gson:${gsonVersion}")
683
		optional("com.rometools:rome:1.5.0")
B
Brian Clozel 已提交
684
		optional("org.eclipse.jetty:jetty-servlet:${jettyVersion}") {
B
Brian Clozel 已提交
685
			exclude group: "javax.servlet", module: "javax.servlet-api"
686
		}
B
Brian Clozel 已提交
687
		optional("org.eclipse.jetty:jetty-server:${jettyVersion}") {
B
Brian Clozel 已提交
688
			exclude group: "javax.servlet", module: "javax.servlet-api"
689
		}
690
		optional("log4j:log4j:1.2.17")
R
Polish  
Rossen Stoyanchev 已提交
691 692
		optional("com.googlecode.protobuf-java-format:protobuf-java-format:1.2")
		optional("com.google.protobuf:protobuf-java:${protobufVersion}")
693
		optional("javax.mail:javax.mail-api:1.5.2")
694
		testCompile(project(":spring-context-support"))  // for JafMediaTypeFactory
A
Arjen Poutsma 已提交
695
		testCompile("xmlunit:xmlunit:1.5")
696
		testCompile("org.slf4j:slf4j-jcl:${slf4jVersion}")
697 698 699
		testCompile("org.apache.taglibs:taglibs-standard-jstlel:1.2.1") {
			exclude group: "org.apache.taglibs", module: "taglibs-standard-spec"
		}
R
Rossen Stoyanchev 已提交
700
		testRuntime("com.sun.mail:javax.mail:1.5.2")
701 702 703
	}

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

707
project("spring-websocket") {
708
	description = "Spring WebSocket"
709 710 711 712 713

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

P
Phillip Webb 已提交
753 754
project("spring-orm") {
	description = "Spring Object/Relational Mapping"
755

756
	dependencies {
757 758 759 760 761 762 763 764
		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")
765 766 767
		optional("org.eclipse.persistence:javax.persistence:2.0.5")
		optional("org.eclipse.persistence:org.eclipse.persistence.core:${eclipseLinkVersion}")
		optional("org.eclipse.persistence:org.eclipse.persistence.jpa:${eclipseLinkVersion}") {
768 769 770 771 772 773 774 775 776
			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'
		}
777
		optional("org.apache.openjpa:openjpa:${openJpaVersion}") {
778 779 780 781 782
			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'
		}
783
		optional("javax.jdo:jdo-api:3.0.1") {
784 785
			exclude group: 'javax.transaction', module: 'transaction-api'
		}
786
		optional("javax.servlet:javax.servlet-api:3.0.1")
787
		testCompile("commons-dbcp:commons-dbcp:1.4")
S
Sam Brannen 已提交
788
		testCompile("org.aspectj:aspectjweaver:${aspectjVersion}")
P
Phillip Webb 已提交
789
		testCompile("org.hsqldb:hsqldb:${hsqldbVersion}")
790
		testCompile("org.slf4j:slf4j-jcl:${slf4jVersion}")
791
	}
C
Chris Beams 已提交
792 793
}

P
Phillip Webb 已提交
794 795
project("spring-orm-hibernate4") {
	description = "Spring Object/Relational Mapping - Hibernate 4 support"
796
	merge.into = project(":spring-orm")
797

798
	dependencies {
799
		provided(project(":spring-jdbc"))
800
		provided(project(":spring-tx"))
801
		optional(project(":spring-web"))
802 803
		optional("org.hibernate:hibernate-core:${hibernate4Version}")
		optional("org.hibernate:hibernate-entitymanager:${hibernate4Version}")
804
		optional("javax.servlet:javax.servlet-api:3.0.1")
805
        optional("aopalliance:aopalliance:1.0")
806 807
		testCompile("javax.validation:validation-api:1.1.0.GA")
		testCompile("org.hibernate:hibernate-validator:${hibVal5Version}")
808 809
		testCompile("javax.el:javax.el-api:2.2.5")
		testCompile("org.glassfish.web:javax.el:2.2.6")
810
	}
811 812
}

P
Phillip Webb 已提交
813 814
project("spring-webmvc") {
	description = "Spring Web MVC"
815

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

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

893 894
project("spring-webmvc-tiles2") {
	description = "Spring Framework Tiles2 Integration"
895
	merge.into = project(":spring-webmvc")
896

897
	dependencies {
898 899
		provided(project(":spring-context"))
		provided(project(":spring-web"))
900
		provided("javax.servlet:javax.servlet-api:3.0.1")
901 902
		optional("javax.servlet.jsp:javax.servlet.jsp-api:2.2.1")
		optional("javax.servlet.jsp.jstl:javax.servlet.jsp.jstl-api:1.2.1")
903 904
		optional("org.apache.tiles:tiles-api:${tiles2Version}")
		optional("org.apache.tiles:tiles-core:${tiles2Version}") {
P
Phillip Webb 已提交
905
			exclude group: "org.slf4j", module: "jcl-over-slf4j"
906
		}
907
		optional("org.apache.tiles:tiles-servlet:${tiles2Version}") {
P
Phillip Webb 已提交
908
			exclude group: "org.slf4j", module: "jcl-over-slf4j"
909
		}
910
		optional("org.apache.tiles:tiles-jsp:${tiles2Version}") {
P
Phillip Webb 已提交
911
			exclude group: "org.slf4j", module: "jcl-over-slf4j"
912
		}
913
		optional("org.apache.tiles:tiles-el:${tiles2Version}") {
914
			exclude group: "org.slf4j", module: "jcl-over-slf4j"
915
		}
916
		optional("org.apache.tiles:tiles-extras:${tiles2Version}") {
P
Phillip Webb 已提交
917
			exclude group: "org.slf4j", module: "jcl-over-slf4j"
918
			exclude group: "org.apache.velocity", module: "velocity-tools"
919
			exclude group: "org.springframework", module: "spring-web"
920
		}
921
		testCompile("org.slf4j:slf4j-jcl:${slf4jVersion}")
922
	}
923 924
}

P
Phillip Webb 已提交
925 926
project("spring-webmvc-portlet") {
	description = "Spring Web Portlet"
927

928
	dependencies {
929 930
		compile(project(":spring-beans"))
		compile(project(":spring-context"))
931
		compile(project(":spring-core"))
932 933
		compile(project(":spring-web"))
		compile(project(":spring-webmvc"))
934 935
		provided("javax.servlet:javax.servlet-api:3.0.1")
		provided("javax.portlet:portlet-api:2.0")
936
		optional("commons-fileupload:commons-fileupload:1.3.1")
937 938 939
	}

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

P
Phillip Webb 已提交
943 944
project("spring-test") {
	description = "Spring TestContext Framework"
945

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

	task testNG(type: Test) {
995
		description = 'Runs TestNG tests.'
996
		useTestNG()
997
		scanForTestClasses = false
998 999
		include(["**/testng/**/*Tests.class", "**/testng/**/*Test.class"])
		// Show STD_OUT & STD_ERR of the test JVM(s) on the console:
1000
		// testLogging.showStandardStreams = true
1001
		// forkEvery 1
1002 1003 1004
	}

	test {
1005
		description = 'Runs JUnit tests.'
1006 1007
		dependsOn testNG
		useJUnit()
1008
		exclude "**/testng/**/*.*"
1009
	}
1010 1011

	task aggregateTestReports(type: TestReport) {
1012
		description = 'Aggregates JUnit and TestNG test reports.'
1013 1014 1015 1016 1017
		destinationDir = test.reports.html.destination
		reportOn test, testNG
	}

	check.dependsOn aggregateTestReports
C
Chris Beams 已提交
1018 1019
}

P
Phillip Webb 已提交
1020 1021 1022
project("spring-aspects") {
	description = "Spring Aspects"
	apply from: "aspects.gradle"
1023

1024
	dependencies {
1025
		aspects(project(":spring-orm"))
1026 1027
		ajc("org.aspectj:aspectjtools:${aspectjVersion}")
		rt("org.aspectj:aspectjrt:${aspectjVersion}")
1028
		compile("org.aspectj:aspectjweaver:${aspectjVersion}")
1029 1030 1031 1032
		provided("org.eclipse.persistence:javax.persistence:2.0.0")
		optional(project(":spring-aop")) // for @Async support
		optional(project(":spring-beans")) // for @Configurable support
		optional(project(":spring-context")) // for @Enable* support
1033
		optional(project(":spring-context-support")) // for JavaMail and JSR-107 support
1034 1035
		optional(project(":spring-orm")) // for JPA exception translation support
		optional(project(":spring-tx")) // for JPA, @Transactional support
S
Stephane Nicoll 已提交
1036
		optional("javax.cache:cache-api:1.0.0")
1037 1038
		testCompile(project(":spring-core")) // for CodeStyleAspect
		testCompile(project(":spring-test"))
1039
		testCompile("javax.mail:javax.mail-api:1.5.2")
1040
	}
1041

1042
	eclipse.project {
P
Phillip Webb 已提交
1043
		natures += "org.eclipse.ajdt.ui.ajnature"
1044
		buildCommands = [new org.gradle.plugins.ide.eclipse.model.
P
Phillip Webb 已提交
1045
				BuildCommand("org.eclipse.ajdt.core.ajbuilder")]
1046
	}
C
Chris Beams 已提交
1047 1048
}

1049 1050 1051 1052 1053 1054 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
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 已提交
1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099
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"
	}
}

1100
configure(rootProject) {
P
Phillip Webb 已提交
1101
	description = "Spring Framework"
1102

P
Phillip Webb 已提交
1103
	apply plugin: "asciidoctor"
1104
	apply plugin: "docbook-reference"
1105
	apply plugin: "groovy"
R
Rob Winch 已提交
1106

1107
	// apply plugin: "detect-split-packages"
1108 1109
	apply from: "${gradleScriptDir}/jdiff.gradle"

R
Rob Winch 已提交
1110
	asciidoctor {
1111 1112
		baseDir = project.file('src/asciidoc')
		backend = 'docbook5'
R
Rob Winch 已提交
1113
		options = [
1114 1115 1116 1117 1118 1119 1120
			eruby: 'erubis',
			attributes: [
				doctype: 'book',
				'spring-version' : project.version,
				revnumber : project.version,
				docinfo : ""
			]
R
Rob Winch 已提交
1121
		]
1122 1123
	}

1124 1125 1126
	reference {
		sourceDir = asciidoctor.outputDir
		pdfFilename = "spring-framework-reference.pdf"
1127
		epubFilename = "spring-framework-reference.epub"
1128 1129 1130 1131 1132 1133 1134
		expandPlaceholders = ""
	}

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

1135 1136 1137 1138 1139
	// 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")
	// }
1140

C
Chris Beams 已提交
1141
	// don't publish the default jar for the root project
1142 1143 1144
	configurations.archives.artifacts.clear()

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

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

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

1184 1185 1186
		source subprojects.collect { project ->
			project.sourceSets.main.allJava
		}
C
Chris Beams 已提交
1187

P
Phillip Webb 已提交
1188
		maxMemory = "1024m"
C
Chris Beams 已提交
1189
		destinationDir = new File(buildDir, "api")
1190 1191 1192

		doFirst {
			classpath = files(
1193
				// ensure Servlet 3.x and Hibernate 4.x have precedence on the javadoc
1194 1195 1196 1197 1198 1199 1200 1201
				// 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 })
		}
1202 1203
	}

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

P
Phillip Webb 已提交
1211 1212
		from("src/dist") {
			include "changelog.txt"
1213 1214 1215
		}

		from (api) {
1216
			into "javadoc-api"
1217 1218
		}

1219 1220
		from (reference) {
			into "spring-framework-reference"
1221 1222 1223 1224
		}
	}

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

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

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

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

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

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

1277
		moduleProjects.each { subproject ->
1278 1279
			into ("${baseDir}/libs") {
				from subproject.jar
P
Phillip Webb 已提交
1280
				if (subproject.tasks.findByPath("sourcesJar")) {
1281 1282
					from subproject.sourcesJar
				}
P
Phillip Webb 已提交
1283
				if (subproject.tasks.findByPath("javadocJar")) {
1284 1285 1286 1287 1288 1289
					from subproject.javadocJar
				}
			}
		}
	}

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

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

1344
}
1345

S
Stephane Nicoll 已提交
1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360
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/**/*"
		}
	}
}

1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371
/*
 * 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-")) {
1372
			return version.replace('BUILD', qualifier)
1373 1374
		}
	}
1375
	return version
1376
}