Treat warnings as errors when compiling

See gh-21271
This commit is contained in:
Andy Wilkinson
2020-06-03 20:04:11 +01:00
parent 0f1ada5e29
commit 47874d8c6a
5 changed files with 24 additions and 7 deletions

View File

@@ -15,6 +15,7 @@ sourceSets {
}
dependencies {
testCompileOnly("com.google.code.findbugs:jsr305:3.0.2")
testImplementation(enforcedPlatform(project(":spring-boot-project:spring-boot-dependencies")))
testImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support"))
testImplementation("javax.validation:validation-api")

View File

@@ -65,3 +65,9 @@ processResources {
dependsOn reproducibleLoaderJar
dependsOn reproducibleJarModeLayerToolsJar
}
compileJava {
if ((!project.hasProperty("buildJavaHome")) && JavaVersion.current() == JavaVersion.VERSION_1_8) {
options.compilerArgs += ['-Xlint:-sunapi', '-XDenableSunApiLintControl']
}
}