maven-javadoc-plugin icon indicating copy to clipboard operation
maven-javadoc-plugin copied to clipboard

The --no-fonts option breaks the build with JDK 21 after upgrade to v3.11.3 when using toolchain

Open jafarre-bi opened this issue 4 months ago • 7 comments

Affected version

3.11.3

Bug description

I just upgraded from 3.11.2 to 3.11.3, and the build crashed because the flag --no-fonts was being used and not recognised by the javadoc tool. I'm using Temurin 21.0.8 under Windows 11 x64 with Maven 4.0.0-rc-2. Adding the option <disableNoFonts>true</disableNoFonts> worked around the issue.

jafarre-bi avatar Aug 18 '25 21:08 jafarre-bi

can you provide exactly how you have this issue? because there is a test here https://github.com/apache/maven-javadoc-plugin/blob/9333db140f286cc57016f5ba22b7106af7ff64d5/src/main/java/org/apache/maven/plugins/javadoc/AbstractJavadocMojo.java#L1993 and the option is activated only from java23. And we have our CI builds from java 8 to 23. I would like to understand how exactly do you have this issue.

olamy avatar Aug 19 '25 00:08 olamy

I ran into this while running Maven with JDK 25 and using a toolchain for JDK 21. Here's a minimal repro.

tkindy avatar Oct 22 '25 18:10 tkindy

Possible solution direction: This plugin uses the java version dictated by the toolchain instead of the java version that was used to run maven?

nielsbasjes avatar Oct 30 '25 15:10 nielsbasjes

Possible solution direction: This plugin uses the java version dictated by the toolchain instead of the java version that was used to run maven?

correct see https://github.com/apache/maven-javadoc-plugin/issues/377

Well TBH I'm not sure if it's an issue here as it;s just a matter of configuration.

olamy avatar Oct 30 '25 20:10 olamy

I consider it to be an issue because this no-fonts is automatically added depending on the used Java version. It is this java version where it is apparently looking at the wrong one to make this conclusion.

I agree you CAN counteract this incorrect feature usage by adding extra configuration, to me that still makes it an issue.

nielsbasjes avatar Oct 31 '25 11:10 nielsbasjes

Sure I agree

olamy avatar Nov 10 '25 04:11 olamy

maybe using some code from https://github.com/apache/maven-jar-plugin/pull/500 ?

olamy avatar Nov 10 '25 21:11 olamy