The maven-pdf-plugin generates a PDF of the project documentation.
Two notes from the documentation to consider:
Note 1: By default, the PDF plugin generates a PDF document which aggregates all your site documents. If you want to generate each site document individually, you need to add -Daggregate=false in the command line.
Note 2: By default, the PDF plugin uses the FOP implementation. The plugin also supports the iText implementation, you just need to add -Dimplementation=itext in the command line.
You can actually specify the aggregate property in your POM (see example below)
This configuration will generate the PDF on each build that the docs
profile is active (you could do it on every build, but it would be a bit slow for your typical development cycle:
<profiles>
<profile>
<id>docs</id>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-pdf-plugin</artifactId>
<version>1.0</version>
<executions>
<execution>
<id>pdf</id>
<phase>site</phase>
<goals>
<goal>pdf</goal>
</goals>
<configuration>
<outputDirectory>
${project.reporting.outputDirectory}
</outputDirectory>
<aggregate>false</Daggregate>
</configuration>
</execution>
</executions>
</plugin>
</profile>
</profiles>
You can activate the profile on the command line with -P docs
or use an activation configuration if you want to be finer-grained.