<?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>
  <groupId>org.activiti.cloud.examples</groupId>
  <artifactId>example-runtime-bundle</artifactId>
  <name>Activiti Cloud :: Runtime Bundle</name>
  <version>7.0.59</version>
  <url>http://activiti.org</url>
  <scm>
    <url>https://github.com/Activiti/${project.artifactId}</url>
    <connection>scm:git:https://github.com/Activiti/${project.artifactId}.git</connection>
    <developerConnection>scm:git:https://github.com/Activiti/${project.artifactId}.git</developerConnection>
    <tag>HEAD</tag>
  </scm>
  <properties>
    <java.version>1.8</java.version>
    <activiti-cloud-dependencies.version>7.0.145</activiti-cloud-dependencies.version>
    <maven-compiler-plugin.version>3.7.0</maven-compiler-plugin.version>
    <maven-failsafe-plugin.version>2.18.1</maven-failsafe-plugin.version>
    <maven-surefire-plugin.version>2.18.1</maven-surefire-plugin.version>
    <spring-boot.version>2.1.0.RELEASE</spring-boot.version>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>
  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>org.activiti.cloud.dependencies</groupId>
        <artifactId>activiti-cloud-dependencies</artifactId>
        <version>${activiti-cloud-dependencies.version}</version>
        <scope>import</scope>
        <type>pom</type>
      </dependency>
    </dependencies>
  </dependencyManagement>
  <dependencies>
    <dependency>
      <groupId>org.activiti.cloud.rb</groupId>
      <artifactId>activiti-cloud-starter-runtime-bundle</artifactId>
    </dependency>
    <dependency>
      <groupId>org.postgresql</groupId>
      <artifactId>postgresql</artifactId>
      <scope>runtime</scope>
    </dependency>
    <dependency>
      <groupId>com.h2database</groupId>
      <artifactId>h2</artifactId>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-test</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-test</artifactId>
      <scope>test</scope>
    </dependency>
  </dependencies>
  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>${maven-compiler-plugin.version}</version>
        <configuration>
          <source>${java.version}</source>
          <target>${java.version}</target>
          <showDeprecation>true</showDeprecation>
          <showWarnings>true</showWarnings>
          <optimize>true</optimize>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-maven-plugin</artifactId>
        <version>${spring-boot.version}</version>
        <executions>
          <execution>
            <goals>
              <goal>repackage</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-deploy-plugin</artifactId>
        <version>2.8.2</version>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>${maven-surefire-plugin.version}</version>
      </plugin>
    </plugins>
  </build>
  <profiles>
    <profile>
      <id>integration-test</id>
      <activation>
        <activeByDefault>false</activeByDefault>
        <property>
          <name>skipITs</name>
          <value>false</value>
        </property>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-failsafe-plugin</artifactId>
            <version>${maven-failsafe-plugin.version}</version>
            <configuration>
              <forkCount>0</forkCount>
              <useSystemClassLoader>false</useSystemClassLoader>
            </configuration>
            <executions>
              <execution>
                <id>integration-test</id>
                <goals>
                  <goal>integration-test</goal>
                  <goal>verify</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>io.fabric8</groupId>
            <artifactId>docker-maven-plugin</artifactId>
            <configuration>
              <images>
                <image>
                  <name>activiti/activiti-keycloak</name>
                  <alias>activiti-keycloak</alias>
                  <run>
                    <ports>
                      <port>8180:8180</port>
                    </ports>
                    <wait>
                      <log>Keycloak .* started in</log>
                      <time>40000</time>
                      <shutdown>5000</shutdown>
                      <kill>1000</kill>
                    </wait>
                  </run>
                </image>
                <image>
                  <name>rabbitmq:management</name>
                  <alias>activiti-rabbitmq</alias>
                  <run>
                    <ports>
                      <port>5672:5672</port>
                      <port>15672:15672</port>
                    </ports>
                    <wait>
                      <log>Server startup complete</log>
                      <time>20000</time>
                      <shutdown>3000</shutdown>
                      <kill>1000</kill>
                    </wait>
                  </run>
                </image>
              </images>
              <skip>${skipTests}</skip>
            </configuration>
            <executions>
              <execution>
                <goals>
                  <goal>start</goal>
                  <goal>stop</goal>
                  <goal>remove</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
  <repositories>
    <repository>
      <id>activiti-releases</id>
      <name>Activiti Releases</name>
      <url>https://artifacts.alfresco.com/nexus/content/repositories/activiti-releases/</url>
    </repository>
  </repositories>
</project>
