diff --git a/.gitignore b/.gitignore
index 9a6ed702843a4..5c9e1aa4ef171 100644
--- a/.gitignore
+++ b/.gitignore
@@ -12,6 +12,7 @@ scalastyle-output.xml
.project
.version.properties
.spotless-index-file
+.checkstyle-cachefile
filter.properties
logs.zip
.mvn/wrapper/*.jar
diff --git a/pom.xml b/pom.xml
index 9a6a69c54175d..3904ad1cf42b6 100644
--- a/pom.xml
+++ b/pom.xml
@@ -2145,6 +2145,7 @@ under the License.
/tools/maven/checkstyle.xml
true
true
+ ${project.basedir}/.checkstyle-cachefile