<?xml version="1.0"?>
<!-- Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -->
<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>
  <parent>
    <groupId>com.yahoo.vespa</groupId>
    <artifactId>parent</artifactId>
    <version>8.190.2</version>
    <relativePath>../parent/pom.xml</relativePath>
  </parent>
  <artifactId>vespa-feed-client</artifactId>
  <packaging>jar</packaging>
  <version>8.190.2</version>

  <dependencies>
    <!-- compile scope -->
    <dependency>
      <groupId>com.yahoo.vespa</groupId>
      <artifactId>annotations</artifactId>
      <version>${project.version}</version>
    </dependency>
    <dependency>
      <groupId>org.bouncycastle</groupId>
      <artifactId>bcpkix-jdk18on</artifactId>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.httpcomponents.client5</groupId>
      <artifactId>httpclient5</artifactId>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>com.fasterxml.jackson.core</groupId>
      <artifactId>jackson-core</artifactId>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>com.yahoo.vespa</groupId>
      <artifactId>vespa-feed-client-api</artifactId>
      <version>${project.version}</version>
    </dependency>

    <!-- test scope -->
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.github.tomakehurst</groupId>
      <artifactId>wiremock-jre8-standalone</artifactId>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <executions>
          <execution>
            <id>compile-java-${vespaClients.jdk.releaseVersion}</id>
            <goals>
              <goal>compile</goal>
            </goals>
            <configuration>
              <compilerArgs> <!-- Remove (to use default) when not compiling for 8 -->
                <arg>-Xlint:all</arg>
                <arg>-Xlint:-rawtypes</arg>
                <arg>-Xlint:-unchecked</arg>
                <arg>-Xlint:-serial</arg>
              </compilerArgs>
              <release>${vespaClients.jdk.releaseVersion}</release>
              <showDeprecation>true</showDeprecation>
            </configuration>
          </execution>
          <execution>
            <id>compile-java-9</id>
            <phase>compile</phase>
            <goals>
              <goal>compile</goal>
            </goals>
            <configuration>
              <release>9</release>
              <compileSourceRoots>
                <compileSourceRoot>${project.basedir}/src/main/java9</compileSourceRoot>
              </compileSourceRoots>
              <outputDirectory>${project.build.outputDirectory}/META-INF/versions/9</outputDirectory>
              <showDeprecation>true</showDeprecation>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>exec-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>generate-simplified-vtag</id>
            <phase>generate-sources</phase>
            <goals>
              <goal>exec</goal>
            </goals>
            <configuration>
              <executable>src/main/sh/vespa-version-generator.sh</executable>
              <arguments>
                <argument>${project.basedir}/../dist/vtag.map</argument>
                <argument>${project.build.directory}/generated-sources/vespa-version/ai/vespa/feed/client/impl/Vespa.java</argument>
              </arguments>
              <sourceRoot>${project.build.directory}/generated-sources/vespa-version</sourceRoot>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
</project>
