<?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>io.github.saic-ismart-api</groupId>
  <artifactId>saic-ismart-api-parent</artifactId>
  <version>0.2.1</version>
  <packaging>pom</packaging>

  <name>SAIC Java API - Parent</name>
  <description>Implementation of the SAIC API in Java</description>
  <url>https://github.com/SAIC-iSmart-API/saic-java-client</url>
  <licenses>
    <license>
      <name>MIT License</name>
    </license>
  </licenses>
  <developers>
    <developer>
      <id>tisoft</id>
      <name>Markus Heberling</name>
      <url>https://markus.heberling.net</url>
    </developer>
  </developers>
  <modules>
    <module>saic-java-api</module>
    <module>saic-java-client</module>
    <module>saic-java-api-gateway</module>
    <module>saic-java-api-cli</module>
    <module>saic-java-mqtt-gateway</module>
  </modules>
  <scm>
    <connection>scm:git:git@github.com:SAIC-iSmart-API/saic-java-client.git</connection>
    <url>https://github.com/SAIC-iSmart-API/saic-java-client</url>
  </scm>
  <distributionManagement>
    <repository>
      <id>ossrh</id>
      <url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
    </repository>
    <snapshotRepository>
      <id>ossrh</id>
      <url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
    </snapshotRepository>
  </distributionManagement>
  <properties>
    <maven.compiler.source>11</maven.compiler.source>
    <maven.compiler.target>11</maven.compiler.target>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <!-- Use the same timestamp for all files, will be set to the commit timestamp in CI to support reproducible builds -->
    <project.build.outputTimestamp>2023-06-03T15:40:00Z</project.build.outputTimestamp>

    <github.repository>tisoft</github.repository>
    <altReleaseDeploymentRepository>github::https://maven.pkg.github.com/${github.repository}</altReleaseDeploymentRepository>
    <altSnapshotDeploymentRepository>github::https://maven.pkg.github.com/${github.repository}</altSnapshotDeploymentRepository>

    <!-- This is the default, make overridable by git versioning extension-->
    <project.build.finalName>${project.artifactId}-${project.version}</project.build.finalName>
  </properties>
  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>org.testcontainers</groupId>
        <artifactId>testcontainers-bom</artifactId>
        <version>1.18.3</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>

      <dependency>
        <groupId>net.heberling.binarynotes</groupId>
        <artifactId>binarynotes</artifactId>
        <version>1.7.0</version>
      </dependency>
      <dependency>
        <groupId>com.owlike</groupId>
        <artifactId>genson</artifactId>
        <version>1.6</version>
      </dependency>
      <dependency>
        <groupId>org.apache.httpcomponents.client5</groupId>
        <artifactId>httpclient5</artifactId>
        <version>5.2.1</version>
      </dependency>
      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-simple</artifactId>
        <version>1.7.36</version>
      </dependency>
      <dependency>
        <groupId>org.junit.jupiter</groupId>
        <artifactId>junit-jupiter</artifactId>
        <version>5.9.3</version>
        <scope>test</scope>
      </dependency>
    </dependencies>
  </dependencyManagement>
  <build>
    <!-- This is the default, make overridable by git versioning extension-->
    <finalName>${project.build.finalName}</finalName>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>com.diffplug.spotless</groupId>
          <artifactId>spotless-maven-plugin</artifactId>
          <version>2.37.0</version>
        </plugin>
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>build-helper-maven-plugin</artifactId>
          <version>3.4.0</version>
          <executions>
            <execution>
              <id>add-source</id>
              <goals>
                <goal>add-source</goal>
              </goals>
              <phase>generate-sources</phase>
              <configuration>
                <sources>
                  <source>target/generated-sources/asn1-java</source>
                </sources>
              </configuration>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>exec-maven-plugin</artifactId>
          <version>3.1.0</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-jar-plugin</artifactId>
          <version>3.3.0</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-shade-plugin</artifactId>
          <version>3.4.1</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-deploy-plugin</artifactId>
          <version>3.1.1</version>
        </plugin>
      </plugins>
    </pluginManagement>
    <plugins>
      <plugin>
        <groupId>com.diffplug.spotless</groupId>
        <artifactId>spotless-maven-plugin</artifactId>
        <configuration>
          <pom>
            <sortPom></sortPom>
          </pom>
          <java>
            <googleJavaFormat>
              <reflowLongStrings>true</reflowLongStrings>
            </googleJavaFormat>
          </java>
        </configuration>
        <executions>
          <execution>
            <id>format</id>
            <goals>
              <goal>apply</goal>
            </goals>
            <phase>initialize</phase>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <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>
      <plugin>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>3.5.0</version>
        <executions>
          <execution>
            <id>attach-javadocs</id>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.simplify4u.plugins</groupId>
        <artifactId>sign-maven-plugin</artifactId>
        <version>1.0.1</version>
        <executions>
          <execution>
            <goals>
              <goal>sign</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-failsafe-plugin</artifactId>
        <version>3.1.0</version>
        <executions>
          <execution>
            <goals>
              <goal>integration-test</goal>
              <goal>verify</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
  <profiles>
    <profile>
      <id>deploy-ossrh</id>
      <activation>
        <property>
          <name>env.OSSRH_USERNAME</name>
        </property>
      </activation>
      <build>
        <pluginManagement>
          <plugins>
            <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-deploy-plugin</artifactId>
              <executions>
                <execution>
                  <id>deploy-ossrh</id>
                  <goals>
                    <goal>deploy</goal>
                  </goals>
                  <configuration>
                    <altReleaseDeploymentRepository>ossrh::https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</altReleaseDeploymentRepository>
                    <altSnapshotDeploymentRepository>ossrh::https://s01.oss.sonatype.org/content/repositories/snapshots</altSnapshotDeploymentRepository>
                  </configuration>
                </execution>
              </executions>
            </plugin>
          </plugins>
        </pluginManagement>
      </build>
    </profile>
    <profile>
      <id>deploy-dockerhub</id>
      <activation>
        <property>
          <name>env.DOCKERHUB_ORGANIZATION</name>
        </property>
      </activation>
      <build>
        <pluginManagement>
          <plugins>
            <plugin>
              <groupId>com.google.cloud.tools</groupId>
              <artifactId>jib-maven-plugin</artifactId>
              <version>3.3.2</version>
              <executions>
                <execution>
                  <id>build-docker-image-dockerhub</id>
                  <goals>
                    <goal>${jib.goal}</goal>
                  </goals>
                  <phase>${jib.phase}</phase>
                  <configuration>
                    <to>
                      <image>${env.DOCKERHUB_ORGANIZATION}/${dist.oci.name}:${dist.oci.tag}</image>
                    </to>
                  </configuration>
                </execution>
              </executions>
            </plugin>
          </plugins>
        </pluginManagement>
      </build>
    </profile>
  </profiles>
</project>
