<?xml version="1.0"?>
<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.baloise</groupId>
  <artifactId>baloise-airlock-waf-operator</artifactId>
  <version>1.0-SNAPSHOT</version>
  <properties>
    <compiler-plugin.version>3.8.1</compiler-plugin.version>
    <maven.compiler.parameters>true</maven.compiler.parameters>
    <maven.compiler.source>1.8</maven.compiler.source>
    <maven.compiler.target>1.8</maven.compiler.target>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    <quarkus-plugin.version>1.8.1.Final</quarkus-plugin.version>
    <quarkus.platform.artifact-id>quarkus-universe-bom</quarkus.platform.artifact-id>
    <quarkus.platform.group-id>io.quarkus</quarkus.platform.group-id>
    <quarkus.platform.version>1.8.1.Final</quarkus.platform.version>
    <surefire-plugin.version>3.0.0-M5</surefire-plugin.version>
    <jsonschema2pojo.version>1.0.2</jsonschema2pojo.version>
  </properties>
  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>${quarkus.platform.group-id}</groupId>
        <artifactId>${quarkus.platform.artifact-id}</artifactId>
        <version>${quarkus.platform.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
    </dependencies>
  </dependencyManagement>
  <dependencies>
    <dependency>
      <groupId>io.quarkus</groupId>
      <artifactId>quarkus-resteasy</artifactId>
    </dependency>
    <dependency>
      <groupId>io.quarkus</groupId>
      <artifactId>quarkus-junit5</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>io.rest-assured</groupId>
      <artifactId>rest-assured</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>io.quarkus</groupId>
      <artifactId>quarkus-rest-client-jsonb</artifactId>
    </dependency>
    <dependency>
      <groupId>io.quarkus</groupId>
      <artifactId>quarkus-resteasy-jsonb</artifactId>
    </dependency>
    <dependency>
      <groupId>io.quarkus</groupId>
      <artifactId>quarkus-kubernetes-client</artifactId>
    </dependency>
    <!-- only needed if we want use OpenShift ressources only known by the OpenShift client,
    for example Route and as long as quarkus not have a extension for the openshift-client.
         see https://github.com/quarkusio/quarkus/issues/3200
    <dependency>
      <groupId>io.fabric8</groupId>
      <artifactId>openshift-client</artifactId>
      <version>4.10.3</version>
    </dependency>
    -->
    <dependency>
      <groupId>io.quarkus</groupId>
      <artifactId>quarkus-smallrye-health</artifactId>
    </dependency>
  </dependencies>
  <build>
    <plugins>
      <plugin>
        <groupId>io.quarkus</groupId>
        <artifactId>quarkus-maven-plugin</artifactId>
        <version>${quarkus-plugin.version}</version>
        <executions>
          <execution>
            <goals>
              <goal>generate-code</goal>
              <goal>generate-code-tests</goal>
              <goal>build</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>${compiler-plugin.version}</version>
      </plugin>
      <plugin>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>${surefire-plugin.version}</version>
        <configuration>
          <systemPropertyVariables>
            <java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
            <maven.home>${maven.home}</maven.home>
          </systemPropertyVariables>
        </configuration>
      </plugin>
    </plugins>
  </build>
  <profiles>
    <profile>
      <id>json2pojo-mapping</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.jsonschema2pojo</groupId>
            <artifactId>jsonschema2pojo-maven-plugin</artifactId>
            <version>${jsonschema2pojo.version}</version>
            <configuration>
              <!--
              don't add the output directory to the project as a source root.
              we want to add them to the project manually to be able to separate them to different packages.
              -->
              <addCompileSourceRoot>false</addCompileSourceRoot>
              <sourceDirectory>${basedir}/src/main/waf-rest-api-ressources/7.4/create-mapping-result.json</sourceDirectory>
              <targetPackage>com.baloise.waf.rest.api.types.mapping</targetPackage>
              <sourceType>json</sourceType>
              <annotationStyle>none</annotationStyle>
              <includeGetters>false</includeGetters>
              <includeSetters>false</includeSetters>
              <includeConstructors>false</includeConstructors>
            </configuration>
            <executions>
              <execution>
                <goals>
                  <goal>generate</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>json2pojo-backend</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.jsonschema2pojo</groupId>
            <artifactId>jsonschema2pojo-maven-plugin</artifactId>
            <version>${jsonschema2pojo.version}</version>
            <configuration>
              <!--
              don't add the output directory to the project as a source root.
              we want to add them to the project manually to be able to separate them to different packages.
              -->
              <addCompileSourceRoot>false</addCompileSourceRoot>
              <sourceDirectory>${basedir}/src/main/waf-rest-api-ressources/7.4/create-backend-result.json</sourceDirectory>
              <targetPackage>com.baloise.waf.rest.api.types.backend</targetPackage>
              <sourceType>json</sourceType>
              <annotationStyle>none</annotationStyle>
              <includeGetters>false</includeGetters>
              <includeSetters>false</includeSetters>
              <includeConstructors>false</includeConstructors>
            </configuration>
            <executions>
              <execution>
                <goals>
                  <goal>generate</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>json2pojo-vhost</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.jsonschema2pojo</groupId>
            <artifactId>jsonschema2pojo-maven-plugin</artifactId>
            <version>${jsonschema2pojo.version}</version>
            <configuration>
              <!--
              don't add the output directory to the project as a source root.
              we want to add them to the project manually to be able to separate them to different packages.
              -->
              <addCompileSourceRoot>false</addCompileSourceRoot>
              <sourceDirectory>${basedir}/src/main/waf-rest-api-ressources/7.4/create-vhost-result.json</sourceDirectory>
              <targetPackage>com.baloise.waf.rest.api.types.vhost</targetPackage>
              <sourceType>json</sourceType>
              <annotationStyle>none</annotationStyle>
              <includeGetters>false</includeGetters>
              <includeSetters>false</includeSetters>
              <includeConstructors>false</includeConstructors>
            </configuration>
            <executions>
              <execution>
                <goals>
                  <goal>generate</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>native</id>
      <activation>
        <property>
          <name>native</name>
        </property>
      </activation>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-failsafe-plugin</artifactId>
            <version>${surefire-plugin.version}</version>
            <executions>
              <execution>
                <goals>
                  <goal>integration-test</goal>
                  <goal>verify</goal>
                </goals>
                <configuration>
                  <systemPropertyVariables>
                    <native.image.path>${project.build.directory}/${project.build.finalName}-runner</native.image.path>
                    <java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
                    <maven.home>${maven.home}</maven.home>
                  </systemPropertyVariables>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
      <properties>
        <quarkus.package.type>native</quarkus.package.type>
      </properties>
    </profile>
  </profiles>
</project>
