Hi everyone,
I have inherited a complex Maven project that uses a custom plugin that uses Docbkx to generate documentation.
Currently, in my project, the DocBook source is in ${basedir}/src/docbook. When I run mvn site, the DocBook is transformed into a variety of outputs in ${basedir}/target/site/docs.
What I want to do is run an XSLT transform on some of the source documents, and then process as before, using the transformed source documents in place of the untransformed ones.
I can almost get this to work using the following steps:
In pom.xml I have to do is set a parameter called ${docbook.sourceDirectory} to point to the directory where the transformed files are written, as well as adding some lines to make the above steps happen.
However, it fails because something - and I’m not sure what part of the toolchain - copies boilerplate files (gpc-legal.xml et al) to ${basedir}/src/docbook, not ${docbook.sourceDirectory}. The DocBook build depends on the boilerplate files.
I can’t work out what is copying the boilerplate files. I am hoping that it is the Docbkx plugin, and I’m hoping that this list can help me. So here are my questions:
As an alternative, I have thought about integrating my XSLT into our DocBook customisation layer, but I’m not keen to do that because the transform is quite time consuming, and I don’t want to run it on everything, and because it uses XSLT 2.0 and the rest of our customisation is based on XSLT 1.0, and I’d prefer not to upgrade at this time unless it is unavoidable. I’m open to other alternatives if anyone wants to propose them :)
My current hack is to output the transformed files into ${basedir}/src/docbook under different names. This works, but it feels messy because I’m writing generated files to a src directory instead of into target. I am a relative newcomer to Maven.
--
You received this message because you are subscribed to the Google Groups "Docbkx Tools Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to docbkx-tools-us...@googlegroups.com.
To post to this group, send email to docbkx-to...@googlegroups.com.
Visit this group at https://groups.google.com/group/docbkx-tools-users.
For more options, visit https://groups.google.com/d/optout.
It could be getting pulled in from another artifact downloaded through Maven. That would make sense if the content is shared across multiple projects.
Know that in Maven, the plugins in the build are run in the order they occur, though the executions triggered of course depend on the Maven lifecycle.
By the way, for running an XSLT transformation on documents, there's an XML Maven Plugin: http://www.mojohaus.org/xml-maven-plugin/
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>xml-maven-plugin</artifactId>
<version>1.0-beta-2</version>
<executions>
<execution>
<phase>generate-sources</phase>
<goals>
<goal>transform</goal>
</goals>
</execution>
</executions>
<configuration>
<transformationSets>
<transformationSet>
<dir>${basedir}</dir>
<includes>
<include>pom.xml</include>
</includes>
<outputDir>target</outputDir>
<stylesheet>src/xslt/pom-to-poms.xsl</stylesheet>
<parameters>
<parameter>
<name>pluginVersion</name>
<value>${project.version}</value>
</parameter>
</parameters>
</transformationSet>
</transformationSets>
</configuration>
<dependencies>
<dependency>
<groupId>xalan</groupId>
<artifactId>xalan</artifactId>
<version>2.7.0</version>
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>com.agilejava.docbkx</groupId>
<artifactId>docbkx-maven-plugin</artifactId>
<version>${project.version}</version>
<executions>
<execution>
<id>site</id>
<goals>
<goal>generate-html</goal>
</goals>
<phase>pre-site</phase>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>org.docbook</groupId>
<artifactId>docbook-xml</artifactId>
<version>4.4</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>ant</groupId>
<artifactId>ant-trax</artifactId>
<version>1.6.5</version>
</dependency>
</dependencies>
<configuration>
<entities>
<entity>
<name>version</name>
<value>${project.version}</value>
</entity>
</entities>
<sourceDirectory>target/docbkx</sourceDirectory>
<targetDirectory>target/site/</targetDirectory>
<preProcess>
<mkdir dir="${basedir}/target/docbkx" />
<xslt style="${basedir}/src/xslt/pom-to-docbkx.xsl" in="pom.xml" out="target/docbkx/manual.xml" />
</preProcess>
<htmlStylesheet>http://agilejava.com/downloads/kubrick-docbkx.css</htmlStylesheet>
<headerRule>0</headerRule>
<footerRule>0</footerRule>
<draftMode>0</draftMode>
<bodyFontFamily>Helvetica</bodyFontFamily>
</configuration>
</plugin>
</plugins>
--