build.gradle 56.5 KB
Newer Older
1
buildscript {
2
	repositories {
3
		maven { url "https://repo.spring.io/plugins-release" }
4 5
	}
	dependencies {
6
		classpath("io.spring.gradle:dependency-management-plugin:1.0.0.RELEASE")
R
Rob Winch 已提交
7
		classpath("io.spring.gradle:propdeps-plugin:0.0.8")
8
		classpath("io.spring.gradle:docbook-reference-plugin:0.3.1")
9
		classpath("org.asciidoctor:asciidoctor-gradle-plugin:1.5.3")
S
Sebastien Deleuze 已提交
10
		classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.1.0")
11
	}
12 13
}

14
plugins {
15
	id "org.sonarqube" version "2.2.1"
16 17
}

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

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

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

35
	ext.activationApiVersion   = "1.1.1"
36
	ext.annotationApiVersion   = "1.2"
J
Juergen Hoeller 已提交
37
	ext.aspectjVersion         = "1.9.0.BETA-5"
38
	ext.beanvalVersion         = "1.1.0.Final"
39
	ext.cacheApiVersion        = "1.0.0"
40
	ext.caffeineVersion        = "2.4.0"
41
	ext.eclipselinkVersion     = "2.6.4"
42
	ext.ehcacheVersion         = "2.10.3"
43
	ext.ehcachejcacheVersion   = "1.0.1"
44
	ext.ehcache3Version        = "3.3.0"
45
	ext.ejbApiVersion          = "3.2"
J
Juergen Hoeller 已提交
46
	ext.elApiVersion           = "3.0.1-b04"
47 48
	ext.fileuploadVersion      = "1.3.2"
	ext.freemarkerVersion      = "2.3.25-incubating"
49
	ext.groovyVersion          = "2.4.9"
50
	ext.gsonVersion            = "2.8.0"
51
	ext.hamcrestVersion        = "1.3"
52
	ext.hibernate5Version      = "5.2.8.Final"
53
	ext.hibval5Version         = "5.4.0.Final"
54
	ext.hsqldbVersion          = "2.3.4"
55
	ext.httpasyncVersion       = "4.1.3"
56
	ext.httpclientVersion      = "4.5.3"
57
	ext.interceptorApiVersion  = "1.2"
58
	ext.jackson2Version        = "2.9.0.pr1"
59
	ext.javamailVersion        = "1.5.6"
60
	ext.jaxbVersion            = "2.2.11"
61
	ext.jaxwsVersion           = "2.2.11"
62
	ext.jcaVersion             = "1.7"
63
	ext.jettyVersion           = "9.4.2.v20170220"
64
	ext.jmsVersion             = "2.0.1"
65
	ext.jodaVersion            = "2.9.7"
66
	ext.jpaVersion             = "2.1.1"
67
	ext.jsfVersion             = "2.2"
68 69 70
	ext.jspVersion             = "2.3.2-b02"
	ext.jtaVersion             = "1.2"
	ext.junitVersion           = "4.12"
J
Juergen Hoeller 已提交
71 72
	ext.junitJupiterVersion    = '5.0.0-M3'
	ext.junitPlatformVersion   = '1.0.0-M3'
S
Sebastien Deleuze 已提交
73
	ext.kotlinVersion          = "1.1.0"  // also change kotlin-gradle-plugin version when upgrading
74
	ext.log4jVersion           = '2.8.1'
75
	ext.nettyVersion           = "4.1.8.Final"
76
	ext.okhttp3Version         = "3.6.0"
77
	ext.poiVersion             = "3.15"
78
	ext.protobufVersion        = "3.1.0"
79
	ext.quartzVersion          = "2.2.3"
80
	ext.reactorVersion         = "Aluminium-SR1"
81
	ext.romeVersion            = "1.7.1"
82
	ext.rxjavaVersion          = '1.2.7'
83
	ext.rxjavaAdapterVersion   = '1.2.1'
84
	ext.rxjava2Version         = '2.0.6'
85
	ext.rxnettyVersion         = '0.5.2'
86
	ext.servletVersion         = "3.1.0"
87
	ext.slf4jVersion           = "1.7.24"
88
	ext.snakeyamlVersion       = "1.18"
89
	ext.snifferVersion         = "1.15"
90
	ext.testngVersion          = "6.10"
J
Juergen Hoeller 已提交
91
	ext.tiles3Version          = "3.0.7"
B
Brian Clozel 已提交
92
	ext.tomcatVersion          = "8.5.11"
93
	ext.tyrusVersion           = "1.13.1"
94
	ext.undertowVersion        = "1.4.11.Final"
95
	ext.websocketVersion       = "1.1"
96
	ext.woodstoxVersion        = "5.0.3"
97
	ext.xmlunitVersion         = "2.3.0"
98
	ext.xnioVersion            = "3.4.3.Final"
99
	ext.xstreamVersion         = "1.4.9"
100

101
	ext.gradleScriptDir = "${rootProject.projectDir}/gradle"
102

103
	apply plugin: "propdeps"
P
Phillip Webb 已提交
104
	apply plugin: "java"
105
	apply plugin: "test-source-set-dependencies"
106
	apply from: "${gradleScriptDir}/ide.gradle"
C
Chris Beams 已提交
107

S
Sebastien Deleuze 已提交
108 109 110
	// Kotlin compiler does not support JDK 9 yet, see https://youtrack.jetbrains.com/issue/KT-14988
	if (!JavaVersion.current().java9Compatible) {
		apply plugin: "kotlin"
111 112 113 114 115 116
		compileKotlin {
			kotlinOptions.jvmTarget = "1.8"
		}
		compileTestKotlin {
			kotlinOptions.jvmTarget = "1.8"
		}
S
Sebastien Deleuze 已提交
117 118
	}

S
Stephane Nicoll 已提交
119 120 121 122 123
	configurations {
		sniffer
		javaApiSignature
	}

124
	configurations.all {
J
Juergen Hoeller 已提交
125
		// Check for updates every build
126 127
		resolutionStrategy.cacheChangingModulesFor 0, 'seconds'

J
Juergen Hoeller 已提交
128
		// Consistent netty version (e.g. clashes between netty-all vs netty-common)
129 130 131 132 133 134 135
		resolutionStrategy.eachDependency { DependencyResolveDetails details ->
			if (details.requested.group == 'io.netty') {
				details.useVersion nettyVersion
			}
		}
	}

P
Phillip Webb 已提交
136 137 138
	compileJava.options*.compilerArgs = [
		"-Xlint:serial", "-Xlint:varargs", "-Xlint:cast", "-Xlint:classfile",
		"-Xlint:dep-ann", "-Xlint:divzero", "-Xlint:empty", "-Xlint:finally",
S
Stephane Nicoll 已提交
139
		"-Xlint:overrides", "-Xlint:path", "-Xlint:processing", "-Xlint:static",
P
Phillip Webb 已提交
140
		"-Xlint:try", "-Xlint:fallthrough", "-Xlint:rawtypes", "-Xlint:deprecation",
141
		"-Xlint:unchecked", "-Xlint:-options", "-Werror"
142
	]
C
Chris Beams 已提交
143

P
Phillip Webb 已提交
144
	compileTestJava.options*.compilerArgs = [
145
		"-Xlint:serial", "-Xlint:-varargs", "-Xlint:cast", "-Xlint:classfile",
P
Phillip Webb 已提交
146
		"-Xlint:dep-ann", "-Xlint:divzero", "-Xlint:empty", "-Xlint:finally",
S
Stephane Nicoll 已提交
147
		"-Xlint:overrides", "-Xlint:path", "-Xlint:processing", "-Xlint:static",
P
Phillip Webb 已提交
148 149 150
		"-Xlint:try", "-Xlint:-fallthrough", "-Xlint:-rawtypes", "-Xlint:-deprecation",
		"-Xlint:-unchecked", "-Xlint:-options"]

151
	compileJava {
152 153
		sourceCompatibility = 1.8
		targetCompatibility = 1.8
154
		options.encoding = 'UTF-8'
155 156 157
	}

	compileTestJava {
J
Juergen Hoeller 已提交
158 159
		sourceCompatibility = 1.8
		targetCompatibility = 1.8
160
		options.encoding = 'UTF-8'
161
		options.compilerArgs += "-parameters"
J
Juergen Hoeller 已提交
162 163
	}

C
Chris Beams 已提交
164 165
	test {
		systemProperty("java.awt.headless", "true")
166
		systemProperty("testGroups", project.properties.get("testGroups"))
167
		scanForTestClasses = false
168
		include(["**/*Tests.class", "**/*Test.class"])
169 170
		// Since we set scanForTestClasses to false, we need to filter out inner
		// classes with the "$" pattern; otherwise, using -Dtest.single=MyTests to
171
		// run MyTests by itself will fail if MyTests contains any inner classes.
172
		exclude(["**/Abstract*.class", '**/*$*'])
S
Stephane Nicoll 已提交
173
		reports.junitXml.destination = file("$buildDir/test-results")
C
Chris Beams 已提交
174
	}
