<?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/maven-v4_0_0.xsd">
  <parent>
    <artifactId>datastax-mgmtapi</artifactId>
    <groupId>io.k8ssandra</groupId>
    <version>0.1.114</version>
  </parent>
  <modelVersion>4.0.0</modelVersion>
  <artifactId>datastax-mgmtapi-server</artifactId>
  <version>0.1.114</version>
  <build>
    <resources>
      <resource>
        <directory>${basedir}/src/main/resources</directory>
      </resource>
    </resources>
    <plugins>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>exec-maven-plugin</artifactId>
      </plugin>
      <plugin>
        <artifactId>maven-antrun-plugin</artifactId>
        <version>3.0.0</version>
        <executions>
          <execution>
            <id>check.cassandra.bin</id>
            <phase>process-resources</phase>
            <goals>
              <goal>run</goal>
            </goals>
            <configuration>
              <target>
                <condition>
                  <resourceexists>
                    <file />
                  </resourceexists>
                </condition>
              </target>
              <exportAntProperties>true</exportAntProperties>
            </configuration>
          </execution>
          <execution>
            <id>download.cassandra.bin</id>
            <phase>process-test-resources</phase>
            <goals>
              <goal>run</goal>
            </goals>
            <configuration>
              <target>
                <mkdir />
                <get />
                <untar />
                <chmod />
              </target>
              <skip>${skipTests}</skip>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
          <systemPropertyVariables>
            <dseIncluded>${dseIncluded}</dseIncluded>
            <dockerFileRoot>${basedir}/..</dockerFileRoot>
            <CASSANDRA_HOME>${basedir}/.cassandra-bin/apache-cassandra-${cassandra4.version}</CASSANDRA_HOME>
          </systemPropertyVariables>
          <environmentVariables>
            <JVM_EXTRA_OPTS>-javaagent:${basedir}/../management-api-agent/target/datastax-mgmtapi-agent-4.x-${project.version}.jar</JVM_EXTRA_OPTS>
          </environmentVariables>
          <forkCount>1</forkCount>
          <threadCount>1</threadCount>
          <reuseForks>true</reuseForks>
          <skipTests>${skip.surefire.tests}</skipTests>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
      </plugin>
      <plugin>
        <artifactId>maven-resources-plugin</artifactId>
      </plugin>
      <plugin>
        <artifactId>maven-shade-plugin</artifactId>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>shade</goal>
            </goals>
            <configuration>
              <transformers>
                <transformer />
                <transformer>
                  <mainClass>com.datastax.mgmtapi.Cli</mainClass>
                  <manifestEntries>
                    <Implementation-Version>${project.version}</Implementation-Version>
                  </manifestEntries>
                </transformer>
              </transformers>
            </configuration>
          </execution>
        </executions>
        <configuration>
          <createDependencyReducedPom>true</createDependencyReducedPom>
          <artifactSet>
            <includes>
              <include>*:*</include>
            </includes>
          </artifactSet>
          <filters>
            <filter>
              <artifact>*:*</artifact>
              <excludes>
                <exclude>META-INF/*.SF</exclude>
                <exclude>META-INF/*.DSA</exclude>
                <exclude>META-INF/*.RSA</exclude>
              </excludes>
            </filter>
          </filters>
        </configuration>
      </plugin>
      <plugin>
        <groupId>io.swagger.core.v3</groupId>
        <artifactId>swagger-maven-plugin-jakarta</artifactId>
        <version>${jaxrs.version}</version>
        <executions>
          <execution>
            <phase>compile</phase>
            <goals>
              <goal>resolve</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <outputFileName>openapi</outputFileName>
          <outputPath>${project.basedir}/doc</outputPath>
          <outputFormat>JSON</outputFormat>
          <prettyPrint>TRUE</prettyPrint>
          <configurationFilePath>${project.basedir}/src/main/resources/openapi-configuration.json</configurationFilePath>
          <sortOutput>true</sortOutput>
          <skip>${skipOpenApi}</skip>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-jar-plugin</artifactId>
        <executions>
          <execution>
            <goals>
              <goal>test-jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
  <profiles>
    <profile>
      <id>go-clientgen</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.openapitools</groupId>
            <artifactId>openapi-generator-maven-plugin</artifactId>
            <version>7.0.0-beta</version>
            <executions>
              <execution>
                <phase>process-classes</phase>
                <goals>
                  <goal>generate</goal>
                </goals>
              </execution>
            </executions>
            <configuration>
              <inputSpec>${project.basedir}/doc/openapi.json</inputSpec>
              <generatorName>go</generatorName>
              <skip>${skipOpenApi}</skip>
              <output>${project.build.directory}/generated-sources/openapi/go-client</output>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>java-clientgen</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.openapitools</groupId>
            <artifactId>openapi-generator-maven-plugin</artifactId>
            <version>7.0.0-beta</version>
            <executions>
              <execution>
                <phase>process-classes</phase>
                <goals>
                  <goal>generate</goal>
                </goals>
              </execution>
            </executions>
            <configuration>
              <inputSpec>${project.basedir}/doc/openapi.json</inputSpec>
              <generatorName>java</generatorName>
              <skip>${skipOpenApi}</skip>
              <output>${project.build.directory}/generated-sources/openapi/java-client</output>
              <apiPackage>com.datastax.mgmtapi.client.api</apiPackage>
              <modelPackage>com.datastax.mgmtapi.client.model</modelPackage>
              <invokerPackage>com.datastax.mgmtapi.client.invoker</invokerPackage>
              <groupId>${project.groupId}</groupId>
              <artifactId>datastax-mgmtapi-client-openapi</artifactId>
              <artifactVersion>${project.version}</artifactVersion>
              <configOptions>
                <artifactDescription>OpenAPI generated client for Management API for Apache Cassandra</artifactDescription>
                <artifactUrl>https://github.com/k8ssandra/managemenr-api-for-apache-cassandra</artifactUrl>
                <scmConnection>https://github.com/k8ssandra/management-api-for-apache-cassandra.git</scmConnection>
                <scmDeveloperConnection>https://github.com/k8ssandra/management-api-for-apache-cassandra.git</scmDeveloperConnection>
                <scmUrl>https://github.com/k8ssandra/management-api-for-apache-cassandra</scmUrl>
                <licenseName>Apache-2.0</licenseName>
              </configOptions>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
  <dependencies>
    <dependency>
      <groupId>com.github.docker-java</groupId>
      <artifactId>docker-java</artifactId>
      <version>3.3.6</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <artifactId>docker-java-transport-jersey</artifactId>
          <groupId>com.github.docker-java</groupId>
        </exclusion>
        <exclusion>
          <artifactId>docker-java-transport-netty</artifactId>
          <groupId>com.github.docker-java</groupId>
        </exclusion>
        <exclusion>
          <artifactId>docker-java-core</artifactId>
          <groupId>com.github.docker-java</groupId>
        </exclusion>
        <exclusion>
          <artifactId>jcl-over-slf4j</artifactId>
          <groupId>org.slf4j</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>com.github.docker-java</groupId>
      <artifactId>docker-java-transport-zerodep</artifactId>
      <version>3.3.6</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <artifactId>docker-java-transport</artifactId>
          <groupId>com.github.docker-java</groupId>
        </exclusion>
        <exclusion>
          <artifactId>jna</artifactId>
          <groupId>net.java.dev.jna</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.13.2</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <artifactId>hamcrest-core</artifactId>
          <groupId>org.hamcrest</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.awaitility</groupId>
      <artifactId>awaitility</artifactId>
      <version>4.3.0</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <artifactId>hamcrest</artifactId>
          <groupId>org.hamcrest</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.assertj</groupId>
      <artifactId>assertj-core</artifactId>
      <version>3.27.7</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <artifactId>byte-buddy</artifactId>
          <groupId>net.bytebuddy</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-core</artifactId>
      <version>5.5.0</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <artifactId>byte-buddy-agent</artifactId>
          <groupId>net.bytebuddy</groupId>
        </exclusion>
        <exclusion>
          <artifactId>objenesis</artifactId>
          <groupId>org.objenesis</groupId>
        </exclusion>
        <exclusion>
          <artifactId>byte-buddy</artifactId>
          <groupId>net.bytebuddy</groupId>
        </exclusion>
      </exclusions>
    </dependency>
  </dependencies>
  <properties>
    <jsr305.version>3.0.2</jsr305.version>
    <airline.version>3.0.0</airline.version>
    <resteasy.version>6.2.15.Final</resteasy.version>
    <guava.version>33.5.0-jre</guava.version>
    <jakarta.activation.version>2.1.4</jakarta.activation.version>
    <apache.commons.lang3.version>3.20.0</apache.commons.lang3.version>
    <assertj.version>3.27.7</assertj.version>
    <jaxrs.version>2.2.44</jaxrs.version>
    <servelet.version>6.1.0</servelet.version>
    <jakarta.validation.version>3.1.1</jakarta.validation.version>
    <awaitility.version>4.3.0</awaitility.version>
    <commons.io.version>2.21.0</commons.io.version>
  </properties>
</project>
