build.gradle 6.6 KB
Newer Older
1
buildscript {
2
	repositories {
3
		maven { url 'https://repo.spring.io/plugins-release' }
4 5
	}
	dependencies {
6 7
		classpath 'org.asciidoctor:asciidoctorj-pdf:1.5.0-alpha.16'
		classpath 'io.spring.asciidoctor:spring-asciidoctor-extensions:0.1.3.RELEASE'
8
	}
9
}
10
plugins {
11 12 13 14 15 16
	id 'io.spring.dependency-management' version '1.0.7.RELEASE' apply false
	id 'org.jetbrains.kotlin.jvm' version '1.3.41' apply false
	id 'org.jetbrains.dokka' version '0.9.18' apply false
	id 'org.asciidoctor.convert' version '1.5.8'
	id 'io.spring.nohttp' version '0.0.3.RELEASE'
	id 'de.undercouch.download' version '4.0.0'
B
Brian Clozel 已提交
17 18
}

S
Stephane Nicoll 已提交
19
ext {
20
	moduleProjects = subprojects.findAll { it.name.startsWith("spring-") }
21

22
	aspectjVersion       = "1.9.4"
23
	coroutinesVersion    = "1.3.0-RC2"
24
	freemarkerVersion    = "2.3.28"
J
Juergen Hoeller 已提交
25
	groovyVersion        = "2.5.7"
26
	hsqldbVersion        = "2.5.0"
J
Juergen Hoeller 已提交
27
	jackson2Version      = "2.9.9"
28
	jettyVersion         = "9.4.19.v20190610"
S
Sam Brannen 已提交
29
	junit5Version        = "5.5.1"
30 31
	kotlinVersion        = "1.3.41"
	log4jVersion         = "2.12.0"
32
	nettyVersion         = "4.1.38.Final"
33
	reactorVersion       = "Dysprosium-M3"
34
	rsocketVersion       = "1.0.0-RC2"
35 36
	rxjavaVersion        = "1.3.8"
	rxjavaAdapterVersion = "1.2.1"
37
	rxjava2Version       = "2.2.10"
38
	slf4jVersion         = "1.7.26"	  // spring-jcl + consistent 3rd party deps
39
	tiles3Version        = "3.0.8"
40
	tomcatVersion        = "9.0.22"
41
	undertowVersion      = "2.0.23.Final"
42

43
	withoutJclOverSlf4j = {
44
		exclude group: "org.slf4j", module: "jcl-over-slf4j"
45
	}
S
Stephane Nicoll 已提交
46 47
}

