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

13 14 15 16
plugins {
	id "org.sonarqube" version "1.1"
}

S
Stephane Nicoll 已提交
17 18 19 20 21 22
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'
23
	linkScmDevConnection = 'scm:git:ssh://git@github.com:spring-projects/spring-framework.git'
24

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

C
Chris Beams 已提交
30
configure(allprojects) { project ->
31 32
	group = "org.springframework"
	version = qualifyVersionIfNecessary(version)
33

34
	ext.aspectjVersion       = "1.8.9"
35
	ext.caffeineVersion      = "2.3.1"
36
	ext.eclipselinkVersion   = "2.4.2"
37
	ext.ehcacheVersion       = "2.10.2"
38
	ext.ehcachejcacheVersion = "1.0.1"
39
	ext.ehcache3Version      = "3.1.0"
40
	ext.ejbVersion           = "3.0"
41
	ext.fileuploadVersion    = "1.3.2"
42
	ext.freemarkerVersion    = "2.3.23"
J
Juergen Hoeller 已提交
43
	ext.groovyVersion        = "2.4.7"
44
	ext.gsonVersion          = "2.7"
45
	ext.guavaVersion         = "19.0"
46
	ext.hamcrestVersion      = "1.3"
47
	ext.hibernate3Version    = "3.6.10.Final"
48
	ext.hibernate4Version    = "4.3.11.Final"
J
Juergen Hoeller 已提交
49
	ext.hibernate5Version    = "5.2.1.Final"
50
	ext.hibval4Version       = "4.3.2.Final"
51
	ext.hibval5Version       = "5.2.4.Final"
52
	ext.hsqldbVersion        = "2.3.4"
53
	ext.httpasyncVersion     = "4.1.2"
54
	ext.httpclientVersion    = "4.5.2"
55
	ext.jackson2Version      = "2.8.0.rc2"
56
	ext.jasperreportsVersion = "6.2.1"  // our tests fail with JR-internal NPEs against 6.2.2 and higher
57
	ext.javamailVersion      = "1.5.5"
58
	ext.jettyVersion         = "9.3.10.v20160621"
59
	ext.jodaVersion          = "2.9.4"
60
	ext.jrubyVersion         = "1.7.25"  // JRuby 9000 only supported through JSR-223 (StandardScriptFactory)
61
	ext.jtaVersion           = "1.2"
J
Juergen Hoeller 已提交
62
	ext.junitVersion         = "4.12"
63 64
	ext.junitJupiterVersion  = '5.0.0-SNAPSHOT'
	ext.junitPlatformVersion = '1.0.0-SNAPSHOT'
S
Sam Brannen 已提交
65
	ext.log4jVersion         = "1.2.17"
66
	ext.nettyVersion         = "4.1.1.Final"
67
	ext.okhttpVersion        = "2.7.5"
68
	ext.okhttp3Version       = "3.3.1"
69
	ext.openjpaVersion       = "2.4.1"
70
	ext.poiVersion           = "3.14"
R
Rossen Stoyanchev 已提交
71
	ext.reactorVersion       = "2.0.8.RELEASE"
72 73
	ext.romeVersion          = "1.6.0"
	ext.slf4jVersion         = "1.7.21"
74
	ext.snakeyamlVersion     = "1.17"
75
	ext.snifferVersion       = "1.15"
76
	ext.testngVersion        = "6.9.10"
77
	ext.tiles2Version        = "2.2.2"
78
	ext.tiles3Version        = "3.0.5"
79
	ext.tomcatVersion        = "8.5.3"
80
	ext.tyrusVersion         = "1.3.5"  // constrained by WebLogic 12.1.3 support
J
Juergen Hoeller 已提交
81
	ext.undertowVersion      = "1.4.0.CR2"
82
	ext.xmlunitVersion       = "1.6"
J
Juergen Hoeller 已提交
83
	ext.xstreamVersion       = "1.4.9"
84

85
	ext.gradleScriptDir = "${rootProject.projectDir}/gradle"
86

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

S
Stephane Nicoll 已提交
92 93 94 95 96
	configurations {
		sniffer
		javaApiSignature
	}

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

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

112
	compileJava {
113 114
		sourceCompatibility = 1.8
		targetCompatibility = 1.8
115 116 117
	}

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

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

134
	repositories {
B
Brian Clozel 已提交
135
		maven { url "https://repo.spring.io/libs-release" }
136 137
		// For JUnit Platform and Jupiter snapshots:
		maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
138
	}
C
Chris Beams 已提交
139

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

		sniffer("org.codehaus.mojo:animal-sniffer-ant-tasks:${snifferVersion}")
150
		javaApiSignature("org.codehaus.mojo.signature:java18:1.0@signature")
S
Stephane Nicoll 已提交
151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169
	}

	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
