build.gradle 6.8 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
	id "com.jfrog.artifactory" version '4.9.8' apply false
B
Brian Clozel 已提交
18 19
}

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

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

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

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

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

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

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

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

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

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

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

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

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

	ext.javadocLinks = [
S
Spring Operator 已提交
149 150
		"https://docs.oracle.com/javase/8/docs/api/",
		"https://docs.oracle.com/javaee/7/api/",
S
Sam Brannen 已提交
151 152
		"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 已提交
153 154 155 156 157 158 159
		"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",
160
		"https://www.quartz-scheduler.org/api/2.3.0/",
S
Spring Operator 已提交
161 162 163 164
		"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/",
165
		"https://junit.org/junit4/javadoc/4.12/",
166
		"https://junit.org/junit5/docs/${junit5Version}/api/"
C
Chris Beams 已提交
167
	] as String[]
168 169
}

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

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

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

R
Rob Winch 已提交
184 185 186 187 188 189 190 191 192 193 194
	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 已提交
195 196 197 198 199 200
	dependencyManagement {
		imports {
			mavenBom "io.projectreactor:reactor-bom:${reactorVersion}"
		}
	}

201
	dependencies {
202
		asciidoctor("io.spring.asciidoctor:spring-asciidoctor-extensions:0.1.3.RELEASE")
203 204
	}

205 206
	publishing {
		publications {
207
			mavenJava(MavenPublication) {
208 209 210 211 212
				artifact docsZip
				artifact schemaZip
				artifact distZip
			}
		}
213
	}
214
}
215