When upgrading Vaadin to 23.3 or 24 in any of my add-ons, the Javadoc steps of my Maven builds fail with the following (shortened) stack trace:
11640 [ERROR] Failed to execute goal org.apache.maven.plugins:maven-javadoc-plugin:3.4.1:jar (attach-javadocs) on project vaadin-service-ref: Execution attach-javadocs of goal org.apache.maven.plugins:maven-javadoc-plugin:3.4.1:jar failed: Unable to derive module descriptor for E:\Dev.m2\repository\com\vaadin\servletdetector\throw-if-servlet3\1.0.1\throw-if-servlet3-1.0.1.jar: throw.if.servlet3: Invalid module name: ‘throw’ is not a Java identifier → [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-javadoc-plugin:3.4.1:jar (attach-javadocs) on project vaadin-service-ref: Execution attach-javadocs of goal org.apache.maven.plugins:maven-javadoc-plugin:3.4.1:jar failed: Unable to derive module descriptor for E:\Dev.m2\repository\com\vaadin\servletdetector\throw-if-servlet3\1.0.1\throw-if-servlet3-1.0.1.jar
…
Caused by: org.apache.maven.plugin.PluginExecutionException: Execution attach-javadocs of goal org.apache.maven.plugins:maven-javadoc-plugin:3.4.1:jar failed: Unable to derive module descriptor for E:\Dev.m2\repository\com\vaadin\servletdetector\throw-if-servlet3\1.0.1\throw-if-servlet3-1.0.1.jar
…
Caused by: java.lang.module.FindException: Unable to derive module descriptor for E:\Dev.m2\repository\com\vaadin\servletdetector\throw-if-servlet3\1.0.1\throw-if-servlet3-1.0.1.jar
…
Caused by: java.lang.IllegalArgumentException: throw.if.servlet3: Invalid module name: ‘throw’ is not a Java identifier
It’s not the first time I experience Javadoc to be stricter than the compiler or generally care about stuff it has no reason to care about, since modules have been introduced in Java. Previously, upgrading Java to 17 (even when still building for/against older versions) and upgrading the maven-javadoc-plugin have fixed this.