C
Chris Beams 已提交
175

176
	repositories {
B
Brian Clozel 已提交
177
		maven { url "https://repo.spring.io/libs-release" }
178
		maven { url "https://repo.spring.io/milestone" }
179
	}
C
Chris Beams 已提交
180

181
	dependencies {
182 183 184
		testCompile("junit:junit:${junitVersion}") {
			exclude group:'org.hamcrest', module:'hamcrest-core'
		}
185
		testCompile("org.mockito:mockito-core:2.6.1") {
186 187
			exclude group:'org.hamcrest', module:'hamcrest-core'
		}
188
		testCompile("org.hamcrest:hamcrest-all:${hamcrestVersion}")
189 190
		testRuntime("org.apache.logging.log4j:log4j-core:${log4jVersion}")
		testRuntime("org.apache.logging.log4j:log4j-jcl:${log4jVersion}")
191

S
Stephane Nicoll 已提交
192
		sniffer("org.codehaus.mojo:animal-sniffer-ant-tasks:${snifferVersion}")
193
		javaApiSignature("org.codehaus.mojo.signature:java18:1.0@signature")
S
Stephane Nicoll 已提交
194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212
	}

	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
213

S
Stephane Nicoll 已提交
214 215 216 217 218 219 220
		doLast {
			ant.taskdef(
				name: 'animalSniffer',
				classname: 'org.codehaus.mojo.animal_sniffer.ant.CheckSignatureTask',
				classpath: configurations.sniffer.asPath
			)

221 222 223 224 225 226 227
			// TODO: Animal Sniffer currently chokes on optional JDK 9 bytecode in AspectJ 1.9 beta 5
			// ant.animalSniffer(
			// 		signature: "$buildDir/javaApiSignature/javaApi.signature",
			// 		classpath: sourceSets.main.compileClasspath.asPath) {
			// 	path(path: sourceSets.main.output.classesDir)
			// 	annotation(className: "org.springframework.lang.UsesSunHttpServer")
			// }
S
Stephane Nicoll 已提交
228
		}
229
	}
C
Chris Beams 已提交
230 231

	ext.javadocLinks = [
232
		"http://docs.oracle.com/javase/8/docs/api/",
233
		"http://docs.oracle.com/javaee/7/api/",
234
		"http://docs.oracle.com/cd/E13222_01/wls/docs90/javadocs/",  // CommonJ
J
Juergen Hoeller 已提交
235 236
		"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 已提交
237 238
		"http://docs.jboss.org/jbossas/javadoc/4.0.5/connector/",
		"http://docs.jboss.org/jbossas/javadoc/7.1.2.Final/",
239
		"http://tiles.apache.org/tiles-request/apidocs/",
J
Juergen Hoeller 已提交
240
		"http://tiles.apache.org/framework/apidocs/",
C
Chris Beams 已提交
241
		"http://www.eclipse.org/aspectj/doc/released/aspectj5rt-api/",
B
Brian Clozel 已提交
242 243
		"http://ehcache.org/apidocs/${ehcacheVersion}",
		"http://ehcache.org/apidocs/${ehcache3Version}",
244
		"http://quartz-scheduler.org/api/2.2.1/",
245 246 247
		"http://fasterxml.github.io/jackson-core/javadoc/2.8/",
		"http://fasterxml.github.io/jackson-databind/javadoc/2.8/",
		"http://fasterxml.github.io/jackson-dataformat-xml/javadoc/2.8/",
248
		"http://hc.apache.org/httpcomponents-client-ga/httpclient/apidocs/"
C
Chris Beams 已提交
249
	] as String[]
250 251
}

252
configure(subprojects - project(":spring-build-src")) { subproject ->
253
	apply plugin: "merge"
254
	apply from: "${gradleScriptDir}/publish-maven.gradle"
255 256 257 258 259 260 261 262 263 264 265
	apply plugin: "io.spring.dependency-management"

	dependencyManagement {
		imports {
			mavenBom "io.projectreactor:reactor-bom:${reactorVersion}"
		}
		resolutionStrategy {
			cacheChangingModulesFor 0, 'seconds'
		}
		applyMavenExclusions = false
	}
266

S
Stephane Nicoll 已提交
267 268 269 270
	configurations {
		jacoco
	}
	dependencies {
271
		jacoco("org.jacoco:org.jacoco.agent:0.7.5.201505241946:runtime")
S
Stephane Nicoll 已提交
272 273 274
	}

	gradle.taskGraph.whenReady {taskGraph ->
275
		if (taskGraph.hasTask(':sonarqube')) {
S
Stephane Nicoll 已提交
276 277 278 279
			test.jvmArgs "-javaagent:${configurations.jacoco.asPath}=destfile=${buildDir}/jacoco.exec,includes=org.springframework.*"
		}
	}

280
	jar {
P
Phillip Webb 已提交
281 282 283 284
		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
285 286 287 288 289

		from("${rootProject.projectDir}/src/dist") {
			include "license.txt"
			include "notice.txt"
			into "META-INF"
P
Phillip Webb 已提交
290
			expand(copyright: new Date().format("yyyy"), version: project.version)
291 292 293 294
		}
	}

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

297 298 299
		options.memberLevel = org.gradle.external.javadoc.JavadocMemberLevel.PROTECTED
		options.author = true
		options.header = project.name
C
Chris Beams 已提交
300
		options.links(project.ext.javadocLinks)
301
		options.addStringOption('Xdoclint:none', '-quiet')
C
Chris Beams 已提交
302

303 304
		// Suppress warnings due to cross-module @see and @link references.
		// Note that global 'api' task does display all warnings.
C
Chris Beams 已提交
305
		logging.captureStandardError LogLevel.INFO
306
		logging.captureStandardOutput LogLevel.INFO  // suppress "## warnings" message
307 308
	}

309 310
	task sourcesJar(type: Jar, dependsOn: classes) {
		classifier = 'sources'
311
		from sourceSets.main.allSource
312
		// Don't include or exclude anything explicitly by default. See SPR-12085.
313 314 315
	}

	task javadocJar(type: Jar) {
P
Phillip Webb 已提交
316
		classifier = "javadoc"
317 318 319 320 321 322 323
		from javadoc
	}

	artifacts {
		archives sourcesJar
		archives javadocJar
	}
C
Chris Beams 已提交
324 325
}

326 327
project("spring-build-src") {
	description = "Exposes gradle buildSrc for IDE support"
328

329
	apply plugin: "groovy"
330 331 332

	dependencies {
		compile gradleApi()
R
Rob Winch 已提交
333
		compile localGroovy()
334 335 336 337 338
	}

	configurations.archives.artifacts.clear()
}

P
Phillip Webb 已提交
339 340
project("spring-core") {
	description = "Spring Core"
341

342 343
	// 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
344
	// further transformed by the JarJar task to depend on org.springframework.asm; this
345
	// avoids including two different copies of asm unnecessarily.
J
Juergen Hoeller 已提交
346
	def cglibVersion = "3.2.5"
J
Juergen Hoeller 已提交
347
	def objenesisVersion = "2.5.1"
348 349 350 351

	configurations {
		jarjar
		cglib
352
		objenesis
353 354 355 356 357 358 359 360 361 362 363 364 365 366
	}

	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)
					}
J
Juergen Hoeller 已提交
367
					// Repackage net.sf.cglib => org.springframework.cglib
P
Phillip Webb 已提交
368
					rule(pattern: "net.sf.cglib.**", result: "org.springframework.cglib.@1")
J
Juergen Hoeller 已提交
369
					// As mentioned above, transform cglib"s internal asm dependencies from
370 371
					// 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 已提交
372
					rule(pattern: "org.objectweb.asm.**", result: "org.springframework.asm.@1")
373 374 375 376 377
				}
			}
		}
	}

378 379 380 381 382 383 384 385 386 387 388 389
	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)
					}
J
Juergen Hoeller 已提交
390
					// Repackage org.objenesis => org.springframework.objenesis
391 392 393 394 395 396
					rule(pattern: "org.objenesis.**", result: "org.springframework.objenesis.@1")
				}
			}
		}
	}

