<?xml version="1.0" encoding="UTF-8"?>
<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>

    <parent>
        <groupId>io.airlift</groupId>
        <artifactId>airbase</artifactId>
        <version>24</version>
    </parent>

    <groupId>com.facebook.presto</groupId>
    <artifactId>presto-root</artifactId>
    <version>0.74</version>
    <packaging>pom</packaging>

    <name>presto-root</name>
    <description>Presto</description>
    <url>https://github.com/facebook/presto</url>

    <inceptionYear>2012</inceptionYear>

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

    <scm>
        <connection>scm:git:git://github.com/facebook/presto.git</connection>
        <url>https://github.com/facebook/presto</url>
        <tag>0.74</tag>
    </scm>

    <properties>
        <air.main.basedir>${project.basedir}</air.main.basedir>

        <air.check.skip-extended>true</air.check.skip-extended>
        <air.check.skip-license>false</air.check.skip-license>

        <air.check.fail-checkstyle>true</air.check.fail-checkstyle>
        <air.check.skip-checkstyle>false</air.check.skip-checkstyle>

        <dep.antlr.version>3.4</dep.antlr.version>
        <dep.slice.version>0.7</dep.slice.version>
        <dep.airlift.version>0.92</dep.airlift.version>
        <dep.packaging.version>${dep.airlift.version}</dep.packaging.version>

        <cli.skip-execute>true</cli.skip-execute>
        <cli.main-class>None</cli.main-class>

        <!-- use a fractional hour timezone offset for tests -->
        <test.timezone>Asia/Katmandu</test.timezone>
    </properties>

    <modules>
        <module>presto-spi</module>
        <module>presto-cassandra</module>
        <module>presto-hive</module>
        <module>presto-hive-hadoop1</module>
        <module>presto-hive-hadoop2</module>
        <module>presto-hive-cdh4</module>
        <module>presto-hive-cdh5</module>
        <module>presto-example-http</module>
        <module>presto-tpch</module>
        <module>presto-raptor</module>
        <module>presto-client</module>
        <module>presto-parser</module>
        <module>presto-main</module>
        <module>presto-ml</module>
        <module>presto-benchmark</module>
        <module>presto-tests</module>
        <module>presto-jdbc</module>
        <module>presto-cli</module>

        <!-- Important: presto-server needs to be listed *after* all plugins in order for them to be included in the tgz.
             The dependency resolution rules in the maven assembly are broken, so presto-server can't depend on the plugins -->
        <module>presto-server</module>
        <module>presto-docs</module>
        <module>presto-verifier</module>
    </modules>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>com.facebook.presto</groupId>
                <artifactId>presto-spi</artifactId>
                <version>${project.version}</version>
            </dependency>

            <dependency>
                <groupId>com.facebook.presto</groupId>
                <artifactId>presto-hive</artifactId>
                <version>${project.version}</version>
            </dependency>

            <dependency>
                <groupId>com.facebook.presto</groupId>
                <artifactId>presto-hive-cdh4</artifactId>
                <version>${project.version}</version>
                <type>zip</type>
            </dependency>

            <dependency>
                <groupId>com.facebook.presto</groupId>
                <artifactId>presto-example-http</artifactId>
                <version>${project.version}</version>
                <type>zip</type>
            </dependency>

            <dependency>
                <groupId>com.facebook.presto</groupId>
                <artifactId>presto-hive</artifactId>
                <version>${project.version}</version>
                <type>test-jar</type>
            </dependency>

            <dependency>
                <groupId>com.facebook.presto</groupId>
                <artifactId>presto-tpch</artifactId>
                <version>${project.version}</version>
            </dependency>

            <dependency>
                <groupId>com.facebook.presto</groupId>
                <artifactId>presto-raptor</artifactId>
                <version>${project.version}</version>
            </dependency>

            <dependency>
                <groupId>com.facebook.presto</groupId>
                <artifactId>presto-client</artifactId>
                <version>${project.version}</version>
            </dependency>

            <dependency>
                <groupId>com.facebook.presto</groupId>
                <artifactId>presto-parser</artifactId>
                <version>${project.version}</version>
            </dependency>

            <dependency>
                <groupId>com.facebook.presto</groupId>
                <artifactId>presto-parser</artifactId>
                <version>${project.version}</version>
                <type>test-jar</type>
            </dependency>

            <dependency>
                <groupId>com.facebook.presto</groupId>
                <artifactId>presto-main</artifactId>
                <version>${project.version}</version>
            </dependency>

            <dependency>
                <groupId>com.facebook.presto</groupId>
                <artifactId>presto-main</artifactId>
                <version>${project.version}</version>
                <type>test-jar</type>
            </dependency>

            <dependency>
                <groupId>com.facebook.presto</groupId>
                <artifactId>presto-jdbc</artifactId>
                <version>${project.version}</version>
            </dependency>

            <dependency>
                <groupId>com.facebook.presto</groupId>
                <artifactId>presto-server</artifactId>
                <version>${project.version}</version>
            </dependency>

            <dependency>
                <groupId>com.facebook.presto</groupId>
                <artifactId>presto-tests</artifactId>
                <version>${project.version}</version>
            </dependency>

            <dependency>
                <groupId>com.facebook.presto</groupId>
                <artifactId>presto-benchmark</artifactId>
                <version>${project.version}</version>
            </dependency>

            <dependency>
                <groupId>com.facebook.presto.hadoop</groupId>
                <artifactId>hadoop-apache1</artifactId>
                <version>0.2</version>
            </dependency>

            <dependency>
                <groupId>com.facebook.presto.hadoop</groupId>
                <artifactId>hadoop-apache2</artifactId>
                <version>0.1</version>
            </dependency>

            <dependency>
                <groupId>com.facebook.presto.hadoop</groupId>
                <artifactId>hadoop-cdh4</artifactId>
                <version>0.6</version>
            </dependency>

            <dependency>
                <groupId>com.facebook.presto.hive</groupId>
                <artifactId>hive-apache</artifactId>
                <version>0.9</version>
            </dependency>

            <dependency>
                <groupId>io.airlift</groupId>
                <artifactId>log</artifactId>
                <version>${dep.airlift.version}</version>
            </dependency>

            <dependency>
                <groupId>io.airlift</groupId>
                <artifactId>log-manager</artifactId>
                <version>${dep.airlift.version}</version>
            </dependency>

            <dependency>
                <groupId>io.airlift</groupId>
                <artifactId>json</artifactId>
                <version>${dep.airlift.version}</version>
            </dependency>

            <dependency>
                <groupId>io.airlift</groupId>
                <artifactId>units</artifactId>
                <version>${dep.airlift.version}</version>
            </dependency>

            <dependency>
                <groupId>io.airlift</groupId>
                <artifactId>concurrent</artifactId>
                <version>${dep.airlift.version}</version>
            </dependency>

            <dependency>
                <groupId>io.airlift</groupId>
                <artifactId>configuration</artifactId>
                <version>${dep.airlift.version}</version>
            </dependency>

            <dependency>
                <groupId>io.airlift</groupId>
                <artifactId>discovery</artifactId>
                <version>${dep.airlift.version}</version>
            </dependency>

            <dependency>
                <groupId>io.airlift</groupId>
                <artifactId>testing</artifactId>
                <version>${dep.airlift.version}</version>
            </dependency>

            <dependency>
                <groupId>io.airlift</groupId>
                <artifactId>node</artifactId>
                <version>${dep.airlift.version}</version>
            </dependency>

            <dependency>
                <groupId>io.airlift</groupId>
                <artifactId>bootstrap</artifactId>
                <version>${dep.airlift.version}</version>
            </dependency>

            <dependency>
                <groupId>io.airlift</groupId>
                <artifactId>event</artifactId>
                <version>${dep.airlift.version}</version>
            </dependency>

            <dependency>
                <groupId>io.airlift</groupId>
                <artifactId>http-server</artifactId>
                <version>${dep.airlift.version}</version>
            </dependency>

            <dependency>
                <groupId>io.airlift</groupId>
                <artifactId>jaxrs</artifactId>
                <version>${dep.airlift.version}</version>
            </dependency>

            <dependency>
                <groupId>io.airlift</groupId>
                <artifactId>jmx</artifactId>
                <version>${dep.airlift.version}</version>
            </dependency>

            <dependency>
                <groupId>io.airlift</groupId>
                <artifactId>trace-token</artifactId>
                <version>${dep.airlift.version}</version>
            </dependency>

            <dependency>
                <groupId>io.airlift</groupId>
                <artifactId>dbpool</artifactId>
                <version>${dep.airlift.version}</version>
            </dependency>

            <dependency>
                <groupId>io.airlift</groupId>
                <artifactId>jmx-http</artifactId>
                <version>${dep.airlift.version}</version>
            </dependency>

            <dependency>
                <groupId>io.airlift</groupId>
                <artifactId>http-client</artifactId>
                <version>${dep.airlift.version}</version>
            </dependency>

            <dependency>
                <groupId>io.airlift</groupId>
                <artifactId>stats</artifactId>
                <version>${dep.airlift.version}</version>
            </dependency>

            <dependency>
                <groupId>io.airlift.tpch</groupId>
                <artifactId>tpch</artifactId>
                <version>0.2</version>
            </dependency>

            <dependency>
                <groupId>org.ow2.asm</groupId>
                <artifactId>asm-all</artifactId>
                <version>4.1</version>
            </dependency>

            <dependency>
                <groupId>com.h2database</groupId>
                <artifactId>h2</artifactId>
                <version>1.3.170</version>
            </dependency>

            <dependency>
                <groupId>org.sonatype.aether</groupId>
                <artifactId>aether-api</artifactId>
                <version>1.13.1</version>
            </dependency>

            <dependency>
                <groupId>io.airlift.resolver</groupId>
                <artifactId>resolver</artifactId>
                <version>1.1</version>
            </dependency>

            <dependency>
                <groupId>io.airlift</groupId>
                <artifactId>airline</artifactId>
                <version>0.6</version>
            </dependency>

            <dependency>
                <groupId>io.airlift</groupId>
                <artifactId>floatingdecimal</artifactId>
                <version>0.1</version>
            </dependency>

            <dependency>
                <groupId>org.openjdk.jol</groupId>
                <artifactId>jol-core</artifactId>
                <version>0.1</version>
            </dependency>

            <dependency>
                <groupId>com.intellij</groupId>
                <artifactId>annotations</artifactId>
                <version>9.0.4</version>
            </dependency>

            <dependency>
                <groupId>it.unimi.dsi</groupId>
                <artifactId>fastutil</artifactId>
                <version>6.5.9</version>
            </dependency>

            <dependency>
                <groupId>org.jruby.joni</groupId>
                <artifactId>joni</artifactId>
                <version>2.0.0</version>
            </dependency>

            <dependency>
                <groupId>com.facebook.thirdparty</groupId>
                <artifactId>libsvm</artifactId>
                <version>3.18.1</version>
            </dependency>

            <dependency>
                <groupId>mysql</groupId>
                <artifactId>mysql-connector-java</artifactId>
                <version>5.1.25</version>
            </dependency>

            <dependency>
                <groupId>org.jruby.jcodings</groupId>
                <artifactId>jcodings</artifactId>
                <version>1.0.8</version>
            </dependency>

            <dependency>
                <groupId>org.antlr</groupId>
                <artifactId>antlr-runtime</artifactId>
                <version>${dep.antlr.version}</version>
                <exclusions>
                    <exclusion>
                        <groupId>antlr</groupId>
                        <artifactId>antlr</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>

            <dependency>
                <groupId>jline</groupId>
                <artifactId>jline</artifactId>
                <version>2.10</version>
            </dependency>

            <dependency>
                <groupId>org.jdbi</groupId>
                <artifactId>jdbi</artifactId>
                <version>2.43</version>
            </dependency>

            <dependency>
                <groupId>org.iq80.snappy</groupId>
                <artifactId>snappy</artifactId>
                <version>0.3</version>
            </dependency>

            <dependency>
                <groupId>org.apache.thrift</groupId>
                <artifactId>libthrift</artifactId>
                <version>0.9.0</version>
                <exclusions>
                    <exclusion>
                        <groupId>commons-logging</groupId>
                        <artifactId>commons-logging</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>

            <dependency>
                <groupId>net.sf.opencsv</groupId>
                <artifactId>opencsv</artifactId>
                <version>2.3</version>
            </dependency>

            <dependency>
                <groupId>org.apache.commons</groupId>
                <artifactId>commons-math3</artifactId>
                <version>3.2</version>
            </dependency>

            <dependency>
                <groupId>commons-lang</groupId>
                <artifactId>commons-lang</artifactId>
                <version>2.6</version>
            </dependency>

            <dependency>
                <groupId>org.apache.commons</groupId>
                <artifactId>commons-lang3</artifactId>
                <version>3.1</version>
            </dependency>

            <dependency>
                <groupId>commons-codec</groupId>
                <artifactId>commons-codec</artifactId>
                <version>1.7</version>
            </dependency>

            <dependency>
                <groupId>io.netty</groupId>
                <artifactId>netty</artifactId>
                <version>3.7.0.Final</version>
            </dependency>

            <dependency>
                <groupId>io.airlift.discovery</groupId>
                <artifactId>discovery-server</artifactId>
                <version>1.19</version>
            </dependency>

            <dependency>
                <groupId>com.amazonaws</groupId>
                <artifactId>aws-java-sdk</artifactId>
                <version>1.7.1</version>
                <exclusions>
                    <exclusion>
                        <groupId>commons-logging</groupId>
                        <artifactId>commons-logging</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>joda-time</groupId>
                        <artifactId>joda-time</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <configuration combine.children="append">
                        <argLine>-Duser.timezone=${test.timezone} -Xmx2g -Xms2g -XX:MaxPermSize=512m</argLine>
                        <parallel>methods</parallel>
                        <threadCount>4</threadCount>
                        <perCoreThreadCount>true</perCoreThreadCount>
                        <systemPropertyVariables>
                            <file.encoding>${project.build.sourceEncoding}</file.encoding>
                            <sun.jnu.encoding>${project.build.sourceEncoding}</sun.jnu.encoding>
                            <user.timezone>${test.timezone}</user.timezone>
                            <java.awt.headless>true</java.awt.headless>
                            <java.util.logging.SimpleFormatter.format>%1$tY-%1$tm-%1$td %1$tH:%1$tM:%1$tS %4$s %5$s%6$s%n</java.util.logging.SimpleFormatter.format>
                        </systemPropertyVariables>
                    </configuration>
                </plugin>

                <plugin>
                    <groupId>org.antlr</groupId>
                    <artifactId>antlr3-maven-plugin</artifactId>
                    <version>${dep.antlr.version}</version>
                    <executions>
                        <execution>
                            <goals>
                                <goal>antlr</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-shade-plugin</artifactId>
                    <version>2.2</version>
                </plugin>

                <plugin>
                    <groupId>org.skife.maven</groupId>
                    <artifactId>really-executable-jar-maven-plugin</artifactId>
                    <version>1.0.5</version>
                </plugin>

                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>exec-maven-plugin</artifactId>
                    <version>1.2.1</version>
                </plugin>

                <plugin>
                    <groupId>org.tomdz.maven</groupId>
                    <artifactId>sphinx-maven-plugin</artifactId>
                    <version>1.0.3</version>
                </plugin>

                <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
                <plugin>
                    <!--suppress MavenModelInspection -->
                    <groupId>org.eclipse.m2e</groupId>
                    <!--suppress MavenModelInspection -->
                    <artifactId>lifecycle-mapping</artifactId>
                    <!--suppress MavenModelInspection -->
                    <version>1.0.0</version>
                    <configuration>
                        <lifecycleMappingMetadata>
                            <pluginExecutions>
                                <pluginExecution>
                                    <pluginExecutionFilter>
                                        <groupId>org.apache.maven.plugins</groupId>
                                        <artifactId>maven-dependency-plugin</artifactId>
                                        <versionRange>[2.5.1,)</versionRange>
                                        <goals>
                                            <goal>copy</goal>
                                            <goal>analyze-dep-mgt</goal>
                                            <goal>analyze-duplicate</goal>
                                            <goal>analyze-only</goal>
                                        </goals>
                                    </pluginExecutionFilter>
                                    <action>
                                        <ignore />
                                    </action>
                                </pluginExecution>
                                <pluginExecution>
                                    <pluginExecutionFilter>
                                        <groupId>org.jacoco</groupId>
                                        <artifactId>jacoco-maven-plugin</artifactId>
                                        <versionRange>[0.6.2.201302030002,)</versionRange>
                                        <goals>
                                            <goal>prepare-agent</goal>
                                        </goals>
                                    </pluginExecutionFilter>
                                    <action>
                                        <ignore />
                                    </action>
                                </pluginExecution>
                                <pluginExecution>
                                    <pluginExecutionFilter>
                                        <groupId>com.mycila</groupId>
                                        <artifactId>license-maven-plugin</artifactId>
                                        <versionRange>[2.3,)</versionRange>
                                        <goals>
                                            <goal>check</goal>
                                        </goals>
                                    </pluginExecutionFilter>
                                    <action>
                                        <ignore />
                                    </action>
                                </pluginExecution>
                                <pluginExecution>
                                    <pluginExecutionFilter>
                                        <groupId>com.ning.maven.plugins</groupId>
                                        <artifactId>maven-duplicate-finder-plugin</artifactId>
                                        <versionRange>[1.0.4,)</versionRange>
                                        <goals>
                                            <goal>check</goal>
                                        </goals>
                                    </pluginExecutionFilter>
                                    <action>
                                        <ignore />
                                    </action>
                                </pluginExecution>
                            </pluginExecutions>
                        </lifecycleMappingMetadata>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>

        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-checkstyle-plugin</artifactId>
                <version>2.11</version>
                <executions>
                    <execution>
                        <phase>validate</phase>
                        <goals>
                            <goal>check</goal>
                        </goals>
                        <configuration>
                            <skip>${air.check.skip-checkstyle}</skip>
                            <failOnViolation>${air.check.fail-checkstyle}</failOnViolation>
                            <consoleOutput>true</consoleOutput>
                            <includeTestSourceDirectory>true</includeTestSourceDirectory>
                            <configLocation>${air.main.basedir}/src/checkstyle/checks.xml</configLocation>
                            <excludes>**/com/facebook/presto/operator/PagesIndexOrdering.java</excludes>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <!-- run cli for development: mvn -am -pl presto-cli -P cli compile exec:java -->
        <profile>
            <id>cli</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>exec-maven-plugin</artifactId>
                        <configuration>
                            <skip>${cli.skip-execute}</skip>
                            <executable>${java.home}/bin/java</executable>
                            <mainClass>${cli.main-class}</mainClass>
                            <arguments>
                                <argument>--debug</argument>
                            </arguments>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
