7

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?

Sven
  • 892
  • 14
  • 29
  • If you got an access denied error then you need to fix the permissions in your tree, not try other experiments at random. – bmargulies Jan 17 '12 at 13:52
  • There's no permission to fix, the plugin is holding a file that it tries to move (on any machine or Jenkins server, not only locally). As I wrote it works when configured as a plugin and not as a report plugin. Besides, that is not the main issue. The plugin still doesn't take the config. – Sven Jan 17 '12 at 14:06
  • If you can make a test case that demonstrates this problem, open a JIRA at the plugin JIRA and someone, possibly me, will attend to it. – bmargulies Jan 17 '12 at 14:34
  • Tried to move the config inside the execution block? – Corubba Jan 17 '12 at 15:02
  • I did try to move the config within the block, I found two different examples and tried them both with no succes. – Sven Jan 17 '12 at 15:18
  • @bmargulies, I'll see if I can take the time to make a test case. – Sven Jan 17 '12 at 15:20
  • The config will work or fail exactly identically in either place. Unless Sven has *something funny* going on, this is a maven-javadoc-plugin bug, and best handled in JIRA. – bmargulies Jan 17 '12 at 16:09
  • @BloodyWorld, yes did that too. That was the "moved around"-part. – Sven Jan 18 '12 at 08:56
  • @Sven, are you specifically running the `javadoc:javadoc` goal from the command line, or are you doing this as part of the overall reactor build (e.g. `mvn package` or something)? The reason I ask is because the location of the configuration in the POM is different depending on these use cases. – Peter Mularien Apr 08 '13 at 16:17

1 Answers1

5

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.

s4nk
  • 647
  • 1
  • 9
  • 18