build.gradle 57.0 KB
Newer Older
1
buildscript {
2
	repositories {
3
		maven { url "https://repo.spring.io/plugins-snapshot" }
S
Sebastien Deleuze 已提交
4
		maven { url "http://dl.bintray.com/kotlin/kotlin-eap-1.1" }
5 6
	}
	dependencies {
S
Sam Brannen 已提交
7
		classpath("org.springframework.build.gradle:propdeps-plugin:0.0.7")
8
		classpath("org.asciidoctor:asciidoctor-gradle-plugin:1.5.3")
9
		classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.1.0-beta-17")
10
		classpath("io.spring.gradle:docbook-reference-plugin:0.3.1")
11
		classpath("io.spring.gradle:dependency-management-plugin:1.0.0.BUILD-SNAPSHOT")
12
	}
13 14
}

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

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

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

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

36
	ext.activationApiVersion   = "1.1.1"
37
	ext.annotationApiVersion   = "1.2"
J
Juergen Hoeller 已提交
38
	ext.aspectjVersion         = "1.9.0.BETA-5"
39
	ext.beanvalVersion         = "1.1.0.Final"
40
	ext.cacheApiVersion        = "1.0.0"
41
	ext.caffeineVersion        = "2.3.5"
42
	ext.eclipselinkVersion     = "2.6.4"
43
	ext.ehcacheVersion         = "2.10.3"
44
	ext.ehcachejcacheVersion   = "1.0.1"
45
	ext.ehcache3Version        = "3.2.0"
46
	ext.ejbApiVersion          = "3.2"
J
Juergen Hoeller 已提交
47
	ext.elApiVersion           = "3.0.1-b04"
48 49
	ext.fileuploadVersion      = "1.3.2"
	ext.freemarkerVersion      = "2.3.25-incubating"
50
	ext.groovyVersion          = "2.4.8"
51
	ext.gsonVersion            = "2.8.0"
52
	ext.hamcrestVersion        = "1.3"
J
Juergen Hoeller 已提交
53
	ext.hibernate5Version      = "5.2.6.Final"
54
	ext.hibval5Version         = "5.4.0.CR1"
55 56 57 58
	ext.hsqldbVersion          = "2.3.4"
	ext.httpasyncVersion       = "4.1.2"
	ext.httpclientVersion      = "4.5.2"
	ext.interceptorApiVersion  = "1.2"
59
	ext.jackson2Version        = "2.8.6"
60
	ext.javamailVersion        = "1.5.6"
61
	ext.jaxbVersion            = "2.2.11"
62
	ext.jaxwsVersion           = "2.2.11"
63
	ext.jcaVersion             = "1.7"
B
Brian Clozel 已提交
64
	ext.jettyVersion           = "9.4.0.v20161208"
65
	ext.jmsVersion             = "2.0.1"
66
	ext.jodaVersion            = "2.9.7"
67
	ext.jpaVersion             = "2.1.1"
68
	ext.jsfVersion             = "2.2"
69 70 71
	ext.jspVersion             = "2.3.2-b02"
	ext.jtaVersion             = "1.2"
	ext.junitVersion           = "4.12"
J
Juergen Hoeller 已提交
72 73
	ext.junitJupiterVersion    = '5.0.0-M3'
	ext.junitPlatformVersion   = '1.0.0-M3'
74
	ext.kotlinVersion          = "1.1.0-beta-17" // Also change kotlin-gradle-plugin version when upgrading
75
	ext.log4jVersion           = '2.7'
76
	ext.nettyVersion           = "4.1.7.Final"
77
	ext.okhttpVersion          = "2.7.5"
78
	ext.okhttp3Version         = "3.5.0"
79
	ext.poiVersion             = "3.15"
80
	ext.protobufVersion        = "3.1.0"
81
	ext.quartzVersion          = "2.2.3"
82
	ext.reactorVersion         = "Aluminium-BUILD-SNAPSHOT"
83
	ext.romeVersion            = "1.7.0"
84
	ext.rxjavaVersion          = '1.2.5'
