diff --git a/buildSrc/src/main/groovy/org/elasticsearch/gradle/precommit/LicenseHeadersTask.groovy b/buildSrc/src/main/groovy/org/elasticsearch/gradle/precommit/LicenseHeadersTask.groovy index 7c57fd23c23..49687d933e3 100644 --- a/buildSrc/src/main/groovy/org/elasticsearch/gradle/precommit/LicenseHeadersTask.groovy +++ b/buildSrc/src/main/groovy/org/elasticsearch/gradle/precommit/LicenseHeadersTask.groovy @@ -58,7 +58,10 @@ public class LicenseHeadersTask extends DefaultTask { // checks all the java sources (allJava) for (SourceSet set : project.sourceSets) { for (File dir : set.allJava.srcDirs) { - ant.fileset(dir: dir) + // sometimes these dirs don't exist, e.g. site-plugin has no actual java src/main... + if (dir.exists()) { + ant.fileset(dir: dir) + } } }