<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns="http://maven.apache.org/POM/4.0.0"
  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>
  <artifactId>taskana-simplehistory-rest-spring</artifactId>

  <name>${project.groupId}:${project.artifactId}</name>
  <description>The taskana history events plugin, spring based REST API.</description>

  <parent>
    <groupId>pro.taskana.history</groupId>
    <artifactId>taskana-history-parent</artifactId>
    <version>4.5.2-SNAPSHOT</version>
    <relativePath>../pom.xml</relativePath>
  </parent>

  <dependencies>
    <dependency>
      <groupId>pro.taskana.history</groupId>
      <artifactId>taskana-simplehistory-provider</artifactId>
      <version>${project.version}</version>
    </dependency>
    <dependency>
      <groupId>pro.taskana</groupId>
      <artifactId>taskana-rest-spring</artifactId>
      <version>${project.version}</version>
    </dependency>
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-beans</artifactId>
    </dependency>
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-jdbc</artifactId>
    </dependency>
    <dependency>
      <groupId>org.springframework.hateoas</groupId>
      <artifactId>spring-hateoas</artifactId>
    </dependency>
    <dependency>
      <groupId>javax.servlet</groupId>
      <artifactId>javax.servlet-api</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>javax.validation</groupId>
      <artifactId>validation-api</artifactId>
    </dependency>
    <dependency>
      <groupId>com.fasterxml.jackson.core</groupId>
      <artifactId>jackson-databind</artifactId>
    </dependency>

    <!-- test dependencies -->
    <dependency>
      <groupId>pro.taskana</groupId>
      <artifactId>taskana-common-test</artifactId>
      <version>${project.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>pro.taskana</groupId>
      <artifactId>taskana-common-data</artifactId>
      <version>${project.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.unboundid</groupId>
      <artifactId>unboundid-ldapsdk</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.assertj</groupId>
      <artifactId>assertj-core</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-web</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-test</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-security</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-jdbc</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.springframework.plugin</groupId>
      <artifactId>spring-plugin-core</artifactId>
      <version>${version.spring.core}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.springframework.security</groupId>
      <artifactId>spring-security-test</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.springframework.restdocs</groupId>
      <artifactId>spring-restdocs-mockmvc</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>net.bytebuddy</groupId>
      <artifactId>byte-buddy</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>net.bytebuddy</groupId>
      <artifactId>byte-buddy-agent</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.h2database</groupId>
      <artifactId>h2</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>capital.scalable</groupId>
      <artifactId>spring-auto-restdocs-core</artifactId>
      <version>${version.auto-restdocs}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-validation</artifactId>
      <scope>test</scope>
    </dependency>
  </dependencies>
  
  <build>
    <plugins>
      <plugin>
        <artifactId>maven-resources-plugin</artifactId>
        <version>${version.maven.resources}</version>
        <executions>
          <execution>
            <id>copy-resources</id>
            <phase>validate</phase>
            <goals>
              <goal>copy-resources</goal>
            </goals>
            <configuration>
              <outputDirectory>${basedir}/target/generated-javadoc-json</outputDirectory>
              <resources>
                <resource>
                  <directory>../../rest/taskana-rest-spring/target/generated-javadoc-json
                  </directory>
                </resource>
              </resources>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>${version.maven.javadoc}</version>
        <extensions>true</extensions>
        <configuration>
          <tags>
            <tag>
              <name>title</name>
              <placement>m</placement>
            </tag>
          </tags>
        </configuration>
        <executions>
          <execution>
            <id>generate-javadoc-json</id>
            <phase>validate</phase>
            <goals>
              <goal>javadoc-no-fork</goal>
            </goals>
            <configuration>
              <doclet>capital.scalable.restdocs.jsondoclet.ExtractDocumentationAsJsonDoclet</doclet>
              <docletArtifact>
                <groupId>capital.scalable</groupId>
                <!--
                    currently the jdk9+ version of this doclet has a very bad bug.
                    see: https://github.com/ScaCap/spring-auto-restdocs/issues/412
                -->
                <artifactId>spring-auto-restdocs-json-doclet</artifactId>
                <version>${version.auto-restdocs}</version>
              </docletArtifact>
              <destDir>generated-javadoc-json</destDir>
              <reportOutputDirectory>${project.build.directory}</reportOutputDirectory>
              <useStandardDocletOptions>false</useStandardDocletOptions>
              <show>package</show>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.asciidoctor</groupId>
        <artifactId>asciidoctor-maven-plugin</artifactId>
        <version>${version.maven.asciidoctor}</version>
        <executions>
          <execution>
            <id>generate-docs</id>
            <phase>prepare-package</phase>
            <goals>
              <goal>process-asciidoc</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <backend>html5</backend>
          <doctype>book</doctype>
          <attributes>
            <snippets>${project.build.directory}/generated-snippets</snippets>
            <doctype>book</doctype>
            <icons>font</icons>
            <source-highlighter>highlightjs</source-highlighter>
            <toc>left</toc>
            <docinfo>shared</docinfo>
            <toclevels>4</toclevels>
            <sectlinks/>
          </attributes>
          <logHandler>
            <outputToConsole>false</outputToConsole>
            <failIf>
              <severity>ERROR</severity>
            </failIf>
          </logHandler>
        </configuration>
      </plugin>
    </plugins>
  </build>

</project>
