<?xml version="1.0"?>
<!--

    Licensed to the Apache Software Foundation (ASF) under one
    or more contributor license agreements.  See the NOTICE file
    distributed with this work for additional information
    regarding copyright ownership.  The ASF licenses this file
    to you 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="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>
    <artifactId>pinot</artifactId>
    <groupId>org.apache.pinot</groupId>
    <version>1.3.0</version>
  </parent>
  <artifactId>pinot-spi</artifactId>
  <name>Pinot Service Provider Interface</name>
  <url>https://pinot.apache.org/</url>
  <properties>
    <pinot.root>${basedir}/..</pinot.root>
  </properties>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
        <executions>
          <execution>
            <id>copy-pinot-plugins</id>
            <!-- The org.apache.pinot.spi.plugin.ClassLoaderTest has tests that requires plugin jars.
                 These jars could have been added to src/test/resources/plugins, but that would increase the size of
                 source repository a lot. Instead, let Maven download these jars and put them at the expected location.

                 DO NOT replace its versions with ${project.version}, as the ClassLoaderTest depends on the existence
                 and non-existence of classes in these jars.
            -->
            <phase>generate-test-resources</phase>
            <goals>
              <goal>copy</goal>
            </goals>
            <configuration>
              <artifactItems>
                <artifactItem>
                  <groupId>org.apache.pinot</groupId>
                  <artifactId>pinot-dropwizard</artifactId>
                  <version>0.10.0</version> <!-- @dependabot ignore -->
                  <classifier>shaded</classifier>
                  <outputDirectory>${project.build.testOutputDirectory}/plugins/pinot-dropwizard</outputDirectory>
                </artifactItem>
                <artifactItem>
                  <groupId>org.apache.pinot</groupId>
                  <artifactId>pinot-yammer</artifactId>
                  <version>0.10.0</version> <!-- @dependabot ignore -->
                  <classifier>shaded</classifier>
                  <outputDirectory>${project.build.testOutputDirectory}/plugins/pinot-yammer</outputDirectory>
                </artifactItem>
                <artifactItem>
                  <groupId>org.apache.pinot</groupId>
                  <artifactId>pinot-yammer</artifactId>
                  <version>0.10.0</version> <!-- @dependabot ignore -->
                  <classifier>shaded</classifier>
                  <outputDirectory>${project.build.testOutputDirectory}/plugins/pinot-shaded-yammer</outputDirectory>
                </artifactItem>
                <artifactItem>
                  <groupId>commons-io</groupId>
                  <artifactId>commons-io</artifactId>
                  <version>2.11.0</version> <!-- @dependabot ignore -->
                  <outputDirectory>${project.build.testOutputDirectory}/plugins/assemblybased-pinot-plugin</outputDirectory>
                </artifactItem>
                <artifactItem>
                  <groupId>com.yammer.metrics</groupId>
                  <artifactId>metrics-core</artifactId>
                  <version>2.1.5</version> <!-- @dependabot ignore -->
                  <outputDirectory>${project.build.testOutputDirectory}/plugins/assemblybased-pinot-plugin</outputDirectory>
                </artifactItem>
              </artifactItems>
            </configuration>
          </execution>
          <execution>
            <id>unpack-pinot-plugins</id>
            <!-- The org.apache.pinot.spi.plugin.ClassLoaderTest has tests that requires plugin jars.
                 These jars could have been added to src/test/resources/plugins, but that would increase the size of
                 source repository a lot. Instead, let Maven download these jars and put them at the expected location.

                 DO NOT replace its versions with ${project.version}, as the ClassLoaderTest depends on the existence
                 and non-existence of classes in these jars.
            -->
            <phase>generate-test-resources</phase>
            <goals>
              <goal>unpack</goal>
            </goals>
            <configuration>
              <artifactItems>
                <artifactItem>
                  <groupId>org.apache.pinot</groupId>
                  <artifactId>pinot-yammer</artifactId>
                  <version>0.10.0</version> <!-- @dependabot ignore -->
                  <outputDirectory>${project.build.testOutputDirectory}/plugins/assemblybased-pinot-plugin/classes</outputDirectory>
                </artifactItem>
              </artifactItems>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
          <forkCount>1</forkCount>
          <reuseForks>true</reuseForks>
        </configuration>
      </plugin>
    </plugins>
  </build>

  <dependencies>
    <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-lang3</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-collections4</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-math3</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-configuration2</artifactId>
    </dependency>
    <!-- commons-beanutils is required by commons-configuration2 -->
    <dependency>
      <groupId>commons-beanutils</groupId>
      <artifactId>commons-beanutils</artifactId>
    </dependency>
    <dependency>
      <groupId>commons-io</groupId>
      <artifactId>commons-io</artifactId>
    </dependency>
    <dependency>
      <groupId>commons-codec</groupId>
      <artifactId>commons-codec</artifactId>
    </dependency>

    <dependency>
      <groupId>org.codehaus.plexus</groupId>
      <artifactId>plexus-classworlds</artifactId>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>jcl-over-slf4j</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.logging.log4j</groupId>
      <artifactId>log4j-core</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.logging.log4j</groupId>
      <artifactId>log4j-slf4j2-impl</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.logging.log4j</groupId>
      <artifactId>log4j-1.2-api</artifactId>
    </dependency>
    <dependency>
      <groupId>com.lmax</groupId>
      <artifactId>disruptor</artifactId>
    </dependency>

    <dependency>
      <groupId>com.google.guava</groupId>
      <artifactId>guava</artifactId>
    </dependency>
    <dependency>
      <groupId>com.fasterxml.jackson.core</groupId>
      <artifactId>jackson-databind</artifactId>
    </dependency>
    <dependency>
      <groupId>org.reflections</groupId>
      <artifactId>reflections</artifactId>
    </dependency>
    <dependency>
      <groupId>joda-time</groupId>
      <artifactId>joda-time</artifactId>
    </dependency>
    <dependency>
      <groupId>org.yaml</groupId>
      <artifactId>snakeyaml</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.avro</groupId>
      <artifactId>avro</artifactId>
    </dependency>
    <dependency>
      <groupId>org.codehaus.groovy</groupId>
      <artifactId>groovy-all</artifactId>
    </dependency>

    <dependency>
      <groupId>org.testng</groupId>
      <artifactId>testng</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>nl.jqno.equalsverifier</groupId>
      <artifactId>equalsverifier</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-core</artifactId>
      <scope>test</scope>
    </dependency>
  </dependencies>
  <profiles>
    <profile>
      <id>build-shaded-jar</id>
      <activation>
        <activeByDefault>false</activeByDefault>
      </activation>
      <properties>
        <shade.phase.prop>package</shade.phase.prop>
      </properties>
    </profile>
    <profile>
      <id>pinot-fastdev</id>
      <properties>
        <shade.phase.prop>none</shade.phase.prop>
      </properties>
    </profile>
  </profiles>
</project>