397
	dependencies {
398
		cglib("cglib:cglib:${cglibVersion}@jar")
399
		objenesis("org.objenesis:objenesis:${objenesisVersion}@jar")
400
		jarjar("com.googlecode.jarjar:jarjar:1.3")
401

P
Phillip Webb 已提交
402
		compile(files(cglibRepackJar))
403
		compile(files(objenesisRepackJar))
404
		compile("commons-logging:commons-logging:1.2")
405
		optional("net.sf.jopt-simple:jopt-simple:5.0.3")
406
		optional("org.aspectj:aspectjweaver:${aspectjVersion}")
407
		optional("org.jetbrains.kotlin:kotlin-reflect:${kotlinVersion}")
408
		optional("org.jetbrains.kotlin:kotlin-stdlib-jre8:${kotlinVersion}")
409 410
		optional("org.reactivestreams:reactive-streams")
		optional("io.projectreactor:reactor-core")
411
		optional "io.reactivex:rxjava:${rxjavaVersion}"
S
Sebastien Deleuze 已提交
412
		optional "io.reactivex.rxjava2:rxjava:${rxjava2Version}"
413
		optional "io.reactivex:rxjava-reactive-streams:${rxjavaAdapterVersion}"
414
		optional("io.netty:netty-buffer:${nettyVersion}")
415
		testCompile("io.projectreactor.addons:reactor-test")
416
		testCompile("javax.xml.bind:jaxb-api:${jaxbVersion}")
417
		testCompile("org.apache.tomcat.embed:tomcat-embed-core:${tomcatVersion}")
418
		testCompile("org.xmlunit:xmlunit-matchers:${xmlunitVersion}")
419
		testCompile("com.fasterxml.woodstox:woodstox-core:${woodstoxVersion}") {
P
Phillip Webb 已提交
420 421
			exclude group: "stax", module: "stax-api"
		}
422 423 424
	}

	jar {
J
Juergen Hoeller 已提交
425
		// Inline repackaged cglib classes directly into spring-core jar
426 427
		dependsOn cglibRepackJar
		from(zipTree(cglibRepackJar.archivePath)) {
P
Phillip Webb 已提交
428
			include "org/springframework/cglib/**"
429
		}
430 431 432 433 434

		dependsOn objenesisRepackJar
		from(zipTree(objenesisRepackJar.archivePath)) {
			include "org/springframework/objenesis/**"
		}
435
	}
C
Chris Beams 已提交
436 437
}

P
Phillip Webb 已提交
438 439
project("spring-beans") {
	description = "Spring Beans"
440

441
	dependencies {
442 443
		compile(project(":spring-core"))
		compile(files(project(":spring-core").cglibRepackJar))
444
		optional("javax.inject:javax.inject:1")
445
		optional("org.jetbrains.kotlin:kotlin-reflect:${kotlinVersion}")
446
		optional("org.jetbrains.kotlin:kotlin-stdlib-jre8:${kotlinVersion}")
447
		optional("org.yaml:snakeyaml:${snakeyamlVersion}")
448
		testCompile("org.apache.tomcat.embed:tomcat-embed-core:${tomcatVersion}")
J
Juergen Hoeller 已提交
449
	}
C
Chris Beams 已提交
450 451
}

452 453
project("spring-beans-groovy") {
	description "Groovy Bean Definitions"
454

J
Juergen Hoeller 已提交
455
	merge.into = project(":spring-beans")
456
	apply plugin: "groovy"
J
Juergen Hoeller 已提交
457 458 459

	dependencies {
		compile(project(":spring-core"))
460
		optional("org.codehaus.groovy:groovy-all:${groovyVersion}")
J
Juergen Hoeller 已提交
461 462
	}

J
Juergen Hoeller 已提交
463
	// This module's Java and Groovy sources need to be compiled together.
464
	compileJava.enabled = false
J
Juergen Hoeller 已提交
465 466 467
	sourceSets {
		main {
			groovy {
468
				srcDir "src/main/java"
J
Juergen Hoeller 已提交
469 470 471
			}
		}
	}
472 473

	compileGroovy {
474 475
		sourceCompatibility = 1.8
		targetCompatibility = 1.8
476
	}
J
Juergen Hoeller 已提交
477 478
}

P
Phillip Webb 已提交
479 480
project("spring-aop") {
	description = "Spring AOP"
481

482
	dependencies {
483
		compile(project(":spring-beans"))
484 485
		compile(project(":spring-core"))
		compile(files(project(":spring-core").cglibRepackJar))
486
		compile(files(project(":spring-core").objenesisRepackJar))
487
		optional("org.aspectj:aspectjweaver:${aspectjVersion}")
488
		optional("org.apache.commons:commons-pool2:2.4.2")
489
		optional("com.jamonapi:jamon:2.81")
490
	}
C
Chris Beams 已提交
491 492
}

P
Phillip Webb 已提交
493 494
project("spring-expression") {
	description = "Spring Expression Language (SpEL)"
495

496
	dependencies {
497
		compile(project(":spring-core"))
498
	}
C
Chris Beams 已提交
499 500
}

P
Phillip Webb 已提交
501 502
project("spring-instrument") {
	description = "Spring Instrument"
503

504
	jar {
P
Phillip Webb 已提交
505 506
		manifest.attributes["Premain-Class"] =
			"org.springframework.instrument.InstrumentationSavingAgent"
507 508
		manifest.attributes["Agent-Class"] =
			"org.springframework.instrument.InstrumentationSavingAgent"
509 510 511
		manifest.attributes["Can-Redefine-Classes"] = "true"
		manifest.attributes["Can-Retransform-Classes"] = "true"
		manifest.attributes["Can-Set-Native-Method-Prefix"] = "false"
512
	}
C
Chris Beams 已提交
513 514
}

P
Phillip Webb 已提交
515 516
project("spring-context") {
	description = "Spring Context"
517

518
	apply plugin: "groovy"
519

520
	dependencies {
521 522 523 524 525
		compile(project(":spring-aop"))
		compile(project(":spring-beans"))
		compile(project(":spring-expression"))
		compile(project(":spring-core"))
		compile(files(project(":spring-core").cglibRepackJar))
526
		optional(project(":spring-instrument"))
527
		optional("javax.inject:javax.inject:1")
528 529
		optional("javax.annotation:javax.annotation-api:${annotationApiVersion}")
		optional("javax.xml.ws:jaxws-api:${jaxwsVersion}")
530
		optional("javax.ejb:javax.ejb-api:${ejbApiVersion}")
S
Stephane Nicoll 已提交
531
		optional("javax.interceptor:javax.interceptor-api:${interceptorApiVersion}")
532
		optional("javax.enterprise.concurrent:javax.enterprise.concurrent-api:1.0")
533
		optional("javax.money:money-api:1.0.1")
J
Juergen Hoeller 已提交
534 535
		optional("org.eclipse.persistence:javax.persistence:${jpaVersion}")
		optional("javax.validation:validation-api:${beanvalVersion}")
536
		optional("org.hibernate:hibernate-validator:${hibval5Version}")
537 538
		optional("joda-time:joda-time:${jodaVersion}")
		optional("org.aspectj:aspectjweaver:${aspectjVersion}")
J
Juergen Hoeller 已提交
539
		optional("org.codehaus.groovy:groovy-all:${groovyVersion}")
540
		optional("org.beanshell:bsh:2.0b5")
541
		optional("org.jetbrains.kotlin:kotlin-stdlib-jre8:${kotlinVersion}")
542
		testCompile("org.apache.commons:commons-pool2:2.4.2")
543
		testCompile("org.slf4j:slf4j-api:${slf4jVersion}")
544
		testCompile("javax.inject:javax.inject-tck:1")
545
		testRuntime("javax.xml.bind:jaxb-api:${jaxbVersion}")
546 547 548
		testRuntime("javax.el:javax.el-api:${elApiVersion}")
		testRuntime("org.glassfish:javax.el:3.0.1-b08")
		testRuntime("org.javamoney:moneta:1.1")
549 550 551 552 553 554 555 556 557 558
	}
}

