<?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.4</version>
  </parent>
  <modelVersion>4.0.0</modelVersion>

  <groupId>io.ap4k</groupId>
  <artifactId>spring-boot-with-prometheus-on-kubernetes-example</artifactId>
  <name>AP4K :: Examples :: Spring Boot with Prometheus 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>

    <version.spring-boot>2.1.0.RELEASE</version.spring-boot>
    <version.micrometer>1.0.9</version.micrometer>
    <version.fabric8-maven-plugin>3.5.42</version.fabric8-maven-plugin>
  </properties>

 <dependencies>
    <dependency>
      <groupId>io.ap4k</groupId>
      <artifactId>kubernetes-spring-starter</artifactId>
      <version>${project.version}</version>
    </dependency>
   <dependency>
     <groupId>io.ap4k</groupId>
     <artifactId>prometheus-annotations</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>
    <dependency>
      <groupId>io.micrometer</groupId>
      <artifactId>micrometer-registry-prometheus</artifactId>
      <version>${version.micrometer}</version>
    </dependency>
    <!-- Testing -->
    <dependency>
      <groupId>io.ap4k</groupId>
      <artifactId>kubernetes-junit-starter</artifactId>
      <version>${project.version}</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <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>
    </plugins>
  </build>

  <profiles>
    <profile>
      <id>build</id>
      <build>
        <plugins>
          <plugin>
            <groupId>io.fabric8</groupId>
            <artifactId>fabric8-maven-plugin</artifactId>
            <version>${version.fabric8-maven-plugin}</version>
            <executions>
              <execution>
                <id>resources</id>
                <phase>process-resources</phase>
                <goals>
                  <goal>resource</goal>
                </goals>
              </execution>
              <execution>
                <id>build</id>
                <phase>package</phase>
                <goals>
                  <goal>build</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

</project>
