diff --git a/gradle/documentation/documentation.gradle b/gradle/documentation/documentation.gradle index 4e7b970cb84..9ed49de6c93 100644 --- a/gradle/documentation/documentation.gradle +++ b/gradle/documentation/documentation.gradle @@ -72,12 +72,14 @@ configure(rootProject) { if (!skipSolr) { dependsOn ':solr:documentation:assemble' - doFirst { - // Sanity check doc. version vs. actual version. - def actualLuceneVersion = getVersion("org.apache.lucene", "lucene-core").replace('.', '_') - if (luceneDocVersion != actualLuceneVersion) { - throw new GradleException("Compiling documentation with Lucene version ${luceneDocVersion} which is " + - "different from actual dependency ${actualLuceneVersion}?") + if (skipLucene) { + doFirst { + // Sanity check doc. version vs. actual version. + def actualLuceneVersion = getVersion("org.apache.lucene", "lucene-core").replace('.', '_') + if (luceneDocVersion != actualLuceneVersion) { + throw new GradleException("Compiling documentation with Lucene version ${luceneDocVersion} which is " + + "different from actual dependency ${actualLuceneVersion}?") + } } } }