maven 3 javadoc plugin ignores configuration
Asked Answered
H

1

7

I use maven 3 and have my javadoc configured according to the new maven 3 siteplugin+javadoc configuration. However all of my javadoc configuration parameters seem to be ignored. So no package grouping, no source linking etc.

My project is a multi module project, the command I use is: mvn3 clean package javadoc:aggregate

Here is the relevent part of my root pom.:

<build>
    <!-- Memory management properties for jenkins build. -->
    <pluginManagement>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.11</version>
                <configuration>
                    <argLine>-Xmn8m -Xms32m -Xmx96m -XX:PermSize=32m
                        -XX:MaxPermSize=128m</argLine>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-site-plugin</artifactId>
                <version>3.0-beta-3</version>
                <configuration>
                    <reportPlugins>
                        <plugin>
                            <groupId>org.apache.maven.plugins</groupId>
                            <artifactId>maven-javadoc-plugin</artifactId>
                            <version>2.8</version>
                            <configuration>
                                <verbose>true</verbose>
                                <groups>
                                    <group>
                                        <title>Hypercube</title>
                                        <packages>org.hypercube*</packages>
                                    </group>
                                    <group>
                                        <title>Hyperdrive</title>
                                        <packages>org.hyperdrive*</packages>
                                    </group>
                                    <group>
                                        <title>Hydrogen</title>
                                        <packages>org.hydrogen*</packages>
                                    </group>
                                    <group>
                                        <title>Fusion-X11</title>
                                        <packages>org.fusion.x11*</packages>
                                    </group>
                                    <group>
                                        <title>Fusion-Qt</title>
                                        <packages>org.fusion.qt*</packages>
                                    </group>
                                </groups>
                                <linksource>true</linksource>
                                <minmemory>16m</minmemory>
                                <maxmemory>128m</maxmemory>
                            </configuration>
                        </plugin>
                    </reportPlugins>
                </configuration>
            </plugin>
        </plugins>
    </pluginManagement>
</build>
Homeostasis answered 13/1, 2012 at 13:44 Comment(0)
A
8

This is because Maven separates between the plugin-config of plugins and reportplugins inside the configuration of the site-plugin. The snippet you post will only take action when running mvn site, not the javadoc goals directly. This behavior effects all plugins. Afaik is the only way to duplicate the configuration to a "normal" plugin-config like this:

<build>
    <!-- Memory management properties for jenkins build. -->
    <pluginManagement>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.11</version>
                <configuration>
                    <argLine>-Xmn8m -Xms32m -Xmx96m -XX:PermSize=32m
                        -XX:MaxPermSize=128m</argLine>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-site-plugin</artifactId>
                <version>3.0-beta-3</version>
                <configuration>
                    <reportPlugins>
                        <plugin>
                            <groupId>org.apache.maven.plugins</groupId>
                            <artifactId>maven-javadoc-plugin</artifactId>
                            <version>2.8</version>
                            <configuration>
                                <verbose>true</verbose>
                                <groups>
                                    <group>
                                        <title>Hypercube</title>
                                        <packages>org.hypercube*</packages>
                                    </group>
                                    <group>
                                        <title>Hyperdrive</title>
                                        <packages>org.hyperdrive*</packages>
                                    </group>
                                    <group>
                                        <title>Hydrogen</title>
                                        <packages>org.hydrogen*</packages>
                                    </group>
                                    <group>
                                        <title>Fusion-X11</title>
                                        <packages>org.fusion.x11*</packages>
                                    </group>
                                    <group>
                                        <title>Fusion-Qt</title>
                                        <packages>org.fusion.qt*</packages>
                                    </group>
                                </groups>
                                <linksource>true</linksource>
                                <minmemory>16m</minmemory>
                                <maxmemory>128m</maxmemory>
                            </configuration>
                        </plugin>
                    </reportPlugins>
                </configuration>
            </plugin>
            <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-javadoc-plugin</artifactId>
              <version>2.8</version>
              <configuration>
              <verbose>true</verbose>
              <groups>
                <group>
                    <title>Hypercube</title>
                    <packages>org.hypercube*</packages>
                </group>
                <group>
                    <title>Hyperdrive</title>
                    <packages>org.hyperdrive*</packages>
                </group>
                <group>
                    <title>Hydrogen</title>
                    <packages>org.hydrogen*</packages>
                </group>
                <group>
                    <title>Fusion-X11</title>
                    <packages>org.fusion.x11*</packages>
                </group>
                <group>
                    <title>Fusion-Qt</title>
                    <packages>org.fusion.qt*</packages>
                </group>
              </groups>
              <linksource>true</linksource>
              <minmemory>16m</minmemory>
              <maxmemory>128m</maxmemory>
              </configuration>
            </plugin>
        </plugins>
    </pluginManagement>
</build>
Ackerley answered 13/1, 2012 at 13:45 Comment(2)
Just do not expect this "design" to be fixed soon, there are numerous bugs reported and the speed of changes is not exactly fast.Halftone
On a JMPS/Jigsaw modularized project, I am trying to run javadoc:aggregate and the javadoc plugin configuration is being ignored. I have tried a bunch of solutions and nothing seems to work.Marzi

© 2022 - 2024 — McMap. All rights reserved.