[ https://issues.apache.org/jira/browse/MJAVADOC-797?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17865721#comment-17865721 ]
Michael Osipov edited comment on MJAVADOC-797 at 7/13/24 9:01 PM: ------------------------------------------------------------------ Now, I went through the case and your reproducer, thanks for that. First of all, our {{excludePackageNames}} does not match {{-exclude}}, it is a superset adding extra features like wildcards. If we put the wildcards aside and read the behavior of {{-exclude}} in any Java version we see that {{org.apache.internal}} shall be enough to exclude this package and all of its subpackages. Java 8 exactly does that, but nothing newer does that. I have tried: "C:\Program Files\Eclipse Adoptium\jdk-8.0.412.8-hotspot" "C:\Program Files\Eclipse Adoptium\jdk-11.0.23.9-hotspot" "C:\Program Files\Eclipse Adoptium\jdk-17.0.11.9-hotspot" "C:\Program Files\Eclipse Adoptium\jdk-21.0.3.9-hotspot" All of them, but 8 fail. They require EVERY single package to be listed. I would recommend to strip down your sample to bare {{javadoc}} calls and write to https://mail.openjdk.org/mailman/listinfo/javadoc-dev. For me clearly a bug in the JDK. Please refer to this JIRA issue as well. By testing I mean I have passed the same {{@options}} file the javadoc executable of those listed versions w/o Maven. was (Author: michael-o): Now, I went through the case and your reproducer, thanks for that. First of all, our {{excludePackageNames}} does not match {{-exclude}}, it is a superset adding extra features like wildcards. If we put the wildcards aside and read the behavior of {{-exclude}} in any Java version we see that {{org.apache.internal}} shall be enough to exclude this package and all of its subpackages. Java 8 exactly does that, but nothing newer does that. I have tried: "C:\Program Files\Eclipse Adoptium\jdk-8.0.412.8-hotspot" "C:\Program Files\Eclipse Adoptium\jdk-11.0.23.9-hotspot" "C:\Program Files\Eclipse Adoptium\jdk-17.0.11.9-hotspot" "C:\Program Files\Eclipse Adoptium\jdk-21.0.3.9-hotspot" All of them, but 8 fail. They require EVERY single package to be listed. I would recommend to strip down your sample to bare {{javadoc}} calls and write to https://mail.openjdk.org/mailman/listinfo/javadoc-dev. For me clearly a bug in the JDK. By testing I mean I have passed the same {{@options}} file the javadoc executable of those listed versions w/o Maven. > Exclusion rules works differently for Java 8 and Java 11 > -------------------------------------------------------- > > Key: MJAVADOC-797 > URL: https://issues.apache.org/jira/browse/MJAVADOC-797 > Project: Maven Javadoc Plugin > Issue Type: Bug > Affects Versions: 3.7.0 > Reporter: Maksim Timonin > Priority: Major > > The behavior of the "-excludePackageNames" differs for java8 and java11 in > case of using an option "-subpackages". > Reproducer is available in the PR: > [1] [https://github.com/apache/maven-javadoc-plugin/pull/289] > There are possibly, 2 bugs: > 1. Behavior for "excludePackageNames" is actually depends on whether the > "subpackages" setting is specified or not - there are different patterns for > exclusion used, see patterns in *JavadocUtil#getExcludedPackages* and > *JavadocUtil#getIncludedFiles* > 2. In case of using "subpackages" the scenario in the PR [1], the plugin > prepares equal options for the javadoc util for both java versions. But > actually the output for the javadoc util differs (depends on the java > version). I'm not sure is it an expected behavior for the javadoc util, but > I'd expect the maven-javadoc-plugin will adjust for different java versions > and provides equal exclusion result. > -- This message was sent by Atlassian Jira (v8.20.10#820010)