<?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.ap4k</groupId>
    <version>0.1.0</version>
  </parent>
  <modelVersion>4.0.0</modelVersion>

  <groupId>io.ap4k</groupId>
  <artifactId>spring-boot-with-gradle-on-openshift-example</artifactId>

  <name>AP4K :: Examples :: Spring Boot with Gradle on Openshift</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.ap4k</groupId>
      <artifactId>openshift-spring-starter</artifactId>
      <version>${project.version}</version>
    </dependency>
    <dependency>
      <groupId>io.ap4k</groupId>
      <artifactId>openshift-junit-starter</artifactId>
      <version>${project.version}</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <sourceDirectory>src/main/groovy</sourceDirectory>
    <testSourceDirectory>src/test/groovy</testSourceDirectory>
    <plugins>
      <plugin>
        <groupId>org.fortasoft</groupId>
        <artifactId>gradle-maven-plugin</artifactId>
        <version>1.0.8</version>
        <configuration>
          <gradleVersion>4.10</gradleVersion>
          <jvmArgs>
            <arg>-Dap4kVersion=${project.version}</arg>
          </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>-Dap4kVersion=${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>
          <plugin>
            <groupId>com.bluetrainsoftware.maven</groupId>
            <artifactId>groovydoc-maven-plugin</artifactId>
            <version>${version.groovydoc-maven-plugin}</version>
            <executions>
              <execution>
                <id>attach-docs</id>
                <phase>package</phase>
                <goals>
                  <goal>attach-docs</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

</project>
