diff --git a/gradle/spotless.gradle b/gradle/spotless.gradle
index a853a23672871190e73e2ddb55340ff801ab5d4f..d02c9ac8b3332ea99d84dbf36c22e00152efc516 100644
--- a/gradle/spotless.gradle
+++ b/gradle/spotless.gradle
@@ -43,7 +43,7 @@ spotless {
   /* Markdown, YAML, .gitignore, Bash, and Dockerfile formatting */
   format "misc", {
     target "**/*.md", "**/*.yml", "**/.gitgnore", "**/*.sh", "**/*Dockerfile"
-    targetExclude "**/build", ".gradle", ".settings", "tmp", "libs"
+    targetExclude "**/build", ".gradle", ".settings", "tmp/**", "libs/**"
     trimTrailingWhitespace()
     indentWithSpaces(2)
     endWithNewline()
@@ -54,7 +54,7 @@ spotless {
   format "xml", {
     target fileTree(".") {
       include "**/*.xml"
-      exclude "**/build", ".settings", ".classpath", ".project", "tmp", ".gradle", "libs"
+      exclude "**/build", ".settings", ".classpath", ".project", "tmp/**", ".gradle", "libs/**"
     }
     eclipseWtp("xml")
     indentWithSpaces(2)