diff --git a/buildSrc/src/main/groovy/org/elasticsearch/gradle/BuildPlugin.groovy b/buildSrc/src/main/groovy/org/elasticsearch/gradle/BuildPlugin.groovy index 5ffe673ef1e..07e5ca4c967 100644 --- a/buildSrc/src/main/groovy/org/elasticsearch/gradle/BuildPlugin.groovy +++ b/buildSrc/src/main/groovy/org/elasticsearch/gradle/BuildPlugin.groovy @@ -288,7 +288,11 @@ class BuildPlugin implements Plugin { project.tasks.withType(JavaCompile) { options.fork = true options.forkOptions.executable = new File(project.javaHome, 'bin/javac') - options.compilerArgs << '-Werror' << '-Xlint:all' << '-Xdoclint:all' << '-Xdoclint:-missing' + /* + * -path because gradle will send in paths that don't always exist. + * -missing because we have tons of missing @returns and @param. + */ + options.compilerArgs << '-Werror' << '-Xlint:all,-path' << '-Xdoclint:all' << '-Xdoclint:-missing' options.encoding = 'UTF-8' } } diff --git a/buildSrc/src/main/groovy/org/elasticsearch/gradle/precommit/PrecommitTasks.groovy b/buildSrc/src/main/groovy/org/elasticsearch/gradle/precommit/PrecommitTasks.groovy index b577d475b0a..cb76a5e04c1 100644 --- a/buildSrc/src/main/groovy/org/elasticsearch/gradle/precommit/PrecommitTasks.groovy +++ b/buildSrc/src/main/groovy/org/elasticsearch/gradle/precommit/PrecommitTasks.groovy @@ -111,7 +111,11 @@ class PrecommitTasks { task.outputs.file(successMarker) task.executable = new File(project.javaHome, 'bin/java') task.doFirst({ - task.args('-cp', testClasspath.asPath, 'org.elasticsearch.bootstrap.JarHell') + /* JarHell doesn't like getting directories that don't exist but + gradle isn't especially careful about that. So we have to do it + filter it ourselves. */ + def taskClasspath = testClasspath.filter { it.exists() } + task.args('-cp', taskClasspath.asPath, 'org.elasticsearch.bootstrap.JarHell') }) if (task.logger.isInfoEnabled() == false) { task.standardOutput = new ByteArrayOutputStream()