<?xml version="1.0"?>
<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>
    <groupId>com.basho.riak</groupId>
    <artifactId>riak-client</artifactId>
    <packaging>bundle</packaging>
    <version>1.0.7</version>
    <name>Riak Client for Java</name>
    <description>HttpClient-based client for Riak</description>
    <url>https://github.com/basho/riak-java-client</url>

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

    <developers>
        <developer>
            <name>Jonathan Lee</name>
            <email>jonjlee@gmail.com</email>
        </developer>
        <developer>
            <name>Andy Gross</name>
            <email>andy@basho.com</email>
        </developer>
        <developer>
            <name>Dave Smith</name>
            <email>dizzyd@basho.com</email>
        </developer>
        <developer>
            <name>Russell Brown</name>
            <email>russelldb@basho.com</email>
        </developer>
        <developer>
            <name>Brian Roach</name>
            <email>roach@basho.com</email>
        </developer>
    </developers>

    <scm>
        <connection>scm:git:ssh://git@github.com/basho/riak-java-client.git</connection>
        <developerConnection>scm:git:ssh://git@github.com/basho/riak-java-client.git</developerConnection>
        <url>http://github.com/basho/riak-java-client</url>
    </scm>

    <properties>
        <os.installed.protoc.version>2.3.0</os.installed.protoc.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <cobertura.version>2.4</cobertura.version>
    </properties>

    <distributionManagement>
        <snapshotRepository>
            <id>sonatype-nexus-snapshots</id>
            <name>Sonatype Nexus Snapshots</name>
            <url>http://oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
        <repository>
            <id>sonatype-nexus-staging</id>
            <name>Nexus Release Repository</name>
            <url>http://oss.sonatype.org/service/local/staging/deploy/maven2</url>
        </repository>
    </distributionManagement>

    <dependencies>
        <!-- Apache Commons -->
        <dependency>
            <groupId>org.apache.httpcomponents</groupId>
            <artifactId>httpclient</artifactId>
            <version>4.2.2</version>
        </dependency>
        <!-- Protocol Buffers -->
        <dependency>
            <groupId>org.codehaus.jackson</groupId>
            <artifactId>jackson-core-asl</artifactId>
            <version>1.9.11</version>
        </dependency>
        <dependency>
            <groupId>org.codehaus.jackson</groupId>
            <artifactId>jackson-mapper-asl</artifactId>
            <version>1.9.11</version>
        </dependency>
        <!-- Testing -->
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-all</artifactId>
            <version>1.8.0</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.4</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.json</groupId>
            <artifactId>json</artifactId>
            <version>20090211</version>
        </dependency>
        <dependency>
            <groupId>com.basho.riak.protobuf</groupId>
            <artifactId>riak-pb</artifactId>
            <version>1.2.1</version>
        </dependency>
        <dependency>
            <groupId>com.google.protobuf</groupId>
            <artifactId>protobuf-java</artifactId>
            <version>2.4.1</version>
        </dependency>
    </dependencies>
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>2.3.2</version>
                <configuration>
                    <source>1.5</source>
                    <target>1.5</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>cobertura-maven-plugin</artifactId>
                <version>${cobertura.version}</version>
                <configuration>
                    <instrumentation>
                        <excludes>
                            <exclude>org/json/*.class</exclude>
                            <exclude>com/basho/riak/pbc/RPB*</exclude>
                        </excludes>
                    </instrumentation>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>clean</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-release-plugin</artifactId>
                <version>2.1</version>
            </plugin>
            <plugin>
                <artifactId>maven-jar-plugin</artifactId>
                <version>2.4</version>
                <executions>
                    <execution>
                        <id>test-jar</id>
                        <phase>package</phase>
                        <goals>
                            <goal>test-jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-bundle-plugin</artifactId>
                <groupId>org.apache.felix</groupId>
                <version>2.3.7</version>
                <extensions>true</extensions>
                <configuration>
                    <instructions>
                        <Import-Package>
                            org.apache.commons.codec.binary;version="[1.4,2)",
                            *;resolution:=optional
                        </Import-Package>
                    </instructions>
                </configuration>
            </plugin>
        </plugins>
    </build>
    <profiles>
        <profile>
            <id>itest</id>
            <build>
                <plugins>
                    <!--
                        Run integration tests (ITest*.java) by executing `mvn
                        -Pitest verify`
                    -->
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>failsafe-maven-plugin</artifactId>
                        <version>2.4.3-alpha-1</version>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>integration-test</goal>
                                    <goal>verify</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>release</id>
            <activation>
                <property>
                    <name>performRelease</name>
                    <value>true</value>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>1.4</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <!-- NOTE: source and javadoc jars automatically generated on release (http://maven.apache.org/pom.html#The_Super_POM) -->
                </plugins>
            </build>
        </profile>
        <profile>
            <id>githubUpload</id>
            <activation>
                <property>
                    <name>github.downloads</name>
                    <value>true</value>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>com.github.github</groupId>
                        <artifactId>downloads-maven-plugin</artifactId>
                        <version>0.4</version>
                        <configuration>
                            <description>${project.version} release of ${project.name}</description>
                            <override>false</override>
                            <includeAttached>true</includeAttached>
                        </configuration>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>upload</goal>
                                </goals>
                                <phase>install</phase>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>dependencyArchive</id>
            <activation>
                <property>
                    <name>bundle.archives</name>
                    <value>true</value>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-assembly-plugin</artifactId>
                        <version>2.2.1</version>
                        <configuration>
                            <descriptors>
                                <descriptor>src/main/assembly/rjc-deps.xml</descriptor>
                            </descriptors>
                            <archive>
                            </archive>
                        </configuration>
                        <executions>
                            <execution>
                                <id>make-assembly</id>
                                <phase>package</phase>
                                <goals>
                                    <goal>single</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>depsAndTests</id>
            <activation>
                <property>
                    <name>bundle.be_fat</name>
                    <value>true</value>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-assembly-plugin</artifactId>
                        <version>2.2.1</version>
                        <configuration>
                            <descriptors>
                                <descriptor>src/main/assembly/rjc-be-fat.xml</descriptor>
                            </descriptors>
                            <archive>
                            </archive>
                        </configuration>
                        <executions>
                            <execution>
                                <id>make-assembly</id>
                                <phase>package</phase>
                                <goals>
                                    <goal>single</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>fat_jar</id>
            <activation>
                <property>
                    <name>bundle.fat</name>
                    <value>true</value>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-assembly-plugin</artifactId>
                        <version>2.2.1</version>
                        <configuration>
                            <descriptorRefs>
                                <descriptorRef>jar-with-dependencies</descriptorRef>
                            </descriptorRefs>
                            <archive>
                            </archive>
                        </configuration>
                        <executions>
                            <execution>
                                <id>make-assembly</id>
                                <phase>package</phase>
                                <goals>
                                    <goal>single</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

    <reporting>
        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>cobertura-maven-plugin</artifactId>
                <version>${cobertura.version}</version>
            </plugin>
        </plugins>
    </reporting>
</project>
