build.gradle 46.6 KB
Newer Older
1
buildscript {
2
	repositories {
P
Phillip Webb 已提交
3
		maven { url "http://repo.springsource.org/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 19 20 21
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'
	linkScmDevConnection = 'scm:git:ssh://git@github.com:spring-projects/spring-framwork.git'
}

C
Chris Beams 已提交
22
configure(allprojects) { project ->
23 24
	group = "org.springframework"
	version = qualifyVersionIfNecessary(version)
25

26
	ext.aspectjVersion       = "1.8.1"
27
	ext.eclipseLinkVersion   = "2.4.2"
28 29
	ext.ehcacheVersion       = "2.8.3"
	ext.ehcacheJCacheVersion = "1.0.0"
30
	ext.groovyVersion        = "2.3.6"
31
	ext.hibernate3Version    = "3.6.10.Final"
32
	ext.hibernate4Version    = "4.3.6.Final"
33 34
	ext.hibVal4Version       = "4.3.2.Final"
	ext.hibVal5Version       = "5.1.2.Final"
35
	ext.hsqldbVersion        = "2.3.2"
36
	ext.jackson2Version      = "2.4.1"
R
Roy Clarkson 已提交
37
	ext.gsonVersion          = "2.3"
38
	ext.jasperReportsVersion = "5.6.0"
39
	ext.jettyVersion         = "9.2.2.v20140723"
40
	ext.jodaVersion          = "2.4"
41
	ext.junitVersion         = "4.11"
42
	ext.openJpaVersion       = "2.2.2"  // 2.3.0 not Java 8 compatible (based on ASM 4)
43
	ext.slf4jVersion         = "1.7.7"
S
Stephane Nicoll 已提交
44
	ext.snakeYamlVersion     = "1.13"
45
	ext.snifferVersion       = "1.11"
46
	ext.tiles2Version        = "2.2.2"
47
	ext.tiles3Version        = "3.0.4"
48
	ext.tomcatVersion        = "8.0.9"
49
	ext.xstreamVersion       = "1.4.7"
50
	ext.protobufVersion      = "2.5.0"
51
	ext.woodstoxVersion      = "4.1.6"
52

53
	ext.gradleScriptDir = "${rootProject.projectDir}/gradle"
54

55
	apply plugin: "propdeps"
P
Phillip Webb 已提交
56
	apply plugin: "java"
57
	apply plugin: "test-source-set-dependencies"
58
	apply from: "${gradleScriptDir}/ide.gradle"
C
Chris Beams 已提交
59

S
Stephane Nicoll 已提交
60 61 62 63 64
	configurations {
		sniffer
		javaApiSignature
	}

P
Phillip Webb 已提交
65 66 67
	compileJava.options*.compilerArgs = [
		"-Xlint:serial", "-Xlint:varargs", "-Xlint:cast", "-Xlint:classfile",
		"-Xlint:dep-ann", "-Xlint:divzero", "-Xlint:empty", "-Xlint:finally",
S
Stephane Nicoll 已提交
68
		"-Xlint:overrides", "-Xlint:path", "-Xlint:processing", "-Xlint:static",
P
Phillip Webb 已提交
69 70
		"-Xlint:try", "-Xlint:fallthrough", "-Xlint:rawtypes", "-Xlint:deprecation",
		"-Xlint:unchecked", "-Xlint:-options", "-Werror"
71
	]
C
Chris Beams 已提交
72

P
Phillip Webb 已提交
73 74 75
	compileTestJava.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 79
		"-Xlint:try", "-Xlint:-fallthrough", "-Xlint:-rawtypes", "-Xlint:-deprecation",
		"-Xlint:-unchecked", "-Xlint:-options"]

80 81 82 83 84 85
	compileJava {
		sourceCompatibility=1.6
		targetCompatibility=1.6
	}

	compileTestJava {
86 87 88
		sourceCompatibility=1.8
		targetCompatibility=1.8
		options.compilerArgs += "-parameters"
J
Juergen Hoeller 已提交
89 90
	}

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

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

104
	repositories {
105
		maven { url "http://repo.spring.io/libs-release" }
106
	}
C
Chris Beams 已提交
107

108
	dependencies {
109 110 111 112 113 114
		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'
		}
115
		testCompile("org.hamcrest:hamcrest-all:1.3")
S
Stephane Nicoll 已提交
116 117 118
		testCompile("org.mockito:mockito-core:1.9.5")

		sniffer("org.codehaus.mojo:animal-sniffer-ant-tasks:${snifferVersion}")
119
		javaApiSignature("org.codehaus.mojo.signature:java16:1.1@signature")  // as from JDK 6 update 18
S
Stephane Nicoll 已提交
120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139
	}

	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 }
