<?xml version="1.0" encoding="UTF-8"?>
<!--

    Copyright 2014-2018 Rudy De Busscher (https://www.atbash.be)

    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 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
         xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>be.atbash.ee.security</groupId>
        <artifactId>octopus</artifactId>
        <version>0.3</version>
        <relativePath>../pom.xml</relativePath>
    </parent>

    <artifactId>octopus-core</artifactId>
    <version>0.3</version>
    <packaging>jar</packaging>

    <properties>
        <asciidoctor.maven.plugin.version>1.5.6</asciidoctor.maven.plugin.version>
        <asciidoctorj.pdf.version>1.5.0-alpha.16</asciidoctorj.pdf.version>
    </properties>

    <dependencies>

        <!-- CDI API 1.1 has dependency on interceptor 1.1 which is wrong -->
        <dependency>
            <groupId>javax.interceptor</groupId>
            <artifactId>javax.interceptor-api</artifactId>
            <version>1.2</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>javax.enterprise</groupId>
            <artifactId>cdi-api</artifactId>
            <version>1.1</version>
            <scope>provided</scope>
        </dependency>

        <!-- atbash -->
        <dependency>
            <groupId>be.atbash.utils</groupId>
            <artifactId>utils-se</artifactId>
        </dependency>

        <dependency>
            <groupId>be.atbash.config</groupId>
            <artifactId>atbash-config</artifactId>
            <version>${atbash-config.version}</version>
        </dependency>

        <dependency>
            <groupId>be.atbash.utils</groupId>
            <artifactId>utils-cdi</artifactId>
        </dependency>

        <dependency>
            <groupId>be.atbash.json</groupId>
            <artifactId>octopus-json-smart</artifactId>
            <version>${atbash-json.version}</version>
        </dependency>

        <!-- Deltaspike -->
        <dependency>
            <groupId>org.apache.deltaspike.modules</groupId>
            <artifactId>deltaspike-security-module-api</artifactId>
            <version>${deltaspike.version}</version>
            <scope>provided</scope>
        </dependency>

        <!-- test -->
        <dependency>
            <groupId>be.atbash.utils</groupId>
            <artifactId>utils-se</artifactId>
            <version>${atbash-utils.version}</version>
            <classifier>tests</classifier>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>be.atbash.utils</groupId>
            <artifactId>utils-cdi</artifactId>
            <version>${atbash-utils.version}</version>
            <classifier>tests</classifier>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>be.atbash.config</groupId>
            <artifactId>atbash-config-test</artifactId>
            <version>${atbash-config.version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>nl.jqno.equalsverifier</groupId>
            <artifactId>equalsverifier</artifactId>
            <version>2.4.1</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>2.5</version>
                <executions>
                    <execution>
                        <id>testJar</id>
                        <goals>
                            <goal>test-jar</goal>
                        </goals>
                        <configuration>
                            <excludes>
                                <exclude>**/*Test.class</exclude>
                            </excludes>
                        </configuration>
                    </execution>
                    <execution>
                        <id>manifest</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <archive>
                        <manifestEntries>
                            <Release-Version>${project.parent.version}</Release-Version>
                            <buildTime>${maven.build.timestamp}</buildTime>
                        </manifestEntries>
                    </archive>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.asciidoctor</groupId>
                <artifactId>asciidoctor-maven-plugin</artifactId>
                <version>${asciidoctor.maven.plugin.version}</version>
                <dependencies>
                    <dependency>
                        <groupId>org.asciidoctor</groupId>
                        <artifactId>asciidoctorj-pdf</artifactId>
                        <version>${asciidoctorj.pdf.version}</version>
                    </dependency>

                </dependencies>
                <configuration>
                    <sourceDirectory>src/main/doc</sourceDirectory>
                    <!-- Attributes common to all output formats -->
                    <attributes>
                        <sourcedir>${project.build.sourceDirectory}</sourcedir>
                    </attributes>
                </configuration>
                <executions>
                    <execution>
                        <id>generate-pdf-doc</id>
                        <phase>generate-resources</phase>
                        <goals>
                            <goal>process-asciidoc</goal>
                        </goals>
                        <configuration>
                            <backend>pdf</backend>
                            <!-- Since 1.5.0-alpha.9 PDF back-end can use 'rouge' as well as 'coderay'
                            for source highlighting -->
                            <!-- Due to a known issue on windows, it is recommended to use 'coderay' until an new version of 'rouge' is released.
                                    see discussions: https://github.com/asciidoctor/asciidoctor-maven-examples/pull/58
                                                     https://github.com/asciidoctor/asciidoctorj-pdf/issues/3
                                                     https://github.com/jneen/rouge/issues/661
                            -->
                            <sourceHighlighter>coderay</sourceHighlighter>
                            <attributes>
                                <icons>font</icons>
                                <pagenums/>
                                <toc/>
                                <idprefix/>
                                <idseparator>-</idseparator>
                            </attributes>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

        </plugins>
    </build>
</project>
