<?xml version="1.0" encoding="UTF-8"?>
<!--~
    ~ Copyright 2017 Couchbase, Inc.
    ~
    ~ Licensed under the Apache License, Version 2.0 (the "License");
    ~ you may not use this file except in compliance with the License.
    ~ You may obtain a copy of the License at
    ~
    ~     http://www.apache.org/licenses/LICENSE-2.0
    ~
    ~ Unless required by applicable law or agreed to in writing, software
    ~ distributed under the License is distributed on an "AS IS" BASIS,
    ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    ~ See the License for the specific language governing permissions and
    ~ limitations under the License.
    ~-->
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xmlns="http://maven.apache.org/POM/4.0.0"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

    <modelVersion>4.0.0</modelVersion>

    <groupId>com.couchbase.client</groupId>
    <artifactId>kafka-connect-couchbase</artifactId>
    <packaging>jar</packaging>
    <version>3.1.2</version>
    <name>Kafka Connector for Couchbase</name>
    <organization>
        <name>Couchbase, Inc.</name>
        <url>http://couchbase.com</url>
    </organization>
    <url>http://couchbase.com</url>
    <description>
        A Kafka Connect Couchbase connector for copying data between Kafka and Couchbase Server.
    </description>

    <licenses>
        <license>
            <name>Apache License 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0.html</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <scm>
        <connection>scm:git:git://github.com/couchbase/kafka-connect-couchbase.git</connection>
        <developerConnection>scm:git:git@github.com:couchbase/kafka-connect-couchbase.git</developerConnection>
        <url>https://github.com/couchbase/kafka-connect-couchbase</url>
        <tag>HEAD</tag>
    </scm>

    <issueManagement>
        <system>Couchbase JIRA</system>
        <url>http://www.couchbase.com/issues/browse/KAFKAC</url>
    </issueManagement>

    <developers>
        <developer>
            <id>avsej</id>
            <name>Sergey Avseyev</name>
            <email>sergey@couchbase.com</email>
        </developer>
    </developers>

    <properties>
        <java-compat.version>1.6</java-compat.version>
        <confluent.version>3.1.1</confluent.version>
        <kafka-connect-api.version>0.10.1.1</kafka-connect-api.version>
        <kafka-connect-json.version>0.10.1.1</kafka-connect-json.version>
        <kafka-streams.version>0.10.1.1</kafka-streams.version>
        <dcp-client.version>0.8.0</dcp-client.version>
        <java-client.version>2.4.2</java-client.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <confluent.maven.repo>http://packages.confluent.io/maven/</confluent.maven.repo>
        <junit.version>4.12</junit.version>
        <mysql.version>5.1.6</mysql.version>
    </properties>

    <repositories>
        <repository>
            <id>confluent</id>
            <name>Confluent</name>
            <url>${confluent.maven.repo}</url>
        </repository>
    </repositories>

    <dependencies>
        <dependency>
            <groupId>org.apache.kafka</groupId>
            <artifactId>connect-api</artifactId>
            <version>${kafka-connect-api.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.kafka</groupId>
            <artifactId>connect-json</artifactId>
            <version>${kafka-connect-json.version}</version>
        </dependency>
        <dependency>
            <groupId>io.confluent</groupId>
            <artifactId>kafka-connect-avro-converter</artifactId>
            <version>${confluent.version}</version>
        </dependency>
        <dependency>
            <groupId>com.couchbase.client</groupId>
            <artifactId>dcp-client</artifactId>
            <version>${dcp-client.version}</version>
        </dependency>
        <dependency>
            <groupId>com.couchbase.client</groupId>
            <artifactId>java-client</artifactId>
            <version>${java-client.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.kafka</groupId>
            <artifactId>kafka-streams</artifactId>
            <version>${kafka-streams.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>${junit.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <version>${mysql.version}</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>2.5.1</version>
                <inherited>true</inherited>
                <configuration>
                    <source>${java-compat.version}</source>
                    <target>${java-compat.version}</target>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-assembly-plugin</artifactId>
                <version>2.5.3</version>
                <configuration>
                    <descriptors>
                        <descriptor>src/assembly/development.xml</descriptor>
                        <descriptor>src/assembly/package.xml</descriptor>
                    </descriptors>
                </configuration>
                <executions>
                    <execution>
                        <id>make-assembly</id>
                        <phase>package</phase>
                        <goals>
                            <goal>single</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.18.1</version>
                <configuration>
                    <argLine>-Djava.awt.headless=true</argLine>
                    <forkMode>pertest</forkMode>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>2.10.4</version>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <additionalparam>-Xdoclint:none</additionalparam>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>3.0.1</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>

        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>true</filtering>
            </resource>
        </resources>
    </build>

    <profiles>
        <profile>
            <id>standalone</id>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-assembly-plugin</artifactId>
                        <configuration>
                            <descriptors>
                                <descriptor>src/assembly/standalone.xml</descriptor>
                            </descriptors>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>unit</id>
            <activation>
                <property>
                    <name>unit</name>
                    <value>true</value>
                </property>
            </activation>
            <properties>
                <test-source-directory>src/test/java</test-source-directory>
            </properties>
        </profile>
    </profiles>
</project>
