<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>com.couchbase.client</groupId>
    <artifactId>couchbase-spring-cache</artifactId>
    <version>2.1.0</version>
    <packaging>jar</packaging>

    <name>Couchbase Spring Cache</name>
    <description>Spring Cache implementation based on the official Couchbase Java SDK</description>
    <url>https://github.com/couchbaselabs/couchbase-spring-cache</url>

    <licenses>
        <license>
            <name>The Apache Software License, Version 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <organization>
        <name>Couchbase, Inc.</name>
        <url>http://couchbase.com</url>
    </organization>

    <scm>
        <url>https://github.com/couchbaselabs/couchbase-spring-cache</url>
        <connection>
            scm:git:git://github.com/couchbaselabs/couchbase-spring-cache
        </connection>
        <developerConnection>
            scm:git:git://github.com/couchbaselabs/couchbase-spring-cache
        </developerConnection>
    </scm>

    <developers>
        <developer>
            <id>daschl</id>
            <name>Michael Nitschinger</name>
            <email>michael.nitschinger@couchbase.com</email>
        </developer>
        <developer>
            <id>simonbasle</id>
            <name>Simon Baslé</name>
            <email>simon@couchbase.com</email>
        </developer>
    </developers>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <java.version>1.6</java.version>

        <spring.version>4.3.5.RELEASE</spring.version>
        <couchbase.version>2.3.6</couchbase.version>
        <slf4j.version>1.7.10</slf4j.version>

        <junit.version>4.12</junit.version>
        <hamcrest.version>1.3</hamcrest.version>
    </properties>

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

        <dependency>
            <groupId>com.couchbase.client</groupId>
            <artifactId>java-client</artifactId>
            <version>${couchbase.version}</version>
        </dependency>

        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>${junit.version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.hamcrest</groupId>
            <artifactId>hamcrest-core</artifactId>
            <version>${hamcrest.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>${slf4j.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-test</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-framework-bom</artifactId>
                <version>${spring.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.1</version>
                <configuration>
                    <source>${java.version}</source>
                    <target>${java.version}</target>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>2.4</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>2.10.3</version>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <version>1.9.1</version>
                <executions>
                    <execution>
                        <id>add-integration-test-source-as-test-sources</id>
                        <phase>generate-test-sources</phase>
                        <goals>
                            <goal>add-test-source</goal>
                        </goals>
                        <configuration>
                            <sources>
                                <!-- add the following sources in addition to the unit tests -->
                                <source>${test-source-directory}</source>
                            </sources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>

        <testResources>
            <testResource>
                <directory>src/integration/java</directory>
            </testResource>
        </testResources>
    </build>

    <profiles>
        <profile>
            <id>default</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <properties>
                <!-- by default, add also the int tests -->
                <test-source-directory>src/integration/java</test-source-directory>
            </properties>
        </profile>
        <profile>
            <id>unit</id>
            <activation>
                <property>
                    <name>unit</name>
                    <value>true</value>
                </property>
            </activation>
            <properties>
                <!-- just adding the unit tests again, noop. -->
                <test-source-directory>src/test/java</test-source-directory>
            </properties>
        </profile>
    </profiles>
</project>
