Description
Overview
Changes made in conjunction with #27497 caused the aggregated Javadoc not to be generated/published.
However, we were quite surprised that such an error did not fail our Gradle build.
During the release process for Spring Framework 7.0.0-M4, the javadoc
task in the Gradle build actually stated that there was an error, but the task finished successfully, which is why we did not notice that the Javadoc had not been published.
> Task :framework-api:javadoc
error: invalid flag: --link-modularity-mismatch
1 error
Usage:
javadoc [options] [packagenames] [sourcefiles] [@files]
...
BUILD SUCCESSFUL ...
It turns out that the Gradle javadoc
task does "fail on error" by default.
However, the io.freefair.aggregate-javadoc
Gradle plugin from the FreeFair project configures the javadoc
task so that it does NOT "fail on error" by default.
If we set failOnError = true
for the javadoc
task, the build then correctly fails when the javadoc
tool fails to execute and generate documentation, which is the behavior we expect.
In light of that, we should set failOnError = true
for all javadoc
tasks to avoid such surprises in the future.