Maven JavaDoc插件:聚合依赖项

时间:2013-01-02 13:07:50

标签: maven javadoc maven-javadoc-plugin

我正在尝试用以下代码编译JavaDocs:

mvn javadoc:aggregate

我不断收到错误,例如:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-javadoc-plugin:2.5:aggregate (default-cli) on project mutopia: An error has occurred in JavaDocs report generation:Exit code: 1 - /Users/Aram/Development/Java/MUtopia/Code/mutopia/mutopia-server/src/main/java/au/edu/unimelb/civenv/hpvat/mutopia/server/Asset.java:3: package org.springframework.roo.addon.javabean does not exist
[ERROR] import org.springframework.roo.addon.javabean.RooJavaBean;

[ERROR] /Users/Aram/Development/Java/MUtopia/Code/mutopia/mutopia-server/src/main/java/au/edu/unimelb/civenv/hpvat/mutopia/server/Param.java:8: package flexjson does not exist
[ERROR] import flexjson.JSONDeserializer;

显然,我无法识别多模块/聚合项目的依赖关系。这些都标记为我的一个模块“pom.xml文件中的依赖项。我是否需要在父pom.xml中为maven-javadoc-plugin提供其他参数?

修改

我跑了mvn install它似乎有效。我的父母pom.xml是:

<build>
    ...
    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>2.5</version>
        <configuration>
            <aggregate>true</aggregate>
        </configuration>
    </plugin>
    ...
</build>

版本已过时,但似乎不是问题。

1 个答案:

答案 0 :(得分:0)

您需要通过这样的pom配置:

<project>
  ...
  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>2.9</version>
        <configuration>
          <!-- Default configuration for all reports -->
          ...
        </configuration>
        <executions>
          <execution>
            <id>aggregate</id>
            <goals>
              <goal>aggregate</goal>
            </goals>
            <phase>site</phase>
            <configuration>
              <!-- Specific configuration for the aggregate report -->
              ...
            </configuration>
          </execution>
          ...
        </executions>
      </plugin>
      ...
    </plugins>
  </build>
  ...
</project>

而且你需要打电话给mvn网站...