85
	ext.rxjavaAdapterVersion   = '1.2.1'
86
	ext.rxjava2Version         = '2.0.4'
87
	ext.rxnettyVersion         = '0.5.2-rc.5'
88
	ext.servletVersion         = "3.1.0"
89
	ext.slf4jVersion           = "1.7.22"
90 91
	ext.snakeyamlVersion       = "1.17"
	ext.snifferVersion         = "1.15"
92
	ext.testngVersion          = "6.10"
J
Juergen Hoeller 已提交
93
	ext.tiles3Version          = "3.0.7"
94
	ext.tomcatVersion          = "8.5.9"
95
	ext.tyrusVersion           = "1.13"
96
	ext.undertowVersion        = "1.4.8.Final"
97
	ext.websocketVersion       = "1.1"
98
	ext.woodstoxVersion        = "5.0.3"
99
	ext.xmlunitVersion         = "2.3.0"
100
	ext.xnioVersion            = "3.4.3.Final"
101
	ext.xstreamVersion         = "1.4.9"
102

103
	ext.gradleScriptDir = "${rootProject.projectDir}/gradle"
104

105
	apply plugin: "propdeps"
106
	apply plugin: "propdeps-maven"
P
Phillip Webb 已提交
107
	apply plugin: "java"
108
	apply plugin: "test-source-set-dependencies"
109
	apply plugin: "io.spring.dependency-management"
110
	apply from: "${gradleScriptDir}/ide.gradle"
C
Chris Beams 已提交
111

S
Sebastien Deleuze 已提交
112 113 114 115 116
	// Kotlin compiler does not support JDK 9 yet, see https://youtrack.jetbrains.com/issue/KT-14988
	if (!JavaVersion.current().java9Compatible) {
		apply plugin: "kotlin"
	}

S
Stephane Nicoll 已提交
117 118 119 120 121
	configurations {
		sniffer
		javaApiSignature
	}

122 123 124 125 126 127 128 129 130 131 132 133
	configurations.all {
		// check for updates every build
		resolutionStrategy.cacheChangingModulesFor 0, 'seconds'

		// consistent netty version (e.g. clashes between netty-all vs netty-common)
		resolutionStrategy.eachDependency { DependencyResolveDetails details ->
			if (details.requested.group == 'io.netty') {
				details.useVersion nettyVersion
			}
		}
	}

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

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

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

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

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

174
	repositories {
175
		maven { url "https://repo.spring.io/libs-snapshot" }
B
Brian Clozel 已提交
176
		maven { url "https://repo.spring.io/libs-release" }
177
		maven { url "https://repo.spring.io/milestone" }
S
Sebastien Deleuze 已提交
178
		maven { url "http://dl.bintray.com/kotlin/kotlin-eap-1.1" }
179
	}
C
Chris Beams 已提交
180

181 182 183 184 185 186 187
	dependencyManagement {
		imports {
			mavenBom "io.projectreactor:reactor-bom:${reactorVersion}"
		}
		resolutionStrategy {
			cacheChangingModulesFor 0, 'seconds'
		}
188
		applyMavenExclusions = false
189 190
	}

191
	dependencies {
192 193 194
		testCompile("junit:junit:${junitVersion}") {
			exclude group:'org.hamcrest', module:'hamcrest-core'
		}
195
		testCompile("org.mockito:mockito-core:2.6.1") {
196 197
			exclude group:'org.hamcrest', module:'hamcrest-core'
		}
198
		testCompile("org.hamcrest:hamcrest-all:${hamcrestVersion}")
199 200
		testRuntime("org.apache.logging.log4j:log4j-core:${log4jVersion}")
		testRuntime("org.apache.logging.log4j:log4j-jcl:${log4jVersion}")
201

S
Stephane Nicoll 已提交
202
		sniffer("org.codehaus.mojo:animal-sniffer-ant-tasks:${snifferVersion}")
203
		javaApiSignature("org.codehaus.mojo.signature:java18:1.0@signature")
S
Stephane Nicoll 已提交
204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222
	}

	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
223

