<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<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/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.github.francis-pang</groupId>
    <artifactId>expense-tally</artifactId>
    <packaging>pom</packaging>
    <version>75</version>
    <modules>
        <module>base</module>
        <module>model</module>
        <module>csv-parser</module>
        <module>expense-manager</module>
        <module>reconciliator</module>
        <module>cli</module>
    </modules>

    <!-- Application information -->
    <name>${project.groupId}:${project.artifactId}</name>
    <description>
        Expense Tally is an application which tallies the transaction history from Singapore banks against the records
        download from Expense Manager database.
    </description>
    <url>https://github.com/francis-pang/expense-tally</url>

    <licenses>
        <license>
            <name>MIT License</name>
            <url>https://opensource.org/licenses/MIT</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <!-- Development team information -->
    <developers>
        <developer>
            <name>Francis Pang</name>
            <email>boyshawn@hotmail.com</email>
            <organizationUrl>https://www.linkedin.com/in/francispangdexian/</organizationUrl>
        </developer>
    </developers>
    <properties>
        <javaVersion>11</javaVersion>
        <javaCompilerVersion>1.11</javaCompilerVersion>
        <sonar.host.url>https://sonarcloud.io</sonar.host.url>
        <sonar.projectKey>boyshawn_expense-tally</sonar.projectKey>
        <sonar.moduleKey>${project.groupId}:${project.artifactId}</sonar.moduleKey>
        <sonar.login>f3e43ff4f0692fcd97fc41da1a7f890c79a86b5b</sonar.login>
        <sonar.organization>boyshawn-github</sonar.organization>
        <maven.developmentVersion>0-SNAPSHOT</maven.developmentVersion>
        <!--Prevent "File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent!"
        This warning is emitted by a plugin that processes plain text files but has not been configured to use a
        specific file encoding. -->
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

    <!--Source control management information-->
    <scm>
        <connection>scm:git:git@github.com:francis-pang/expense-tally.git</connection>
        <developerConnection>scm:git:https://github.com/francis-pang/expense-tally.git</developerConnection>
        <url>https://github.com/francis-pang/expense-tally</url>
        <tag>expense-tally-75</tag>
    </scm>

    <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-enforcer-plugin</artifactId>
                <version>3.0.0</version>
                <executions>
                    <execution>
                        <id>enforce-maven</id>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                        <configuration>
                            <rules>
                                <requireMavenVersion>
                                    <version>3.6.0</version>
                                </requireMavenVersion>
                            </rules>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <!-- Check for version -->
            <!-- Command to use: mvn versions:use-latest-releases -->
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>versions-maven-plugin</artifactId>
                <version>2.11.0</version>
            </plugin>
            <!-- Need this to specify the compiler argument -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.10.1</version>
                <configuration>
                    <release>${javaVersion}</release>
                    <source>${javaCompilerVersion}</source>
                    <target>${javaCompilerVersion}</target>
                    <compilerArgument>-Xlint:all</compilerArgument>
                    <showWarnings>true</showWarnings>
                    <showDeprecation>true</showDeprecation>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-clean-plugin</artifactId>
                <version>3.2.0</version>
            </plugin>

            <!-- Used for executing test-->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>3.0.0-M6</version>
                <configuration>
                    <excludes>
                        <exclude>some test to exclude here</exclude>
                    </excludes>
                </configuration>
            </plugin>
            <!-- Used for executing integration test -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-failsafe-plugin</artifactId>
                <version>3.0.0-M6</version>
                <configuration>
                    <properties>
                        <configurationParameters>
                            junit.jupiter.conditions.deactivate = *
                            junit.jupiter.extensions.autodetection.enabled = true
                            junit.jupiter.testinstance.lifecycle.default = per_class
                            junit.jupiter.execution.parallel.enabled = true
                        </configurationParameters>
                    </properties>
                </configuration>
            </plugin>
            <!-- testing code coverage -->
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <version>0.8.8</version>
                <configuration>
                    <excludes>
                        <!-- Exclude all the model package -->
                        <exclude>expense_tally/**/model/*</exclude>
                    </excludes>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>prepare-agent</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>during-test-report</id>
                        <!-- The default is package, I change this so that the report is generated during test phase -->
                        <phase>test</phase>
                        <goals>
                            <goal>report</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>default-check</id>
                        <goals>
                            <goal>check</goal>
                        </goals>
                        <configuration>
                            <rules>
                                <rule />
                            </rules>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <!-- Need this to specify the main entry point of the application-->
            <plugin>
                <!-- Build an executable JAR -->
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>3.2.2</version>
            </plugin>
            <!-- Sonarqube plugin -->
            <plugin>
                <groupId>org.sonarsource.scanner.maven</groupId>
                <artifactId>sonar-maven-plugin</artifactId>
                <version>3.9.1.2184</version>
            </plugin>

            <!-- Perform maven release to update the POM version-->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <version>3.0.0-M5</version>
                <executions>
                    <execution>
                        <id>update-pom</id>
                        <goals>
                            <goal>update-versions</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <autoVersionSubmodules>true</autoVersionSubmodules>
                    <useReleaseProfile>false</useReleaseProfile>
                    <goals>deploy</goals>
                </configuration>
            </plugin>
            <!-- This will fix the issue of The code being documented uses modules but the packages defined in
            https://docs.oracle.com/javase/13/docs/api/ are in the unnamed module. -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>3.4.0</version>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <javadocExecutable>${java.home}/bin/javadoc</javadocExecutable>
                </configuration>
            </plugin>
            <!-- Generate the source jar -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>3.2.1</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar-no-fork</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <!-- skip the deployment portion -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-deploy-plugin</artifactId>
                <version>3.0.0-M2</version>
                <configuration>
                    <skip>true</skip>
                </configuration>
            </plugin>
            <!-- Used to sign the components with the following configuration.-->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-gpg-plugin</artifactId>
                <version>3.0.1</version>
                <executions>
                    <execution>
                        <id>sign-artifacts</id>
                        <phase>verify</phase>
                        <goals>
                            <goal>sign</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <!--Deploy to the OSSRH Nexus Repository Manager with the Nexus Staging Maven plugin -->
            <plugin>
                <groupId>org.sonatype.plugins</groupId>
                <artifactId>nexus-staging-maven-plugin</artifactId>
                <version>1.6.13</version>
                <extensions>true</extensions>
                <configuration>
                    <serverId>ossrh</serverId>
                    <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                    <autoReleaseAfterClose>true</autoReleaseAfterClose>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>