170

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

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

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

S
Stephane Nicoll 已提交
218 219 220 221 222
	configurations {
		jacoco
	}

	dependencies {
223
		jacoco("org.jacoco:org.jacoco.agent:0.7.5.201505241946:runtime")
S
Stephane Nicoll 已提交
224 225 226
	}

	gradle.taskGraph.whenReady {taskGraph ->
227
		if (taskGraph.hasTask(':sonarqube')) {
S
Stephane Nicoll 已提交
228 229 230 231
			test.jvmArgs "-javaagent:${configurations.jacoco.asPath}=destfile=${buildDir}/jacoco.exec,includes=org.springframework.*"
		}
	}

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

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

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

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

		// 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
259 260
	}

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

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

	artifacts {
		archives sourcesJar
		archives javadocJar
	}
C
Chris Beams 已提交
276 277
}

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

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

	configurations.archives.artifacts.clear()
}

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

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

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

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

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

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

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

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

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

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

384
	dependencies {
385 386
		compile(project(":spring-core"))
		compile(files(project(":spring-core").cglibRepackJar))
387
		optional("javax.inject:javax.inject:1")
388
		optional("javax.el:javax.el-api:2.2.5")
389
		optional("org.yaml:snakeyaml:${snakeyamlVersion}")
S
Sam Brannen 已提交
390
		testCompile("log4j:log4j:${log4jVersion}")
391
		testCompile("org.apache.tomcat.embed:tomcat-embed-core:${tomcatVersion}")
J
Juergen Hoeller 已提交
392
	}
C
Chris Beams 已提交
393 394
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

