diff --git a/spring-boot-project/spring-boot/build.gradle b/spring-boot-project/spring-boot/build.gradle index 9402f6a5675..299a2d6b30b 100644 --- a/spring-boot-project/spring-boot/build.gradle +++ b/spring-boot-project/spring-boot/build.gradle @@ -161,6 +161,14 @@ def syncJavaTemplates = tasks.register("syncJavaTemplates", Sync) { inputs.properties(properties) } +tasks.named("checkFormatMain") { + def generatedSources = fileTree("build/generated-sources/main") + // Exclude source generated from the templates as expand(properties) changes line endings on Windows + exclude { candidate -> generatedSources.contains(candidate.file) } + // Add the templates to check that the input is correctly formatted + source(fileTree("src/main/javaTemplates")) +} + plugins.withType(EclipsePlugin) { eclipse { synchronizationTasks syncJavaTemplates