Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

maven 3 javadoc plugin ignores configuration

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>
like image 772
Zubzub Avatar asked Jan 13 '12 13:01

Zubzub


1 Answers

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>
like image 175
Corubba Avatar answered Oct 29 '22 12:10

Corubba