P
Phillip Webb 已提交
617 618
project("spring-jdbc") {
	description = "Spring JDBC"
619

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

P
Phillip Webb 已提交
634 635
project("spring-context-support") {
	description = "Spring Context Support"
636

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

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

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

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

P
Phillip Webb 已提交
738 739
project("spring-orm") {
	description = "Spring Object/Relational Mapping"
740

741
	dependencies {
742 743 744 745 746 747 748
		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"))
749
		optional("org.eclipse.persistence:javax.persistence:2.0.5")
750 751
		optional("org.eclipse.persistence:org.eclipse.persistence.core:${eclipselinkVersion}")
		optional("org.eclipse.persistence:org.eclipse.persistence.jpa:${eclipselinkVersion}") {
752 753 754 755 756 757 758 759 760
			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'
		}
761
		optional("org.apache.openjpa:openjpa:${openjpaVersion}") {
762 763 764 765 766
			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'
		}
767
		optional("javax.jdo:jdo-api:3.1") {
768 769
			exclude group: 'javax.transaction', module: 'transaction-api'
		}
770
		optional("javax.servlet:javax.servlet-api:3.0.1")
771
		testCompile("commons-dbcp:commons-dbcp:1.4")
S
Sam Brannen 已提交
772
		testCompile("org.aspectj:aspectjweaver:${aspectjVersion}")
P
Phillip Webb 已提交
773
		testCompile("org.hsqldb:hsqldb:${hsqldbVersion}")
774
		testCompile("org.slf4j:slf4j-jcl:${slf4jVersion}")
775
	}
C
Chris Beams 已提交
776 777
}

P
Phillip Webb 已提交
778 779
project("spring-orm-hibernate4") {
	description = "Spring Object/Relational Mapping - Hibernate 4 support"
780
	merge.into = project(":spring-orm")
781

782
	dependencies {
783
		provided(project(":spring-jdbc"))
784
		provided(project(":spring-tx"))
785
		optional(project(":spring-web"))
786 787
		optional("org.hibernate:hibernate-core:${hibernate4Version}")
		optional("org.hibernate:hibernate-entitymanager:${hibernate4Version}")
788
		optional("javax.servlet:javax.servlet-api:3.0.1")
789
		testCompile("javax.validation:validation-api:1.1.0.GA")
790
		testCompile("org.hibernate:hibernate-validator:${hibval5Version}")
791 792
		testCompile("javax.el:javax.el-api:2.2.5")
		testCompile("org.glassfish.web:javax.el:2.2.6")
793
	}
794 795
}

796 797 798 799 800 801 802 803
project("spring-orm-hibernate5") {
	description = "Spring Object/Relational Mapping - Hibernate 5 support"
	merge.into = project(":spring-orm")

	dependencies {
		provided(project(":spring-jdbc"))
		provided(project(":spring-tx"))
		optional(project(":spring-web"))
804
		optional("org.hibernate:hibernate-core:${hibernate5Version}")
805
		optional("javax.servlet:javax.servlet-api:3.0.1")
806
		optional("javax.transaction:javax.transaction-api:${jtaVersion}")
807 808 809
	}
}

P
Phillip Webb 已提交
810 811
project("spring-webmvc") {
	description = "Spring Web MVC"
812

813
	dependencies {
814
		compile(project(":spring-aop"))
815 816
		compile(project(":spring-beans"))
		compile(project(":spring-context"))
817
		compile(project(":spring-core"))
818
		compile(files(project(":spring-core").objenesisRepackJar))
819 820
		compile(project(":spring-expression"))
		compile(project(":spring-web"))
821
		provided("javax.servlet:javax.servlet-api:3.1.0")
822 823
		optional(project(":spring-context-support"))  // for Velocity support
		optional(project(":spring-oxm"))  // for MarshallingView
824 825
		optional("javax.servlet.jsp:javax.servlet.jsp-api:2.2.1")
		optional("javax.servlet.jsp.jstl:javax.servlet.jsp.jstl-api:1.2.1")
826
		optional("net.sourceforge.jexcelapi:jxl:2.6.12")
827 828
		optional("org.apache.poi:poi:${poiVersion}")
		optional("org.apache.poi:poi-ooxml:${poiVersion}")
829 830
		optional("org.apache.velocity:velocity:1.7")
		optional("velocity-tools:velocity-tools-view:1.4")
831
		optional("org.freemarker:freemarker:${freemarkerVersion}")
832
		optional("org.codehaus.groovy:groovy-all:${groovyVersion}")
833
		optional("com.lowagie:itext:2.1.7")
834
		optional("net.sf.jasperreports:jasperreports:$jasperreportsVersion") {
835 836 837
			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"
838 839
			exclude group: "org.olap4j", module: "olap4j"
			exclude group: "xml-apis", module: "xml-apis"
A
Andy Wilkinson 已提交
840
			exclude group: "org.springframework", module: "spring-context"
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:${romeVersion}")
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
		optional('org.webjars:webjars-locator:0.32')
864
		testCompile("xmlunit:xmlunit:${xmlunitVersion}")
865
		testCompile("dom4j:dom4j:1.6.1") {
P
Phillip Webb 已提交
866
			exclude group: "xml-apis", module: "xml-apis"
867 868
		}
		testCompile("jaxen:jaxen:1.1.1") {
P
Phillip Webb 已提交
869 870 871
			exclude group: "xml-apis", module: "xml-apis"
			exclude group: "xom", module: "xom"
			exclude group: "xerces", module: "xercesImpl"
872
		}
B
Brian Clozel 已提交
873
		testCompile("org.eclipse.jetty:jetty-servlet:${jettyVersion}") {
B
Brian Clozel 已提交
874
			exclude group: "javax.servlet", module: "javax.servlet"
875
		}
B
Brian Clozel 已提交
876
		testCompile("org.eclipse.jetty:jetty-server:${jettyVersion}") {
B
Brian Clozel 已提交
877
			exclude group: "javax.servlet", module: "javax.servlet"
878 879
		}
		testCompile("javax.validation:validation-api:1.0.0.GA")
880 881 882
		testCompile("org.hibernate:hibernate-validator:${hibval4Version}")
		testCompile("org.apache.httpcomponents:httpclient:${httpclientVersion}")
		testCompile("commons-fileupload:commons-fileupload:${fileuploadVersion}")
883
		testCompile("commons-io:commons-io:1.3")
884
		testCompile("joda-time:joda-time:${jodaVersion}")
885
		testCompile("org.slf4j:slf4j-jcl:${slf4jVersion}")
886 887
		testCompile("org.jruby:jruby:${jrubyVersion}")
		testCompile("org.python:jython-standalone:2.5.3")
888
		testCompile("org.mozilla:rhino:1.7.7.1")
889
		testCompile("org.webjars:underscorejs:1.8.3")
890
	}
C
Chris Beams 已提交
891 892
}

893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924
project("spring-webmvc-tiles2") {
	description = "Spring Framework Tiles2 Integration"
	merge.into = project(":spring-webmvc")

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

P
Phillip Webb 已提交
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:${fileuploadVersion}")
937
	}
C
Chris Beams 已提交
938 939
}

940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979
project("spring-websocket") {
	description = "Spring WebSocket"

	dependencies {
		compile(project(":spring-core"))
		compile(project(":spring-context"))
		compile(project(":spring-web"))
		optional(project(":spring-messaging"))
		optional(project(":spring-webmvc"))
		optional("javax.servlet:javax.servlet-api:3.1.0")
		optional("javax.websocket:javax.websocket-api:1.0")
		optional("org.apache.tomcat:tomcat-websocket:${tomcatVersion}") {
			exclude group: "org.apache.tomcat", module: "tomcat-websocket-api"
			exclude group: "org.apache.tomcat", module: "tomcat-servlet-api"
		}
		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}")
		optional("org.eclipse.jetty:jetty-webapp:${jettyVersion}") {
			exclude group: "javax.servlet", module: "javax.servlet"
		}
		optional("org.eclipse.jetty.websocket:websocket-server:${jettyVersion}") {
			exclude group: "javax.servlet", module: "javax.servlet"
		}
		optional("org.eclipse.jetty.websocket:websocket-client:${jettyVersion}")
		optional("org.eclipse.jetty:jetty-client:${jettyVersion}")
		optional("io.undertow:undertow-core:${undertowVersion}")
		optional("io.undertow:undertow-servlet:${undertowVersion}") {
			exclude group: "org.jboss.spec.javax.servlet", module: "jboss-servlet-api_3.1_spec"
			exclude group: "org.jboss.spec.javax.annotation", module: "jboss-annotations-api_1.2_spec"
		}
		optional("io.undertow:undertow-websockets-jsr:${undertowVersion}") {
			exclude group: "org.jboss.spec.javax.websocket", module: "jboss-websocket-api_1.1_spec"
		}
		optional("com.fasterxml.jackson.core:jackson-databind:${jackson2Version}")
		testCompile("org.apache.tomcat.embed:tomcat-embed-core:${tomcatVersion}")
		testCompile("org.apache.tomcat.embed:tomcat-embed-websocket:${tomcatVersion}")
		testCompile("io.projectreactor:reactor-net:${reactorVersion}")
		testCompile("io.netty:netty-all:${nettyVersion}")
S
Sam Brannen 已提交
980
		testCompile("log4j:log4j:${log4jVersion}")
981 982 983 984
		testCompile("org.slf4j:slf4j-jcl:${slf4jVersion}")
	}
}

P
Phillip Webb 已提交
985 986
project("spring-test") {
	description = "Spring TestContext Framework"
987

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

1047
		testRuntime("org.ehcache:ehcache:${ehcache3Version}")
J
Juergen Hoeller 已提交
1048
		testRuntime("org.terracotta:management-model:2.0.0")
1049
	}
1050 1051

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

	test {
1062
		description = 'Runs JUnit tests.'
1063 1064
		dependsOn testNG
		useJUnit()
1065 1066 1067
		scanForTestClasses = false
		include(['**/*Tests.class', '**/*Test.class', '**/SpringJUnitJupiterTestSuite.class'])
		exclude(['**/testng/**/*.*'])
1068
	}
1069 1070

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

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

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

1083
	dependencies {
1084
		aspects(project(":spring-orm"))
1085 1086 1087
		ajc("org.aspectj:aspectjtools:${aspectjVersion}")
		rt("org.aspectj:aspectjrt:${aspectjVersion}")
		compile("org.aspectj:aspectjweaver:${aspectjVersion}")
1088
		provided("org.eclipse.persistence:javax.persistence:2.0.0")
1089 1090 1091 1092 1093 1094
		optional(project(":spring-aop"))  // for @Async support
		optional(project(":spring-beans"))  // for @Configurable support
		optional(project(":spring-context"))  // for @Enable* support
		optional(project(":spring-context-support"))  // for JavaMail and JSR-107 support
		optional(project(":spring-orm"))  // for JPA exception translation support
		optional(project(":spring-tx"))  // for JPA, @Transactional support
1095
		optional("javax.transaction:javax.transaction-api:${jtaVersion}")  // for @javax.transaction.Transactional support
S
Stephane Nicoll 已提交
1096
		optional("javax.cache:cache-api:1.0.0")
1097
		testCompile(project(":spring-core"))  // for CodeStyleAspect
1098
		testCompile(project(":spring-test"))
1099
		testCompile("javax.mail:javax.mail-api:${javamailVersion}")
1100
	}
1101

1102
	eclipse.project {
P
Phillip Webb 已提交
1103
		natures += "org.eclipse.ajdt.ui.ajnature"
1104
		buildCommands = [new org.gradle.plugins.ide.eclipse.model.BuildCommand("org.eclipse.ajdt.core.ajbuilder")]
1105
	}
C
Chris Beams 已提交
1106 1107
}

