Search code examples
mavenmaven-pluginmaven-javadoc-plugin

Multimodule maven java doc build


I have multimodule maven project like this

myproject
  framework1
    f1-presentation
      *.java
    f1-core
      *.java
    f1-tag
      *.java

 framework2
   f2-presentation
      *.java
   f2-core
      *.java
   f2-tag
      *.java

I want to create apidocs for all java files. If I run mvn javadoc:aggregate in the project root it creates apidcos in the target directory of project root (target/sites/apidocs). But what I want is to create this apidocs for each 2nd level modules. As for example I want apidocs for all java files of framework1 to be create in framework1/target/sites/apidocs. Same thing goes for framework2. Final result will be like this

myproject
 framework1
    target/sites/apidocs (this will contain javadocs for all its submodules classes)
    f1-presentation
      *.java
    f1-core
      *.java
    f1-tag
      *.java

 framework2
    target/sites/apidocs (this will contain javadocs for all its submodules classes)
    f2-presentation
      *.java
    f2-core
      *.java
    f2-tag
      *.java

Could you guys tell me how to do that using maven javadoc plugin.

Edit: pom.xml in framework1 contains

 <build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <version>2.8</version>
            <executions>
                <execution>
                    <id>aggregate</id>
                    <goals>
                        <goal>aggregate</goal>
                    </goals>
                    <phase>package</phase>
                </execution>
            </executions>
        </plugin>
    </plugins>

  </build>

Solution

  • After digging, I found that the Maven Javadoc plugin is not so good for a multimodule project. What I wanted to achieve is not yet supported.