Hard-code Java versions for plugins other than maven-surefire-plugin
.
#7333
+277
−174
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hard-code Java versions for plugins other than
maven-surefire-plugin
.In particular:
--release
-like compatibility guarantee. However, that could complicate using newer APIs conditionally. And of course we'd expect JDK 8 to be buggier than JDK 22. (In fact, we still have a workaround or two for JDK 8 bugs (with a brand new one coming in cl/655556207), and we could now remove those—assuming that none of our users use JDK 8 to build Guava outside of our Maven build.) JDK 22 also supports new versions of Error Prone, while JDK 8 does not.maven-javadoc-plugin.additionalJOptions
.maven-compiler-plugin
to 22. I had it using 11 for any other plugins (just Animal Sniffer, maybe?), I think from when I was trying to get toolchains to take effect at all. I've since changed this CL to set the default toolchain to 22 while still including overrides formaven-javadoc-plugin
andmaven-surefire-plugin
.ci.yml
file. But since we're using JDK 11 currently for docs in general, I'm sticking with that for now. Still, we should consider upgrading the version used for Javadoc generation. But this CL is already complicated enough....<source>${java.specification.version}</source>
line: That would otherwise set (for example)-source 17
when running Maven under JDK 17, and JDK 11 wouldn't recognize it. As I recall, thejava.specification.version
usage was from the days in which we tried to inherit Javadoc from the JDK. Inheritance had stopped working, and we ripped it out in cl/614693592. I first tried going with the default from the JDK whose Javadoc binary we're using, which (again) will now be 11. But that led to a problem inorg.codehaus.plexus.languages.java.jpms.CmdModuleNameExtractor
, which apparently tries to look up the module name for the-source 11
run but uses the Maven run's JDK instead of the Javadoc toolchain or Maven toolchain. So now I've set it to 8 to match what we use formaven-compiler-plugin
. (I thought I had remembered thatmaven-javadoc-plugin
defaulted to matchingmaven-compiler-plugin
, even though that's weird. Maybe the two actually just read from the same Maven property or something, or maybe the behavior changed.)Some other thing I'm wondering:
<plugins>
(not just<pluginManagement>
) section of the parentpom.xml
. Might that save us from having to do so in each separatepom.xml
? (We might actually mostly get away with activating(?) them only in the mainguava
build: That downloads and registers the toolchains, and then at least the other projects' per-plugin toolchain configuration probably finds them? But for the more general configuration to work, I think we at least need to activate(?)maven-toolchains-plugin
in each? I haven't experimented a ton with this.)(See also these notes.)
Fixes #7331
RELNOTES=n/a