48
configure(allprojects.findAll { (it.name != "spring-framework-bom") } ) { project ->
49
	group = "org.springframework"
50

51 52
	apply plugin: "java"
	apply plugin: "checkstyle"
53
	apply plugin: 'org.springframework.build.compile'
54
	apply plugin: "io.spring.dependency-management"
55
	apply from: "${rootDir}/gradle/ide.gradle"
C
Chris Beams 已提交
56

57 58
	dependencyManagement {
		resolutionStrategy {
59
			cacheChangingModulesFor 0, "seconds"
60 61 62 63 64
		}
		applyMavenExclusions = false
		generatedPomCustomization {
			enabled = false
		}
65 66
		imports {
			mavenBom "org.junit:junit-bom:${junit5Version}"
S
Sebastien Deleuze 已提交
67
			mavenBom "org.jetbrains.kotlin:kotlin-bom:${kotlinVersion}"
68
			mavenBom "org.jetbrains.kotlinx:kotlinx-coroutines-bom:${coroutinesVersion}"
69
		}
70 71
	}

72
	configurations.all {
J
Juergen Hoeller 已提交
73
		// Check for updates every build
74
		resolutionStrategy.cacheChangingModulesFor 0, "seconds"
75 76 77

		// Consistent slf4j version (e.g. clashes between slf4j versions)
		resolutionStrategy.eachDependency { DependencyResolveDetails details ->
78
			if (details.requested.group == "org.slf4j") {
79 80 81
				details.useVersion slf4jVersion
			}
		}
82 83
	}

84 85 86 87 88 89 90
	pluginManager.withPlugin("kotlin") {
		apply plugin: "org.jetbrains.dokka"
		compileKotlin {
			kotlinOptions {
				jvmTarget = "1.8"
				freeCompilerArgs = ["-Xjsr305=strict"]
			}
91
		}
92 93 94 95 96
		compileTestKotlin {
			kotlinOptions {
				jvmTarget = "1.8"
				freeCompilerArgs = ["-Xjsr305=strict"]
			}
97
		}
J
Juergen Hoeller 已提交
98 99
	}

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

113
	checkstyle {
114
		toolVersion = "8.23"
115 116 117
		configDir = rootProject.file("src/checkstyle")
	}

118
	repositories {
119
		mavenCentral()
120
		maven { url "https://repo.spring.io/libs-release" }
121
		maven { url "https://repo.spring.io/milestone" } // Reactor
122
		mavenLocal()
123
	}
C
Chris Beams 已提交
124

125
	dependencies {
126 127
		testCompile("org.junit.jupiter:junit-jupiter-api")
		testCompile("org.junit.jupiter:junit-jupiter-params")
S
Sam Brannen 已提交
128
		testCompile("org.mockito:mockito-core:3.0.0") {
129
			exclude group: "org.hamcrest", module: "hamcrest-core"
130
		}
131
		testCompile("org.mockito:mockito-junit-jupiter:3.0.0")
132
		testCompile("io.mockk:mockk:1.9.3")
S
Sam Brannen 已提交
133
		testCompile("org.hamcrest:hamcrest:2.1")
S
Sam Brannen 已提交
134
		testCompile("org.assertj:assertj-core:3.13.1")
135
		// Pull in the latest JUnit 5 Launcher API to ensure proper support in IDEs.
136
		testRuntime("org.junit.platform:junit-platform-launcher")
137
		testRuntime("org.junit.jupiter:junit-jupiter-engine")
138
		testRuntime("org.apache.logging.log4j:log4j-core:${log4jVersion}")
139 140
		testRuntime("org.apache.logging.log4j:log4j-slf4j-impl:${log4jVersion}")
		testRuntime("org.apache.logging.log4j:log4j-jul:${log4jVersion}")
P
Phillip Webb 已提交
141
		// JSR-305 only used for non-required meta-annotations
142 143
		compileOnly("com.google.code.findbugs:jsr305:3.0.2")
		testCompileOnly("com.google.code.findbugs:jsr305:3.0.2")
144
		checkstyle("io.spring.javaformat:spring-javaformat-checkstyle:0.0.15")
145
	}
C
Chris Beams 已提交
146 147

	ext.javadocLinks = [
S
Spring Operator 已提交
148 149
		"https://docs.oracle.com/javase/8/docs/api/",
		"https://docs.oracle.com/javaee/7/api/",
S
Sam Brannen 已提交
150 151
		"https://docs.oracle.com/cd/E13222_01/wls/docs90/javadocs/",  // CommonJ
		"https://www.ibm.com/support/knowledgecenter/SS7JFU_8.5.5/com.ibm.websphere.javadoc.doc/web/apidocs/",
S
Spring Operator 已提交
152 153 154 155 156 157 158
		"https://glassfish.java.net/nonav/docs/v3/api/",
		"https://docs.jboss.org/jbossas/javadoc/4.0.5/connector/",
		"https://docs.jboss.org/jbossas/javadoc/7.1.2.Final/",
		"https://tiles.apache.org/tiles-request/apidocs/",
		"https://tiles.apache.org/framework/apidocs/",
		"https://www.eclipse.org/aspectj/doc/released/aspectj5rt-api/",
		"https://www.ehcache.org/apidocs/2.10.4",
159
		"https://www.quartz-scheduler.org/api/2.3.0/",
S
Spring Operator 已提交
160 161 162 163
		"https://fasterxml.github.io/jackson-core/javadoc/2.9/",
		"https://fasterxml.github.io/jackson-databind/javadoc/2.9/",
		"https://fasterxml.github.io/jackson-dataformat-xml/javadoc/2.9/",
		"https://hc.apache.org/httpcomponents-client-ga/httpclient/apidocs/",
164
		"https://junit.org/junit4/javadoc/4.12/",
165
		"https://junit.org/junit5/docs/${junit5Version}/api/"
C
Chris Beams 已提交
166
	] as String[]
167 168
}

169 170
configure(moduleProjects) { project ->
	apply from: "${rootDir}/gradle/spring-module.gradle"
C
Chris Beams 已提交
171 172
}

173
configure(rootProject) {
174
	description = "Spring Framework"
175

176
	apply plugin: "groovy"
177
	apply plugin: "kotlin"
R
Rob Winch 已提交
178
	apply plugin: "io.spring.nohttp"
179
	apply plugin: 'org.springframework.build.api-diff'
180
	apply from: "${rootDir}/gradle/docs.gradle"
181

R
Rob Winch 已提交
182 183 184 185 186 187 188 189 190 191 192
	nohttp {
		source.exclude "**/test-output/**"
		whitelistFile = project.file("src/nohttp/whitelist.lines")
		def projectDirURI = project.projectDir.toURI()
		allprojects.forEach { p ->
			def outURI = p.file("out").toURI()
			def pattern = projectDirURI.relativize(outURI).path + "**"
			source.exclude pattern
		}
	}

R
Rob Winch 已提交
193 194 195 196 197 198
	dependencyManagement {
		imports {
			mavenBom "io.projectreactor:reactor-bom:${reactorVersion}"
		}
	}

199
	dependencies {
200
		asciidoctor("io.spring.asciidoctor:spring-asciidoctor-extensions:0.1.3.RELEASE")
201 202 203 204 205 206 207
	}

	artifacts {
		archives docsZip
		archives schemaZip
		archives distZip
	}
208
}
209