<?xml version="1.0" encoding="UTF-8"?>
<!--
  Licensed to the Apache Software Foundation (ASF) under one
  or more contributor license agreements. See the NOTICE file
  distributed with this work for additional information
  regarding copyright ownership. The ASF licenses this file
  to you 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>
    <groupId>org.apache.uima</groupId>
    <artifactId>uimaj-parent-internal</artifactId>
    <version>3.6.1</version>
    <relativePath>../uimaj-parent-internal/pom.xml</relativePath>
  </parent>

  <artifactId>uimaj-documentation</artifactId>
  <packaging>pom</packaging>
  <name>Apache UIMA Java SDK Documentation</name>
  <url>https://uima.apache.org</url>

  <properties>
    <maven.deploy.skip>true</maven.deploy.skip>
  </properties>

  <profiles>
    <profile>
      <id>docs</id>
      <activation>
        <property>
          <name>!skipDocs</name>
        </property>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.asciidoctor</groupId>
            <artifactId>asciidoctor-maven-plugin</artifactId>
            <version>${asciidoctor.plugin.version}</version>
            <configuration>
              <outputDirectory>${project.build.directory}/site/d</outputDirectory>
              <attributesChain>webfonts!</attributesChain>
              <attributes>
                <experimental>true</experimental>
                <doctype>book</doctype>
                <toclevels>8</toclevels>
                <sectanchors>true</sectanchors>
                <sectnums>true</sectnums>
                <docinfo1>true</docinfo1>
                <project-version>${project.version}</project-version>
                <revnumber>${project.version}</revnumber>
                <product-website-url>https://uima.apache.org</product-website-url>
                <relativeBaseDir>true</relativeBaseDir>
                <xrefstyle>short</xrefstyle>
              </attributes>
              <requires>
                <require>asciidoctor-pdf</require>
              </requires>
            </configuration>
            <executions>
              <execution>
                <id>tug-html</id>
                <phase>generate-resources</phase>
                <goals>
                  <goal>process-asciidoc</goal>
                </goals>
                <configuration>
                  <sourceDocumentName>tug.adoc</sourceDocumentName>
                  <backend>html5</backend>
                  <attributes>
                    <toc>left</toc>
                    <imagesdir>./tug</imagesdir>
                  </attributes>
                </configuration>
              </execution>
              <execution>
                <id>tug-pdf</id>
                <phase>generate-resources</phase>
                <goals>
                  <goal>process-asciidoc</goal>
                </goals>
                <configuration>
                  <sourceDocumentName>tug.adoc</sourceDocumentName>
                  <backend>pdf</backend>
                  <attributes>
                    <toc>preamble</toc>
                    <imagesdir>./tug</imagesdir>
                  </attributes>
                </configuration>
              </execution>
              <execution>
                <id>oas-html</id>
                <phase>generate-resources</phase>
                <goals>
                  <goal>process-asciidoc</goal>
                </goals>
                <configuration>
                  <sourceDocumentName>oas.adoc</sourceDocumentName>
                  <backend>html5</backend>
                  <attributes>
                    <toc>left</toc>
                    <imagesdir>./oas</imagesdir>
                  </attributes>
                </configuration>
              </execution>
              <execution>
                <id>oas-pdf</id>
                <phase>generate-resources</phase>
                <goals>
                  <goal>process-asciidoc</goal>
                </goals>
                <configuration>
                  <sourceDocumentName>oas.adoc</sourceDocumentName>
                  <backend>pdf</backend>
                  <attributes>
                    <toc>preamble</toc>
                    <imagesdir>./oas</imagesdir>
                  </attributes>
                </configuration>
              </execution>
              <execution>
                <id>ref-html</id>
                <phase>generate-resources</phase>
                <goals>
                  <goal>process-asciidoc</goal>
                </goals>
                <configuration>
                  <sourceDocumentName>ref.adoc</sourceDocumentName>
                  <backend>html5</backend>
                  <attributes>
                    <toc>left</toc>
                    <imagesdir>./ref</imagesdir>
                  </attributes>
                </configuration>
              </execution>
              <execution>
                <id>ref-pdf</id>
                <phase>generate-resources</phase>
                <goals>
                  <goal>process-asciidoc</goal>
                </goals>
                <configuration>
                  <sourceDocumentName>ref.adoc</sourceDocumentName>
                  <backend>pdf</backend>
                  <attributes>
                    <toc>preamble</toc>
                    <imagesdir>./ref</imagesdir>
                  </attributes>
                </configuration>
              </execution>
              <execution>
                <id>tools-html</id>
                <phase>generate-resources</phase>
                <goals>
                  <goal>process-asciidoc</goal>
                </goals>
                <configuration>
                  <sourceDocumentName>tools.adoc</sourceDocumentName>
                  <backend>html5</backend>
                  <attributes>
                    <toc>left</toc>
                    <imagesdir>./tools</imagesdir>
                  </attributes>
                </configuration>
              </execution>
              <execution>
                <id>tools-pdf</id>
                <phase>generate-resources</phase>
                <goals>
                  <goal>process-asciidoc</goal>
                </goals>
                <configuration>
                  <sourceDocumentName>tools.adoc</sourceDocumentName>
                  <backend>pdf</backend>
                  <attributes>
                    <toc>preamble</toc>
                    <imagesdir>./tools</imagesdir>
                  </attributes>
                </configuration>
              </execution>
              <execution>
                <id>maint-html</id>
                <phase>generate-resources</phase>
                <goals>
                  <goal>process-asciidoc</goal>
                </goals>
                <configuration>
                  <sourceDocumentName>maint.adoc</sourceDocumentName>
                  <backend>html5</backend>
                  <attributes>
                    <toc>left</toc>
                    <imagesdir>./maint</imagesdir>
                  </attributes>
                </configuration>
              </execution>
              <execution>
                <id>maint-pdf</id>
                <phase>generate-resources</phase>
                <goals>
                  <goal>process-asciidoc</goal>
                </goals>
                <configuration>
                  <sourceDocumentName>maint.adoc</sourceDocumentName>
                  <backend>pdf</backend>
                  <attributes>
                    <toc>preamble</toc>
                    <imagesdir>./maint</imagesdir>
                  </attributes>
                </configuration>
              </execution>
              <execution>
                <id>user-html</id>
                <phase>generate-resources</phase>
                <goals>
                  <goal>process-asciidoc</goal>
                </goals>
                <configuration>
                  <sourceDocumentName>user.adoc</sourceDocumentName>
                  <backend>html5</backend>
                  <attributes>
                    <toc>left</toc>
                    <imagesdir>./user</imagesdir>
                  </attributes>
                </configuration>
              </execution>
              <execution>
                <id>user-pdf</id>
                <phase>generate-resources</phase>
                <goals>
                  <goal>process-asciidoc</goal>
                </goals>
                <configuration>
                  <sourceDocumentName>user.adoc</sourceDocumentName>
                  <backend>pdf</backend>
                  <attributes>
                    <toc>preamble</toc>
                    <imagesdir>./user</imagesdir>
                  </attributes>
                </configuration>
              </execution>
              <execution>
                <id>fit-html</id>
                <phase>generate-resources</phase>
                <goals>
                  <goal>process-asciidoc</goal>
                </goals>
                <configuration>
                  <sourceDocumentName>fit.adoc</sourceDocumentName>
                  <backend>html5</backend>
                  <attributes>
                    <toc>left</toc>
                    <imagesdir>./fit</imagesdir>
                  </attributes>
                </configuration>
              </execution>
              <execution>
                <id>fit-pdf</id>
                <phase>generate-resources</phase>
                <goals>
                  <goal>process-asciidoc</goal>
                </goals>
                <configuration>
                  <sourceDocumentName>fit.adoc</sourceDocumentName>
                  <backend>pdf</backend>
                  <attributes>
                    <toc>preamble</toc>
                    <imagesdir>./fit</imagesdir>
                  </attributes>
                </configuration>
              </execution>
            </executions>
            <dependencies>
              <dependency>
                  <groupId>org.jruby</groupId>
                  <artifactId>jruby</artifactId>
                  <version>9.4.3.0</version>
              </dependency>
              <dependency>
                <groupId>org.asciidoctor</groupId>
                <artifactId>asciidoctorj</artifactId>
                <version>${asciidoctor.version}</version>
              </dependency>
              <dependency>
                <groupId>org.asciidoctor</groupId>
                <artifactId>asciidoctorj-pdf</artifactId>
                <version>${asciidoctor.pdf.version}</version>
              </dependency>
            </dependencies>
          </plugin>
        </plugins>
      </build>
    </profile>

    <profile>
      <id>m2e</id>
      <activation>
        <property>
          <name>m2e.version</name>
        </property>
      </activation>
      <build>
        <pluginManagement>
          <plugins>
            <!--
              - 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.asciidoctor</groupId>
                        <artifactId>asciidoctor-maven-plugin</artifactId>
                        <versionRange>[1.0,)</versionRange>
                        <goals>
                          <goal>process-asciidoc</goal>
                        </goals>
                      </pluginExecutionFilter>
                      <action>
                        <execute />
                      </action>
                    </pluginExecution>
                  </pluginExecutions>
                </lifecycleMappingMetadata>
              </configuration>
            </plugin>
          </plugins>
        </pluginManagement>
      </build>
    </profile>
  </profiles>
</project>