As a follow up to #27480 (see commit 030ba52805a7c513fa196e97d54543b6e3972cae), we need to determine why we cannot configure external Javadoc links to JUnit 5.

Note that code in the spring-test module (e.g., the SpringExtension for JUnit Jupiter) links to JUnit 5 APIs.

If we uncomment the following...

https://github.com/spring-projects/spring-framework/blob/167e538dd13535c4b7a7cff171cd7a0ae22c9b81/build.gradle#L347-L352

... we get the following Javadoc warning which fails the build.

warning: The code being documented uses packages in the unnamed module, but the packages defined in https://junit.org/junit5/docs/5.8.1/api/ are in named modules. 

Related JDK issues

  • https://bugs.openjdk.java.net/browse/JDK-8240169
  • https://bugs.openjdk.java.net/browse/JDK-8274639

Comment From: sbrannen

/cc @sormuras

Comment From: sbrannen

Update

Thanks to a tip from @sormuras, it turns out that the links are actually generated properly in the resulting HTML if we remove the use of -Werror for the javadoc task.

Thus, the warning is merely a "warning" that we are not interested in.

Unfortunately, (as far as I know) there is currently no way to instruct javadoc not to log that as a "warning".

Comment From: sormuras

This https://bugs.openjdk.java.net/browse/JDK-8274639 describes the underlying cause and a potential fix.

Comment From: sbrannen

Java 18 will introduce a --link-modularity-mismatch option that defaults to WARN (the status quo), and we will be able to set it to INFO to prevent such warnings from breaking our build.

Comment From: sbrannen

Java 18 will introduce a --link-modularity-mismatch option that defaults to WARN (the status quo), and we will be able to set it to INFO to prevent such warnings from breaking our build.

Spring Framework 6.0.x is built using Java 17.

Since that requires that we execute our Gradle builds with Java 18, we cannot currently address this issue.