<?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">
  <modelVersion>4.0.0</modelVersion>

  <parent>
    <groupId>io.dekorate</groupId>
    <artifactId>examples</artifactId>
    <version>4.1.8</version>
    <relativePath>../pom.xml</relativePath>
  </parent>

  <artifactId>spring-boot-with-groovy-on-openshift-example</artifactId>
  <name>Dekorate :: Examples :: Spring Boot with Groovy 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>

    <version.groovy>2.4.12</version.groovy>
    <version.spring-boot>2.5.12</version.spring-boot>
    <version.gmavenplus-plugin>1.6.2</version.gmavenplus-plugin>
    <version.maven-compiler-plugin>3.8.0</version.maven-compiler-plugin>
    <version.maven-failsafe-plugin>3.0.0-M3</version.maven-failsafe-plugin>
    <version.maven-surefire-plugin>3.0.0-M3</version.maven-surefire-plugin>
    <version.groovydoc-maven-plugin>2.1</version.groovydoc-maven-plugin>
  </properties>

  <dependencies>
    <dependency>
      <groupId>org.codehaus.groovy</groupId>
      <artifactId>groovy-all</artifactId>
      <version>2.4.12</version>
    </dependency>

    <dependency>
      <groupId>io.dekorate</groupId>
      <artifactId>openshift-spring-starter</artifactId>
      <version>${project.version}</version>
    </dependency>

    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-web</artifactId>
      <version>${version.spring-boot}</version>
    </dependency>

    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-actuator</artifactId>
      <version>${version.spring-boot}</version>
    </dependency>

    <!-- Testing -->
    <dependency>
      <groupId>io.dekorate</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>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>${version.maven-compiler-plugin}</version>
        <configuration>
          <source>${java.version}</source>
          <target>${java.version}</target>
          <release>${java.release}</release>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-maven-plugin</artifactId>
        <version>${version.spring-boot}</version>
        <executions>
          <execution>
            <goals>
              <goal>repackage</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-failsafe-plugin</artifactId>
        <version>${version.maven-failsafe-plugin}</version>
        <executions>
          <execution>
            <goals>
              <goal>integration-test</goal>
              <goal>verify</goal>
            </goals>
            <phase>integration-test</phase>
            <configuration>
              <includes>
                <include>**/*IT.class</include>
              </includes>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.codehaus.gmavenplus</groupId>
        <artifactId>gmavenplus-plugin</artifactId>
        <version>1.6.2</version>
        <inherited>true</inherited>
        <executions>
          <execution>
            <goals>
              <goal>addSources</goal>
              <goal>addTestSources</goal>
              <goal>generateStubs</goal>
              <goal>compile</goal>
              <goal>generateTestStubs</goal>
              <goal>compileTests</goal>
              <goal>removeStubs</goal>
              <goal>removeTestStubs</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <profile>
      <id>release</id>
      <build>
        <plugins>
          <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>
