Question

I'm using the docbkx-tools for creating the DocBook by using Maven. At the moment I can produce the book in various formats. I also achieve to deploy my Maven site to the web server by using the Wagon through the WebDav already.

I would like to publish them together, the generated DocBook and my Maven site, by using the command like mvn clean install site:deploy. Could you please help to shed some light?

Was it helpful?

Solution

You simple need to copy the generated pdf/rtf/html whatever to the correct location and it will be deployed with the maven-site or you can generate directly into the target location for the site like this:

 <plugin>
    <groupId>com.agilejava.docbkx</groupId>
    <artifactId>docbkx-maven-plugin</artifactId>
    <version>2.0.14</version>
    <dependencies>
      <dependency>
        <groupId>docbook</groupId>
        <artifactId>docbook-xml</artifactId>
        <version>4.4</version>
      </dependency>
    </dependencies>
    <executions>
      <execution>
        <goals>
          <goal>generate-pdf</goal>
        </goals>
        <phase>pre-site</phase>
        <configuration>
          <sourceDirectory>${basedir}/src/docbkx</sourceDirectory>
          <xincludeSupported>true</xincludeSupported>
          <includes>maui.xml</includes>
          <foCustomization>src/docbkx/fopdf.xsl</foCustomization>
          <targetDirectory>${project.build.directory}/site/</targetDirectory>
        </configuration>
      </execution>
    </executions>
  </plugin>

You shouldn't use site:deploy you should use mvn site and mvn site-deploy instead to get run the site life-cycle.

OTHER TIPS

You can control the docbook output directory with this property : <targetDirectory> (default is ${basedir}/target/docbkx/<something dependending on the output format>.

On the other hand the maven-site-plugin will get all files under <inputDirectory> the create to site (globally, it make a zip with everything in the directory). Default is project.reporting.outputDirectory

So if you change the docbook plugin <targetDirectory> to something in maven-site-plugin <inputDirectory> : the docbook output will be included in the generated site zip.

Additionally, to be sure that your docbook plugin will be run before the site get deployed, you need to bind the docbook plugin the some phase in the site lifecycle before the site-deploy. So one of those phase is OK : pre-site site post-site Here is more details about binding a plugin to a phase

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top