Maven doc plugin: Single chapter output

ForgeRock Community LogoAs Lana mentioned to me the other day, if you make small changes to core docs, it can be painful to wait for the entire documentation set to generate just to see how your changes look in HTML or PDF for example. The fix for DOCS-29 lets you generate output for a single format. You can use the documentSrcName parameter to restrict what gets built to a single file, such as an individual chapter.

The following command generates PDF only for a single chapter of the forgerock-doc-maven-plugin-test project.

$ mvn -DdocumentSrcName=chap-one.xml -Dinclude=pdf clean pre-site

Find the pre-site output under target/docbkx/.

$ ls target/docbkx/pdf/*.pdf 
target/docbkx/pdf/ForgeRock-Bogus-Guide.pdf

Caveats:

  • If you defined <excludes>, then you cannot use <include> in the same configuration.
  • If you have multiple chapters with the same name, this might not work as expected. My guess is the last one wins.
  • The documentSrcName must correspond to a file. You cannot currently generate output for a part of a file, nor for several arbitrary files.
Advertisements

2 thoughts on “Maven doc plugin: Single chapter output

  1. Another way to speed up the builds is to turn off external link checking, which I just added a moment ago:

    If you want to skip the checks for external URLs, pass -DskipLinkCheck=true to Maven, as in the following example:

    mvn -DskipLinkCheck=true clean pre-site

    By default, the linktester plugin does check that the URLs work.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s