Convert Maven site software documentation to PDF

I am currently working on a project written in Java and I am using the Maven and maven-site-plugin to create a website containing all the relevant JavaDocs, reports, etc. At the same time, I need to be able to convert the same documentation into a readable, book format. Are there any scripts or tools designed to host the website and convert them to a sufficiently formatted PDF file or other style so that it can be easily digitalized or printed?

+5
source share
1 answer

maven-pdf-plugin creates a PDF project documentation file.

Two notes from the documentation:

Note 1: By default, the PDF plugin creates a PDF document that combines all the documents of your site. If you want to generate each site document separately, you need to add -Daggregate = false on the command line.

Note 2: By default, the PDF plugin uses the FOP implementation. The plugin also supports the implementation of iText, you just need to add -Dimplementation = itext on the command line.

In fact, you can specify the aggregate property in the POM (see example below)

This configuration will generate a PDF in every assembly that is active in the profile docs(you can do this with every assembly, but it will be a little 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</aggregate>
          </configuration>
        </execution>
      </executions>
    </plugin>
  </profile>
</profiles>

-P docs , .

+7

All Articles