build.gradle 6.7 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 {
21
		(it.name != "spring-framework-bom") && (it.name != "spring-core-coroutines") && (it.name != "integration-tests")
22
	}
23

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

178
	apply plugin: "groovy"
179
	apply plugin: "kotlin"
R
Rob Winch 已提交
180
	apply plugin: "io.spring.nohttp"
181
	apply plugin: 'org.springframework.build.api-diff'
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 207 208 209
	}

	artifacts {
		archives docsZip
		archives schemaZip
		archives distZip
	}
210
}
211