<?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>infinispan-spring-boot-starter-parent</artifactId>
    <groupId>org.infinispan</groupId>
    <version>2.1.4.Final</version>
  </parent>
  <modelVersion>4.0.0</modelVersion>

  <artifactId>infinispan-spring-boot-starter-remote</artifactId>

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

    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-configuration-processor</artifactId>
      <optional>true</optional>
    </dependency>
    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-autoconfigure-processor</artifactId>
      <optional>true</optional>
    </dependency>

    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-actuator</artifactId>
      <optional>true</optional>
    </dependency>

    <dependency>
      <groupId>org.infinispan</groupId>
      <artifactId>infinispan-client-hotrod</artifactId>
    </dependency>

    <!-- Even if query is an optional feature, query DSL dependency is necessary to @Autowire a RemoteCache by Spring -->
    <dependency>
      <groupId>org.infinispan</groupId>
      <artifactId>infinispan-query-dsl</artifactId>
    </dependency>

    <dependency>
      <groupId>org.infinispan</groupId>
      <artifactId>infinispan-spring5-remote</artifactId>
    </dependency>

    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-test</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.assertj</groupId>
      <artifactId>assertj-core</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter-api</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter-engine</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>io.micrometer</groupId>
      <artifactId>micrometer-test</artifactId>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <profiles>
  <profile>
    <id>infinispan-itests</id>
    <activation>
      <activeByDefault>false</activeByDefault>
    </activation>
    <properties>
      <server.dir.parent>${project.build.directory}</server.dir.parent>
      <server.dir.name>infinispan-server-${infinispan.version}</server.dir.name>
      <server.dir>${server.dir.parent}/${server.dir.name}</server.dir>
    </properties>
    <build>
      <plugins>
        <plugin>
          <groupId>com.googlecode.maven-download-plugin</groupId>
          <artifactId>download-maven-plugin</artifactId>
          <version>1.4.0</version>
          <executions>
            <execution>
              <id>download-infinispan-server</id>
              <phase>pre-integration-test</phase>
              <goals>
                <goal>wget</goal>
              </goals>
              <configuration>
                <url>http://downloads.jboss.org/infinispan/${infinispan.version}/infinispan-server-${infinispan.version}.zip</url>
                <unpack>true</unpack>
                <outputDirectory>${server.dir.parent}</outputDirectory>
              </configuration>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-dependency-plugin</artifactId>
          <executions>
            <execution>
              <id>deploy-converter-factory</id>
              <phase>generate-test-resources</phase>
              <goals>
                <goal>copy</goal>
              </goals>
              <configuration>
                <artifactItems>
                  <artifactItem>
                    <groupId>org.infinispan.server</groupId>
                    <artifactId>infinispan-server-testsuite</artifactId>
                    <classifier>tests</classifier>
                    <version>${infinispan.version}</version>
                    <outputDirectory>${server.dir}/standalone/deployments</outputDirectory>
                  </artifactItem>
                </artifactItems>
              </configuration>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <groupId>org.wildfly.plugins</groupId>
          <artifactId>wildfly-maven-plugin</artifactId>
          <version>${version.maven.wildfly-plugin}</version>
          <executions>
            <execution>
              <id>start-server</id>
              <phase>pre-integration-test</phase>
              <goals>
                <goal>start</goal>
              </goals>
              <configuration>
                <skip>${skipTests}</skip>
                <jbossHome>${server.dir}</jbossHome>
              </configuration>
            </execution>
            <execution>
              <id>configure-caches</id>
              <phase>pre-integration-test</phase>
              <goals>
                <goal>execute-commands</goal>
              </goals>
              <configuration>
                <skip>${skipTests}</skip>
                <executeCommands>
                  <commands>
                  </commands>
                </executeCommands>
              </configuration>
            </execution>
            <execution>
              <id>stop-server</id>
              <phase>post-integration-test</phase>
              <goals>
                <goal>shutdown</goal>
              </goals>
              <configuration>
                <skip>${skipTests}</skip>
                <jbossHome>${server.dir}</jbossHome>
              </configuration>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-failsafe-plugin</artifactId>
          <version>${version.maven.failsafe}</version>
          <executions>
            <execution>
              <goals>
                <goal>integration-test</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
      </plugins>
    </build>
  </profile>
</profiles>
</project>
