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

<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>com.geotab</groupId>
  <artifactId>java-sdk</artifactId>
  <version>9.0.5</version>

  <name>java-sdk</name>
  <description>Geotab java sdk.</description>
  <url>https://www.geotab.com/</url>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <maven.compiler.source>1.8</maven.compiler.source>
    <maven.compiler.target>1.8</maven.compiler.target>
    <!-- lib versions -->
    <fasterxml.jackson.version>2.14.1</fasterxml.jackson.version>
    <lombok.version>1.18.22</lombok.version>
    <slf4j.version>1.7.36</slf4j.version>
  </properties>

  <licenses>
    <license>
      <name>Apache License, Version 2.0</name>
      <url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
      <distribution>repo</distribution>
    </license>
  </licenses>

  <scm>
    <connection>scm:git:https://git.geotab.com/dev/java-api-client</connection>
    <url>https://git.geotab.com/dev/java-api-client</url>
  </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>

  <dependencies><!-- @formatter:off -->
    <!-- runtime -->
    <dependency><groupId>com.fasterxml.jackson.core</groupId><artifactId>jackson-annotations</artifactId><version>${fasterxml.jackson.version}</version></dependency>
    <dependency><groupId>com.fasterxml.jackson.core</groupId><artifactId>jackson-core</artifactId><version>${fasterxml.jackson.version}</version></dependency>
    <dependency><groupId>com.fasterxml.jackson.core</groupId><artifactId>jackson-databind</artifactId><version>${fasterxml.jackson.version}</version></dependency>
    <dependency><groupId>com.fasterxml.jackson.datatype</groupId><artifactId>jackson-datatype-jsr310</artifactId><version>${fasterxml.jackson.version}</version></dependency>
    <dependency><groupId>org.apache.httpcomponents.client5</groupId><artifactId>httpclient5</artifactId><version>5.1.3</version></dependency>
    <dependency><groupId>org.slf4j</groupId><artifactId>slf4j-api</artifactId><version>${slf4j.version}</version></dependency>
    <!-- provided -->
    <dependency><groupId>org.jetbrains</groupId><artifactId>annotations</artifactId><version>17.0.0</version><scope>provided</scope></dependency>
    <dependency><groupId>org.projectlombok</groupId><artifactId>lombok</artifactId><version>${lombok.version}</version><scope>provided</scope></dependency>
    <!-- test -->
    <dependency><groupId>com.google.guava</groupId><artifactId>guava</artifactId><version>31.1-jre</version><scope>test</scope></dependency>
    <dependency><groupId>com.squareup</groupId><artifactId>javapoet</artifactId><version>1.13.0</version><scope>test</scope></dependency>
    <dependency><groupId>ch.qos.logback</groupId><artifactId>logback-classic</artifactId><version>1.2.11</version><scope>test</scope></dependency>
    <dependency><groupId>junit</groupId><artifactId>junit</artifactId><version>4.13.2</version><scope>test</scope></dependency>
    <dependency><groupId>org.mockito</groupId><artifactId>mockito-core</artifactId><version>4.3.1</version><scope>test</scope></dependency>
    <dependency><groupId>org.mock-server</groupId><artifactId>mockserver-netty</artifactId><version>5.14.0</version><scope>test</scope></dependency>
    <dependency><groupId>org.reflections</groupId><artifactId>reflections</artifactId><version>0.10.2</version><scope>test</scope></dependency>
    <dependency><groupId>org.slf4j</groupId><artifactId>jcl-over-slf4j</artifactId><version>${slf4j.version}</version><scope>test</scope></dependency>
  </dependencies><!-- @formatter:on -->

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.8.1</version>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-checkstyle-plugin</artifactId>
        <version>3.1.1</version>
        <executions>
          <execution>
            <id>validate</id>
            <phase>validate</phase>
            <configuration>
              <configLocation>checkstyle.xml</configLocation>
              <encoding>UTF-8</encoding>
              <consoleOutput>true</consoleOutput>
              <failsOnError>true</failsOnError>
            </configuration>
            <goals>
              <goal>check</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-source-plugin</artifactId>
        <groupId>org.apache.maven.plugins</groupId>
        <version>3.2.1</version>
        <executions>
          <execution>
            <id>attach-sources</id>
            <goals>
              <goal>jar-no-fork</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-javadoc-plugin</artifactId>
        <groupId>org.apache.maven.plugins</groupId>
        <version>3.2.0</version>
        <configuration>
          <doclint>none</doclint>
        </configuration>
        <executions>
          <execution>
            <id>attach-javadocs</id>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>2.22.2</version>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <!-- Activate using the release property: mvn deploy -DskipTests -Prelease  -->
    <profile>
      <id>release</id>
      <build>
        <plugins>
          <plugin>
            <artifactId>nexus-staging-maven-plugin</artifactId>
            <groupId>org.sonatype.plugins</groupId>
            <version>1.6.8</version>
            <extensions>true</extensions>
            <configuration>
              <serverId>ossrh</serverId>
              <nexusUrl>https://oss.sonatype.org/</nexusUrl>
              <autoReleaseAfterClose>false</autoReleaseAfterClose>
              <keepStagingRepositoryOnCloseRuleFailure>true
              </keepStagingRepositoryOnCloseRuleFailure>
            </configuration>
          </plugin>
          <plugin>
            <artifactId>maven-gpg-plugin</artifactId>
            <groupId>org.apache.maven.plugins</groupId>
            <version>1.6</version>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
              </execution>
            </executions>
            <configuration>
              <useAgent>true</useAgent>
              <gpgArguments>
                <arg>--batch</arg>
                <arg>--pinentry-mode</arg>
                <arg>loopback</arg>
              </gpgArguments>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>

    <!-- Runs integration tests against a real server to check model compatibility -->
    <profile>
      <id>compatibility</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-failsafe-plugin</artifactId>
            <version>3.0.0-M5</version>
            <executions>
              <execution>
                <goals>
                  <goal>integration-test</goal>
                  <goal>verify</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>owasp</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.owasp</groupId>
            <artifactId>dependency-check-maven</artifactId>
            <version>7.1.0</version>
            <configuration>
              <assemblyAnalyzerEnabled>false</assemblyAnalyzerEnabled>
              <!-- Fail on HIGH or CRITICAL vulnerability -->
              <failBuildOnCVSS>7</failBuildOnCVSS>
            </configuration>
            <executions>
              <execution>
                <goals>
                  <goal>check</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

  <developers>
    <developer>
      <name>Dragos Vizireanu-Isaic</name>
      <email>dragosvizireanuisaic@geotab.com</email>
      <organization>Geotab</organization>
      <organizationUrl>https://www.geotab.com</organizationUrl>
    </developer>
    <developer>
      <name>Atahan Ozer</name>
      <email>atahanozer@geotab.com</email>
      <organization>Geotab</organization>
      <organizationUrl>https://www.geotab.com</organizationUrl>
    </developer>
    <developer>
      <name>Ignacio Baca</name>
      <email>ignaciobaca@geotab.com</email>
      <organization>Geotab</organization>
      <organizationUrl>https://www.geotab.com</organizationUrl>
    </developer>
  </developers>

</project>
