Maven generate javadoc for one submodule

445 views Asked by At

I have a maven project with submodules.

Is is it possible to run on the root pom:

mvn clean install javadoc:javadoc

And building all the project (submodules) but generating the javadoc only for one of the submodule ? Cause I'm only interesseted to publish the javadoc of one.

My pom.xml contains the maven-javadoc-plugin.

Thanks.

1

There are 1 answers

0
Jens Baitinger On

Configure the Javadoc plugin within the module you want to have the javadoc generated:

<build>
    <plugins>
        <plugin>
            <artifactId>maven-javadoc-plugin</artifactId>
            <version>2.9.1</version>
            <executions>
                <execution>
                    <id>javadoc-jar</id>
                    <phase>package</phase>
                    <goals>
                        <goal>jar</goal>
                    </goals>
                    <configuration>
                        [...]
                    </configuration>
                </execution>
            </executions>
        </plugin>
    </plugins>
</build>

This config will create the Javadoc each tome you call mvn package or mvn install