Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

maven 3 javadoc plugin doesn't take the excludepackagename config

I'm trying to exclude a bunch of packages from a javadoc site.

Unfortunately this plugin seems to live its own life and when it was configured as a report plugin it failed with access denied when moving files, so it was changed to be a normal plugin and then configured to run with the site goal (aggregated). By doing that we have the javadoc generated and it's published under the site as it should be.

But it seems that the configuration parameters for the plugin doesn't take effect at all. I've tried to move the <excludePackageNames> element around - both being a general config and to be a specific config for the aggregate goal - and I even added an exclusion for our entire code base and all files was still generated.

What I'm trying to do is to simply remove a couple of packages that shouldn't be in the javadoc. Anyone who got this plugin and the config to play nicely, to exclude packages?

This is the config I use right now, the javadoc is created but all packages, including the excluded, is generated.

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-javadoc-plugin</artifactId>
    <version>2.8</version>
    <configuration>
        <excludePackageNames>my.company.packages.*</excludePackageNames>
    </configuration>
    <executions>
        <!-- Hook up the Javadoc generation on the site phase -->
        <execution>
            <id>aggregate</id>
            <goals>
                <goal>aggregate</goal>
            </goals>
            <phase>site</phase>
        </execution>
    </executions>
</plugin>

Any ideas, pretty please?

like image 705
Sven Avatar asked Jan 17 '12 13:01

Sven


1 Answers

I solved identical problem by adding the sourcepath parameter to the configuration:

<configuration>
    <sourcepath>${project.basedir}/src/main/java</sourcepath>
    <excludePackageNames>my.company.packages.*</excludePackageNames>
</configuration>

The configuration above will exclude all packages below my.company.packages but not my.company.packages itself. To exclude also my.company.packages use <excludePackageNames>my.company.packages</excludePackageNames> instead.

like image 125
s4nk Avatar answered Oct 01 '22 20:10

s4nk