140

S
Stephane Nicoll 已提交
141 142 143 144 145 146 147 148 149 150 151
		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)
152 153 154
				annotation(className: "org.springframework.lang.UsesJava7")
				annotation(className: "org.springframework.lang.UsesJava8")
				annotation(className: "org.springframework.lang.UsesSunHttpServer")
S
Stephane Nicoll 已提交
155 156
			}
		}
157
	}
C
Chris Beams 已提交
158 159

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

183
configure(subprojects - project(":spring-build-src")) { subproject ->
184
	apply plugin: "merge"
185 186
	apply from: "${gradleScriptDir}/publish-maven.gradle"

S
Stephane Nicoll 已提交
187 188 189 190 191 192 193 194 195 196 197 198 199 200
	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.*"
		}
	}

201
	jar {
P
Phillip Webb 已提交
202 203 204 205
		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
206 207 208 209 210

		from("${rootProject.projectDir}/src/dist") {
			include "license.txt"
			include "notice.txt"
			into "META-INF"
P
Phillip Webb 已提交
211
			expand(copyright: new Date().format("yyyy"), version: project.version)
212 213 214 215
		}
	}

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

218 219 220
		options.memberLevel = org.gradle.external.javadoc.JavadocMemberLevel.PROTECTED
		options.author = true
		options.header = project.name
C
Chris Beams 已提交
221
		options.links(project.ext.javadocLinks)
222
		options.addStringOption('Xdoclint:none', '-quiet')
C
Chris Beams 已提交
223 224 225 226 227

		// 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
228 229
	}

230 231 232 233 234 235 236 237 238 239 240 241
	task sourcesJar(type: Jar, dependsOn: classes) {
		classifier = 'sources'
		from sourceSets.main.allJava.srcDirs, sourceSets.main.resources.srcDirs
		// sourceSets.main.allGroovy.srcDirs can only be applied to groovy projects
		include '**/*.java'
		include '**/*.groovy'
		include '**/*.aj'
		include 'META-INF/spring.factories'
		include 'META-INF/services/*'
		include '**/*.properties'
		include '**/*.xml'
		include '**/*.types'
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
		compile("commons-logging:commons-logging:1.1.3")
332
		optional("commons-codec:commons-codec:1.9")
333
		optional("org.aspectj:aspectjweaver:${aspectjVersion}")
334
		optional("net.sf.jopt-simple:jopt-simple:4.6")
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.76")
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.12")
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"))
J
Juergen Hoeller 已提交
480 481
		optional("org.projectreactor:reactor-core:1.1.3.RELEASE")
		optional("org.projectreactor:reactor-net:1.1.3.RELEASE")
B
Brian Clozel 已提交
482
		optional("org.eclipse.jetty.websocket:websocket-server:${jettyVersion}") {
B
Brian Clozel 已提交
483 484
			exclude group: "javax.servlet", module: "javax.servlet-api"
		}
B
Brian Clozel 已提交
485
		optional("org.eclipse.jetty.websocket:websocket-client:${jettyVersion}")
486
		optional("com.fasterxml.jackson.core:jackson-databind:${jackson2Version}")
487
		testCompile(project(":spring-test"))
488
		testCompile("javax.inject:javax.inject-tck:1")
489
		testCompile("javax.servlet:javax.servlet-api:3.1.0")
490
		testCompile("javax.validation:validation-api:1.0.0.GA")
491
		testCompile("com.thoughtworks.xstream:xstream:${xstreamVersion}")
492 493 494 495 496
		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 已提交
497
		testCompile("org.eclipse.jetty:jetty-webapp:${jettyVersion}") {
B
Brian Clozel 已提交
498
			exclude group: "javax.servlet", module: "javax.servlet-api"
499
		}
500 501 502
		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}")