project("spring-oxm") {
	description = "Spring Object/XML Marshalling"
	apply from: "oxm.gradle"

	dependencies {
		compile(project(":spring-beans"))
		compile(project(":spring-core"))
559 560
		optional("javax.xml.bind:jaxb-api:${jaxbVersion}")
		optional("javax.activation:activation:${activationApiVersion}")
561 562 563 564 565 566 567 568 569 570 571
		optional("org.codehaus.castor:castor-xml:1.4.1")  {
			exclude group: 'stax', module: 'stax-api'
			exclude group: "org.springframework", module: "spring-context"
		}
		optional("com.thoughtworks.xstream:xstream:${xstreamVersion}") {
			exclude group: 'xpp3', module: 'xpp3_min'
			exclude group: 'xmlpull', module: 'xmlpull'
		}
		optional("org.jibx:jibx-run:1.2.6")
		testCompile(project(":spring-context"))
		testCompile("xpp3:xpp3:1.1.4c")
572
		testCompile("org.codehaus.jettison:jettison:1.3.8") {
573 574
			exclude group: 'stax', module: 'stax-api'
		}
575
		testCompile("org.xmlunit:xmlunit-matchers:${xmlunitVersion}")
576 577
        testCompile(files(genCastor.classesDir).builtBy(genCastor))
        testCompile(files(genJaxb.classesDir).builtBy(genJaxb))
578 579 580
		testRuntime("xerces:xercesImpl:2.11.0")  // for Castor
		testRuntime("com.sun.xml.bind:jaxb-core:${jaxbVersion}")
		testRuntime("com.sun.xml.bind:jaxb-impl:${jaxbVersion}")
581
	}
582 583 584 585 586 587 588 589 590
}

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

	dependencies {
		compile(project(":spring-beans"))
		compile(project(":spring-core"))
		compile(project(":spring-context"))
591
		optional(project(":spring-oxm"))
592 593
		optional("io.projectreactor:reactor-core")
		optional("io.projectreactor.ipc:reactor-netty")
594
		optional("io.netty:netty-all:${nettyVersion}")
B
Brian Clozel 已提交
595
		optional("org.eclipse.jetty.websocket:websocket-server:${jettyVersion}") {
B
Brian Clozel 已提交
596 597
			exclude group: "javax.servlet", module: "javax.servlet-api"
		}
B
Brian Clozel 已提交
598
		optional("org.eclipse.jetty.websocket:websocket-client:${jettyVersion}")
599
		optional("com.fasterxml.jackson.core:jackson-databind:${jackson2Version}")
600
		optional("javax.xml.bind:jaxb-api:${jaxbVersion}")
601
		testCompile("javax.inject:javax.inject-tck:1")
602
		testCompile("javax.servlet:javax.servlet-api:${servletVersion}")
J
Juergen Hoeller 已提交
603
		testCompile("javax.validation:validation-api:${beanvalVersion}")
604
		testCompile("com.thoughtworks.xstream:xstream:${xstreamVersion}")
605 606 607 608 609
		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 已提交
610
		testCompile("org.eclipse.jetty:jetty-webapp:${jettyVersion}") {
B
Brian Clozel 已提交
611
			exclude group: "javax.servlet", module: "javax.servlet-api"
612
		}
613 614
		testCompile("org.apache.tomcat.embed:tomcat-embed-core:${tomcatVersion}")
		testCompile("org.apache.tomcat.embed:tomcat-embed-websocket:${tomcatVersion}")
615
		testCompile("io.netty:netty-all:${nettyVersion}")
616
		testCompile("org.xmlunit:xmlunit-matchers:${xmlunitVersion}")
617
		testCompile("org.slf4j:slf4j-jcl:${slf4jVersion}")
S
Sebastien Deleuze 已提交
618
		testCompile("org.jetbrains.kotlin:kotlin-reflect:${kotlinVersion}")
619
		testCompile("org.jetbrains.kotlin:kotlin-stdlib-jre8:${kotlinVersion}")
620
		testRuntime("javax.activation:activation:${activationApiVersion}")
621 622
		testRuntime("com.sun.xml.bind:jaxb-core:${jaxbVersion}")
		testRuntime("com.sun.xml.bind:jaxb-impl:${jaxbVersion}")
623
	}
624 625 626 627 628

	if (JavaVersion.current().java9Compatible) {
		// Reactor2TcpClient's use of Netty requires access to sun.nio.ch.SelectorImpl
		test.jvmArgs(["--add-exports", "java.base/sun.nio.ch=ALL-UNNAMED"])
	}
C
Chris Beams 已提交
629 630
}

P
Phillip Webb 已提交
631 632
project("spring-tx") {
	description = "Spring Transaction"
633

634
	dependencies {
635 636
		compile(project(":spring-beans"))
		compile(project(":spring-core"))
637
		optional(project(":spring-aop"))
638
		optional(project(":spring-context"))  // for JCA, @EnableTransactionManagement
639
		optional("javax.transaction:javax.transaction-api:${jtaVersion}")
J
Juergen Hoeller 已提交
640
		optional("javax.resource:javax.resource-api:${jcaVersion}")
641
		optional("javax.ejb:javax.ejb-api:${ejbApiVersion}")
S
Stephane Nicoll 已提交
642
		optional("javax.interceptor:javax.interceptor-api:${interceptorApiVersion}")
643
		optional("com.ibm.websphere:uow:6.0.2.17")
644
		testCompile("org.aspectj:aspectjweaver:${aspectjVersion}")
J
Juergen Hoeller 已提交
645
		testCompile("org.eclipse.persistence:javax.persistence:${jpaVersion}")
646
		testCompile("org.codehaus.groovy:groovy-all:${groovyVersion}")
647
	}
C
Chris Beams 已提交
648 649
}

P
Phillip Webb 已提交
650 651
project("spring-jms") {
	description = "Spring JMS"
652

653
	dependencies {
654 655 656 657
		compile(project(":spring-core"))
		compile(project(":spring-beans"))
		compile(project(":spring-aop"))
		compile(project(":spring-context"))
658
		compile(project(":spring-messaging"))
659
		compile(project(":spring-tx"))
660
		provided("javax.jms:javax.jms-api:${jmsVersion}")
661
		optional(project(":spring-oxm"))
662
		optional("javax.transaction:javax.transaction-api:${jtaVersion}")
J
Juergen Hoeller 已提交
663
		optional("javax.resource:javax.resource-api:${jcaVersion}")
664
		optional("com.fasterxml.jackson.core:jackson-databind:${jackson2Version}")
665
		testRuntime("javax.activation:activation:${activationApiVersion}")
666
	}
C
Chris Beams 已提交
667 668
}

P
Phillip Webb 已提交
669 670
project("spring-jdbc") {
	description = "Spring JDBC"
671

672
	dependencies {
673
		compile(project(":spring-beans"))
674
		compile(project(":spring-core"))
675
		compile(project(":spring-tx"))
676
		optional(project(":spring-context"))  // for JndiDataSourceLookup
677
		optional("javax.transaction:javax.transaction-api:${jtaVersion}")
P
Phillip Webb 已提交
678
		optional("org.hsqldb:hsqldb:${hsqldbVersion}")
679 680 681
		optional("com.h2database:h2:1.4.193")
		optional("org.apache.derby:derby:10.13.1.1")
		optional("org.apache.derby:derbyclient:10.13.1.1")
M
Mario Arias 已提交
682
		optional("org.jetbrains.kotlin:kotlin-reflect:${kotlinVersion}")
683
		optional("org.jetbrains.kotlin:kotlin-stdlib-jre8:${kotlinVersion}")
684
	}
C
Chris Beams 已提交
685 686
}

P
Phillip Webb 已提交
687 688
project("spring-context-support") {
	description = "Spring Context Support"
689

690
	dependencies {
691 692 693
		compile(project(":spring-core"))
		compile(project(":spring-beans"))
		compile(project(":spring-context"))
694 695
		optional(project(":spring-jdbc"))  // for Quartz support
		optional(project(":spring-tx"))  // for Quartz support
696
		optional("javax.activation:activation:${activationApiVersion}")
697
		optional("javax.mail:javax.mail-api:${javamailVersion}")
698
		optional("javax.cache:cache-api:${cacheApiVersion}")
B
Ben Manes 已提交
699
		optional("com.github.ben-manes.caffeine:caffeine:${caffeineVersion}")
700
		optional("net.sf.ehcache:ehcache:${ehcacheVersion}")
701
		optional("org.quartz-scheduler:quartz:${quartzVersion}")
702
		optional("org.codehaus.fabric3.api:commonj:1.1.0")
703
		optional("org.freemarker:freemarker:${freemarkerVersion}")
704
		optional("com.lowagie:itext:2.1.7")
705
		testCompile(project(":spring-context"))
706
		testCompile("org.apache.poi:poi:${poiVersion}")
P
Phillip Webb 已提交
707
		testCompile("org.hsqldb:hsqldb:${hsqldbVersion}")
708
		testCompile("org.slf4j:slf4j-api:${slf4jVersion}")
709
		testRuntime("com.sun.mail:javax.mail:${javamailVersion}")
710
		testRuntime("org.ehcache:jcache:${ehcachejcacheVersion}")
711
	}
C
Chris Beams 已提交
712 713
}

714 715 716 717 718 719 720 721 722 723 724
project("spring-context-indexer") {
	description = "Spring Context Indexer"

	dependencies {
		testCompile(project(":spring-context"))
		testCompile("javax.inject:javax.inject:1")
		testCompile("javax.annotation:javax.annotation-api:${annotationApiVersion}")
		testCompile("org.eclipse.persistence:javax.persistence:${jpaVersion}")
	}
}

