<?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>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>2.1.12.RELEASE</version>
    <relativePath/> <!-- lookup parent from repository -->
  </parent>
  <groupId>org.activiti.cloud.examples</groupId>
  <artifactId>example-runtime-bundle</artifactId>
  <name>Activiti Cloud :: Runtime Bundle</name>
  <version>7.1.31-TEST</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>
    <activiti-cloud-runtime-bundle-service.version>7.1.414</activiti-cloud-runtime-bundle-service.version>
    <docker-maven-plugin.version>0.32.0</docker-maven-plugin.version>
    <activiti-cloud-messages-service.version>7.1.414</activiti-cloud-messages-service.version>
  </properties>
  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>org.activiti.cloud.rb</groupId>
        <artifactId>activiti-cloud-runtime-bundle-dependencies</artifactId>
        <version>${activiti-cloud-runtime-bundle-service.version}</version>
        <scope>import</scope>
        <type>pom</type>
      </dependency>
      <dependency>
        <groupId>org.activiti.cloud.messages</groupId>
        <artifactId>activiti-cloud-messages-dependencies</artifactId>
        <version>${activiti-cloud-messages-service.version}</version>
        <scope>import</scope>
        <type>pom</type>
      </dependency>
    </dependencies>
  </dependencyManagement>
  <dependencies>
    <dependency>
      <groupId>javax.xml.bind</groupId>
      <artifactId>jaxb-api</artifactId>
    </dependency>
    <dependency>
      <groupId>org.activiti.cloud.rb</groupId>
      <artifactId>activiti-cloud-starter-runtime-bundle</artifactId>
    </dependency>
    <dependency>
      <groupId>org.springframework.cloud</groupId>
      <artifactId>spring-cloud-starter-stream-rabbit</artifactId>
    </dependency>
    <dependency>
      <groupId>org.activiti.cloud.messages</groupId>
      <artifactId>activiti-cloud-starter-messages-jdbc</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>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-test</artifactId>
      <scope>test</scope>
    </dependency>

    <!-- Marker Pom for Dependency Conversion Validation  -->
    <dependency>
      <groupId>org.activiti.cloud.rb</groupId>
      <artifactId>activiti-cloud-runtime-bundle-dependencies</artifactId>
      <version>${activiti-cloud-runtime-bundle-service.version}</version>
      <type>pom</type>
    </dependency>
    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-parent</artifactId>
      <version>${project.parent.version}</version>
      <type>pom</type>
    </dependency>
    <!-- Marker Pom for Dependency Conversion Validation  -->

  </dependencies>
  <build>
    <plugins>
      <plugin>
        <groupId>pl.project13.maven</groupId>
        <artifactId>git-commit-id-plugin</artifactId>
        <configuration>
          <verbose>false</verbose>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-maven-plugin</artifactId>
        <executions>
          <execution>
            <goals>
              <goal>build-info</goal>
            </goals>
          </execution>
        </executions>
      </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>
            <version>${docker-maven-plugin.version}</version>
            <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>
    <profile>
      <id>mock-spring-cloud-stream</id>
      <dependencies>
        <dependency>
          <groupId>org.springframework.cloud</groupId>
          <artifactId>spring-cloud-stream-test-support</artifactId>
        </dependency>
      </dependencies>
    </profile>
  </profiles>
  <repositories>
    <repository>
      <id>activiti-releases</id>
      <url>https://artifacts.alfresco.com/nexus/content/repositories/activiti-releases</url>
    </repository>
  </repositories>
</project>
