<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/maven-v4_0_0.xsd">

  <modelVersion>4.0.0</modelVersion>
  <parent>
    <groupId>com.atlassian.vcache</groupId>
    <artifactId>atlassian-vcache</artifactId>
    <version>1.6.2</version>
  </parent>

  <artifactId>atlassian-vcache-internal-memcached</artifactId>
  <name>Atlassian VCache - Memcached Impl</name>

  <dependencies>
    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>atlassian-vcache-internal-guava</artifactId>
    </dependency>

    <!-- Implementation dependencies -->
    <dependency>
      <groupId>com.google.guava</groupId>
      <artifactId>guava</artifactId>
    </dependency>
    <dependency>
      <groupId>net.spy</groupId>
      <artifactId>spymemcached</artifactId>
    </dependency>

    <!-- Test dependencies -->
    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>atlassian-vcache-internal-test</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.hamcrest</groupId>
      <artifactId>hamcrest-library</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-all</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-simple</artifactId>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-failsafe-plugin</artifactId>
        <configuration>
          <systemProperties>
            <memcached.svr>
              ${docker.containers.memcached.ports.11211/tcp.host}:${docker.containers.memcached.ports.11211/tcp.port}
            </memcached.svr>
          </systemProperties>
        </configuration>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <profile>
      <id>integration-tests</id>
      <activation>
        <property>
          <name>!skipITs</name>
        </property>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>net.wouterdanes.docker</groupId>
            <artifactId>docker-maven-plugin</artifactId>
            <executions>
              <execution>
                <id>start</id>
                <goals>
                  <goal>start-containers</goal>
                </goals>
                <configuration>
                  <containers>
                    <container>
                      <id>memcached</id>
                      <image>memcached:1.4</image>
                      <!-- <waitForStartup>sadly no logging to wait for, good thing it is quick</waitForStartup> -->
                    </container>
                  </containers>
                </configuration>
              </execution>
              <execution>
                <id>stop</id>
                <goals>
                  <goal>stop-containers</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

</project>
