<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Copyright 2011 JBoss, by Red Hat, Inc
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~    http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  -->

<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/maven-v4_0_0.xsd">

    <modelVersion>4.0.0</modelVersion>

    <name>Errai::Reference::Guide</name>
    <groupId>org.jboss.errai</groupId>
    <artifactId>errai-reference-guide</artifactId>
    <packaging>jdocbook</packaging>

    <!-- Parent -->
    <parent>
        <groupId>org.jboss.errai</groupId>
        <artifactId>errai-parent</artifactId>
        <version>2.1.0.Final-redhat-1</version>
        <relativePath>../pom.xml</relativePath>
    </parent>

    <properties>
        <translation>en</translation>
        <docname>Reference_Guide</docname>
        <bookname>Reference Guide</bookname>
    </properties>

    <dependencies>
    </dependencies>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.jboss.maven.plugins</groupId>
                    <artifactId>maven-jdocbook-plugin</artifactId>
                    <version>2.3.5</version>
                    <extensions>true</extensions>

                    <dependencies>
                        <dependency>
                            <groupId>org.jboss.pressgang</groupId>
                            <!--Non-namespaced version for DocBook 4.5 compatibility. For XSD namespaced version, use pressgang-xslt-ns-->
                            <artifactId>pressgang-xslt</artifactId>
                            <version>2.0.0</version>
                        </dependency>

                        <dependency>
                            <groupId>org.jboss.pressgang</groupId>
                            <artifactId>pressgang-jdocbook-style</artifactId>
                            <type>jdocbook-style</type>
                            <version>2.0.0</version>
                        </dependency>
                    </dependencies>

                    <configuration>
                        <sourceDocumentName>Reference_Guide.xml</sourceDocumentName>
                        <masterTranslation>en</masterTranslation>
                        <imageResource>
                            <directory>${basedir}/src/main/docbook/en</directory>
                            <includes>
                                <include>images/*.png</include>
                            </includes>
                        </imageResource>

                        <formats>
                            <format>
                                <formatName>pdf</formatName>
                                <stylesheetResource>classpath:/xslt/org/jboss/pdf.xsl</stylesheetResource>
                                <finalName>${docname}.pdf</finalName>
                            </format>

                            <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>
                        </formats>

                        <options>
                            <xmlTransformerType>saxon</xmlTransformerType>
                            <xincludeSupported>true</xincludeSupported>
                            <docbookVersion>1.72.0</docbookVersion>
                            <useRelativeImageUris>true</useRelativeImageUris>
                        </options>

                    </configuration>

                </plugin>
                <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
                <plugin>
                  <groupId>org.eclipse.m2e</groupId>
                  <artifactId>lifecycle-mapping</artifactId>
                  <version>1.0.0</version>
                  <configuration>
                    <lifecycleMappingMetadata>
                      <pluginExecutions>
                        <pluginExecution>
                          <pluginExecutionFilter>
                            <groupId>org.jboss.maven.plugins</groupId>
                            <artifactId>maven-jdocbook-plugin</artifactId>
                            <versionRange>[2.3.5,)</versionRange>
                            <goals>
                              <goal>generate</goal>
                              <goal>resources</goal>
                            </goals>
                          </pluginExecutionFilter>
                          <action>
                            <ignore></ignore>
                          </action>
                        </pluginExecution>
                        <pluginExecution>
                          <pluginExecutionFilter>
                            <groupId>org.codehaus.mojo</groupId>
                            <artifactId>xml-maven-plugin</artifactId>
                            <versionRange>[1.0,)</versionRange>
                            <goals>
                              <goal>transform</goal>
                            </goals>
                          </pluginExecutionFilter>
                          <action>
                            <ignore></ignore>
                          </action>
                        </pluginExecution>
                      </pluginExecutions>
                    </lifecycleMappingMetadata>
                  </configuration>
                </plugin>
            </plugins>
        </pluginManagement>

        <plugins>
            <plugin>
                <!-- Entry needed to enable jdocbook packaging -->
                <groupId>org.jboss.maven.plugins</groupId>
                <artifactId>maven-jdocbook-plugin</artifactId>
            </plugin>

            <!-- Using the XML plugin to preprocess the documents and add language attribtues to programlistings. -->
            <!-- This can be removed once ORG-1337 is resolved (language attributes should be included in docbook export in the first place!) -->
            <plugin>
              <groupId>org.codehaus.mojo</groupId>
              <artifactId>xml-maven-plugin</artifactId>
              <executions>
                <execution>
                  <id>default-cli</id>
                  <goals>
                    <goal>transform</goal>
                  </goals>
                </execution>
              </executions>
              <configuration>
                <transformationSets>
                  <transformationSet>
                    <dir>src/main/docbook</dir>
                    <includes>
                      <include>**/*.xml</include>
                    </includes>
                    <stylesheet>set-language-attributes.xsl</stylesheet>
                  </transformationSet>
                </transformationSets>
              </configuration>
              <dependencies>
                <!-- The stylesheet uses regex matching, so we need an XSLT 2.0 compliant processor -->
                <dependency>
                  <groupId>net.sf.saxon</groupId>
                  <artifactId>saxon</artifactId>
                  <version>8.7</version>
                </dependency>
              </dependencies>
            </plugin>

        </plugins>

    </build>
</project>
