<?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">
  <parent>
    <artifactId>examples</artifactId>
    <groupId>io.dekorate</groupId>
    <version>0.10.0.redhat-00001</version>
  </parent>
  <modelVersion>4.0.0</modelVersion>

  <groupId>io.dekorate</groupId>
  <artifactId>spring-boot-with-gradle-on-kubernetes-example</artifactId>

  <name>Dekorate :: Examples :: Spring Boot with Gradle on Kubernetes</name>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    <java.version>1.8</java.version>
  </properties>

  <!-- we need to express the dependencies here as they affect build order -->
  <dependencies>
    <dependency>
      <groupId>io.dekorate</groupId>
      <artifactId>kubernetes-spring-starter</artifactId>
      <version>${project.version}</version>
    </dependency>
    <dependency>
      <groupId>io.dekorate</groupId>
      <artifactId>kubernetes-junit-starter</artifactId>
      <version>${project.version}</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <sourceDirectory>src/main/java</sourceDirectory>
    <testSourceDirectory>src/test/java</testSourceDirectory>
    <plugins>
      <!-- Skip compilation from java -->
       <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <executions>
          <execution>
            <id>default-compile</id>
            <phase>none</phase>
          </execution>
          <execution>
            <id>default-testCompile</id>
            <phase>none</phase>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.fortasoft</groupId>
        <artifactId>gradle-maven-plugin</artifactId>
        <version>1.0.8.redhat-1</version>
        <configuration>
          <gradleVersion>4.10</gradleVersion>
          <args>
            <arg>--stacktrace</arg>
          </args>
          <jvmArgs>
            <jvmArg>-Xmx1024m</jvmArg>
            <jvmArg>-DdekorateVersion=${project.version}</jvmArg>
          </jvmArgs>
        </configuration>
        <executions>
          <execution>
            <id>package</id>
            <phase>package</phase>
            <goals>
              <goal>invoke</goal>
            </goals>
            <configuration>
              <tasks>
                <task>build</task>
              </tasks>
            </configuration>
          </execution>
          <execution>
            <id>clean</id>
            <phase>clean</phase>
            <goals>
              <goal>invoke</goal>
            </goals>
            <configuration>
              <tasks>
                <task>clean</task>
              </tasks>
            </configuration>
          </execution>
          <execution>
            <id>integration-test</id>
            <phase>integration-test</phase>
            <goals>
              <goal>invoke</goal>
            </goals>
            <configuration>
              <tasks>
                <task>test</task>
              </tasks>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <profile>
      <id>release</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.fortasoft</groupId>
            <artifactId>gradle-maven-plugin</artifactId>
            <version>1.0.8</version>
            <configuration>
              <gradleVersion>4.10</gradleVersion>
              <jvmArgs>
                <arg>-DdekorateVersion=${project.version}</arg>
              </jvmArgs>
            </configuration>
            <executions>
              <execution>
                <id>package</id>
                <phase>none</phase>
              </execution>
              <execution>
                <id>clean</id>
                <phase>clean</phase>
                <goals>
                  <goal>invoke</goal>
                </goals>
                <configuration>
                  <tasks>
                    <task>clean</task>
                  </tasks>
                </configuration>
              </execution>
              <execution>
                <id>integration-test</id>
                <phase>none</phase>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

</project>