S
Stephane Nicoll 已提交
224 225 226 227 228 229 230
		doLast {
			ant.taskdef(
				name: 'animalSniffer',
				classname: 'org.codehaus.mojo.animal_sniffer.ant.CheckSignatureTask',
				classpath: configurations.sniffer.asPath
			)

231 232 233 234 235 236 237
			// 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 已提交
238
		}
239
	}
C
Chris Beams 已提交
240 241

	ext.javadocLinks = [
242
		"http://docs.oracle.com/javase/8/docs/api/",
243
		"http://docs.oracle.com/javaee/7/api/",
244
		"http://docs.oracle.com/cd/E13222_01/wls/docs90/javadocs/",  // CommonJ
J
Juergen Hoeller 已提交
245 246
		"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 已提交
247 248
		"http://docs.jboss.org/jbossas/javadoc/4.0.5/connector/",
		"http://docs.jboss.org/jbossas/javadoc/7.1.2.Final/",
249
		"http://tiles.apache.org/tiles-request/apidocs/",
J
Juergen Hoeller 已提交
250
		"http://tiles.apache.org/framework/apidocs/",
C
Chris Beams 已提交
251
		"http://www.eclipse.org/aspectj/doc/released/aspectj5rt-api/",
B
Brian Clozel 已提交
252 253
		"http://ehcache.org/apidocs/${ehcacheVersion}",
		"http://ehcache.org/apidocs/${ehcache3Version}",
254
		"http://quartz-scheduler.org/api/2.2.1/",
255 256 257
		"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/",
258
		"http://hc.apache.org/httpcomponents-client-ga/httpclient/apidocs/"
C
Chris Beams 已提交
259
	] as String[]
260 261
}

262
configure(subprojects - project(":spring-build-src")) { subproject ->
263
	apply plugin: "merge"
264 265
	apply from: "${gradleScriptDir}/publish-maven.gradle"

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

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

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

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

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

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

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

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

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

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

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

328
	apply plugin: "groovy"
329 330 331

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

	configurations.archives.artifacts.clear()
}

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

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

	configurations {
		jarjar
		cglib
351
		objenesis
352 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)
					}
					// repackage net.sf.cglib => org.springframework.cglib
P
Phillip Webb 已提交
367 368
					rule(pattern: "net.sf.cglib.**", result: "org.springframework.cglib.@1")
					// as mentioned above, transform cglib"s internal asm dependencies from
369 370
					// 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 已提交
371
					rule(pattern: "org.objectweb.asm.**", result: "org.springframework.asm.@1")
372 373 374 375 376
				}
			}
		}
	}

377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395
	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")
				}
			}
		}
	}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

517
	apply plugin: "groovy"
518

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

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

	dependencies {
		compile(project(":spring-beans"))
		compile(project(":spring-core"))
558 559
		optional("javax.xml.bind:jaxb-api:${jaxbVersion}")
		optional("javax.activation:activation:${activationApiVersion}")
560 561 562 563 564 565 566 567 568 569 570
		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")
571
		testCompile("org.codehaus.jettison:jettison:1.3.8") {
572 573
			exclude group: 'stax', module: 'stax-api'
		}
574
		testCompile("org.xmlunit:xmlunit-matchers:${xmlunitVersion}")
575 576
        testCompile(files(genCastor.classesDir).builtBy(genCastor))
        testCompile(files(genJaxb.classesDir).builtBy(genJaxb))
577 578 579
		testRuntime("xerces:xercesImpl:2.11.0")  // for Castor
		testRuntime("com.sun.xml.bind:jaxb-core:${jaxbVersion}")
		testRuntime("com.sun.xml.bind:jaxb-impl:${jaxbVersion}")
580
	}
581 582 583 584 585 586 587 588 589
}

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

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

	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 已提交
628 629
}

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

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

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

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

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

671
	dependencies {
672
		compile(project(":spring-beans"))
673
		compile(project(":spring-core"))
674
		compile(project(":spring-tx"))
675
		optional(project(":spring-context"))  // for JndiDataSourceLookup
676
		optional("javax.transaction:javax.transaction-api:${jtaVersion}")
677
		optional("com.mchange:c3p0:0.9.5.2")
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")
682
	}
