Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Reproducer for different behavior of exclude for java8 and java11 #289

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

timoninmaxim
Copy link
Member

@timoninmaxim timoninmaxim commented Jun 20, 2024

In the test I want to prepare javadocs only for the class org.apache.project.IncludeClass. All other classes located in packages io and org.apache.internal should be skipped.

Configuration I use is the following:

          <subpackages>org.apache</subpackages>
          <excludePackageNames>org.apache.internal:org.apache.internal.*</excludePackageNames>

It works well for java8, but for java11 (actually since java9) it doesn't exclude the class org.apache.internal.subpackage.subsubpackage.ExcludeInternalSubSubClass.

I tried comment the "subpackages" setting and now it excludes the ExcludeInternalSubSubClass. This behavior is not obvious for me, I expect that exclusion rules should not depend on the "subpackages" setting.

I debug it and found:

  1. Behavior for exclusion 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. If the "subpackages" setting is used, the plugin prepares equal options for the javadoc util for both java versions. But actually the output for the javadoc util differs. I tried the same command
    javadoc -sourcepath ./src/main/java -subpackages org.apache -exclude org.apache.internal -d javadoc
    for both java version and it returns different result. I'm not sure is it expected behavior, but I'd expect the javadoc plugin will adjust for different java versions.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant