Issues with Maven + Javadoc generation + Vaadin 23.3 or 24.

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.

Not this time though. I can exclude throw-if-servlet3 from vaadin-core. But it seems wrong having to do that.

It seems this should be something that can be fixed by adding a proper Automatic-Module-Name to that artifact.

@winsome-wombat ping :grin: this looks like your recently added pet artefact

Not sure what would be wrong with that jar

Invalid module name: 'throw' is not a Java identifier sounds … odd

But apparently you see the error if you do

java -p throw-if-servlet3-1.0.1.jar --list-modules

seems like https://github.com/vaadin/servlet-detector/pull/3 fixes it

Yeah, that should fix it :)

You can use servlet detector 1.0.2 or wait for the next Vaadin release

Thank you. This is in preparation for Vaadin 24, so for me it’s enough when it’s fixed by then (which it will :+1: ) :)