Reputation: 1081
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>
Upvotes: 1
Views: 2349
Reputation: 1081
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.
Upvotes: 1
Reputation: 52635
One way to achieve this could be to run mvn javadoc:aggregate in each of framework1
and framework2
folders separately.
The other would be to configure the poms of framework1
and framework2
to aggregate
as specified in this example and run mvn site
from myproject
.
Upvotes: 0