I would like to enable my Maven build to fetch all source and JavaDoc jars and to unpack all JavaDoc jars only once in a multi-module Maven project.
I managed with the help of the Maven dependency plugin to to fetch all source and JavaDoc jars for every sub-module. But I need them only once to be unpacked and not for every sub-module.
The best solution would be to be able to unpack all managed dependencies specified in the project parent POM. Any idea how to achieve this?
Here is my current solution:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>fetch-source</id>
<goals>
<goal>sources</goal>
</goals>
</execution>
<execution>
<id>fetch-doc</id>
<goals>
<goal>resolve</goal>
</goals>
<configuration>
<classifier>javadoc</classifier>
</configuration>
</execution>
<execution>
<id>unpack-javadoc</id>
<goals>
<goal>unpack-dependencies</goal>
</goals>
<configuration>
<classifier>javadoc</classifier>
<useSubDirectoryPerArtifact>true</useSubDirectoryPerArtifact>
<stripClassifier>true</stripClassifier>
</configuration>
</execution>
</executions>
</plugin>