<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

  <modelVersion>4.0.0</modelVersion>

  <parent>
    <groupId>org.artificer</groupId>
    <artifactId>artificer</artifactId>
    <version>1.0.1.IDP-redhat-1</version>
    <relativePath>../pom.xml</relativePath>
  </parent>

  <artifactId>artificer-doc</artifactId>
  <name>Artificer Documentation</name>
  <description>Artificer Documentation</description>
  <packaging>jdocbook</packaging>
  
  <build>
    <plugins>
      <plugin>
        <groupId>org.asciidoctor</groupId>
        <artifactId>asciidoctor-maven-plugin</artifactId>
        <version>0.1.4</version>
        <executions>
          <execution>
            <id>output-docbook</id>
            <phase>generate-resources</phase>
            <goals>
              <goal>process-asciidoc</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <sourceDirectory>guide/en-US</sourceDirectory>
          <outputDirectory>target/docbook/en-US</outputDirectory>
          <backend>docbook</backend>
          <doctype>book</doctype>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.jboss.maven.plugins</groupId>
        <artifactId>maven-jdocbook-plugin</artifactId>
        <version>2.3.8</version>
        <extensions>true</extensions>
        <dependencies>
          <dependency>
            <groupId>org.jboss.pressgang</groupId>
            <artifactId>pressgang-xslt-ns</artifactId>
            <version>2.0.2</version>
          </dependency>
          <dependency>
            <groupId>org.jboss.pressgang</groupId>
            <artifactId>pressgang-jdocbook-style</artifactId>
            <type>jdocbook-style</type>
            <version>2.0.2</version>
          </dependency>
        </dependencies>
        <configuration>
          <sourceDocumentName>Guide.xml</sourceDocumentName>
          <sourceDirectory>target/docbook/</sourceDirectory>
          <imageResource>
            <directory>.</directory>
            <includes>
              <include>images/*</include>
            </includes>
          </imageResource>

          <formats>
            <format>
              <formatName>html</formatName>
              <stylesheetResource>classpath:/xslt/org/jboss/xhtml.xsl</stylesheetResource>
              <finalName>index.html</finalName>
            </format>
            <format>
              <formatName>html_single</formatName>
              <stylesheetResource>classpath:/xslt/org/jboss/xhtml-single.xsl</stylesheetResource>
              <finalName>index.html</finalName>
            </format>

            <format>
              <formatName>pdf</formatName>
              <stylesheetResource>classpath:/xslt/org/jboss/pdf.xsl</stylesheetResource>
              <finalName>Artificer_Reference_Guide.pdf</finalName>
            </format>
            
          </formats>
          <options>
            <xincludeSupported>true</xincludeSupported>
            <xmlTransformerType>saxon</xmlTransformerType>
            <!-- needed for uri-resolvers; can be ommitted if using 'current' uri scheme -->
            <!-- could also locate the docbook dependency and inspect its version... -->
            <docbookVersion>1.72.0</docbookVersion>
            <transformerParameters>
              <property>
                <name>javax.xml.parsers.DocumentBuilderFactory</name>
                <value>org.apache.xerces.jaxp.DocumentBuilderFactoryImpl</value>
              </property>
              <property>
                <name>javax.xml.parsers.SAXParserFactory</name>
                <value>org.apache.xerces.jaxp.SAXParserFactoryImpl</value>
              </property>
              <!--<javax.xml.parsers.DocumentBuilderFactory>org.apache.xerces.jaxp.DocumentBuilderFactoryImpl</javax.xml.parsers.DocumentBuilderFactory> 
                <javax.xml.parsers.SAXParserFactory>org.apache.xerces.jaxp.SAXParserFactoryImpl</javax.xml.parsers.SAXParserFactory> 
                <javax.xml.validation.SchemaFactory:http\://www.w3.org/2001/XMLSchema>org.apache.xerces.jaxp.validation.XMLSchemaFactory</javax.xml.validation.SchemaFactory:http\://www.w3.org/2001/XMLSchema> -->
            </transformerParameters>
          </options>
        </configuration>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <profile>
      <!-- Don't deploy by default.  The release plugin will use this profile. -->
      <id>upload-docs</id>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-antrun-plugin</artifactId>
            <executions>
              <execution>
                <id>upload-docs</id>
                <phase>deploy</phase>
                <goals>
                  <goal>run</goal>
                </goals>
                <configuration>
                  <tasks>
                    <scp sftp="true" trust="true" failonerror="false" keyfile="${keyfile}" todir="artificer@filemgmt.jboss.org:/docs_htdocs/artificer/${project.version}">
                      <fileset dir="${project.build.directory}/docbook/publish/en-US"></fileset>
                    </scp>
                  </tasks>
                </configuration>
              </execution>
            </executions>
            <dependencies>
              <dependency>
                <groupId>org.apache.ant</groupId>
                <artifactId>ant-jsch</artifactId>
                <version>1.8.2</version>
              </dependency>
            </dependencies>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