P
Phillip Webb 已提交
725 726
project("spring-web") {
	description = "Spring Web"
S
Sebastien Deleuze 已提交
727

728
	apply plugin: "groovy"
729

730
	dependencies {
731 732
		compile(project(":spring-aop"))  // for JaxWsPortProxyFactoryBean
		compile(project(":spring-beans"))  // for MultipartFilter
733
		compile(project(":spring-context"))
734
		compile(project(":spring-core"))
735
		provided "javax.servlet:javax.servlet-api:${servletVersion}"
736
		optional(project(":spring-oxm"))  // for MarshallingHttpMessageConverter
737
		optional("javax.servlet.jsp:javax.servlet.jsp-api:${jspVersion}")
738
		optional("javax.el:javax.el-api:${elApiVersion}")
739
		optional("javax.faces:javax.faces-api:${jsfVersion}")
J
Juergen Hoeller 已提交
740
		optional("javax.validation:validation-api:${beanvalVersion}")
741
		optional("javax.activation:activation:${activationApiVersion}")
742
		optional("org.codehaus.groovy:groovy-all:${groovyVersion}")
743
		optional("com.caucho:hessian:4.0.38")
744
		optional("commons-fileupload:commons-fileupload:${fileuploadVersion}")
745 746 747
		optional("org.reactivestreams:reactive-streams")
		optional("io.projectreactor:reactor-core")
		optional("io.projectreactor.ipc:reactor-netty")
J
Juergen Hoeller 已提交
748
		optional("io.reactivex:rxnetty-http:${rxnettyVersion}") {
749 750
			exclude group: 'io.reactivex', module: 'rxjava'
		}
751
		optional("io.reactivex:rxjava:${rxjavaVersion}")
S
Sebastien Deleuze 已提交
752
		optional "io.reactivex.rxjava2:rxjava:${rxjava2Version}"
753
		optional("io.reactivex:rxjava-reactive-streams:${rxjavaAdapterVersion}")
B
Brian Clozel 已提交
754
		optional("org.apache.tomcat.embed:tomcat-embed-core:${tomcatVersion}")
755
		optional("io.undertow:undertow-core:${undertowVersion}")
756
		optional("org.jboss.xnio:xnio-api:${xnioVersion}")
757 758
		optional("io.netty:netty-buffer:${nettyVersion}")  // temporarily for JsonObjectDecoder
	  	optional("com.fasterxml.woodstox:woodstox-core:${woodstoxVersion}") {  // woodstox before aalto
759 760
			exclude group: "stax", module: "stax-api"
		}
761
		optional("com.fasterxml:aalto-xml:1.0.0")
762 763
		optional("org.apache.httpcomponents:httpclient:${httpclientVersion}")
		optional("org.apache.httpcomponents:httpasyncclient:${httpasyncVersion}")
764
		optional("io.netty:netty-all:${nettyVersion}")
765
		optional("com.squareup.okhttp3:okhttp:${okhttp3Version}")
766
		optional("com.fasterxml.jackson.core:jackson-databind:${jackson2Version}")
767
		optional("com.fasterxml.jackson.dataformat:jackson-dataformat-xml:${jackson2Version}")
768 769
		optional("com.fasterxml.jackson.dataformat:jackson-dataformat-smile:${jackson2Version}")
		optional("com.fasterxml.jackson.dataformat:jackson-dataformat-cbor:${jackson2Version}")
R
Roy Clarkson 已提交
770
		optional("com.google.code.gson:gson:${gsonVersion}")
771
		optional("com.rometools:rome:${romeVersion}")
B
Brian Clozel 已提交
772
		optional("org.eclipse.jetty:jetty-servlet:${jettyVersion}") {
B
Brian Clozel 已提交
773
			exclude group: "javax.servlet", module: "javax.servlet-api"
774
		}
B
Brian Clozel 已提交
775
		optional("org.eclipse.jetty:jetty-server:${jettyVersion}") {
B
Brian Clozel 已提交
776
			exclude group: "javax.servlet", module: "javax.servlet-api"
777
		}
778 779
		optional("com.google.protobuf:protobuf-java:${protobufVersion}")
		optional("com.google.protobuf:protobuf-java-util:${protobufVersion}")
780
		optional("com.googlecode.protobuf-java-format:protobuf-java-format:1.4")
781 782
		optional("javax.xml.bind:jaxb-api:${jaxbVersion}")
		optional("javax.xml.ws:jaxws-api:${jaxwsVersion}")
783
		optional("javax.mail:javax.mail-api:${javamailVersion}")
784
		optional("org.jetbrains.kotlin:kotlin-stdlib-jre8:${kotlinVersion}")
785
		testCompile(project(":spring-context-support"))  // for JafMediaTypeFactory
786
		testCompile("io.projectreactor.addons:reactor-test")
787 788 789
		testCompile("org.apache.taglibs:taglibs-standard-jstlel:1.2.1") {
			exclude group: "org.apache.taglibs", module: "taglibs-standard-spec"
		}
790
		testCompile("com.fasterxml.jackson.datatype:jackson-datatype-joda:${jackson2Version}")
791
		testCompile("com.fasterxml.jackson.datatype:jackson-datatype-jdk8:${jackson2Version}")
792
		testCompile("com.fasterxml.jackson.module:jackson-module-kotlin:${jackson2Version}")
793 794 795 796
		testCompile("org.apache.tomcat:tomcat-util:${tomcatVersion}")
		testCompile("org.apache.tomcat.embed:tomcat-embed-core:${tomcatVersion}")
		testCompile("org.eclipse.jetty:jetty-server:${jettyVersion}")
		testCompile("org.eclipse.jetty:jetty-servlet:${jettyVersion}")
797 798 799
		testCompile("com.squareup.okhttp3:mockwebserver:${okhttp3Version}")
		testCompile("org.xmlunit:xmlunit-matchers:${xmlunitVersion}")
		testCompile("org.slf4j:slf4j-jcl:${slf4jVersion}")
S
Sebastien Deleuze 已提交
800
		testCompile("org.jetbrains.kotlin:kotlin-reflect:${kotlinVersion}")
801
		testRuntime("com.sun.mail:javax.mail:${javamailVersion}")
802 803
		testRuntime("com.sun.xml.bind:jaxb-core:${jaxbVersion}")
		testRuntime("com.sun.xml.bind:jaxb-impl:${jaxbVersion}")
804
		testRuntime("org.jboss.xnio:xnio-nio:${xnioVersion}")
805
		testRuntime("org.jboss.logging:jboss-logging:3.3.0.Final")
806
	}
807 808 809 810 811

	if (JavaVersion.current().java9Compatible) {
		// Netty4ClientHttpRequestFactory requires access to sun.nio.ch.SelectorImpl
		test.jvmArgs(["--add-exports", "java.base/sun.nio.ch=ALL-UNNAMED"])
	}
812 813
}

814 815
project("spring-webflux") {
	description = "Spring WebFlux"
816

817 818 819
	dependencies {
		compile(project(":spring-core"))
		compile(project(":spring-web"))
820 821
		compile "org.reactivestreams:reactive-streams"
		compile "io.projectreactor:reactor-core"
822 823
		optional(project(":spring-context-support"))  // for FreeMarker support
		provided "javax.servlet:javax.servlet-api:${servletVersion}"
824
		optional("javax.xml.bind:jaxb-api:${jaxbVersion}")
825 826
		optional("com.fasterxml.jackson.core:jackson-databind:${jackson2Version}")
		optional("org.freemarker:freemarker:${freemarkerVersion}")
827
		optional "org.apache.httpcomponents:httpclient:${httpclientVersion}"
828
		optional('org.webjars:webjars-locator:0.32')
829
		optional("io.projectreactor.ipc:reactor-netty")
830 831 832 833 834
		optional("io.reactivex:rxnetty-http:${rxnettyVersion}") {
			exclude group: 'io.reactivex', module: 'rxjava'
		}
		optional("io.reactivex:rxjava:${rxjavaVersion}")
		optional("io.reactivex:rxjava-reactive-streams:${rxjavaAdapterVersion}")
835 836 837 838 839
		optional("javax.websocket:javax.websocket-api:${websocketVersion}")
		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"
		}
840 841 842
		optional("org.eclipse.jetty.websocket:websocket-server:${jettyVersion}") {
			exclude group: "javax.servlet", module: "javax.servlet"
		}
843 844 845
		optional("io.undertow:undertow-websockets-jsr:${undertowVersion}") {
			exclude group: "org.jboss.spec.javax.websocket", module: "jboss-websocket-api_1.1_spec"
		}
846
		optional("org.jetbrains.kotlin:kotlin-reflect:${kotlinVersion}")
847
		optional("org.jetbrains.kotlin:kotlin-stdlib-jre8:${kotlinVersion}")
848
		testCompile("io.projectreactor.addons:reactor-test")
849
		testCompile("javax.validation:validation-api:${beanvalVersion}")
R
Rossen Stoyanchev 已提交
850
		testCompile("org.hibernate:hibernate-validator:${hibval5Version}")
851 852 853 854
		testCompile("org.apache.tomcat:tomcat-util:${tomcatVersion}")
		testCompile("org.apache.tomcat.embed:tomcat-embed-core:${tomcatVersion}")
		testCompile("org.eclipse.jetty:jetty-server:${jettyVersion}")
		testCompile("org.eclipse.jetty:jetty-servlet:${jettyVersion}")
S
Sebastien Deleuze 已提交
855
		testCompile "io.reactivex.rxjava2:rxjava:${rxjava2Version}"
856
		testCompile("io.undertow:undertow-core:${undertowVersion}")
857
		testCompile("org.jboss.xnio:xnio-api:${xnioVersion}")
858
		testCompile("com.fasterxml:aalto-xml:1.0.0")
859
		testCompile("org.xmlunit:xmlunit-matchers:${xmlunitVersion}")
860
		testCompile("org.slf4j:slf4j-jcl:${slf4jVersion}")
B
Brian Clozel 已提交
861
		testCompile("com.squareup.okhttp3:mockwebserver:${okhttp3Version}")
862 863
		testRuntime("javax.el:javax.el-api:${elApiVersion}")
		testRuntime("org.glassfish:javax.el:3.0.1-b08")
864 865 866
		testRuntime("com.sun.xml.bind:jaxb-core:${jaxbVersion}")
		testRuntime("com.sun.xml.bind:jaxb-impl:${jaxbVersion}")
		testRuntime("javax.activation:activation:${activationApiVersion}")
867
		testRuntime("org.jboss.xnio:xnio-nio:${xnioVersion}")
868
		testRuntime("org.jboss.logging:jboss-logging:3.3.0.Final")
869
		testRuntime("org.webjars:underscorejs:1.8.3")
870
		testRuntime("org.jruby:jruby:9.1.7.0")
871
		testRuntime("org.python:jython-standalone:2.5.3")
872
		testRuntime("org.jetbrains.kotlin:kotlin-compiler:${kotlinVersion}")
873
		testCompile("org.jetbrains.kotlin:kotlin-script-runtime:${kotlinVersion}")
874
		testRuntime("org.jetbrains.kotlin:kotlin-script-util:${kotlinVersion}")
875
	}
