Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Another harrowing maven-javadoc-plugin workaround
As of 5ee9b6b it was possible to generate javadocs, and today it was not, and that remains unexplained. The version of maven-javadoc-plugin was still 3.1.1 as it was then. It is herewith updated to 3.2.0, only because it exists, not because it solved the problem. To explain what finally worked around the problem, a few words about the problem are needed. The maven-javadoc-plugin is adding a --module-source-path option when invoking javadoc. It's easy to confirm that javadoc behaves perfectly with all of the plugin-supplied options except that, which simply isn't needed. The plugin isn't merely adding a bogus option, though. It quite carefully creates a directory, and another, empty, directory within it, for the unneeded option to point to, with the natural result that javadoc fails to find the module. And even combing through AbstractJavadocMojo's code (don't waste time with its documentation) did not reveal any way to configure that plugin from the POM to simply stop inserting that option that makes javadoc fail. Perhaps there is a way and I didn't find it. Thanks for a workaround to a change in the JDK itself for Java 12. https://bugs.java.com/bugdatabase/view_bug.do?bug_id=8208609 For other reasons, but saving the day here, they made the --module-source-path option repeatable starting in Java 12, with a new syntax option that makes it possible for a correct source path to be given, and override the bogus one that the plugin is still putting in. So with that, there are buildable javadocs again, but only with Java 12 or later. Builds with Java 9, 10, or 11 simply won't be able to make the javadocs. This commit, read together with 5ee9b6b, may serve as an argument to discontinue using anything as black-boxy and opinionated as maven-javadoc-plugin to build the javadocs for this project. It would have been considerably faster to write some JavaScript in antrun, as we do in some other places, to just run the wretched javadoc program with the handful of arguments it needs for the job. That wasn't an option here because the maven-antrun-plugin doesn't implement MavenReport. It might very well still have been faster *to write* a reporting plugin exposing JavaScript, add it to the project, build it, and use it to launch simple javadoc commands.
- Loading branch information