<?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>
        <artifactId>datasafe</artifactId>
        <groupId>de.adorsys</groupId>
        <version>0.4.2</version>
    </parent>

    <artifactId>datasafe-rest-impl</artifactId>
    <version>0.4.2</version>
    <name>datasafe-rest-impl</name>
    <description>Spring Boot DataSafe Application</description>

    <properties>
        <java.version>1.8</java.version>
        <spring-boot.version>2.1.5.RELEASE</spring-boot.version>
        <springfox-swagger.version>2.9.2</springfox-swagger.version>
        <jjwt.version>0.10.5</jjwt.version>
        <spring-restdocs.version>2.0.3.RELEASE</spring-restdocs.version>
        <asciidoctor-maven-plugin.version>1.5.3</asciidoctor-maven-plugin.version>
        <exec-maven-plugin.version>1.6.0</exec-maven-plugin.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>de.adorsys</groupId>
            <artifactId>datasafe-business</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>de.adorsys</groupId>
            <artifactId>datasafe-storage-api</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>de.adorsys</groupId>
            <artifactId>datasafe-storage-impl-fs</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>de.adorsys</groupId>
            <artifactId>datasafe-storage-impl-s3</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>de.adorsys</groupId>
            <artifactId>datasafe-metainfo-version-api</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>de.adorsys</groupId>
            <artifactId>datasafe-metainfo-version-impl</artifactId>
            <version>${project.version}</version>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
            <version>${spring-boot.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-actuator</artifactId>
            <version>${spring-boot.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-devtools</artifactId>
            <version>${spring-boot.version}</version>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-configuration-processor</artifactId>
            <version>${spring-boot.version}</version>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>io.springfox</groupId>
            <artifactId>springfox-swagger2</artifactId>
            <version>${springfox-swagger.version}</version>
        </dependency>
        <dependency>
            <groupId>io.springfox</groupId>
            <artifactId>springfox-swagger-ui</artifactId>
            <version>${springfox-swagger.version}</version>
        </dependency>
        <dependency>
            <groupId>com.internetitem</groupId>
            <artifactId>logback-elasticsearch-appender</artifactId>
            <version>1.6</version>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
            <version>2.9.8</version>
        </dependency>
        <dependency>
            <groupId>io.jsonwebtoken</groupId>
            <artifactId>jjwt-api</artifactId>
            <version>${jjwt.version}</version>
        </dependency>
        <dependency>
            <groupId>io.jsonwebtoken</groupId>
            <artifactId>jjwt-impl</artifactId>
            <version>${jjwt.version}</version>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>io.jsonwebtoken</groupId>
            <artifactId>jjwt-jackson</artifactId>
            <version>${jjwt.version}</version>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-security</artifactId>
            <version>${spring-boot.version}</version>
        </dependency>

        <!-- TEST -->

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <version>${spring-boot.version}</version>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>junit</groupId>
                    <artifactId>junit</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>de.adorsys</groupId>
            <artifactId>datasafe-types-api</artifactId>
            <version>${project.version}</version>
            <type>test-jar</type>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-api</artifactId>
            <scope>test</scope>
            <version>${jupiter.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.restdocs</groupId>
            <artifactId>spring-restdocs-mockmvc</artifactId>
            <scope>test</scope>
            <version>${spring-restdocs.version}</version>
        </dependency>
    </dependencies>

    <profiles>
        <profile>
            <id>default</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <build>
                <finalName>${project.artifactId}-${project.version}</finalName>
                <plugins>
                    <plugin>
                        <groupId>org.springframework.boot</groupId>
                        <artifactId>spring-boot-maven-plugin</artifactId>
                        <version>${spring-boot.version}</version>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>repackage</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <artifactId>maven-dependency-plugin</artifactId>
                        <version>${maven.dependency.plugin.version}</version>
                        <executions>
                            <execution>
                                <id>analyze</id>
                                <goals>
                                    <goal>analyze-only</goal>
                                </goals>
                                <configuration>
                                    <failOnWarning>false</failOnWarning>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>api-doc</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.asciidoctor</groupId>
                        <artifactId>asciidoctor-maven-plugin</artifactId>
                        <version>${asciidoctor-maven-plugin.version}</version>
                        <executions>
                            <execution>
                                <id>generate-xml-doc</id>
                                <phase>prepare-package</phase>
                                <goals>
                                    <goal>process-asciidoc</goal>
                                </goals>
                                <configuration>
                                    <doctype>book</doctype>
                                    <outputDirectory>${project.basedir}/target</outputDirectory>
                                </configuration>
                            </execution>
                        </executions>
                        <dependencies>
                            <dependency>
                                <groupId>org.springframework.restdocs</groupId>
                                <artifactId>spring-restdocs-asciidoctor</artifactId>
                                <version>${spring-restdocs.version}</version>
                            </dependency>
                        </dependencies>
                    </plugin>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>exec-maven-plugin</artifactId>
                        <version>${exec-maven-plugin.version}</version>
                        <executions>
                            <execution>
                                <id>pandoc</id>
                                <phase>package</phase>
                                <configuration>
                                    <executable>pandoc</executable>
                                    <workingDirectory></workingDirectory>
                                    <arguments>
                                        <argument>-f</argument>
                                        <argument>docbook</argument>
                                        <argument>-t</argument>
                                        <argument>gfm</argument>
                                        <argument>${project.basedir}/target/Datasafe-Rest-API.xml</argument>
                                        <argument>-o</argument>
                                        <argument>${project.basedir}/README.md</argument>
                                    </arguments>
                                </configuration>
                                <goals>
                                    <goal>exec</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