876 877 878 879 880

	if (JavaVersion.current().java9Compatible) {
		// ReactorClientHttpConnector requires access to sun.nio.ch.SelectorImpl
		test.jvmArgs(["--add-exports", "java.base/sun.nio.ch=ALL-UNNAMED"])
	}
C
Chris Beams 已提交
881 882
}

P
Phillip Webb 已提交
883 884
project("spring-orm") {
	description = "Spring Object/Relational Mapping"
885

886
	dependencies {
887 888 889 890 891 892 893
		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"))
J
Juergen Hoeller 已提交
894
		optional("org.eclipse.persistence:javax.persistence:${jpaVersion}")
895 896
		optional("org.eclipse.persistence:org.eclipse.persistence.core:${eclipselinkVersion}")
		optional("org.eclipse.persistence:org.eclipse.persistence.jpa:${eclipselinkVersion}") {
897 898
			exclude group: 'org.eclipse.persistence', module: 'javax.persistence'
		}
899
		optional("org.hibernate:hibernate-core:${hibernate5Version}")
900
		optional("javax.servlet:javax.servlet-api:${servletVersion}")
S
Sam Brannen 已提交
901
		testCompile("org.aspectj:aspectjweaver:${aspectjVersion}")
P
Phillip Webb 已提交
902
		testCompile("org.hsqldb:hsqldb:${hsqldbVersion}")
903
		testCompile("org.slf4j:slf4j-jcl:${slf4jVersion}")
904
		testRuntime("javax.xml.bind:jaxb-api:${jaxbVersion}")
905
	}
C
Chris Beams 已提交
906 907
}

P
Phillip Webb 已提交
908 909
project("spring-webmvc") {
	description = "Spring Web MVC"
910

911
	dependencies {
912
		compile(project(":spring-aop"))
913 914
		compile(project(":spring-beans"))
		compile(project(":spring-context"))
915
		compile(project(":spring-core"))
916
		compile(files(project(":spring-core").objenesisRepackJar))
917 918
		compile(project(":spring-expression"))
		compile(project(":spring-web"))
919
		provided("javax.servlet:javax.servlet-api:${servletVersion}")
920
		optional(project(":spring-context-support"))  // for FreeMarker support
921
		optional(project(":spring-oxm"))  // for MarshallingView
922
		optional("javax.servlet.jsp:javax.servlet.jsp-api:${jspVersion}")
923
		optional("javax.servlet.jsp.jstl:javax.servlet.jsp.jstl-api:1.2.1")
924
		optional("javax.xml.bind:jaxb-api:${jaxbVersion}")
925 926
		optional("org.apache.poi:poi:${poiVersion}")
		optional("org.apache.poi:poi-ooxml:${poiVersion}")
927
		optional("org.freemarker:freemarker:${freemarkerVersion}")
928
		optional("org.codehaus.groovy:groovy-all:${groovyVersion}")
929 930
		optional("com.lowagie:itext:2.1.7")
		optional("com.fasterxml.jackson.core:jackson-databind:${jackson2Version}")
931
		optional("com.fasterxml.jackson.dataformat:jackson-dataformat-xml:${jackson2Version}")
932 933
		optional("com.fasterxml.jackson.dataformat:jackson-dataformat-smile:${jackson2Version}")
		optional("com.fasterxml.jackson.dataformat:jackson-dataformat-cbor:${jackson2Version}")
934
		optional("com.rometools:rome:${romeVersion}")
935
		optional("javax.el:javax.el-api:${elApiVersion}")
936 937
		optional("org.apache.tiles:tiles-api:${tiles3Version}")
		optional("org.apache.tiles:tiles-core:${tiles3Version}") {
938 939
			exclude group: "org.slf4j", module: "jcl-over-slf4j"
		}
940
		optional("org.apache.tiles:tiles-servlet:${tiles3Version}") {
941 942
			exclude group: "org.slf4j", module: "jcl-over-slf4j"
		}
943
		optional("org.apache.tiles:tiles-jsp:${tiles3Version}") {
944 945
			exclude group: "org.slf4j", module: "jcl-over-slf4j"
		}
946
		optional("org.apache.tiles:tiles-el:${tiles3Version}") {
947 948
			exclude group: "org.slf4j", module: "jcl-over-slf4j"
		}
949
		optional("org.apache.tiles:tiles-extras:${tiles3Version}") {
950 951 952
			exclude group: "org.slf4j", module: "jcl-over-slf4j"
			exclude group: "org.springframework", module: "spring-web"
		}
953
		optional('org.webjars:webjars-locator:0.32')
954
		testCompile("org.xmlunit:xmlunit-matchers:${xmlunitVersion}")
955
		testCompile("dom4j:dom4j:1.6.1") {
P
Phillip Webb 已提交
956
			exclude group: "xml-apis", module: "xml-apis"
957 958
		}
		testCompile("jaxen:jaxen:1.1.1") {
P
Phillip Webb 已提交
959 960 961
			exclude group: "xml-apis", module: "xml-apis"
			exclude group: "xom", module: "xom"
			exclude group: "xerces", module: "xercesImpl"
962
		}
B
Brian Clozel 已提交
963
		testCompile("org.eclipse.jetty:jetty-servlet:${jettyVersion}") {
B
Brian Clozel 已提交
964
			exclude group: "javax.servlet", module: "javax.servlet"
965
		}
B
Brian Clozel 已提交
966
		testCompile("org.eclipse.jetty:jetty-server:${jettyVersion}") {
B
Brian Clozel 已提交
967
			exclude group: "javax.servlet", module: "javax.servlet"
968
		}
J
Juergen Hoeller 已提交
969
		testCompile("javax.validation:validation-api:${beanvalVersion}")
970
		testCompile("org.hibernate:hibernate-validator:${hibval5Version}")
971 972
		testCompile("org.apache.httpcomponents:httpclient:${httpclientVersion}")
		testCompile("commons-fileupload:commons-fileupload:${fileuploadVersion}")
973
		testCompile("commons-io:commons-io:2.5")
974
		testCompile("joda-time:joda-time:${jodaVersion}")
975
		testCompile("org.slf4j:slf4j-jcl:${slf4jVersion}")
976
		testCompile("org.mozilla:rhino:1.7.7.1")
977
		testRuntime("org.jruby:jruby:9.1.7.0")
978
		testRuntime("org.python:jython-standalone:2.5.3")
979
		testRuntime("org.jetbrains.kotlin:kotlin-compiler:${kotlinVersion}")
980
		testCompile("org.jetbrains.kotlin:kotlin-script-runtime:${kotlinVersion}")
981
		testRuntime("org.jetbrains.kotlin:kotlin-script-util:${kotlinVersion}")
982
		testRuntime("org.webjars:underscorejs:1.8.3")
983
		testRuntime("org.glassfish:javax.el:3.0.1-b08")
984 985 986
		testRuntime("com.sun.xml.bind:jaxb-core:${jaxbVersion}")
		testRuntime("com.sun.xml.bind:jaxb-impl:${jaxbVersion}")
		testRuntime("javax.activation:activation:${activationApiVersion}")
987 988 989
	}
}

990 991 992 993 994 995 996 997 998
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"))
999 1000
		optional("javax.servlet:javax.servlet-api:${servletVersion}")
		optional("javax.websocket:javax.websocket-api:${websocketVersion}")
1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024
		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"
		}
1025
		optional("org.jboss.xnio:xnio-api:${xnioVersion}")
1026 1027 1028
		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}")
1029 1030
		testCompile("io.projectreactor:reactor-core")
		testCompile("io.projectreactor.ipc:reactor-netty")
1031 1032
		testCompile("io.netty:netty-all:${nettyVersion}")
		testCompile("org.slf4j:slf4j-jcl:${slf4jVersion}")
1033
		testRuntime("org.jboss.xnio:xnio-nio:${xnioVersion}")
1034
		testRuntime("org.jboss.logging:jboss-logging:3.3.0.Final")
1035
	}
