<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"
         xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.marcnuri.helm-java</groupId>
  <artifactId>helm-java-parent</artifactId>
  <version>0.0.3</version>
  <packaging>pom</packaging>
  <name>Helm Java :: Parent</name>
  <description>
    Helm Java allows you to run Helm commands from Java code.
  </description>

  <url>https://github.com/manusa/helm-java</url>

  <developers>
    <developer>
      <name>Marc Nuri</name>
      <email>marc@marcnuri.com</email>
      <url>https://www.marcnuri.com</url>
    </developer>
  </developers>

  <scm>
    <connection>scm:git:git://github.com/manusa/helm-java.git</connection>
    <developerConnection>scm:git:ssh://git@github.com/manusa/helm-java.git</developerConnection>
    <tag>HEAD</tag>
    <url>git://github.com/manusa/helm-java.git</url>
  </scm>

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

  <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>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    <maven.compiler.source>1.8</maven.compiler.source>
    <maven.compiler.target>1.8</maven.compiler.target>
    <com.marcnuri.jkube-helm.repository.snapshots>https://oss.sonatype.org/content/repositories/snapshots</com.marcnuri.jkube-helm.repository.snapshots>
    <com.marcnuri.jkube-helm.repository.stable>https://repo1.maven.org/maven2</com.marcnuri.jkube-helm.repository.stable>
    <version.assertj>3.25.2</version.assertj>
    <version.jna>5.14.0</version.jna>
    <version.junit>5.10.1</version.junit>
    <version.maven-core>3.9.5</version.maven-core>
    <version.maven-plugin-annotations>3.10.1</version.maven-plugin-annotations>
    <version.maven-plugin-plugin>3.9.0</version.maven-plugin-plugin>
    <version.maven-enforcer-plugin>3.4.1</version.maven-enforcer-plugin>
    <version.maven-gpg>3.1.0</version.maven-gpg>
    <version.maven-invoker-plugin>3.6.0</version.maven-invoker-plugin>
    <version.maven-javadoc-plugin>3.6.3</version.maven-javadoc-plugin>
    <version.maven-release-plugin>3.0.1</version.maven-release-plugin>
    <!-- DON'T BUMP to 3.3.0 -->
    <!-- https://issues.apache.org/jira/browse/MSOURCES-143?page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel&focusedCommentId=17755616#comment-17755616 -->
    <version.maven-source-plugin>3.2.1</version.maven-source-plugin>
    <version.maven-surefire-plugin>3.2.5</version.maven-surefire-plugin>
    <version.sonatype-staging>1.6.13</version.sonatype-staging>
    <version.test-containers>1.19.4</version.test-containers>
  </properties>

  <modules>
    <module>lib/api</module>
    <module>lib/darwin-amd64</module>
    <module>lib/darwin-arm64</module>
    <module>lib/linux-amd64</module>
    <module>lib/linux-arm64</module>
    <module>lib/windows-amd64</module>
    <module>helm-java</module>
  </modules>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>${project.groupId}</groupId>
        <artifactId>lib-api</artifactId>
        <version>${project.version}</version>
      </dependency>
      <dependency>
        <groupId>${project.groupId}</groupId>
        <artifactId>darwin-amd64</artifactId>
        <version>${project.version}</version>
      </dependency>
      <dependency>
        <groupId>${project.groupId}</groupId>
        <artifactId>darwin-arm64</artifactId>
        <version>${project.version}</version>
      </dependency>
      <dependency>
        <groupId>${project.groupId}</groupId>
        <artifactId>linux-amd64</artifactId>
        <version>${project.version}</version>
      </dependency>
      <dependency>
        <groupId>${project.groupId}</groupId>
        <artifactId>linux-arm64</artifactId>
        <version>${project.version}</version>
      </dependency>
      <dependency>
        <groupId>${project.groupId}</groupId>
        <artifactId>windows-amd64</artifactId>
        <version>${project.version}</version>
      </dependency>

      <dependency>
        <groupId>net.java.dev.jna</groupId>
        <artifactId>jna-jpms</artifactId>
        <version>${version.jna}</version>
      </dependency>
      <dependency>
        <groupId>net.java.dev.jna</groupId>
        <artifactId>jna-platform-jpms</artifactId>
        <version>${version.jna}</version>
      </dependency>

      <dependency>
        <groupId>org.junit.jupiter</groupId>
        <artifactId>junit-jupiter-api</artifactId>
        <version>${version.junit}</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>org.junit.jupiter</groupId>
        <artifactId>junit-jupiter-engine</artifactId>
        <version>${version.junit}</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>org.assertj</groupId>
        <artifactId>assertj-core</artifactId>
        <version>${version.assertj}</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>org.testcontainers</groupId>
        <artifactId>k3s</artifactId>
        <version>${version.test-containers}</version>
        <scope>test</scope>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-enforcer-plugin</artifactId>
        <version>${version.maven-enforcer-plugin}</version>
        <executions>
          <execution>
            <id>enforce-rules</id>
            <goals>
              <goal>enforce</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <rules>
            <dependencyConvergence/>
            <requireFilesExist>
              <files>
                <file>${project.basedir}/native/out/helm-darwin-10.12-amd64.dylib</file>
                <file>${project.basedir}/native/out/helm-darwin-10.12-arm64.dylib</file>
                <file>${project.basedir}/native/out/helm-linux-amd64.so</file>
                <file>${project.basedir}/native/out/helm-linux-arm64.so</file>
                <file>${project.basedir}/native/out/helm-windows-4.0-amd64.dll</file>
              </files>
            </requireFilesExist>
          </rules>
          <fail>true</fail>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>${version.maven-surefire-plugin}</version>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>${version.maven-javadoc-plugin}</version>
        <executions>
          <execution>
            <id>attach-javadocs</id>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
        <version>${version.maven-source-plugin}</version>
        <executions>
          <execution>
            <id>attach-sources</id>
            <goals>
              <goal>jar-no-fork</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
  <profiles>
    <profile>
      <id>quickly</id>
      <activation>
        <property>
          <name>quickly</name>
        </property>
      </activation>
      <properties>
        <skipTests>true</skipTests>
        <invoker.skip>true</invoker.skip>
      </properties>
    </profile>
    <profile>
      <id>release</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-release-plugin</artifactId>
            <version>${version.maven-release-plugin}</version>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>${version.maven-gpg}</version>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
              </execution>
            </executions>
            <configuration>
              <gpgArguments>
                <arg>--batch</arg>
                <arg>--pinentry-mode</arg>
                <arg>loopback</arg>
              </gpgArguments>
            </configuration>
          </plugin>
          <plugin>
            <groupId>org.sonatype.plugins</groupId>
            <artifactId>nexus-staging-maven-plugin</artifactId>
            <version>${version.sonatype-staging}</version>
            <extensions>true</extensions>
            <configuration>
              <serverId>ossrh</serverId>
              <nexusUrl>https://oss.sonatype.org/</nexusUrl>
              <autoReleaseAfterClose>true</autoReleaseAfterClose>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
