<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ JBoss, Home of Professional Open Source
  ~ Copyright 2011, Red Hat, Inc. and/or its affiliates, and individual contributors
  ~ by the @authors tag. See the copyright.txt in the distribution for a
  ~ full listing of individual contributors.
  ~
  ~ 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>

    <parent>
        <artifactId>hibernate-validator-parent</artifactId>
        <groupId>org.hibernate</groupId>
        <version>4.3.3.Final</version>
        <relativePath>../pom.xml</relativePath>
    </parent>

    <artifactId>hibernate-validator-documentation</artifactId>
    <packaging>jdocbook</packaging>

    <name>Hibernate Validator Manual</name>
    <description>The Hibernate Validator reference manual</description>

    <properties>
        <jdocbookSourceDirectory>${basedir}/src/main/docbook</jdocbookSourceDirectory>
        <jdocbook.ignoreTranslations>false</jdocbook.ignoreTranslations>
        <!-- Skip artifact deployment -->
        <maven.deploy.skip>true</maven.deploy.skip>
    </properties>

    <build>
        <plugins>
            <plugin>
                <groupId>org.jboss.maven.plugins</groupId>
                <artifactId>maven-jdocbook-plugin</artifactId>
                <configuration>
                    <sourceDirectory>${jdocbookSourceDirectory}</sourceDirectory>
                    <sourceDocumentName>master.xml</sourceDocumentName>
                    <masterTranslation>en-US</masterTranslation>
                    <translations>
                        <translation>zh-CN</translation>
                    </translations>
                    <!--
                    The jdookbook plug-in doesn't define an expression for this property, therefore
                    it can't be passed on the command line. To address this issue the value is retrieved
                    from a custom property, which itself can be set using -DignoreTranslations=...
                    -->
                    <ignoreTranslations>${jdocbook.ignoreTranslations}</ignoreTranslations>
                    <imageResource>
                        <directory>${basedir}/src/main/docbook/en-US/images</directory>
                    </imageResource>
                    <formats>
                        <format>
                            <formatName>pdf</formatName>
                            <stylesheetResource>classpath:/xslt/org/hibernate/jdocbook/xslt/pdf.xsl
                            </stylesheetResource>
                            <finalName>hibernate_validator_reference.pdf</finalName>
                        </format>
                        <format>
                            <formatName>html_single</formatName>
                            <stylesheetResource>classpath:/xslt/org/hibernate/jdocbook/xslt/xhtml-single.xsl
                            </stylesheetResource>
                            <finalName>index.html</finalName>
                        </format>
                        <format>
                            <formatName>html</formatName>
                            <stylesheetResource>classpath:/xslt/org/hibernate/jdocbook/xslt/xhtml.xsl
                            </stylesheetResource>
                            <finalName>index.html</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>
                        <localeSeparator>-</localeSeparator>
                    </options>
                    <profiling>
                        <enabled>true</enabled>
                    </profiling>
                </configuration>
                <executions>
                    <execution>
                        <!--
                            here we are attaching the translate goal so that the translations are processed
                            before compilation so that the translated XML is also transformed during
                            generation
                        -->
                        <phase>process-resources</phase>
                        <goals>
                            <goal>translate</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.codehaus.gmaven</groupId>
                <artifactId>gmaven-plugin</artifactId>
                <executions>
                    <execution>
                        <phase>initialize</phase>
                        <goals>
                            <goal>execute</goal>
                        </goals>
                        <configuration>
                            <source>
                                println "[INFO] ------------------------------------------------------------------------";
                                println "[INFO] DOCUMENTATION BUILD INFO                                                ";
                                println "[INFO] ------------------------------------------------------------------------";
                                println "[INFO] The documentation build requires the external tool po2xml for processing";
                                println "[INFO] translations. You can skip the whole documentation build via specifying ";
                                println "[INFO] the property 'disableDocumentationBuil':                                ";
                                println "[INFO]                                                                         ";
                                println "[INFO] mvn install -DdisableDocumentationBuild=true                            ";
                                println "[INFO]                                                                         ";
                                println "[INFO] Or you can just skip the translations:                                  ";
                                println "[INFO]                                                                         ";
                                println "[INFO] mvn install -Djdocbook.ignoreTranslations=true                          ";
                                println "[INFO]                                                                         ";
                                println "[INFO] See http://community.jboss.org/wiki/ContributingtoHibernateValidator    ";
                                println "[INFO] ------------------------------------------------------------------------";
                            </source>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.zanata</groupId>
                <artifactId>zanata-maven-plugin</artifactId>
                <configuration>
                    <srcDir>${basedir}/src/main/docbook</srcDir>
                    <srcDirPot>${basedir}/src/main/docbook/pot</srcDirPot>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>