1036 1037 1038 1039 1040

	if (JavaVersion.current().java9Compatible) {
		// Reactor2TcpClient's use of Netty requires access to sun.nio.ch.SelectorImpl
		test.jvmArgs(["--add-exports", "java.base/sun.nio.ch=ALL-UNNAMED"])
	}
1041 1042
}

P
Phillip Webb 已提交
1043 1044
project("spring-test") {
	description = "Spring TestContext Framework"
1045

1046
	dependencies {
1047
		compile(project(":spring-core"))
1048 1049 1050 1051 1052 1053 1054
		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"))
1055
		optional(project(":spring-webflux"))
1056
		optional(project(":spring-websocket"))
1057
		optional("junit:junit:${junitVersion}")
1058
		optional("org.junit.jupiter:junit-jupiter-api:${junitJupiterVersion}")
1059
		optional("org.testng:testng:${testngVersion}")
1060
		optional("javax.inject:javax.inject:1")
1061 1062
		optional("javax.servlet:javax.servlet-api:${servletVersion}")
		optional("javax.servlet.jsp:javax.servlet.jsp-api:${jspVersion}")
1063 1064 1065 1066
		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"
		}
1067
		optional("javax.el:javax.el-api:${elApiVersion}")
1068
		optional("javax.websocket:javax.websocket-api:${websocketVersion}")
1069 1070
		optional("javax.activation:activation:${activationApiVersion}")
		optional("javax.xml.bind:jaxb-api:${jaxbVersion}")
1071
		optional("org.aspectj:aspectjweaver:${aspectjVersion}")
S
Sam Brannen 已提交
1072
		optional("org.codehaus.groovy:groovy-all:${groovyVersion}")
1073
		optional("org.hamcrest:hamcrest-core:${hamcrestVersion}")
1074
		optional("org.xmlunit:xmlunit-matchers:${xmlunitVersion}")
1075 1076 1077
		optional("net.sourceforge.htmlunit:htmlunit:2.25")
		optional("org.seleniumhq.selenium:htmlunit-driver:2.25")
		optional("org.seleniumhq.selenium:selenium-java:3.2.0") {
1078 1079
			exclude group: "io.netty", module: "netty"
		}
1080
		optional("org.skyscreamer:jsonassert:1.4.0")
1081
		optional("com.jayway.jsonpath:json-path:2.2.0")
1082 1083
		optional("org.reactivestreams:reactive-streams")
		optional("io.projectreactor:reactor-core")
1084
		optional("io.projectreactor.addons:reactor-test")
1085 1086
		testCompile(project(":spring-context-support"))
		testCompile(project(":spring-oxm"))
1087
		testCompile("javax.mail:javax.mail-api:${javamailVersion}")
1088
		testCompile("javax.ejb:javax.ejb-api:${ejbApiVersion}")
S
Stephane Nicoll 已提交
1089
		testCompile("javax.interceptor:javax.interceptor-api:${interceptorApiVersion}")
1090
		testCompile("org.hibernate:hibernate-core:${hibernate5Version}")
1091
		testCompile("org.hibernate:hibernate-validator:${hibval5Version}")
1092 1093
		// Enable use of the JUnitPlatform Runner
		testCompile("org.junit.platform:junit-platform-runner:${junitPlatformVersion}")
1094
		testCompile("com.thoughtworks.xstream:xstream:${xstreamVersion}")
1095
		testCompile("com.fasterxml.jackson.core:jackson-databind:${jackson2Version}")
1096
		testCompile("com.rometools:rome:${romeVersion}")
1097 1098
		testCompile("org.apache.tiles:tiles-api:${tiles3Version}")
		testCompile("org.apache.tiles:tiles-core:${tiles3Version}") {
1099 1100
			exclude group: "org.slf4j", module: "jcl-over-slf4j"
		}
1101
		testCompile("org.apache.tiles:tiles-servlet:${tiles3Version}") {
1102 1103
			exclude group: "org.slf4j", module: "jcl-over-slf4j"
		}
1104
		testCompile("org.hsqldb:hsqldb:${hsqldbVersion}")
S
Sam Brannen 已提交
1105
		testCompile("org.slf4j:slf4j-jcl:${slf4jVersion}")
1106
		testCompile("org.apache.httpcomponents:httpclient:${httpclientVersion}")
1107
		testCompile("javax.cache:cache-api:${cacheApiVersion}")
1108
		testCompile('de.bechte.junit:junit-hierarchicalcontextrunner:4.12.1')
1109
		testCompile('io.projectreactor.ipc:reactor-netty')
1110
		testRuntime("org.junit.jupiter:junit-jupiter-engine:${junitJupiterVersion}")
1111
		testRuntime("org.apache.logging.log4j:log4j-jul:${log4jVersion}")  // Java Util Logging for JUnit 5
1112
		testRuntime("org.ehcache:ehcache:${ehcache3Version}")
J
Juergen Hoeller 已提交
1113
		testRuntime("org.terracotta:management-model:2.0.0")
1114 1115
		testRuntime("javax.el:javax.el-api:${elApiVersion}")
		testRuntime("org.glassfish:javax.el:3.0.1-b08")
1116 1117
		testRuntime("com.sun.xml.bind:jaxb-core:${jaxbVersion}")
		testRuntime("com.sun.xml.bind:jaxb-impl:${jaxbVersion}")
1118
	}
1119 1120

	task testNG(type: Test) {
1121
		description = 'Runs TestNG tests.'
1122
		useTestNG()
1123
		scanForTestClasses = false
1124 1125
		include(["**/testng/**/*Tests.class", "**/testng/**/*Test.class"])
		// Show STD_OUT & STD_ERR of the test JVM(s) on the console:
1126
		// testLogging.showStandardStreams = true
1127
		// forkEvery 1
1128
		reports.junitXml.destination = file("$buildDir/test-results")
1129 1130 1131
	}

	test {
1132
		description = 'Runs JUnit tests.'
1133 1134
		dependsOn testNG
		useJUnit()
1135 1136 1137
		scanForTestClasses = false
		include(['**/*Tests.class', '**/*Test.class', '**/SpringJUnitJupiterTestSuite.class'])
		exclude(['**/testng/**/*.*'])
1138 1139
		// Java Util Logging for JUnit 5.
		// systemProperty('java.util.logging.manager', 'org.apache.logging.log4j.jul.LogManager')
1140
		reports.junitXml.destination = file("$buildDir/test-results")
1141
	}
1142 1143

	task aggregateTestReports(type: TestReport) {
1144
		description = 'Aggregates JUnit and TestNG test reports.'
1145 1146 1147 1148 1149
		destinationDir = test.reports.html.destination
		reportOn test, testNG
	}

	check.dependsOn aggregateTestReports
C
Chris Beams 已提交
1150 1151
}

P
Phillip Webb 已提交
1152 1153 1154
project("spring-aspects") {
	description = "Spring Aspects"
	apply from: "aspects.gradle"
1155

1156
	dependencies {
1157
		aspects(project(":spring-orm"))
1158 1159 1160
		ajc("org.aspectj:aspectjtools:${aspectjVersion}")
		rt("org.aspectj:aspectjrt:${aspectjVersion}")
		compile("org.aspectj:aspectjweaver:${aspectjVersion}")
J
Juergen Hoeller 已提交
1161
		provided("org.eclipse.persistence:javax.persistence:${jpaVersion}")
1162 1163 1164 1165 1166 1167
		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
1168
		optional("javax.transaction:javax.transaction-api:${jtaVersion}")  // for @javax.transaction.Transactional support
1169
		optional("javax.cache:cache-api:${cacheApiVersion}")
1170
		testCompile(project(":spring-core"))  // for CodeStyleAspect
1171
		testCompile(project(":spring-test"))
1172
		testCompile("javax.mail:javax.mail-api:${javamailVersion}")
1173
	}
1174

1175
	eclipse.project {
P
Phillip Webb 已提交
1176
		natures += "org.eclipse.ajdt.ui.ajnature"
1177
		buildCommands = [new org.gradle.plugins.ide.eclipse.model.BuildCommand("org.eclipse.ajdt.core.ajbuilder")]
1178
	}
C
Chris Beams 已提交
1179 1180
}

