Skip to content

Commit b331054

Browse files
cpovirkGoogle Java Core Libraries
authored and
Google Java Core Libraries
committed
Link to Java 21 Javadoc instead of Java 9.
(Compare cl/696632561 for Truth. I verified that the Truth change worked in post-submit CI, and (as you'll see) I did some work to verify that this Guava change works in local testing.) This CL addresses the "linking" part of #6790 but not the "inheriting" part. I was having trouble getting this to work with the JDK in the `<linkoffline>` section, so I moved it to the `<link>` section. (But not before first accidentally creating a _second_ `<link>` section, which Maven seems to have chosen to ignore without error. See also my other complaints in a comment in the actual `pom.xml`.) Fortunately, we don't need to use `<linkoffline>` for the JDK anymore because we no longer need to have the JDK in the same section as JSR-305 now that `javax.annotation` isn't part of the JDK anymore (and thus there's no longer a conflict about whether the JDK or JSR-305 gets to "claim" it and thus there's no need to resolve it through ordering, which we can control only within sections, not across sections). Somewhere in the course of working through that, I upgraded `maven-javadoc-plugin` to 3.11.1. That may or may not have turned out to be necessary, but it's probably more likely to help than to hurt. RELNOTES=n/a PiperOrigin-RevId: 696636564
1 parent 747dd4b commit b331054

File tree

4 files changed

+6
-16
lines changed

4 files changed

+6
-16
lines changed

android/guava/pom.xml

+2-7
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@
153153
</tags>
154154

155155
<!-- TODO(cpovirk): Move this to the parent after making the package-list files available there. -->
156-
<!-- We add the link ourselves, both so that we can choose Java 9 over the version that -source suggests and so that we can solve the JSR305 problem described below. -->
156+
<!-- We add the link ourselves so that we can choose Java 21 over the version that -source suggests. -->
157157
<detectJavaApiLink>false</detectJavaApiLink>
158158
<offlineLinks>
159159
<!-- We need local copies of some of these for 2 reasons: a User-Agent problem (https://stackoverflow.com/a/47891403/28465) and an SSL problem (https://issues.apache.org/jira/browse/MJAVADOC-507). If we choose to work around the User-Agent problem, we can go back to <links>, sidestepping the SSL problem. -->
@@ -166,18 +166,13 @@
166166
<url>https://static.javadoc.io/com.google.j2objc/j2objc-annotations/1.1/</url>
167167
<location>${project.basedir}/javadoc-link/j2objc-annotations</location>
168168
</offlineLink>
169-
<!-- The JDK doc must be listed after JSR305 (and as an <offlineLink>, not a <link>) so that JSR305 "claims" javax.annotation. -->
170-
<offlineLink>
171-
<url>https://docs.oracle.com/javase/9/docs/api/</url>
172-
<location>https://docs.oracle.com/javase/9/docs/api/</location>
173-
</offlineLink>
174-
<!-- The Checker Framework likewise would claim javax.annotations, despite providing only a subset of the JSR305 annotations, so it must likewise come after JSR305. -->
175169
<offlineLink>
176170
<url>https://checkerframework.org/api/</url>
177171
<location>${project.basedir}/javadoc-link/checker-framework</location>
178172
</offlineLink>
179173
</offlineLinks>
180174
<links>
175+
<link>https://docs.oracle.com/javase/21/docs/api/</link>
181176
<link>https://errorprone.info/api/latest/</link>
182177
</links>
183178
<overview>../../overview.html</overview>

android/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@
319319
</plugin>
320320
<plugin>
321321
<artifactId>maven-javadoc-plugin</artifactId>
322-
<version>3.8.0</version>
322+
<version>3.11.1</version>
323323
<configuration>
324324
<!-- TODO: b/286965322 - Use a newer version (probably the default 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). -->
325325
<jdkToolchain>

guava/pom.xml

+2-7
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@
153153
</tags>
154154

155155
<!-- TODO(cpovirk): Move this to the parent after making the package-list files available there. -->
156-
<!-- We add the link ourselves, both so that we can choose Java 9 over the version that -source suggests and so that we can solve the JSR305 problem described below. -->
156+
<!-- We add the link ourselves so that we can choose Java 21 over the version that -source suggests. -->
157157
<detectJavaApiLink>false</detectJavaApiLink>
158158
<offlineLinks>
159159
<!-- We need local copies of some of these for 2 reasons: a User-Agent problem (https://stackoverflow.com/a/47891403/28465) and an SSL problem (https://issues.apache.org/jira/browse/MJAVADOC-507). If we choose to work around the User-Agent problem, we can go back to <links>, sidestepping the SSL problem. -->
@@ -166,18 +166,13 @@
166166
<url>https://static.javadoc.io/com.google.j2objc/j2objc-annotations/1.1/</url>
167167
<location>${project.basedir}/javadoc-link/j2objc-annotations</location>
168168
</offlineLink>
169-
<!-- The JDK doc must be listed after JSR305 (and as an <offlineLink>, not a <link>) so that JSR305 "claims" javax.annotation. -->
170-
<offlineLink>
171-
<url>https://docs.oracle.com/javase/9/docs/api/</url>
172-
<location>https://docs.oracle.com/javase/9/docs/api/</location>
173-
</offlineLink>
174-
<!-- The Checker Framework likewise would claim javax.annotations, despite providing only a subset of the JSR305 annotations, so it must likewise come after JSR305. -->
175169
<offlineLink>
176170
<url>https://checkerframework.org/api/</url>
177171
<location>${project.basedir}/javadoc-link/checker-framework</location>
178172
</offlineLink>
179173
</offlineLinks>
180174
<links>
175+
<link>https://docs.oracle.com/javase/21/docs/api/</link>
181176
<link>https://errorprone.info/api/latest/</link>
182177
</links>
183178
<overview>../overview.html</overview>

pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@
314314
</plugin>
315315
<plugin>
316316
<artifactId>maven-javadoc-plugin</artifactId>
317-
<version>3.8.0</version>
317+
<version>3.11.1</version>
318318
<configuration>
319319
<!-- TODO: b/286965322 - Use a newer version (probably the default 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). -->
320320
<jdkToolchain>

0 commit comments

Comments
 (0)