aboutsummaryrefslogtreecommitdiff
path: root/pom.xml
diff options
context:
space:
mode:
authorDmitry Timofeev <dmitrytimofeev@google.com>2021-12-03 07:50:09 -0800
committerGoogle Java Core Libraries <java-core-libraries-team+copybara@google.com>2021-12-03 07:53:21 -0800
commit3072f4fe6dd57678886ba800efc9da4667abc366 (patch)
treedbe56a9ca1a3c6e6aab9c660e316509798ae80e0 /pom.xml
parenta197d99b96d69ea75a2c4a15ecd8a730dd3270d6 (diff)
downloadguava-3072f4fe6dd57678886ba800efc9da4667abc366.tar.gz
Fix Javadoc search on JDK 11:
Fixed Javadoc search feature on JDK 11, which is currently used in our scripts updating snapshot Javadocs on guava.dev and building Guava releases, by adding `no-module-directories` flag. This option is not present in javadoc tool from JDK 8 and 13+, hence we use profiles to conditionally pass this flag on 9-12 only. Note that on JDK 17 javadoc generation does not work, as it seems to have changed the warning on LVTI usage in sources to an error. Fixes #5457 Fixes #5800 RELNOTES=n/a PiperOrigin-RevId: 413934851
Diffstat (limited to 'pom.xml')
-rw-r--r--pom.xml21
1 files changed, 21 insertions, 0 deletions
diff --git a/pom.xml b/pom.xml
index 87dae7e9b..47449f1e3 100644
--- a/pom.xml
+++ b/pom.xml
@@ -18,6 +18,8 @@
<checker-framework.version>3.12.0</checker-framework.version>
<animal.sniffer.version>1.20</animal.sniffer.version>
<maven-javadoc-plugin.version>3.1.0</maven-javadoc-plugin.version>
+ <!-- Empty for all JDKs but 9-12 -->
+ <maven-javadoc-plugin.additionalJOptions></maven-javadoc-plugin.additionalJOptions>
<maven-source-plugin.version>3.2.1</maven-source-plugin.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
@@ -184,6 +186,7 @@
</additionalOptions>
<linksource>true</linksource>
<source>8</source>
+ <additionalJOption>${maven-javadoc-plugin.additionalJOptions}</additionalJOption>
</configuration>
<executions>
<execution>
@@ -390,5 +393,23 @@
</plugins>
</build>
</profile>
+ <profile>
+ <!--
+ Passes JDK 9-12-specific `no-module-directories` flag to Javadoc tool,
+ which is required to make symbol search work correctly in the generated
+ pages.
+
+ This flag does not exist on 8 and 13+ (https://bugs.openjdk.java.net/browse/JDK-8215582).
+
+ Consider removing it once our release and test scripts are migrated to a recent JDK (17+).
+ -->
+ <id>javadocs-jdk9-12</id>
+ <activation>
+ <jdk>[9,13)</jdk>
+ </activation>
+ <properties>
+ <maven-javadoc-plugin.additionalJOptions>--no-module-directories</maven-javadoc-plugin.additionalJOptions>
+ </properties>
+ </profile>
</profiles>
</project>