diff --git a/build.gradle b/build.gradle
index 66c2497d07..fb65d2623f 100644
--- a/build.gradle
+++ b/build.gradle
@@ -42,9 +42,22 @@ subprojects {
allprojects {
apply plugin: 'io.spring.javaformat'
+ apply plugin: 'checkstyle'
+
+ pluginManager.withPlugin("io.spring.convention.checkstyle", { plugin ->
+ configure(plugin) {
+ dependencies {
+ checkstyle "io.spring.javaformat:spring-javaformat-checkstyle:$springJavaformatVersion"
+ }
+ checkstyle {
+ toolVersion = '8.34'
+ }
+ }
+ })
+
if (project.name.contains('sample')) {
tasks.whenTaskAdded { task ->
- if (task.name.contains('format') || task.name.contains('checkFormat')) {
+ if (task.name.contains('format') || task.name.contains('checkFormat') || task.name.contains("checkstyle")) {
task.enabled = false
}
}
diff --git a/etc/checkstyle/checkstyle-suppressions.xml b/etc/checkstyle/checkstyle-suppressions.xml
new file mode 100644
index 0000000000..ab8baf9d38
--- /dev/null
+++ b/etc/checkstyle/checkstyle-suppressions.xml
@@ -0,0 +1,47 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/etc/checkstyle/checkstyle.xml b/etc/checkstyle/checkstyle.xml
index d7b392014d..deb31f3d5b 100644
--- a/etc/checkstyle/checkstyle.xml
+++ b/etc/checkstyle/checkstyle.xml
@@ -1,51 +1,11 @@
-
-
-
+
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
\ No newline at end of file
diff --git a/etc/checkstyle/header.txt b/etc/checkstyle/header.txt
deleted file mode 100644
index 5e5d28b99f..0000000000
--- a/etc/checkstyle/header.txt
+++ /dev/null
@@ -1,16 +0,0 @@
-^\Q/*\E$
-^\Q * Copyright\E (\d{4}(\-\d{4})? the original author or authors\.|(\d{4}, )*(\d{4}) Acegi Technology Pty Limited)$
-^\Q *\E$
-^\Q * Licensed under the Apache License, Version 2.0 (the "License");\E$
-^\Q * you may not use this file except in compliance with the License.\E$
-^\Q * You may obtain a copy of the License at\E$
-^\Q *\E$
-^\Q * https://www.apache.org/licenses/LICENSE-2.0\E$
-^\Q *\E$
-^\Q * Unless required by applicable law or agreed to in writing, software\E$
-^\Q * distributed under the License is distributed on an "AS IS" BASIS,\E$
-^\Q * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\E$
-^\Q * See the License for the specific language governing permissions and\E$
-^\Q * limitations under the License.\E$
-^\Q */\E$
-^.*$
diff --git a/etc/checkstyle/suppressions.xml b/etc/checkstyle/suppressions.xml
deleted file mode 100644
index 297f0624c9..0000000000
--- a/etc/checkstyle/suppressions.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-