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

    Copyright 2014-2022 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>

    <groupId>be.atbash.utils</groupId>
    <artifactId>utils-parent</artifactId>
    <version>1.2.0</version>
    <packaging>pom</packaging>

    <properties>

        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>

        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

        <junit.version>5.9.0</junit.version>
        <assertj.version>3.22.0</assertj.version>
        <asciidoctor.maven.plugin.version>1.5.7.1</asciidoctor.maven.plugin.version>
        <asciidoctorj.pdf.version>1.5.0-alpha.16</asciidoctorj.pdf.version>
        <documentation.skip>false</documentation.skip>

    </properties>

    <name>Atbash Utils</name>
    <inceptionYear>2014</inceptionYear> <!-- Some classes are created for the first time in that year -->
    <description>Atbash Utils parent</description>
    <url>https://github.com/atbashEE/atbash-utils</url>

    <developers>
        <developer>
            <id>rubus</id>
            <name>Rudy De Busscher</name>
            <email>rdebusscher@gmail.com</email>
            <organization>Atbash, Belgium</organization>
            <timezone>+1</timezone>
        </developer>
    </developers>

    <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>

    <scm>
        <connection>scm:git:git://github.com/atbashEE/atbash-utils.git</connection>
        <developerConnection>scm:git:ssh://github.com:atbashEE/atbash-utils.git</developerConnection>
        <url>http://github.com/atbashEE/atbash-utils/tree/master</url>
    </scm>

    <modules>
        <module>test-resources</module>
        <module>utils-se</module>
        <!--module>utils-cdi</module>
        <module>utils-jsf</module-->
    </modules>

    <dependencies>
        <!-- logging -->
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>1.7.36</version>
        </dependency>

        <!-- testing -->
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-engine</artifactId>
            <version>${junit.version}</version>
            <scope>test</scope>
        </dependency>

    </dependencies>

    <build>
        <plugins>
            <!--plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>animal-sniffer-maven-plugin</artifactId>
                <version>1.16</version>
                <executions>
                    <execution>
                        <phase>test</phase>
                        <goals>
                            <goal>check</goal>
                        </goals>
                        <configuration>
                            <signature>
                                <groupId>org.codehaus.mojo.signature</groupId>
                                <artifactId>java18</artifactId>
                                <version>1.0</version>
                            </signature>
                        </configuration>
                    </execution>
                </executions>
            </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>
                    <skip>${documentation.skip}</skip>
                </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>
                        <site>https://www.atbash.be</site>
                        <aggregate>true</aggregate>
                    </properties>
                    <excludes>
                        <exclude>**/*.adoc</exclude>
                        <exclude>**/*.adi</exclude>
                        <exclude>**/*.jwk</exclude>
                        <exclude>**/README</exclude>
                        <exclude>**/LICENSE.txt</exclude>
                        <exclude>**/NOTICE.txt</exclude>
                        <exclude>**/NOTICE</exclude>
                        <exclude>**/config.yml</exclude>
                        <exclude>**/Base64Codec.java</exclude>
                    </excludes>
                    <mapping>
                        <java>SLASHSTAR_STYLE</java>
                    </mapping>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>com.mycila</groupId>
                        <artifactId>license-maven-plugin-git</artifactId>
                        <version>3.0</version>
                    </dependency>
                </dependencies>
                <executions>
                    <execution>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>clirr-maven-plugin</artifactId>
                <version>2.8</version>
                <configuration>
                    <ignored>
                        <difference>
                            <className>be/atbash/util/base64/Base64Codec</className>
                            <differenceType>8001</differenceType>
                        </difference>
                    </ignored>

                </configuration>
            </plugin>

            <plugin>
                <!-- For JUnit 5 -->
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.22.1</version>
            </plugin>

            <plugin>
                <groupId>de.qaware.maven</groupId>
                <artifactId>go-offline-maven-plugin</artifactId>
                <version>1.2.5</version>
                <configuration>
                </configuration>
            </plugin>
        </plugins>
    </build>
    <profiles>
        <profile>
            <id>release</id>
            <distributionManagement>
                <snapshotRepository>
                    <id>ossrh</id>
                    <url>https://oss.sonatype.org/content/repositories/snapshots</url>
                </snapshotRepository>
                <repository>
                    <id>ossrh</id>
                    <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
                </repository>
            </distributionManagement>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <version>2.4</version>
                        <executions>
                            <execution>
                                <id>attach-sources</id>
                                <goals>
                                    <goal>jar-no-fork</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>

                    <!-- Configure the jar with the javadoc (or rather, convince Maven that
                        we want javadoc at all) -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <version>2.10.3</version>
                        <configuration>
                            <javadocVersion>1.8</javadocVersion>
                            <notimestamp>true</notimestamp>
                            <!--splitindex>true</splitindex-->
                            <doctitle>${project.name} ${project.version}</doctitle>
                            <additionalparam>-Xdoclint:none</additionalparam>
                            <bottom>
                                <![CDATA[]]>
                            </bottom>
                        </configuration>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>1.6</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>

                </plugins>
            </build>

        </profile>
        <profile>
            <id>jdk11-Profile</id>
            <properties>
                <documentation.skip>true</documentation.skip>
            </properties>
            <activation>
                <jdk>11</jdk>
            </activation>
        </profile>
    </profiles>
</project>
