]> granicus.if.org Git - docbook-dsssl/commitdiff
add of maven sample project using our maven artifacts (based on 1.75.0).
authormimil <mimil@users.sourceforge.net>
Mon, 25 May 2009 19:33:37 +0000 (19:33 +0000)
committermimil <mimil@users.sourceforge.net>
Mon, 25 May 2009 19:33:37 +0000 (19:33 +0000)
maven/docbook-sample/pom.xml [new file with mode: 0644]
maven/docbook-sample/src/main/docbook/sample.xml [new file with mode: 0644]

diff --git a/maven/docbook-sample/pom.xml b/maven/docbook-sample/pom.xml
new file mode 100644 (file)
index 0000000..29ff086
--- /dev/null
@@ -0,0 +1,105 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project>
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>net.sf.docbook</groupId>
+  <artifactId>docbook-sample</artifactId>
+  <name>DocBook XSL sample</name>
+  <packaging>pom</packaging>
+  <version>1.0.0</version>
+  <description>Sample of DocBook maven artifacts</description>
+  <url>http://sourceforge.net/projects/docbook/</url>
+
+  <parent>
+    <groupId>net.sf.docbook</groupId>
+    <artifactId>docbook</artifactId>
+    <version>5.0</version>
+  </parent>
+
+  <dependencies>
+    <dependency>
+      <groupId>net.sf.docbook</groupId>
+      <artifactId>docbook-xsl</artifactId>
+      <version>1.75.0</version>
+      <type>zip</type>
+      <classifier>ns-resources</classifier>
+    </dependency>
+  </dependencies>
+
+  <build>
+    <plugins>
+      <!--
+        First we need to extract the stylesheets somewhere
+      -->
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-dependency-plugin</artifactId>
+        <executions>
+          <execution>
+            <id>unpack-shared-resources</id>
+            <goals>
+              <goal>unpack-dependencies</goal>
+            </goals>
+            <phase>generate-resources</phase>
+            <configuration>
+              <outputDirectory>${project.build.directory}/generated-resources</outputDirectory>
+              <includeGroupIds>net.sf.docbook</includeGroupIds>
+              <includeArtifactIds>docbook-xsl</includeArtifactIds>
+              <includeClassifiers>ns-resources</includeClassifiers>
+              <excludeTransitive>true</excludeTransitive>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+      <!--
+        Then use the xslt engine
+      -->
+      <plugin>
+        <groupId>org.codehaus.mojo</groupId>
+        <artifactId>xml-maven-plugin</artifactId>
+        <version>1.0-beta-2</version>
+        <executions>
+          <execution>
+            <goals>
+              <goal>transform</goal>
+            </goals>
+          </execution>
+        </executions>
+        <configuration>
+          <transformationSets>
+            <transformationSet>
+              <!-- select the xml files to transform using dir and includes -->
+              <dir>src/main/docbook/</dir>
+              <includes>
+                <include>sample.xml</include>
+              </includes>
+              <!-- the stylesheet is located in the previously extracted directory under the docbook/ directory -->
+              <stylesheet>${project.build.directory}/generated-resources/docbook/html/docbook.xsl</stylesheet>
+              <!-- rename the file with a proper extension -->
+              <fileMappers>
+                <fileMapper implementation="org.codehaus.plexus.components.io.filemappers.FileExtensionMapper">
+                  <targetExtension>.html</targetExtension>
+                </fileMapper>
+              </fileMappers>
+              <!-- specify the transformed file directory -->
+              <outputDir>${project.build.directory}/docbook</outputDir>
+              <!-- set some stylesheet parameters -->
+              <parameters>
+                <parameter>
+                  <name>draft.mode</name>
+                  <value>yes</value>
+                </parameter>
+              </parameters>
+            </transformationSet>
+          </transformationSets>
+        </configuration>
+        <dependencies>
+          <dependency>
+            <groupId>net.sf.docbook</groupId>
+            <artifactId>docbook-xsl-saxon</artifactId>
+            <version>1.0.0</version>
+          </dependency>
+        </dependencies>
+      </plugin>
+    </plugins>
+  </build>
+</project>
diff --git a/maven/docbook-sample/src/main/docbook/sample.xml b/maven/docbook-sample/src/main/docbook/sample.xml
new file mode 100644 (file)
index 0000000..0199559
--- /dev/null
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<article version="5.0" xmlns="http://docbook.org/ns/docbook"
+         xmlns:xi="http://www.w3.org/2001/XInclude"
+         xmlns:html="http://www.w3.org/1999/xhtml"
+         xmlns:db="http://docbook.org/ns/docbook">
+  <info>
+    <title>Test Article</title>
+  </info>
+
+  <section>
+    <title>Test section</title>
+
+    <para>Test paragraph.</para>
+  </section>
+</article>