我使用maven 3并根据新的maven 3 siteplugin + javadoc配置配置了我的javadoc。但是,我的所有javadoc配置参数似乎都被忽略了。所以没有包分组,没有源链接等。
我的项目是一个多模块项目,我使用的命令是:mvn3 clean package javadoc:aggregate
这是我的根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>
答案 0 :(得分:5)
这是因为Maven在site-plugin的配置中分离了插件的plugin-config和reportplugins。您发布的代码段只会在运行mvn site
时执行,而不是直接运行javadoc目标。此行为会影响所有插件。 Afaik是将配置复制到“普通”插件配置的唯一方法,如下所示:
<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>