From 39e263fe5d8ba767d22e594cffd02420bab43f2a Mon Sep 17 00:00:00 2001 From: Sam Brannen <104798+sbrannen@users.noreply.github.com> Date: Wed, 16 Apr 2025 14:16:59 +0200 Subject: [PATCH] Switch javadoc link-modularity-mismatch flag to info We now invoke the javadoc tool with "--link-modularity-mismatch info" in order not to fail the build when encountering warnings such as the following. > The code being documented uses packages in the unnamed module, but the > packages defined in https://junit.org/junit5/docs/5.12.2/api/ are in > named modules. Closes gh-27497 --- framework-api/framework-api.gradle | 6 +++++- gradle/spring-module.gradle | 3 +++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/framework-api/framework-api.gradle b/framework-api/framework-api.gradle index df7f3bbd57d..e14fa97976c 100644 --- a/framework-api/framework-api.gradle +++ b/framework-api/framework-api.gradle @@ -33,7 +33,11 @@ javadoc { links(rootProject.ext.javadocLinks) // Check for 'syntax' and 'reference' during linting. addBooleanOption('Xdoclint:syntax,reference', true) - addBooleanOption('Werror', true) // fail build on Javadoc warnings + // Change modularity mismatch from warn to info. + // See https://github.com/spring-projects/spring-framework/issues/27497 + addStringOption("-link-modularity-mismatch", "info") + // Fail build on Javadoc warnings. + addBooleanOption('Werror', true) } maxMemory = "1024m" doFirst { diff --git a/gradle/spring-module.gradle b/gradle/spring-module.gradle index c292f84349e..062e13200ae 100644 --- a/gradle/spring-module.gradle +++ b/gradle/spring-module.gradle @@ -82,6 +82,9 @@ javadoc { // 'framework-api:javadoc' task checks for 'reference' in addition // to 'syntax'. addBooleanOption("Xdoclint:syntax,-reference", true) + // Change modularity mismatch from warn to info. + // See https://github.com/spring-projects/spring-framework/issues/27497 + addStringOption("-link-modularity-mismatch", "info") // With the javadoc tool on Java 24, it appears that the 'reference' // group is always active and the '-reference' flag is not honored. // Thus, we do NOT fail the build on Javadoc warnings due to