tanishq chugh
tanishq chugh

Reputation: 1

Excluding a particular java file from Javadoc aggregate

I am running the following command: mvn install javadoc:javadoc javadoc:aggregate

on a multi sub-module maven project. I need to skip two java files from aggregation phase.

Environment is java 17 and maven-javadoc-plugin: version 3.0.1

I have configured my maven-javadoc-plugin in parent pom.xml as follows:

<plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>3.0.1</version>
        <configuration>
          <doclint>none</doclint>
          <useStandardDocletOptions>false</useStandardDocletOptions>
          <sourceFileExcludes>
            <exclude>**/file1.*</exclude>
            <exclude>**/file2.*</exclude>
            <exclude>**/path/file2.java</exclude>
            <exclude>**/path/file2.*</exclude>
            <exclude>/path/file2.java</exclude>
            <exclude>./path/file2.java</exclude>
            <exclude>/path/file2.*</exclude>
            <exclude>./path/file2.*</exclude>
            <exclude>**/folder/file2.*</exclude>
            <exclude>**/folder/file2.java</exclude>
          </sourceFileExcludes>
        </configuration>
        <executions>
          <execution>
            <id>aggregate</id>
            <goals>
              <goal>aggregate</goal>
            </goals>
          </execution>
        </executions>
</plugin>

With this I am able to skip file1.java from the javadoc, but file2.java is still being analysed even after trying various ways as in above code. I do have multiple files with the file2.java name in different paths and in different sub-modules.

Upvotes: 0

Views: 50

Answers (0)

Related Questions