<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.activiti.cloud</groupId>
    <artifactId>activiti-cloud-starters-root</artifactId>
    <version>7-201708-EA</version>
  </parent>

  <artifactId>activiti-cloud-starter-runtime-bundle</artifactId>
  <name>Activiti Cloud Starter :: Runtime Bundle</name>
  <dependencies>

    <dependency>
      <groupId>org.activiti</groupId>
      <artifactId>activiti-engine</artifactId>
      <scope>runtime</scope>
    </dependency>
    <dependency>
      <groupId>org.activiti.cloud</groupId>
      <artifactId>activiti-cloud-starter-configure</artifactId>
    </dependency>
    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-jdbc</artifactId>
    </dependency>
    <!-- keycloak included as default identity provider to be excluded if overridden -->
    <dependency>
      <groupId>org.activiti</groupId>
      <artifactId>activiti-services-identity-keycloak</artifactId>
    </dependency>
    <dependency>
      <groupId>org.activiti</groupId>
      <artifactId>activiti-services-core-model</artifactId>
    </dependency>
    <dependency>
      <groupId>org.activiti</groupId>
      <artifactId>activiti-services-events</artifactId>
    </dependency>
    <dependency>
      <groupId>org.activiti</groupId>
      <artifactId>activiti-services-rest</artifactId>
    </dependency>
    <dependency>
      <groupId>com.fasterxml.jackson.core</groupId>
      <artifactId>jackson-annotations</artifactId>
    </dependency>
    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-amqp</artifactId>
    </dependency>
    <dependency>
      <groupId>org.springframework.cloud</groupId>
      <artifactId>spring-cloud-starter-eureka</artifactId>
    </dependency>
    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-hateoas</artifactId>
    </dependency>
    <dependency>
      <groupId>org.springframework.cloud</groupId>
      <artifactId>spring-cloud-starter-sleuth</artifactId>
    </dependency>
    <dependency>
      <groupId>org.springframework.hateoas</groupId>
      <artifactId>spring-hateoas</artifactId>
    </dependency>
    <dependency>
      <groupId>io.springfox</groupId>
      <artifactId>springfox-core</artifactId>
    </dependency>
    <dependency>
      <groupId>io.springfox</groupId>
      <artifactId>springfox-spi</artifactId>
    </dependency>
    <dependency>
      <groupId>io.springfox</groupId>
      <artifactId>springfox-spring-web</artifactId>
    </dependency>
    <dependency>
      <groupId>io.springfox</groupId>
      <artifactId>springfox-swagger2</artifactId>
    </dependency>
    <dependency>
      <groupId>io.springfox</groupId>
      <artifactId>springfox-swagger-ui</artifactId>
    </dependency>
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-context</artifactId>
    </dependency>
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-beans</artifactId>
    </dependency>
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-web</artifactId>
    </dependency>
    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-web</artifactId>

      <!--exclude tomcat and use embedded jetty, see root pom-->
      <exclusions>
        <exclusion>
          <groupId>org.springframework.boot</groupId>
          <artifactId>spring-boot-starter-tomcat</artifactId>
        </exclusion>
      </exclusions>
    </dependency>

    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-jetty</artifactId>
    </dependency>

    <dependency>
      <groupId>org.springframework.data</groupId>
      <artifactId>spring-data-commons</artifactId>
    </dependency>

    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
    </dependency>

    <!-- Test deps -->
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.assertj</groupId>
      <artifactId>assertj-core</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-core</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>com.h2database</groupId>
      <artifactId>h2</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>ch.qos.logback</groupId>
      <artifactId>logback-classic</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.activiti.cloud</groupId>
      <artifactId>activiti-cloud-starter-test</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.activiti</groupId>
      <artifactId>activiti-services-test</artifactId>
      <scope>test</scope>
    </dependency>
  </dependencies>
  <build>
    <plugins>
      <plugin>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>${maven-surefire-plugin.version}</version>
        <configuration>
          <redirectTestOutputToFile>true</redirectTestOutputToFile>
          <failIfNoTests>false</failIfNoTests>
          <trimStackTrace>false</trimStackTrace>
          <excludes>
            <exclude>**/*TestCase.java</exclude>
            <exclude>**/*IT.java</exclude>
          </excludes>
          <runOrder>alphabetical</runOrder>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.commonjava.maven.plugins</groupId>
        <artifactId>directory-maven-plugin</artifactId>
      </plugin>

      <plugin>
        <groupId>io.fabric8</groupId>
        <artifactId>docker-maven-plugin</artifactId>
        <version>${maven.docker.plugin.version}</version>
        <configuration>
          <images>
            <!-- A single's image configuration -->
            <image>
              <name>activiti/activiti-cloud-sso-idm</name>
              <alias>activiti-cloud-sso-idm</alias>
              <run>
                <ports>
                  <port>8180:8180</port>
                </ports>
                <wait>
                  <log>Keycloak .* started in</log>
                  <time>40000</time>
                </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>15000</time>
                </wait>
              </run>
            </image>

          </images>
        </configuration>

        <!-- Connect start/stop to pre- and
             post-integration-test phase, respectively if you want to start
             your docker containers during integration tests -->
        <executions>
          <execution>
            <id>build</id>
            <phase>package</phase>
            <goals>
              <goal>build</goal>
            </goals>
          </execution>
          <execution>
            <id>start</id>
            <configuration>
              <skip>${skipTests}</skip>
            </configuration>
            <phase>pre-integration-test</phase>
            <goals>
              <goal>start</goal>
            </goals>
          </execution>
          <execution>
            <id>stop</id>
            <configuration>
              <skip>${skipTests}</skip>
            </configuration>
            <phase>post-integration-test</phase>
            <goals>
              <goal>stop</goal>
              <goal>remove</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

</project>