C
Chris Beams 已提交
683 684
}

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

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

712 713 714 715 716 717 718 719 720 721 722
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 已提交
723 724
project("spring-web") {
	description = "Spring Web"
S
Sebastien Deleuze 已提交
725

726
	apply plugin: "groovy"
727

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

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

project("spring-web-reactive") {
	description = "Spring Web Reactive"
814

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

	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 已提交
885 886
}

P
Phillip Webb 已提交
887 888
project("spring-orm") {
	description = "Spring Object/Relational Mapping"
889

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

P
Phillip Webb 已提交
912 913
project("spring-webmvc") {
	description = "Spring Web MVC"
914

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

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

	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"])
	}
1051 1052
}

P
Phillip Webb 已提交
1053 1054
project("spring-test") {
	description = "Spring TestContext Framework"
1055

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

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

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

	task aggregateTestReports(type: TestReport) {
1151
		description = 'Aggregates JUnit and TestNG test reports.'
1152 1153 1154 1155 1156
		destinationDir = test.reports.html.destination
		reportOn test, testNG
	}

	check.dependsOn aggregateTestReports
C
Chris Beams 已提交
1157 1158
}

P
Phillip Webb 已提交
1159 1160 1161
project("spring-aspects") {
	description = "Spring Aspects"
	apply from: "aspects.gradle"
1162

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

1182
	eclipse.project {
P
Phillip Webb 已提交
1183
		natures += "org.eclipse.ajdt.ui.ajnature"
1184
		buildCommands = [new org.gradle.plugins.ide.eclipse.model.BuildCommand("org.eclipse.ajdt.core.ajbuilder")]
1185
	}
C
Chris Beams 已提交
1186 1187
}

1188 1189
project("spring-framework-bom") {
	description = "Spring Framework (Bill of Materials)"
1190

1191 1192 1193 1194 1195
	dependencyManagement {
		generatedPomCustomization {
			enabled = false
		}
	}
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 1222 1223 1224 1225 1226 1227 1228

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

1229 1230
sonarqube {
	properties {
S
Stephane Nicoll 已提交
1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242
		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"
	}
}

1243
configure(rootProject) {
P
Phillip Webb 已提交
1244
	description = "Spring Framework"
1245

B
Brian Clozel 已提交
1246
	apply plugin: "org.asciidoctor.convert"
1247
	apply plugin: "docbook-reference"
1248
	apply plugin: "groovy"
R
Rob Winch 已提交
1249

1250
	// apply plugin: "detect-split-packages"
1251 1252
	apply from: "${gradleScriptDir}/jdiff.gradle"

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

1261 1262 1263
	reference {
		sourceDir = asciidoctor.outputDir
		pdfFilename = "spring-framework-reference.pdf"
1264
		epubFilename = "spring-framework-reference.epub"
1265 1266 1267 1268 1269 1270 1271
		expandPlaceholders = ""
	}

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

1272 1273 1274 1275 1276
	// 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")
	// }
1277

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

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

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

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

1319 1320 1321
		source subprojects.collect { project ->
			project.sourceSets.main.allJava
		}
C
Chris Beams 已提交
1322

P
Phillip Webb 已提交
1323
		maxMemory = "1024m"
C
Chris Beams 已提交
1324
		destinationDir = new File(buildDir, "api")
1325 1326 1327

		doFirst {
			classpath = files(
1328 1329
                // ensure Servlet 3.x has precedence on the javadoc classpath
                project(":spring-webmvc").sourceSets.main.compileClasspath.files.find { it =~ "servlet-api" },
1330 1331 1332 1333 1334
				// 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 })
		}
1335 1336
	}

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

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

		from (api) {
1349
			into "javadoc-api"
1350 1351
		}

1352 1353
		from (reference) {
			into "spring-framework-reference"
1354 1355 1356 1357
		}
	}

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

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

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

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

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

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

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

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

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

1477
}
1478

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

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

1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509
/*
 * 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.
 */

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