1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142
project("spring-framework-bom") {
	description = "Spring Framework (Bill of Materials)"

	configurations.archives.artifacts.clear()
	artifacts {
		// work around GRADLE-2406 by attaching text artifact
		archives(file("spring-framework-bom.txt"))
	}

	install {
		repositories.mavenInstaller {
			pom.whenConfigured {
				packaging = "pom"
				withXml {
					asNode().children().last() + {
						delegate.dependencyManagement {
							delegate.dependencies {
								parent.subprojects.sort { "$it.name" }.each { p ->
									if (p.hasProperty("merge") && p.merge.into == null && p != project) {
										delegate.dependency {
											delegate.groupId(p.group)
											delegate.artifactId(p.name)
											delegate.version(p.version)
										}
									}
								}
							}
						}
					}
				}
			}
		}
	}
}

1143 1144
sonarqube {
	properties {
S
Stephane Nicoll 已提交
1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156
		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"
	}
}

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

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

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

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

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

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

1186 1187 1188 1189 1190
	// TODO: DetectSplitPackagesPlugin fails in line 154 due to method not found on java.io.File.
	// TODO: Possibly related to user rights or OS differences; passes on local Windows machine.
	// detectSplitPackages {
	//	projectsToScan -= project(":spring-instrument-tomcat")
	// }
