diff --git a/build.gradle b/build.gradle index ace768def7..66c2497d07 100644 --- a/build.gradle +++ b/build.gradle @@ -1,6 +1,7 @@ buildscript { dependencies { classpath 'io.spring.gradle:spring-build-conventions:0.0.33.RELEASE' + classpath "io.spring.javaformat:spring-javaformat-gradle-plugin:$springJavaformatVersion" classpath "org.springframework.boot:spring-boot-gradle-plugin:$springBootVersion" classpath 'io.spring.nohttp:nohttp-gradle:0.0.5.RELEASE' classpath "io.freefair.gradle:aspectj-plugin:5.0.1" @@ -34,12 +35,22 @@ subprojects { plugins.withType(JavaPlugin) { project.sourceCompatibility='1.8' } - tasks.withType(JavaCompile) { options.encoding = "UTF-8" } } +allprojects { + apply plugin: 'io.spring.javaformat' + if (project.name.contains('sample')) { + tasks.whenTaskAdded { task -> + if (task.name.contains('format') || task.name.contains('checkFormat')) { + task.enabled = false + } + } + } +} + nohttp { allowlistFile = project.file("etc/nohttp/allowlist.lines") } diff --git a/gradle.properties b/gradle.properties index 8030f9eddc..aca683ccc0 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,6 @@ aspectjVersion=1.9.3 gaeVersion=1.9.80 +springJavaformatVersion=0.0.24 springBootVersion=2.4.0-M1 version=5.4.0-SNAPSHOT kotlinVersion=1.3.72