<!--

    Copyright 2019 Systems Research Group, University of St Andrews:
    <https://github.com/stacs-srg>

    This file is part of the module utilities.

    utilities is free software: you can redistribute it and/or modify it under the terms of the GNU General Public
    License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later
    version.

    utilities is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
    warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

    You should have received a copy of the GNU General Public License along with utilities. If not, see
    <http://www.gnu.org/licenses/>.

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

    <groupId>com.github.stacs-srg</groupId>
    <artifactId>utilities</artifactId>
    <version>1.0.0</version>
    <packaging>jar</packaging>
    <name>utilities</name>

    <description>Utilities</description>
    <url>https://stacs-srg.github.io/utilities/</url>
    <inceptionYear>2017</inceptionYear>

    <organization>
        <name>School of Computer Science at University of St Andrews</name>
        <url>https://www.st-andrews.ac.uk/computer-science/</url>
    </organization>

    <licenses>
        <license>
            <name>GNU General Public License 3.0</name>
            <url>http://www.gnu.org/licenses/gpl-3.0.txt</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <scm>
        <connection>scm:git:git://github.com/stacs-srg/utilities.git</connection>
        <developerConnection>scm:git:ssh://github.com:stacs-srg/utilities.git</developerConnection>
        <url>https://github.com/stacs-srg/utilities/tree/master</url>
    </scm>

    <properties>

        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <jdk.version>1.8</jdk.version>

        <license.template>src/main/resources/license-template.txt</license.template>
        <license.style>src/main/resources/license-custom-style.xml</license.style>

        <maven.compiler.source>${jdk.version}</maven.compiler.source>
        <maven.compiler.target>${jdk.version}</maven.compiler.target>
        <maven.compiler.showDeprecation>true</maven.compiler.showDeprecation>
        <maven.compiler.showWarnings>true</maven.compiler.showWarnings>

        <test.normallyExcludedTestCategories>uk.ac.standrews.cs.test.category.Slow</test.normallyExcludedTestCategories>

    </properties>

    <dependencies>

        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.13</version>
        </dependency>

        <dependency>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>versions-maven-plugin</artifactId>
            <version>2.7</version>
            <type>maven-plugin</type>
        </dependency>

        <dependency>
            <!-- Manipulation of MS Access files -->
            <groupId>com.healthmarketscience.jackcess</groupId>
            <artifactId>jackcess</artifactId>
            <version>2.1.7</version>
        </dependency>

        <dependency>
            <groupId>com.github.mpkorstanje</groupId>
            <artifactId>simmetrics-core</artifactId>
            <version>4.1.1</version>
        </dependency>

        <!-- https://mvnrepository.com/artifact/org.bouncycastle/bcprov-jdk15on -->
        <dependency>
            <groupId>org.bouncycastle</groupId>
            <artifactId>bcprov-jdk15on</artifactId>
            <version>1.57</version>
        </dependency>

        <dependency>
            <groupId>org.json</groupId>
            <artifactId>json</artifactId>
            <version>20170516</version>
        </dependency>

        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
            <version>2.5</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-math3</artifactId>
            <version>3.4.1</version>
        </dependency>

    </dependencies>

    <build>
        <plugins>

            <plugin>
                <!-- This checks that the required licence, specified in the licence template        -->
                <!-- file src/main/resources/license-template.txt, is applied to all source files.   -->

                <groupId>com.mycila</groupId>
                <artifactId>license-maven-plugin</artifactId>
                <version>3.0</version>
            </plugin>

            <!-- Needed for Codecov -->
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <version>0.7.9</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>prepare-agent</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>report</id>
                        <phase>test</phase>
                        <goals>
                            <goal>report</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>3.0.1</version>
                <configuration>
                    <show>public</show>
                    <isOffline>false</isOffline>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.sonatype.plugins</groupId>
                <artifactId>nexus-staging-maven-plugin</artifactId>
                <version>1.6.8</version>
                <extensions>true</extensions>
                <configuration>
                    <serverId>ossrh</serverId>
                    <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                    <autoReleaseAfterClose>false</autoReleaseAfterClose>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>versions-maven-plugin</artifactId>
                <version>2.7</version>
                <configuration>
                    <excludes>
                        <exclude>org.apache.commons:commons-collections4</exclude>
                    </excludes>
                </configuration>
            </plugin>

        </plugins>
        <pluginManagement>

            <plugins>

                <plugin>
                    <!-- This checks that the required licence, specified in the licence template        -->
                    <!-- file src/main/resources/license-template.txt, is applied to all source files.   -->

                    <groupId>com.mycila</groupId>
                    <artifactId>license-maven-plugin</artifactId>
                    <version>3.0</version>
                    <configuration>
                        <header>${license.template}</header>

                        <headerDefinitions>

                            <!-- This custom style is used to override the default formatting for Java   -->
                            <!-- files, which uses Javadoc format, therefore causing confusion with the  -->
                            <!-- actual class-level Javadoc.                                             -->
                            <headerDefinition>${license.style}</headerDefinition>

                        </headerDefinitions>

                        <mapping>
                            <java>JAVA_STYLE</java>
                        </mapping>

                        <includes>
                            <include>src/**</include>
                            <include>pom.xml</include>
                        </includes>

                        <excludes>
                            <exclude>**/README</exclude>
                            <exclude>src/test/resources/**</exclude>
                            <exclude>src/main/resources/**</exclude>
                            <exclude>src/docs/**</exclude>
                            <exclude>src/site/**</exclude>
                        </excludes>

                    </configuration>

                    <executions>
                        <execution>
                            <phase>initialize</phase>
                            <goals>
                                <goal>check</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

    <repositories>

        <!-- Repository to which this module is deployed, and others retrieved from.                 -->
        <!-- This has to be replicated from the parent POM so the parent POM can be found.           -->
        <repository>
            <id>uk.ac.standrews.cs.maven.repository</id>
            <name>School of Computer Science Maven Repository</name>
            <url>https://maven.cs.st-andrews.ac.uk/</url>
        </repository>

    </repositories>

    <distributionManagement>
        <!-- Central Repository -->
        <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>

    <profiles>
        <!-- Deployment profile (required so these plugins are only used when deploying) -->
        <profile>
            <id>deploy</id>
            <build>
                <plugins>
                    <!-- Source plugin -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <version>3.0.1</version>
                        <executions>
                            <execution>
                                <id>attach-sources</id>
                                <goals>
                                    <goal>jar-no-fork</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>

                    <!-- Javadoc plugin -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <version>3.0.1</version>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>

                    <!-- GPG 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>
                                <configuration>
                                    <!-- Prevent `gpg` from using pinentry programs -->
                                    <gpgArguments>
                                        <arg>--pinentry-mode</arg>
                                        <arg>loopback</arg>
                                    </gpgArguments>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

    <developers>
        <developer>
            <id/>
            <name>Alan Dearle</name>
            <email>alan.dearle@st-andrews.ac.uk</email>
            <url>https://al.host.cs.st-andrews.ac.uk/</url>
            <organization>University of St Andrews</organization>
            <organizationUrl>http://www.st-andrews.ac.uk/</organizationUrl>
            <roles>
                <role>Developer</role>
            </roles>
        </developer>
        <developer>
            <id/>
            <name>Graham Kirby</name>
            <email>graham.kirby@st-andrews.ac.uk</email>
            <url>https://graham.host.cs.st-andrews.ac.uk/</url>
            <organization>University of St Andrews</organization>
            <organizationUrl>http://www.st-andrews.ac.uk/</organizationUrl>
            <roles>
                <role>Developer</role>
            </roles>
        </developer>
        <developer>
            <id/>
            <name>Özgür Akgün</name>
            <email>ozgur.akgun@st-andrews.ac.uk</email>
            <url>https://ozgur.host.cs.st-andrews.ac.uk/</url>
            <organization>University of St Andrews</organization>
            <organizationUrl>http://www.st-andrews.ac.uk/</organizationUrl>
            <roles>
                <role>Developer</role>
            </roles>
        </developer>
        <developer>
            <id/>
            <name>Tom Dalton</name>
            <email>tsd4@st-andrews.ac.uk</email>
            <organization>University of St Andrews</organization>
            <organizationUrl>http://www.st-andrews.ac.uk/</organizationUrl>
            <roles>
                <role>Developer</role>
            </roles>
        </developer>
    </developers>
    <contributors>
        <contributor>
            <name>Masih Hajiarab Derkani</name>
            <organization>Previously University of St Andrews</organization>
            <roles>
                <role>Developer</role>
            </roles>
        </contributor>
    </contributors>

</project>
