Skip to content

Conversation

fridrich
Copy link
Contributor

There is no way to exclude module-info.java by package name. That is why when one is in legacyMode, one enters the file-based mode in order to be able to exclude them. Adding -sourcepath in this case simply causes the javadoc to consider the module-info.java files again. With the javadoc:aggregate goal, this ends up in error.
This PR intents to cater for the problem in #1243 but still keep the #1217 intention intact. When in legacyMode and the excludePackageNames is specified, we have no choice but to add the -sourcepath. Because in the file-based mode, the files corresponding to the excluded package names will not be listed and might cause unresolved symbols. But in all other cases, the -sourcepath should not be needed.
All the integration tests are passing with this change, even the one that was introduced by #1243 . I verified that the generated javadoc and the javadoc.sh, argfile and option files are identical in both cases.

@fridrich
Copy link
Contributor Author

Related to #1242

@olamy olamy changed the title Fix legacyMode again after https://github.com/apache/maven-javadoc-plugin/pull/1243 Fix legacyMode Sep 11, 2025
@olamy olamy added the bug Something isn't working label Sep 11, 2025
@olamy olamy merged commit c11b76c into apache:master Sep 11, 2025
100 checks passed
@olamy olamy added this to the 3.12.0 milestone Sep 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants