arturobernalg opened a new pull request, #1417: URL: https://github.com/apache/maven-javadoc-plugin/pull/1417
Fixes #1202. getAddStylesheet() took a javadocOutputDirectory parameter but never used it -- it only looked for the stylesheet under getJavadocDirectory() (src/main/javadoc), and the one call site passed getJavadocDirectory() as that argument too. Two consequences: the internal stylesheetfile name-conflict check could end up extracting the main stylesheetfile into the project's source tree instead of the report output directory, and an addStylesheet entry bundled only in a javadoc plugin dependency could never be found at all, since getStylesheetFile already falls back to the plugin's dependencies via getResource() but getAddStylesheet did not. getAddStylesheet now resolves through the same getResource() path as getStylesheetFile, extracting a dependency-provided resource into the real output directory, and addAddStyleSheets forwards the actual output directory instead of recomputing getJavadocDirectory(). A missing stylesheet is now a warning instead of a thrown exception, matching how a missing stylesheetfile is already handled, which is the alignment the issue itself asks for. Added testAddStylesheetFromDependency and testAddStylesheetMissingDoesNotFailBuild to JavadocReportTest, modeled on the existing testStylesheetfile fixture. Both fail on unfixed code (the first with the stylesheet written into src/main/javadoc, the second with a thrown MavenReportException) and pass after the fix. Full module suite, checkstyle and spotless pass locally. To make clear that you license your contribution under the Apache License Version 2.0, January 2004 check one of the following: - [x] I hereby declare this contribution to be licensed under the Apache License Version 2.0, January 2004 - [ ] I hereby declare that I have filed an Apache Individual Contributor License Agreement. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
