<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~   Copyright [2020 - 2022]   [Matthew Buckton]
  ~
  ~    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 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/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <groupId>io.mapsmessaging</groupId>
  <artifactId>DynamicStorage</artifactId>
  <version>2.4.6</version>
  <packaging>jar</packaging>

  <name>Dynamic Storage</name>
  <description>A generic data store keyed by a Long</description>
  <url>http://www.mapsmessaging.io</url>

  <developers>
    <developer>
      <id>mbuckton</id>
      <name>Matthew Buckton</name>
      <organization>Maps Messaging</organization>
      <organizationUrl>http://mapsmessaging.io/</organizationUrl>
      <roles>
        <role>founder</role>
      </roles>
      <timezone>Australia/Sydney</timezone>
    </developer>
  </developers>

  <licenses>
    <license>
      <name>Mozilla Public License Version 2.0</name>
      <url>https://www.mozilla.org/en-US/MPL/2.0/</url>
      <distribution>repo</distribution>
    </license>
    <license>
      <name>CommonsClause</name>
      <url>https://commonsclause.com/</url>
      <distribution>repo</distribution>
    </license>
  </licenses>
  <scm>
    <url>https://github.com/Maps-Messaging/dynamicStorage</url>
  </scm>

  <properties>
    <maven.compiler.source>13</maven.compiler.source>
    <maven.compiler.target>13</maven.compiler.target>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <gpg.keyname>matthew.buckton@mapsmessaging.io</gpg.keyname>

    <runSuite>**/*Suite.class</runSuite>
    <!-- Below property indicates the pattern of the test suite -->
    <sonar.c.file.suffixes>-</sonar.c.file.suffixes>
    <sonar.coverage.jacoco.xmlReportPaths>target/site/jacoco</sonar.coverage.jacoco.xmlReportPaths>

    <!-- Sonar-JaCoCo properties -->
    <sonar.cpp.file.suffixes>-</sonar.cpp.file.suffixes>
    <sonar.dynamicAnalysis>reuseReports</sonar.dynamicAnalysis>
    <sonar.java.coveragePlugin>jacoco</sonar.java.coveragePlugin>

    <sonar.language>java</sonar.language>
    <sonar.objc.file.suffixes>-</sonar.objc.file.suffixes>

    <sonar.host.url>https://sonarcloud.io</sonar.host.url>
    <sonar.organization>maps-messaging</sonar.organization>
    <sonar.projectKey>dynamic_storage</sonar.projectKey>

    <sonar.sources>src/main</sonar.sources>
    <sonar.test.exclusions>
      **/*Test.*,**/*IT.*, **.*JMH.*
    </sonar.test.exclusions>

  </properties>

  <distributionManagement>
    <snapshotRepository>
      <id>mapsmessaging.io</id>
      <url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
    </snapshotRepository>
    <repository>
      <id>mapsmessaging.io</id>
      <url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
    </repository>
  </distributionManagement>

  <build>
    <plugins>
      <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>
            <configuration>
              <keyname>${gpg.keyname}</keyname>
              <passphraseServerId>${gpg.keyname}</passphraseServerId>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.sonatype.plugins</groupId>
        <artifactId>nexus-staging-maven-plugin</artifactId>
        <version>1.6.8</version>
        <extensions>true</extensions>
        <configuration>
          <serverId>mapsmessaging.io</serverId>
          <nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
          <autoReleaseAfterClose>true</autoReleaseAfterClose>
        </configuration>
      </plugin>

      <!-- Allow JDKs greater than 1.8 to be used by maven -->
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <configuration>
          <compilerArgs>
            <arg>-h</arg>
            <arg>src/main/cpp/</arg>
          </compilerArgs>
          <encoding>UTF-8</encoding>
          <source>11</source>
          <target>11</target>
        </configuration>
        <groupId>org.apache.maven.plugins</groupId>
        <version>3.11.0</version>
      </plugin>

      <!-- Setup code coverage by jacoco for our tests -->
      <plugin>
        <artifactId>jacoco-maven-plugin</artifactId>
        <configuration>
          <excludes>
            <!-- test code, lets not track the testing -->
            <exclude>**/*Test.*</exclude>
          </excludes>
        </configuration>
        <executions>
          <execution>
            <goals>
              <goal>prepare-agent</goal>
            </goals>
          </execution>
          <!-- attached to Maven test phase -->
          <execution>
            <goals>
              <goal>report</goal>
            </goals>
            <id>report</id>
            <phase>test</phase>
          </execution>
        </executions>
        <groupId>org.jacoco</groupId>
        <version>0.8.8</version>
      </plugin>

      <!-- Setup the JUnit tests runner -->
      <plugin>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
          <argLine>@{argLine}</argLine>
          <includes>
            <include>**/*Test.java</include>
            <include>**/*IT.java</include>
          </includes>
        </configuration>
        <groupId>org.apache.maven.plugins</groupId>
        <version>2.22.2</version>
      </plugin>

      <!-- build the source jar as well -->
      <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>

      <!-- JavaDoc -->
      <plugin>
        <artifactId>maven-javadoc-plugin</artifactId>
        <configuration>
          <charset>UTF-8</charset>
          <encoding>UTF-8</encoding>
          <javadocExecutable>${java.home}/bin/javadoc</javadocExecutable>
          <reportOutputDirectory>${project.build.directory}/site/docs</reportOutputDirectory>
          <show>public</show>
        </configuration>
        <executions>
          <execution>
            <goals>
              <goal>jar</goal>
            </goals>
            <id>attach-javadocs</id>
          </execution>
        </executions>
        <groupId>org.apache.maven.plugins</groupId>
        <version>3.5.0</version>
      </plugin>
    </plugins>
  </build>

  <dependencies>

    <dependency>
      <groupId>io.mapsmessaging</groupId>
      <artifactId>Simple_Logging</artifactId>
      <version>2.0.7</version>
    </dependency>
    <!-- Naturally order long collection -->
    <dependency>
      <groupId>io.mapsmessaging</groupId>
      <artifactId>Naturally_Ordered_Long_Collections</artifactId>
      <version>1.1.5</version>
    </dependency>

    <!-- Non Blocking Task Queue module -->
    <dependency>
      <groupId>io.mapsmessaging</groupId>
      <artifactId>Non_Block_Task_Scheduler</artifactId>
      <version>2.1.4</version>
    </dependency>

    <!-- Add annotations for not null -->
    <dependency>
      <artifactId>annotations</artifactId>
      <groupId>org.jetbrains</groupId>
      <version>24.0.1</version>
    </dependency>

    <dependency>
      <artifactId>lombok</artifactId>
      <groupId>org.projectlombok</groupId>
      <version>1.18.26</version>
    </dependency>

    <dependency>
      <artifactId>jsr305</artifactId>
      <groupId>com.google.code.findbugs</groupId>
      <version>3.0.2</version>
    </dependency>

    <!-- https://mvnrepository.com/artifact/org.apache.commons/commons-jcs -->
    <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-jcs3-core</artifactId>
      <version>3.1</version>
    </dependency>

    <!-- https://mvnrepository.com/artifact/com.amazonaws/aws-java-sdk-s3 -->
    <dependency>
      <groupId>com.amazonaws</groupId>
      <artifactId>aws-java-sdk-s3</artifactId>
      <version>1.12.419</version>
    </dependency>


    <!-- Junit5 -->
    <dependency>
      <artifactId>junit-jupiter-engine</artifactId>
      <groupId>org.junit.jupiter</groupId>
      <scope>test</scope>
      <version>5.9.2</version>
    </dependency>

    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter-params</artifactId>
      <version>5.9.2</version>
      <scope>test</scope>
    </dependency>

    <!-- Java micro benchmarking -->
    <dependency>
      <artifactId>jmh-core</artifactId>
      <groupId>org.openjdk.jmh</groupId>
      <scope>test</scope>
      <version>1.36</version>
    </dependency>

    <dependency>
      <artifactId>jmh-generator-annprocess</artifactId>
      <groupId>org.openjdk.jmh</groupId>
      <scope>test</scope>
      <version>1.36</version>
    </dependency>
  </dependencies>
</project>