You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Mess around more with Javadoc and Maven toolchains:
- Use Temurin over Zulu. Per [advice](google#7492 (comment)) from @ben-manes, LTS versions of Temurin [come pre-installed](https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#Hosted-Tool-Cache).
- But be willing to run with any JDK of the appropriate version that's available, rather than requiring Zulu. (Not that this makes a huge difference, given that we'll still *download* Temurin JDKs. I didn't think this through much. I guess you can now at least avoiding downloading a Temurin JDK if you make sure you already have enough JDKs registered and you pass `-Dtoolchain.skip`.)
- Make the test jobs fail [if they need to download a needed JDK](https://github.com/linux-china/toolchains-maven-plugin#how-to-skip-toolchains-maven-plugin-on-cicd-platform) because we didn't already put that one in place with `setup-java`. (Our other CI jobs, which publish snapshots to Sonatype and regenerate snapshot Javadoc, will continue to tolerate missing JDKs. We could change them, too, by making their scripts pass through options to identify the run as a CI run.) This should help us keep our versions in sync, and it should prevent us from silently falling back to slower downloads, per b/334979149.
- Use Java 21 to generate Javadoc (as that's the best we can do now without [further trouble](google#6790 (comment))). I've made sure to make Java 21 available through `setup-java`, including for generating Sonatype snapshots, which [do include Javadoc](https://oss.sonatype.org/content/repositories/snapshots/com/google/guava/guava/HEAD-jre-SNAPSHOT/). Plus, use Java 23 for the Maven VM itself there (so as to standardize on the same version as we already use for the Maven VM itself during our test workflows as of cl/711476575).
- Fix a few Javadoc warnings, leaving behind only [a handful that we can't easily do anything about](google#6790 (comment)).
- Download Java 11 only when it is required. Currently, that's for JDiff and for our Gradle integration tests.
There is a decent chance that this CL will break something, possibly not until we run the snapshot steps after submission... :)
RELNOTES=n/a
PiperOrigin-RevId: 711746683
# When we specify multiple JDKs, the final one becomes the default, which is used to execute Maven itself.
41
41
# Our Maven configuration then specifies different JDKs to use for some of the steps:
42
-
# - 11 for building Javadoc
42
+
# - 11 (sometimes) to *download* to support anyone who runs JDiff or our Gradle integration tests (including our doc snapshots and our Java 11 CI test run) but not to use directly
43
+
# - 21 for building Javadoc
43
44
# - 23 for running javac (to help people who build Guava locally and might not use a recent JDK to run Maven)
44
-
# (Note that we also use Java 11 for running our Gradle integration tests. But we run those only when we are already going to run tests under Java 11.)
Copy file name to clipboardExpand all lines: android/pom.xml
+34-21Lines changed: 34 additions & 21 deletions
Original file line number
Diff line number
Diff line change
@@ -194,7 +194,6 @@
194
194
<plugin>
195
195
<groupId>org.mvnsearch</groupId>
196
196
<artifactId>toolchains-maven-plugin</artifactId>
197
-
<version>4.5.0</version>
198
197
<executions>
199
198
<!--
200
199
We can apparently have only one <jdk> per execution: Others are silently ignored :(
@@ -203,15 +202,15 @@
203
202
(But don't run that if you have put something into ~/.m2/toolchains.xml yourself.)
204
203
-->
205
204
<execution>
206
-
<id>download-11</id>
205
+
<id>download-21</id>
207
206
<goals>
208
207
<goal>toolchain</goal>
209
208
</goals>
210
209
<configuration>
211
210
<toolchains>
212
211
<jdk>
213
-
<version>11</version>
214
-
<vendor>zulu</vendor>
212
+
<version>21</version>
213
+
<vendor>temurin</vendor>
215
214
</jdk>
216
215
</toolchains>
217
216
</configuration>
@@ -225,11 +224,11 @@
225
224
<toolchains>
226
225
<jdk>
227
226
<version>23</version>
228
-
<vendor>zulu</vendor>
227
+
<vendor>temurin</vendor>
229
228
</jdk>
230
229
<testJdk>
231
230
<version>${surefire.toolchain.version}</version>
232
-
<vendor>zulu</vendor>
231
+
<vendor>temurin</vendor>
233
232
</testJdk>
234
233
</toolchains>
235
234
</configuration>
@@ -250,7 +249,6 @@
250
249
<toolchains>
251
250
<jdk>
252
251
<version>23</version>
253
-
<vendor>zulu</vendor>
254
252
</jdk>
255
253
</toolchains>
256
254
</configuration>
@@ -332,10 +330,9 @@
332
330
<artifactId>maven-javadoc-plugin</artifactId>
333
331
<version>3.11.1</version>
334
332
<configuration>
335
-
<!-- TODO: b/286965322 - Use a newer version (probably the default javac toolchain we set up?) if it doesn't break Javadoc (including causing trouble for our later run of JDiff, which we do outside Maven, during snapshots/releases). At that point, we'll likely want to remove the no-module-directories additionalJOption, as documented below. -->
336
333
<jdkToolchain>
337
-
<version>11</version>
338
-
<vendor>zulu</vendor>
334
+
<version>21</version>
335
+
<vendor>temurin</vendor>
339
336
</jdkToolchain>
340
337
<quiet>true</quiet>
341
338
<notimestamp>true</notimestamp>
@@ -348,14 +345,6 @@
348
345
</additionalOptions>
349
346
<linksource>true</linksource>
350
347
<source>8</source>
351
-
<!--
352
-
Required to make symbol search work correctly in the generated pages under JDK 11-12.
353
-
354
-
This flag does not exist on 9-10 and 13+ (https://bugs.openjdk.java.net/browse/JDK-8215582).
355
-
356
-
Consider removing it once our Javadoc generation is migrated to a recent JDK.
<!-- The Gradle integration tests need to set JAVA_HOME to the location of Java 11. The following profile extracts that location. -->
507
+
<!-- JDiff and the Gradle integration tests need Java 11 to be installed, and they need to know where it's located so that they can set JAVA_HOME to point to it. The following profile downloads a temurin Java 11 (if one isn't already available) and writes its location to target/java_11_home. This lets our JDiff and Gradle-integration-test scripts invoke the `print-java-11-home` profile and then read that file. -->
0 commit comments