1181 1182
project("spring-framework-bom") {
	description = "Spring Framework (Bill of Materials)"
1183

1184 1185 1186 1187 1188
	dependencyManagement {
		generatedPomCustomization {
			enabled = false
		}
	}
1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221

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

1222 1223
sonarqube {
	properties {
S
Stephane Nicoll 已提交
1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235
		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"
	}
}

1236
configure(rootProject) {
P
Phillip Webb 已提交
1237
	description = "Spring Framework"
1238

B
Brian Clozel 已提交
1239
	apply plugin: "org.asciidoctor.convert"
1240
	apply plugin: "docbook-reference"
1241
	apply plugin: "groovy"
R
Rob Winch 已提交
1242
	apply plugin: "io.spring.dependency-management"
R
Rob Winch 已提交
1243

1244
	// apply plugin: "detect-split-packages"
1245 1246
	apply from: "${gradleScriptDir}/jdiff.gradle"

R
Rob Winch 已提交
1247 1248 1249 1250 1251 1252 1253 1254 1255 1256
	dependencyManagement {
		imports {
			mavenBom "io.projectreactor:reactor-bom:${reactorVersion}"
		}
		resolutionStrategy {
			cacheChangingModulesFor 0, 'seconds'
		}
		applyMavenExclusions = false
	}

R
Rob Winch 已提交
1257
	asciidoctor {
B
Brian Clozel 已提交
1258 1259
		sourceDir project.file('src/asciidoc')
		separateOutputDirs = false
1260
		backends = ['docbook']
B
Brian Clozel 已提交
1261
		options doctype: 'book', eruby: 'erubis'
J
Juergen Hoeller 已提交
1262
		attributes 'spring-version': project.version, 'revnumber': project.version, 'docinfo': ""
1263 1264
	}

1265 1266 1267
	reference {
		sourceDir = asciidoctor.outputDir
		pdfFilename = "spring-framework-reference.pdf"
1268
		epubFilename = "spring-framework-reference.epub"
1269 1270 1271 1272 1273 1274 1275
		expandPlaceholders = ""
	}

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

1276 1277 1278 1279 1280
	// 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")
	// }
1281

C
Chris Beams 已提交
1282
	// don't publish the default jar for the root project
1283 1284
	configurations.archives.artifacts.clear()

1285
	dependencies {  // for integration tests
1286
		testCompile(project(":spring-aop"))
1287
		testCompile(project(":spring-beans"))
1288
		testCompile(project(":spring-context"))
1289 1290
		testCompile(project(":spring-core"))
		testCompile(project(":spring-expression"))
1291
		testCompile(project(":spring-jdbc"))
1292
		testCompile(project(":spring-orm"))
1293
		testCompile(project(":spring-test"))
1294
		testCompile(project(":spring-tx"))
1295
		testCompile(project(":spring-web"))
1296
		testCompile("javax.servlet:javax.servlet-api:${servletVersion}")
1297
		testCompile("javax.inject:javax.inject:1")
J
Juergen Hoeller 已提交
1298
		testCompile("javax.resource:javax.resource-api:${jcaVersion}")
1299
		testCompile("org.aspectj:aspectjweaver:${aspectjVersion}")
1300
		testCompile("org.hibernate:hibernate-core:${hibernate5Version}")
P
Phillip Webb 已提交
1301
		testCompile("org.hsqldb:hsqldb:${hsqldbVersion}")
1302 1303 1304
	}

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

1309 1310 1311 1312 1313
		dependsOn {
			subprojects.collect {
				it.tasks.getByName("jar")
			}
		}
1314 1315 1316
		options.memberLevel = org.gradle.external.javadoc.JavadocMemberLevel.PROTECTED
		options.author = true
		options.header = rootProject.description
P
Phillip Webb 已提交
1317
		options.overview = "src/api/overview.html"
1318
		options.stylesheetFile = file("src/api/stylesheet.css")
1319
		options.splitIndex = true
C
Chris Beams 已提交
1320
		options.links(project.ext.javadocLinks)
1321
		options.addStringOption('Xdoclint:none', '-quiet')
C
Chris Beams 已提交
1322

1323 1324 1325
		source subprojects.collect { project ->
			project.sourceSets.main.allJava
		}
C
Chris Beams 已提交
1326

P
Phillip Webb 已提交
1327
		maxMemory = "1024m"
C
Chris Beams 已提交
1328
		destinationDir = new File(buildDir, "api")
1329 1330 1331

		doFirst {
			classpath = files(
J
Juergen Hoeller 已提交
1332
				// Ensure the javadoc process can resolve types compiled from .aj sources
1333 1334 1335 1336
				project(":spring-aspects").sourceSets.main.output
			)
			classpath += files(subprojects.collect { it.sourceSets.main.compileClasspath })
		}
1337 1338
	}

1339
	task docsZip(type: Zip, dependsOn: 'reference') {
P
Phillip Webb 已提交
1340 1341 1342
		group = "Distribution"
		baseName = "spring-framework"
		classifier = "docs"
1343 1344 1345
		description = "Builds -${classifier} archive containing api and reference " +
			"for deployment at http://static.springframework.org/spring-framework/docs."

P
Phillip Webb 已提交
1346 1347
		from("src/dist") {
			include "changelog.txt"
1348 1349 1350
		}

		from (api) {
1351
			into "javadoc-api"
1352 1353
		}

1354 1355
		from (reference) {
			into "spring-framework-reference"
1356 1357 1358 1359
		}
	}

	task schemaZip(type: Zip) {
P
Phillip Webb 已提交
1360 1361 1362
		group = "Distribution"
		baseName = "spring-framework"
		classifier = "schema"
1363 1364
		description = "Builds -${classifier} archive containing all " +
			"XSDs for deployment at http://springframework.org/schema."
S
Stephane Nicoll 已提交
1365
		duplicatesStrategy 'exclude'
1366
		moduleProjects.each { subproject ->
1367 1368 1369
			def Properties schemas = new Properties();

			subproject.sourceSets.main.resources.find {
P
Phillip Webb 已提交
1370
				it.path.endsWith("META-INF/spring.schemas")
1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387
			}?.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 已提交
1388 1389 1390
		group = "Distribution"
		baseName = "spring-framework"
		classifier = "dist"
1391
		description = "Builds -${classifier} archive, containing all jars and docs, " +
J
Juergen Hoeller 已提交
1392
			"suitable for community download page."
1393 1394 1395

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

P
Phillip Webb 已提交
1396 1397 1398 1399
		from("src/dist") {
			include "readme.txt"
			include "license.txt"
			include "notice.txt"
1400
			into "${baseDir}"
P
Phillip Webb 已提交
1401
			expand(copyright: new Date().format("yyyy"), version: project.version)
1402 1403 1404 1405 1406 1407 1408 1409 1410 1411
		}

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

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

1412
		moduleProjects.each { subproject ->
1413 1414
			into ("${baseDir}/libs") {
				from subproject.jar
P
Phillip Webb 已提交
1415
				if (subproject.tasks.findByPath("sourcesJar")) {
1416 1417
					from subproject.sourcesJar
				}
P
Phillip Webb 已提交
1418
				if (subproject.tasks.findByPath("javadocJar")) {
1419 1420 1421 1422 1423 1424
					from subproject.javadocJar
				}
			}
		}
	}

1425
	// Create a distribution that contains all dependencies (required and optional).
1426 1427
	// Not published by default; only for use when building from source.
	task depsZip(type: Zip, dependsOn: distZip) { zipTask ->
P
Phillip Webb 已提交
1428 1429 1430
		group = "Distribution"
		baseName = "spring-framework"
		classifier = "dist-with-deps"
1431 1432 1433 1434 1435 1436 1437 1438 1439 1440
		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 ->
1441 1442
					(subproject.configurations.runtime.resolvedConfiguration.resolvedArtifacts +
					subproject.configurations.optional.resolvedConfiguration.resolvedArtifacts).each { artifact ->
1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463
						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 已提交
1464
		description = "Generates gradlew[.bat] scripts"
1465
		gradleVersion = '3.4'
1466 1467

		doLast() {
1468
			def gradleOpts = "-XX:MaxMetaspaceSize=1024m -Xmx1024m"
1469
			def gradleBatOpts = "$gradleOpts -XX:MaxHeapSize=256m"
P
Phillip Webb 已提交
1470
			File wrapperFile = file("gradlew")
1471 1472
			wrapperFile.text = wrapperFile.text.replace("DEFAULT_JVM_OPTS=",
				"GRADLE_OPTS=\"$gradleOpts \$GRADLE_OPTS\"\nDEFAULT_JVM_OPTS=")
P
Phillip Webb 已提交
1473
			File wrapperBatFile = file("gradlew.bat")
1474 1475 1476 1477
			wrapperBatFile.text = wrapperBatFile.text.replace("set DEFAULT_JVM_OPTS=",
				"set GRADLE_OPTS=$gradleBatOpts %GRADLE_OPTS%\nset DEFAULT_JVM_OPTS=")
		}
	}
1478

1479
}
1480

S
Stephane Nicoll 已提交
1481
configure([project(':spring-build-src'), project(':spring-framework-bom')]) {
1482
	sonarqube {
S
Stephane Nicoll 已提交
1483 1484 1485 1486 1487
		skipProject = true
	}
}

configure(project(':spring-core')) {
1488 1489
	sonarqube {
		properties {
S
Stephane Nicoll 已提交
1490 1491 1492 1493 1494 1495
			property "sonar.exclusions",
					"src/main/java/org/springframework/cglib/**/*,src/main/java/org/springframework/asm/**/*"
		}
	}
}

1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511
/*
 * Copyright 2002-2016 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522
/*
 * 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-")) {
1523
			return version.replace('BUILD', qualifier)
1524 1525
		}
	}
1526
	return version
1527
}