1191

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

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

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

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

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

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

		doFirst {
			classpath = files(
1244
				// ensure Servlet 3.x and Hibernate 4.x have precedence on the javadoc
1245 1246 1247 1248 1249 1250 1251 1252
				// classpath over their respective 2.5 and 3.x variants
				project(":spring-webmvc").sourceSets.main.compileClasspath.files.find { it =~ "servlet-api" },
				rootProject.sourceSets.test.compileClasspath.files.find { it =~ "hibernate-core" },
				// ensure the javadoc process can resolve types compiled from .aj sources
				project(":spring-aspects").sourceSets.main.output
			)
			classpath += files(subprojects.collect { it.sourceSets.main.compileClasspath })
		}
1253 1254
	}

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

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

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

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

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

			subproject.sourceSets.main.resources.find {
P
Phillip Webb 已提交
1286
				it.path.endsWith("META-INF/spring.schemas")
1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303
			}?.withInputStream { schemas.load(it) }

			for (def key : schemas.keySet()) {
				def shortName = key.replaceAll(/http.*schema.(.*).spring-.*/, '$1')
				assert shortName != key
				File xsdFile = subproject.sourceSets.main.resources.find {
					it.path.endsWith(schemas.get(key))
				}
				assert xsdFile != null
				into (shortName) {
					from xsdFile.path
				}
			}
		}
	}

	task distZip(type: Zip, dependsOn: [docsZip, schemaZip]) {
P
Phillip Webb 已提交
1304 1305 1306
		group = "Distribution"
		baseName = "spring-framework"
		classifier = "dist"
1307
		description = "Builds -${classifier} archive, containing all jars and docs, " +
J
Juergen Hoeller 已提交
1308
			"suitable for community download page."
1309 1310 1311

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

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

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

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

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

1341
	// Create a distribution that contains all dependencies (required and optional).
1342 1343
	// Not published by default; only for use when building from source.
	task depsZip(type: Zip, dependsOn: distZip) { zipTask ->
P
Phillip Webb 已提交
1344 1345 1346
		group = "Distribution"
		baseName = "spring-framework"
		classifier = "dist-with-deps"
1347 1348 1349 1350 1351 1352 1353 1354 1355 1356
		description = "Builds -${classifier} archive, containing everything " +
			"in the -${distZip.classifier} archive plus all runtime dependencies."

		from zipTree(distZip.archivePath)

		gradle.taskGraph.whenReady { taskGraph ->
			if (taskGraph.hasTask(":${zipTask.name}")) {
				def projectNames = rootProject.subprojects*.name
				def artifacts = new HashSet()
				subprojects.each { subproject ->
1357 1358
					(subproject.configurations.runtime.resolvedConfiguration.resolvedArtifacts +
					subproject.configurations.optional.resolvedConfiguration.resolvedArtifacts).each { artifact ->
1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379
						def dependency = artifact.moduleVersion.id
						if (!projectNames.contains(dependency.name)) {
							artifacts << artifact.file
						}
					}
				}

				zipTask.from(artifacts) {
					into "${distZip.baseDir}/deps"
				}
			}
		}
	}

	artifacts {
		archives docsZip
		archives schemaZip
		archives distZip
	}

	task wrapper(type: Wrapper) {
P
Phillip Webb 已提交
1380
		description = "Generates gradlew[.bat] scripts"
S
Sam Brannen 已提交
1381
		gradleVersion = "2.14"
1382 1383

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

1395
}
1396

S
Stephane Nicoll 已提交
1397
configure([project(':spring-build-src'), project(':spring-framework-bom')]) {
1398
	sonarqube {
S
Stephane Nicoll 已提交
1399 1400 1401 1402 1403
		skipProject = true
	}
}

configure(project(':spring-core')) {
1404 1405
	sonarqube {
		properties {
S
Stephane Nicoll 已提交
1406 1407 1408 1409 1410 1411
			property "sonar.exclusions",
					"src/main/java/org/springframework/cglib/**/*,src/main/java/org/springframework/asm/**/*"
		}
	}
}

1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422
/*
 * Support publication of artifacts versioned by topic branch.
 * CI builds supply `-P BRANCH_NAME=<TOPIC>` to gradle at build time.
 * If <TOPIC> starts with 'SPR-', change version
 *     from BUILD-SNAPSHOT => <TOPIC>-SNAPSHOT
 *     e.g. 3.2.1.BUILD-SNAPSHOT => 3.2.1.SPR-1234-SNAPSHOT
 */
def qualifyVersionIfNecessary(version) {
	if (rootProject.hasProperty("BRANCH_NAME")) {
		def qualifier = rootProject.getProperty("BRANCH_NAME")
		if (qualifier.startsWith("SPR-")) {
1423
			return version.replace('BUILD', qualifier)
1424 1425
		}
	}
1426
	return version
1427
}