<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.amazon.emr</groupId>
    <artifactId>emr-dynamodb-connector</artifactId>
    <version>4.2.0</version>
    <packaging>pom</packaging>

    <name>EMRDynamoDBConnector</name>
    <description>EMR DynamoDB Connector</description>

    <licenses>
        <license>
            <name>Apache License, Version 2.0</name>
            <url>http://aws.amazon.com/apache2.0</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <properties>
        <java.version>1.7</java.version>
        <aws-java-sdk.version>1.10.66</aws-java-sdk.version>
        <hadoop.version>2.7.2</hadoop.version>
        <hive1.version>1.0.0</hive1.version>
        <hive2.version>2.1.0</hive2.version>
        <!-- Use the more recent version as it will be more likely to
        have all the interfaces/classes we need for shims to work -->
        <hive.version>${hive2.version}</hive.version>
        <gson.version>2.1</gson.version>
        <junit.version>4.12</junit.version>
        <mockito.version>1.10.19</mockito.version>
        <powermock.version>1.6.4</powermock.version>
        <hamcrest-all.version>1.3</hamcrest-all.version>
        <checkstyle.plugin.version>2.17</checkstyle.plugin.version>
        <checkstyle.configuration>google_checks.xml</checkstyle.configuration>
        <checkstyle.ignore.rules>AbbreviationAsWordInName,javadoc</checkstyle.ignore.rules>
    </properties>

    <modules>
        <module>emr-dynamodb-hadoop</module>
        <module>emr-dynamodb-hive</module>
        <module>emr-dynamodb-tools</module>
        <module>shims</module>
    </modules>

    <url>https://github.com/awslabs/emr-dynamodb-connector</url>
    <scm><url>${project.url}</url></scm>
    <developers>
        <developer>
            <organization>Amazon Elastic MapReduce</organization>
        </developer>
        <developer>
            <organization>Amazon DynamoDB</organization>
        </developer>
    </developers>

    <dependencies>
        <dependency>
            <groupId>com.amazonaws</groupId>
            <artifactId>aws-java-sdk-dynamodb</artifactId>
            <version>${aws-java-sdk.version}</version>
        </dependency>

        <dependency>
            <groupId>org.hamcrest</groupId>
            <artifactId>hamcrest-all</artifactId>
            <version>${hamcrest-all.version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
            <version>${mockito.version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.powermock</groupId>
            <artifactId>powermock-module-junit4</artifactId>
            <version>${powermock.version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.powermock</groupId>
            <artifactId>powermock-api-mockito</artifactId>
            <version>${powermock.version}</version>
            <scope>test</scope>
        </dependency>

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

    <build>
        <plugins>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.3</version>
                <configuration>
                    <source>${java.version}</source>
                    <target>${java.version}</target>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-checkstyle-plugin</artifactId>
                <version>${checkstyle.plugin.version}</version>
                <executions>
                    <execution>
                        <id>check-style</id>
                        <phase>prepare-package</phase>
                        <goals>
                            <goal>check</goal>
                        </goals>
                        <configuration>
                            <configLocation>${checkstyle.configuration}</configLocation>
                            <failOnViolation>true</failOnViolation>
                            <consoleOutput>true</consoleOutput>
                            <linkXRef>false</linkXRef>
                            <violationIgnore>${checkstyle.ignore.rules}</violationIgnore>
                            <violationSeverity>warning</violationSeverity>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.sonatype.plugins</groupId>
                <artifactId>nexus-staging-maven-plugin</artifactId>
                <version>1.6.7</version>
                <extensions>true</extensions>
                <configuration>
                    <serverId>ossrh</serverId>
                    <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                    <autoReleaseAfterClose>false</autoReleaseAfterClose>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <distributionManagement>
        <snapshotRepository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
        <repository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>
    </distributionManagement>

    <reporting>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-checkstyle-plugin</artifactId>
                <version>${checkstyle.plugin.version}</version>
                <configuration>
                    <configLocation>${checkstyle.configuration}</configLocation>
                    <linkXRef>false</linkXRef>
                </configuration>
            </plugin>
        </plugins>
    </reporting>

    <profiles>
        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <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>
                        <configuration>
                            <charset>UTF-8</charset>
                            <encoding>UTF-8</encoding>
                            <show>public</show>
                            <failOnError>false</failOnError>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <version>2.2.1</version>
                        <executions>
                            <execution>
                                <id>attach-sources</id>
                                <goals>
                                    <goal>jar-no-fork</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>1.5</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

</project>
