<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~
  ~     Copyright [ 2020 - 2023 ] [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: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>io.mapsmessaging</groupId>
  <artifactId>Schemas</artifactId>
  <version>2.1.2</version>
  <packaging>jar</packaging>

  <name>Schema Management</name>
  <description>Provides an extensible functionality to serialize and deserialize data</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>
      <distribution>repo</distribution>
      <name>Mozilla Public License Version 2.0</name>
      <url>https://www.mozilla.org/en-US/MPL/2.0/</url>
    </license>
    <license>
      <distribution>repo</distribution>
      <name>CommonsClause</name>
      <url>https://commonsclause.com/</url>
    </license>
  </licenses>

  <scm>
    <url>https://github.com/Maps-Messaging/schemas.git</url>
  </scm>

  <profiles>
    <profile>
      <id>mac</id>
      <activation>
        <os>
          <family>mac</family>
        </os>
      </activation>
      <properties>
        <protocCommand>/Users/matthew/homebrew/bin/protoc</protocCommand>
      </properties>
    </profile>
    <profile>
      <id>windows</id>
      <activation>
        <os>
          <family>Windows</family>
        </os>
      </activation>
      <properties>
        <protocCommand>protoc</protocCommand>
      </properties>
    </profile>
    <profile>
      <id>unix</id>
      <activation>
        <os>
          <family>unix</family>
        </os>
      </activation>
      <properties>
        <protocCommand>protoc</protocCommand>
      </properties>
    </profile>
  </profiles>


  <properties>
    <maven.compiler.source>11</maven.compiler.source>
    <maven.compiler.target>11</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>Schemas</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.1.0</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.13</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 -->
      <!-- build the source jar as well -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
        <version>3.3.0</version>
        <executions>
          <execution>
            <id>attach-sources</id>
            <goals>
              <goal>jar-no-fork</goal>
            </goals>
          </execution>
        </executions>
      </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>
            <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.10</version>
      </plugin>

      <!-- Setup the JUnit tests runner -->
      <plugin>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
          <argLine>@{argLine}</argLine>
          <includes>
            <include>**/*Test.java</include>
            <include>**/Test*.java</include>
            <include>**/*IT.java</include>
          </includes>
        </configuration>
        <groupId>org.apache.maven.plugins</groupId>
        <version>3.1.2</version>
      </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>
          <sourceFileExcludes>
            <sourceFileExclude>**/*Test.java</sourceFileExclude>
            <sourceFileExclude>**/Test*.java</sourceFileExclude>
            <sourceFileExclude>**/*IT.java</sourceFileExclude>
          </sourceFileExcludes>
        </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>

      <plugin>
        <groupId>com.github.os72</groupId>
        <artifactId>protoc-jar-maven-plugin</artifactId>
        <version>3.11.4</version>
        <executions>
          <execution>
            <phase>generate-test-sources</phase>
            <goals>
              <goal>run</goal>
            </goals>
            <configuration>
              <protocVersion>3.1.0</protocVersion>
              <inputDirectories>
                <include>src/test/resources</include>
              </inputDirectories>
              <outputTargets>
                <outputTarget>
                  <type>java</type>
                  <addSources>none</addSources>
                  <outputDirectory>target/generated-test-sources</outputDirectory>
                </outputTarget>
                <outputTarget>
                  <type>descriptor</type>
                  <addSources>none</addSources>
                  <outputDirectory>src/test/resources</outputDirectory>
                </outputTarget>
              </outputTargets>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <version>3.4.0</version>
        <executions>
          <execution>
            <id>add-test-sources</id>
            <phase>generate-sources</phase>
            <goals>
              <goal>add-test-source</goal>
            </goals>
            <configuration>
              <sources>
                <source>${basedir}/target/generated-test-sources</source>
              </sources>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.avro</groupId>
        <artifactId>avro-maven-plugin</artifactId>
        <version>1.11.1</version>
        <executions>
          <execution>
            <phase>generate-sources</phase>
            <goals>
              <goal>schema</goal>
            </goals>
            <configuration>
              <sourceDirectory>${project.basedir}/src/test/resources/avro</sourceDirectory>
              <outputDirectory>${basedir}/target/generated-test-sources</outputDirectory>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.11.0</version>
        <configuration>
          <source>11</source>
          <target>11</target>
        </configuration>
      </plugin>
    </plugins>
  </build>

  <dependencies>
    <dependency>
      <groupId>io.mapsmessaging</groupId>
      <artifactId>Simple_Logging</artifactId>
      <version>2.0.9</version>
    </dependency>

    <!-- JMS Selector logic module -->
    <dependency>
      <groupId>io.mapsmessaging</groupId>
      <artifactId>Extensible_JMS_Selector_Parser</artifactId>
      <version>1.1.11</version>
    </dependency>

    <!-- https://mvnrepository.com/artifact/org.json/json -->
    <dependency>
      <groupId>org.json</groupId>
      <artifactId>json</artifactId>
      <version>20230618</version>
    </dependency>
    <!-- https://mvnrepository.com/artifact/org.everit.json/org.everit.json.schema -->
    <dependency>
      <groupId>org.everit.json</groupId>
      <artifactId>org.everit.json.schema</artifactId>
      <version>1.5.1</version>
    </dependency>

    <!-- https://mvnrepository.com/artifact/com.google.protobuf/protobuf-java -->
    <dependency>
      <groupId>com.google.protobuf</groupId>
      <artifactId>protobuf-java</artifactId>
      <version>3.23.3</version>
    </dependency>

    <!-- https://mvnrepository.com/artifact/org.apache.avro/avro -->
    <dependency>
      <groupId>org.apache.avro</groupId>
      <artifactId>avro</artifactId>
      <version>1.11.1</version>
    </dependency>


    <!-- https://mvnrepository.com/artifact/org.apache.qpid/proton-j -->
    <dependency>
      <groupId>org.apache.qpid</groupId>
      <artifactId>proton-j</artifactId>
      <version>0.34.1</version>
    </dependency>

    <!-- https://mvnrepository.com/artifact/com.univocity/univocity-parsers -->
    <dependency>
      <groupId>com.univocity</groupId>
      <artifactId>univocity-parsers</artifactId>
      <version>2.9.1</version>
    </dependency>

    <!-- https://mvnrepository.com/artifact/org.quickfixj/quickfixj-core -->
    <dependency>
      <groupId>org.quickfixj</groupId>
      <artifactId>quickfixj-core</artifactId>
      <version>2.3.1</version>
    </dependency>

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

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

    <!-- https://mvnrepository.com/artifact/com.github.javafaker/javafaker -->
    <dependency>
      <groupId>com.github.javafaker</groupId>
      <artifactId>javafaker</artifactId>
      <version>1.0.2</version>
      <scope>test</scope>
    </dependency>

  </dependencies>

</project>