diff --git a/buildSrc/src/main/java/org/springframework/boot/build/KotlinConventions.java b/buildSrc/src/main/java/org/springframework/boot/build/KotlinConventions.java
index 6f6c8e35c13..c832a8039ef 100644
--- a/buildSrc/src/main/java/org/springframework/boot/build/KotlinConventions.java
+++ b/buildSrc/src/main/java/org/springframework/boot/build/KotlinConventions.java
@@ -25,8 +25,11 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile;
* plugin. When the plugin is applied:
*
*
- * - {@link KotlinCompile} tasks are configured to use {@code apiVersion} and
- * {@code languageVersion} 1.3.
+ *
- {@link KotlinCompile} tasks are configured to:
+ *
+ * - Use {@code apiVersion} and {@code languageVersion} 1.3.
+ *
- Treat all warnings as errors
+ *
*
*
*
@@ -41,6 +44,7 @@ class KotlinConventions {
KotlinJvmOptions kotlinOptions = compile.getKotlinOptions();
kotlinOptions.setApiVersion("1.3");
kotlinOptions.setLanguageVersion("1.3");
+ kotlinOptions.setAllWarningsAsErrors(true);
});
});
}