Until this issue is resolved, here is a workaround. Essentially, it flattens the site hierarchy, before running the PDF plugin, by copying the sources from the parent and all child modules into a single folder.
In the parent's pom.xml:
<properties>
<site.aggregate.dir>${project.build.directory}/pdf-aggregate</site.aggregate.dir>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<executions>
<execution>
<id>aggregate-pdf-sources</id>
<phase>pre-site</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${site.aggregate.dir}</outputDirectory>
<resources>
<resource>
<directory>src/site/</directory>
</resource>
<resource>
<directory>module1/src/site</directory>
<excludes>
<exclude>site.xml</exclude>
</excludes>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-pdf-plugin</artifactId>
<version>1.2</version>
<configuration>
<siteDirectory>${site.aggregate.dir}</siteDirectory>
</configuration>
</plugin>
</plugins>
</build>
This works well when the PDF plugin is configured to run as part of the site phase. If not, simply run mvn pre-site pdf:pdf.
Until this issue is resolved, here is a workaround. Essentially, it flattens the site hierarchy, before running the PDF plugin, by copying the sources from the parent and all child modules into a single folder.
In the parent's pom.xml:
This works well when the PDF plugin is configured to run as part of the site phase. If not, simply run mvn pre-site pdf:pdf.