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

    Copyright 2017 Rudy De Busscher

    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.config</groupId>
        <artifactId>config-parent</artifactId>
        <version>0.9</version>
        <relativePath>../pom.xml</relativePath>
    </parent>

    <artifactId>atbash-config</artifactId>
    <version>0.9</version>
    <packaging>jar</packaging>

    <name>Atbash Configuration extension</name>
    <description>Configuration extensions for the MicroProfile Config</description>
    <url>https://github.com/atbashEE/atbash-config</url>

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

    <licenses>
        <license>
            <name>The Apache Software License, Version 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
            <distribution>repo</distribution>
            <comments>A business-friendly OSS license</comments>
        </license>
    </licenses>

    <dependencies>

        <dependency>
            <groupId>be.atbash.config</groupId>
            <artifactId>microprofile-config-api</artifactId>
            <version>${project.parent.version}</version>
        </dependency>

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

        <dependency>
            <groupId>org.yaml</groupId>
            <artifactId>snakeyaml</artifactId>
            <version>1.19</version>
            <optional>true</optional>  <!-- TODO Otherwise it gives issues with Swarm since it access the Logger before Swarm does when using WebTester-->
            <!-- And first impression is that Swarm already has snakeyaml. To be investigated -->
        </dependency>

        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>1.7.25</version>
        </dependency>

        <!-- for the Spock/Groovy based teting -->
        <dependency>
            <groupId>org.codehaus.groovy</groupId>
            <artifactId>groovy-all</artifactId>
            <version>2.4.4</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.spockframework</groupId>
            <artifactId>spock-core</artifactId>
            <version>1.0-groovy-2.4</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>cglib</groupId>
            <artifactId>cglib-nodep</artifactId>
            <version>2.2</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>com.blogspot.toomuchcoding</groupId>
            <artifactId>spock-subjects-collaborators-extension</artifactId>
            <version>1.2.1</version>
            <scope>test</scope>
        </dependency>


    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.codehaus.gmavenplus</groupId>
                <artifactId>gmavenplus-plugin</artifactId>
                <version>1.0</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>testCompile</goal>
                        </goals>
                    </execution>
                </executions>
                <dependencies>
                    <dependency>
                        <groupId>org.codehaus.groovy</groupId>
                        <artifactId>groovy-all</artifactId>
                        <version>2.4.4</version>
                        <scope>runtime</scope>
                    </dependency>
                </dependencies>
            </plugin>
            <!-- Optional -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.16</version>
                <configuration>
                    <parallel>methods</parallel>
                    <threadCount>5</threadCount>
                    <includes>
                        <include>**/*Test.*</include>
                        <include>**/*Spec.*</include>
                    </includes>
                    <excludes>
                        <exclude>**/Abstract*.java</exclude>
                    </excludes>
                </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>
            <plugin>
                <groupId>com.mycila</groupId>
                <artifactId>license-maven-plugin</artifactId>
                <version>3.0</version>
                <configuration>
                    <header>src/etc/headerTemplate.txt</header>
                    <properties>
                        <owner>Rudy De Busscher</owner>
                        <year>2017</year>
                    </properties>
                    <excludes>
                        <exclude>**/*.adoc</exclude>
                        <exclude>**/README</exclude>
                        <exclude>**/LICENSE.txt</exclude>
                        <exclude>**/NOTICE.txt</exclude>
                        <exclude>**/NOTICE</exclude>
                    </excludes>
                    <mapping>
                        <java>SLASHSTAR_STYLE</java>
                    </mapping>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

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