<?xml version="1.0" encoding="UTF-8"?>
<!--

    Copyright 2016-2024 The OpenZipkin Authors

    Licensed 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>
    <groupId>io.zipkin.reporter2</groupId>
    <artifactId>zipkin-reporter-parent</artifactId>
    <version>2.17.2</version>
  </parent>

  <artifactId>zipkin-sender-libthrift</artifactId>
  <name>Zipkin Sender: libthrift (Scribe)</name>

  <properties>
    <!-- Matches Export-Package in bnd.bnd -->
    <module.name>zipkin2.reporter.libthrift</module.name>

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

  <dependencies>
    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>zipkin-reporter</artifactId>
      <version>${project.version}</version>
    </dependency>

    <dependency>
      <groupId>org.apache.thrift</groupId>
      <artifactId>libthrift</artifactId>
      <!-- Always update this to the highest value that doesn't break signature
           compatability on patch release. Signature compatability breaks are
           common in libthrift and lead to rev-lock. As scribe is a deprecated
           transport in Zipkin, it is ok to update this to a signature breaking
           version on minor, but increment to the next minor in the PR. -->
      <version>0.19.0</version>
    </dependency>

    <dependency>
      <groupId>org.testcontainers</groupId>
      <artifactId>testcontainers</artifactId>
      <version>${testcontainers.version}</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>com.squareup.okhttp3</groupId>
      <artifactId>okhttp</artifactId>
      <version>${okhttp.version}</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <profiles>
    <profile>
      <id>release</id>
      <properties>
        <!-- Libthrift is Java 1.6 bytecode -->
        <maven.compiler.source>1.6</maven.compiler.source>
        <maven.compiler.target>1.6</maven.compiler.target>
        <maven.compiler.release>6</maven.compiler.release>
      </properties>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-enforcer-plugin</artifactId>
            <version>${maven-enforcer-plugin.version}</version>
            <executions>
              <execution>
                <id>enforce-java</id>
                <goals>
                  <goal>enforce</goal>
                </goals>
                <configuration>
                  <rules>
                    <!-- The only LTS JDK we support that can compile 1.6 bytecode is 11.
                         https://www.oracle.com/java/technologies/javase/12-relnote-issues.html -->
                    <requireJavaVersion>
                      <version>[11,12)</version>
                    </requireJavaVersion>
                  </rules>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
