We assume you have some sources of DocBook XML documents, that you wish to process and convert into pdf or html output.

Basic usage

Put you DocBook sources into dir which "maven.sdocbook.src.dir" property points to.

Simply typing "maven sdocbook" will generate both html and pdf. The html is produced directly from the sources. The pdf output is done in a two-step process, first converting sources to FO using the DocBook stylesheets and then converting the FO output to pdf using the Apache FOP processor.

Parameterizing stylesheets

The stylesheets which this plugin uses can be controlled with parameters. For examle, they implement various extensions, which you need to enable if you want them in output.

Taking the stylesheets which convert into html as example, you could set the "draft" option by setting the property "maven.sdocbook.html.params=-param draft.mode yes" in your

Using another version of stylesheets

The plugin includes a specific version of the DocBook stylesheets but these are developed in a separate project, and might very well be available in newer versions than included in this plugin.

You can use another version just adding a dependency to the project.xml with the version you want



Another way of doing this is to manually get a distribution of the stylesheets you want and point to the location where you unzip them setting the "maven.sdocbook.stylesheets.dir" property.

Using custom stylesheets

You can create this postGoal in maven.xml to use a custom stylesheet.

    <postGoal name="sdocbook:prepare-filesystem">

            <!-- use a custom fo stylesheet -->
            <copy todir="${maven.sdocbook.stylesheets.dir}/fo">
                <fileset dir="${maven.sdocbook.src.dir}/styles/fo"/>

            <!-- use a custom html stylesheet -->
            <copy todir="${maven.sdocbook.stylesheets.dir}/html">
                <fileset dir="${maven.sdocbook.src.dir}/styles/html"/>

            <!-- copy images -->
            <copy todir="${maven.sdocbook.stylesheets.dir}/images">
                <fileset dir="${maven.sdocbook.src.dir}/images"/>


You can take a look to a FO custom stylesheet and a HTML custom stylesheet from the Acegi Security System for Spring project.

Then change in the stylesheet to use instead of the default one