Question

I am attempting to compile JavaDocs with:

mvn javadoc:aggregate

I keep getting errors such as:

[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;

and

[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;

Clearly my dependencies for a multi-module/aggregation project are not being recognised. Both these are marked as dependencies in one of my modules' pom.xml file. Do I need to provide additional arguments to maven-javadoc-plugin in the parent pom.xml?

EDIT:

I ran mvn install and it seemed to work. My parent pom.xml is:

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

The version is outdated but that didn't seem to be the problem.

Was it helpful?

Solution

You need to go via the pom configuration like this:

<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>

and than you need to call mvn site ...

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top