yagee-de commented on issue #1244:
URL:
https://github.com/apache/maven-javadoc-plugin/issues/1244#issuecomment-3728879178
I came up with a rather complicated workaround that works for me but may
need customization for other use cases:
```xml
<profile>
<!-- workaround for JDK 23+ javadoc issue with missing fonts -->
<!-- https://github.com/apache/maven-javadoc-plugin/issues/1244 -->
<id>workaround-javadoc-no-fonts</id>
<activation>
<jdk>[23,)</jdk>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.gmavenplus</groupId>
<artifactId>gmavenplus-plugin</artifactId>
<version>4.2.1</version>
<dependencies>
<dependency>
<groupId>org.apache.groovy</groupId>
<artifactId>groovy</artifactId>
<version>5.0.3</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.apache.groovy</groupId>
<artifactId>groovy-ant</artifactId>
<version>5.0.3</version>
<scope>runtime</scope>
</dependency>
</dependencies>
<executions>
<execution>
<id>set-javadoc-disableNoFonts</id>
<goals>
<goal>execute</goal>
</goals>
<phase>initialize</phase>
<configuration>
<scripts>
<script><![CDATA[
int mavenMajor = Runtime.version().feature()
def t =
project.properties['maven.compiler.release']?.toString()
if (!t) return
int targetMajor = Integer.parseInt(t)
if (mavenMajor >= 23 && targetMajor < 23) {
project.properties.setProperty('maven.javadoc.disableNoFonts', 'true')
log.info("Set maven.javadoc.disableNoFonts=true (Maven
JDK " + mavenMajor + ", target " + targetMajor + ")")
}
]]></script>
</scripts>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
```
A profile for a parent POM. It's activated on Java 23 or newer and checks if
`maven.compiler.release` property is `23`or less. If so, it sets the property
`maven.javadoc.disableNoFonts=true`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]