503
		testCompile("commons-dbcp:commons-dbcp:1.4")
504
		testCompile("log4j:log4j:1.2.17")
505
		testCompile("org.slf4j:slf4j-jcl:${slf4jVersion}")
506
	}
C
Chris Beams 已提交
507 508
}

P
Phillip Webb 已提交
509 510
project("spring-tx") {
	description = "Spring Transaction"
511

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

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

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

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

P
Phillip Webb 已提交
565 566
project("spring-jms") {
	description = "Spring JMS"
567

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

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

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

P
Phillip Webb 已提交
601 602
project("spring-context-support") {
	description = "Spring Context Support"
603

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

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

P
Phillip Webb 已提交
640 641
project("spring-web") {
	description = "Spring Web"
642
	apply plugin: "groovy"
643

644 645 646 647 648 649 650 651 652 653 654 655 656 657 658
	// 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"
	}

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

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

701
project("spring-websocket") {
702
	description = "Spring WebSocket"
703 704 705 706 707

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

P
Phillip Webb 已提交
747 748
project("spring-orm") {
	description = "Spring Object/Relational Mapping"
749

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

P
Phillip Webb 已提交
788 789
project("spring-orm-hibernate4") {
	description = "Spring Object/Relational Mapping - Hibernate 4 support"
790
	merge.into = project(":spring-orm")
791

792
	dependencies {
793
		provided(project(":spring-jdbc"))
794
		provided(project(":spring-tx"))
795
		optional(project(":spring-web"))
796 797
		optional("org.hibernate:hibernate-core:${hibernate4Version}")
		optional("org.hibernate:hibernate-entitymanager:${hibernate4Version}")
798
		optional("javax.servlet:javax.servlet-api:3.0.1")
799
        optional("aopalliance:aopalliance:1.0")
800 801
		testCompile("javax.validation:validation-api:1.1.0.GA")
		testCompile("org.hibernate:hibernate-validator:${hibVal5Version}")
802 803
		testCompile("javax.el:javax.el-api:2.2.5")
		testCompile("org.glassfish.web:javax.el:2.2.6")
804
	}
805 806
}

P
Phillip Webb 已提交
807 808
project("spring-webmvc") {
	description = "Spring Web MVC"
809

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

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

887 888
project("spring-webmvc-tiles2") {
	description = "Spring Framework Tiles2 Integration"
889
	merge.into = project(":spring-webmvc")
890

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

P
Phillip Webb 已提交
919 920
project("spring-webmvc-portlet") {
	description = "Spring Web Portlet"
921

922
	dependencies {
923 924
		compile(project(":spring-beans"))
		compile(project(":spring-context"))
925
		compile(project(":spring-core"))
926 927
		compile(project(":spring-web"))
		compile(project(":spring-webmvc"))
928 929
		provided("javax.servlet:javax.servlet-api:3.0.1")
		provided("javax.portlet:portlet-api:2.0")
930
		optional("commons-fileupload:commons-fileupload:1.3.1")
931 932 933
	}

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

P
Phillip Webb 已提交
937 938
project("spring-test") {
	description = "Spring TestContext Framework"
939

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

	task testNG(type: Test) {
		useTestNG()
990
		scanForTestClasses = false
991 992
		include(["**/testng/**/*Tests.class", "**/testng/**/*Test.class"])
		// Show STD_OUT & STD_ERR of the test JVM(s) on the console:
993
		// testLogging.showStandardStreams = true
994
		// forkEvery 1
995 996 997 998 999
	}

	test {
		dependsOn testNG
		useJUnit()
1000
		exclude "**/testng/**/*.*"
1001
	}
1002 1003 1004 1005 1006 1007 1008

	task aggregateTestReports(type: TestReport) {
		destinationDir = test.reports.html.destination
		reportOn test, testNG
	}

	check.dependsOn aggregateTestReports
C
Chris Beams 已提交
1009 1010
}

P
Phillip Webb 已提交
1011 1012 1013
project("spring-aspects") {
	description = "Spring Aspects"
	apply from: "aspects.gradle"
1014

1015
	dependencies {
1016
		aspects(project(":spring-orm"))
1017 1018
		ajc("org.aspectj:aspectjtools:${aspectjVersion}")
		rt("org.aspectj:aspectjrt:${aspectjVersion}")
1019
		compile("org.aspectj:aspectjweaver:${aspectjVersion}")
1020 1021 1022 1023
		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
1024
		optional(project(":spring-context-support")) // for JavaMail and JSR-107 support
1025 1026
		optional(project(":spring-orm")) // for JPA exception translation support
		optional(project(":spring-tx")) // for JPA, @Transactional support
S
Stephane Nicoll 已提交
1027
		optional("javax.cache:cache-api:1.0.0")
1028 1029
		testCompile(project(":spring-core")) // for CodeStyleAspect
		testCompile(project(":spring-test"))
1030
		testCompile("javax.mail:javax.mail-api:1.5.2")
1031
	}
1032

1033
	eclipse.project {
P
Phillip Webb 已提交
1034
		natures += "org.eclipse.ajdt.ui.ajnature"
1035
		buildCommands = [new org.gradle.plugins.ide.eclipse.model.
P
Phillip Webb 已提交
1036
				BuildCommand("org.eclipse.ajdt.core.ajbuilder")]
1037
	}
C
Chris Beams 已提交
1038 1039
}

1040 1041 1042 1043 1044 1045 1046 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
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 已提交
1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090
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"
	}
}

1091
configure(rootProject) {
P
Phillip Webb 已提交
1092
	description = "Spring Framework"
1093

P
Phillip Webb 已提交
1094
	apply plugin: "asciidoctor"
1095
	apply plugin: "docbook-reference"
1096
	apply plugin: "groovy"
R
Rob Winch 已提交
1097

1098
	// apply plugin: "detect-split-packages"
1099 1100
	apply from: "${gradleScriptDir}/jdiff.gradle"

R
Rob Winch 已提交
1101
	asciidoctor {
1102 1103
		baseDir = project.file('src/asciidoc')
		backend = 'docbook5'
R
Rob Winch 已提交
1104
		options = [
1105 1106 1107 1108 1109 1110 1111
			eruby: 'erubis',
			attributes: [
				doctype: 'book',
				'spring-version' : project.version,
				revnumber : project.version,
				docinfo : ""
			]
R
Rob Winch 已提交
1112
		]
1113 1114
	}

1115 1116 1117
	reference {
		sourceDir = asciidoctor.outputDir
		pdfFilename = "spring-framework-reference.pdf"
1118
		epubFilename = "spring-framework-reference.epub"
1119 1120 1121 1122 1123 1124 1125
		expandPlaceholders = ""
	}

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

1126 1127 1128 1129 1130
	// 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")
	// }
1131

C
Chris Beams 已提交
1132
	// don't publish the default jar for the root project
1133 1134 1135
	configurations.archives.artifacts.clear()

	dependencies { // for integration tests
1136
		testCompile(project(":spring-aop"))
1137
		testCompile(project(":spring-beans"))
1138
		testCompile(project(":spring-context"))
1139 1140
		testCompile(project(":spring-core"))
		testCompile(project(":spring-expression"))
1141
		testCompile(project(":spring-jdbc"))
1142
		testCompile(project(":spring-orm"))
1143
		testCompile(project(":spring-test"))
1144
		testCompile(project(":spring-tx"))
1145 1146
		testCompile(project(":spring-web"))
		testCompile(project(":spring-webmvc-portlet"))
1147
		testCompile("javax.servlet:javax.servlet-api:3.0.1")
1148 1149 1150 1151
		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}")
1152
		testCompile("org.hibernate:hibernate-core:${hibernate4Version}")
P
Phillip Webb 已提交
1153
		testCompile("org.hsqldb:hsqldb:${hsqldbVersion}")
1154 1155 1156
	}

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

1161 1162 1163 1164 1165
		dependsOn {
			subprojects.collect {
				it.tasks.getByName("jar")
			}
		}
1166 1167 1168
		options.memberLevel = org.gradle.external.javadoc.JavadocMemberLevel.PROTECTED
		options.author = true
		options.header = rootProject.description
P
Phillip Webb 已提交
1169
		options.overview = "src/api/overview.html"
1170
		options.stylesheetFile = file("src/api/stylesheet.css")
1171
		options.splitIndex = true
C
Chris Beams 已提交
1172
		options.links(project.ext.javadocLinks)
1173
		options.addStringOption('Xdoclint:none', '-quiet')
C
Chris Beams 已提交
1174

1175 1176 1177
		source subprojects.collect { project ->
			project.sourceSets.main.allJava
		}
C
Chris Beams 已提交
1178

P
Phillip Webb 已提交
1179
		maxMemory = "1024m"
C
Chris Beams 已提交
1180
		destinationDir = new File(buildDir, "api")
1181 1182 1183

		doFirst {
			classpath = files(
1184
				// ensure Servlet 3.x and Hibernate 4.x have precedence on the javadoc
1185 1186 1187 1188 1189 1190 1191 1192
				// 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 })
		}
1193 1194
	}

1195
	task docsZip(type: Zip, dependsOn: 'reference') {
P
Phillip Webb 已提交
1196 1197 1198
		group = "Distribution"
		baseName = "spring-framework"
		classifier = "docs"
1199 1200 1201
		description = "Builds -${classifier} archive containing api and reference " +
			"for deployment at http://static.springframework.org/spring-framework/docs."

P
Phillip Webb 已提交
1202 1203
		from("src/dist") {
			include "changelog.txt"
1204 1205 1206
		}

		from (api) {
1207
			into "javadoc-api"
1208 1209
		}

1210 1211
		from (reference) {
			into "spring-framework-reference"
1212 1213 1214 1215
		}
	}

	task schemaZip(type: Zip) {
P
Phillip Webb 已提交
1216 1217 1218
		group = "Distribution"
		baseName = "spring-framework"
		classifier = "schema"
1219 1220
		description = "Builds -${classifier} archive containing all " +
			"XSDs for deployment at http://springframework.org/schema."
S
Stephane Nicoll 已提交
1221
		duplicatesStrategy 'exclude'
1222 1223 1224 1225
		subprojects.each { subproject ->
			def Properties schemas = new Properties();

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

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

P
Phillip Webb 已提交
1252 1253 1254 1255
		from("src/dist") {
			include "readme.txt"
			include "license.txt"
			include "notice.txt"
1256
			into "${baseDir}"
P
Phillip Webb 已提交
1257
			expand(copyright: new Date().format("yyyy"), version: project.version)
1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270
		}

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

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

		subprojects.each { subproject ->
			into ("${baseDir}/libs") {
				from subproject.jar
P
Phillip Webb 已提交
1271
				if (subproject.tasks.findByPath("sourcesJar")) {
1272 1273
					from subproject.sourcesJar
				}
P
Phillip Webb 已提交
1274
				if (subproject.tasks.findByPath("javadocJar")) {
1275 1276 1277 1278 1279 1280 1281 1282 1283
					from subproject.javadocJar
				}
			}
		}
	}

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

		doLast() {
1324
			def gradleOpts = "-XX:MaxMetaspaceSize=1024m -Xmx1024m"
1325
			def gradleBatOpts = "$gradleOpts -XX:MaxHeapSize=256m"
P
Phillip Webb 已提交
1326
			File wrapperFile = file("gradlew")
1327 1328
			wrapperFile.text = wrapperFile.text.replace("DEFAULT_JVM_OPTS=",
				"GRADLE_OPTS=\"$gradleOpts \$GRADLE_OPTS\"\nDEFAULT_JVM_OPTS=")
P
Phillip Webb 已提交
1329
			File wrapperBatFile = file("gradlew.bat")
1330 1331 1332 1333
			wrapperBatFile.text = wrapperBatFile.text.replace("set DEFAULT_JVM_OPTS=",
				"set GRADLE_OPTS=$gradleBatOpts %GRADLE_OPTS%\nset DEFAULT_JVM_OPTS=")
		}
	}
1334

1335
}
1336

S
Stephane Nicoll 已提交
1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351
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/**/*"
		}
	}
}

1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362
/*
 * 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-")) {
1363
			return version.replace('BUILD', qualifier)
1364 1365
		}
	}
1366
	return version
1367
}