<?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.trino</groupId>
        <artifactId>trino-root</artifactId>
        <version>473</version>
        <relativePath>../../pom.xml</relativePath>
    </parent>

    <artifactId>trino-spi</artifactId>
    <description>Trino - Service Provider Interface (SPI)</description>

    <properties>
        <released-artifacts.dir>${project.build.directory}/released-artifacts</released-artifacts.dir>
        <trino.check.skip-revapi>${air.check.skip-basic}</trino.check.skip-revapi>
    </properties>

    <!-- the SPI should have only minimal dependencies -->
    <dependencies>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-annotations</artifactId>
        </dependency>

        <dependency>
            <groupId>com.google.errorprone</groupId>
            <artifactId>error_prone_annotations</artifactId>
            <optional>true</optional>
        </dependency>

        <dependency>
            <groupId>io.airlift</groupId>
            <artifactId>slice</artifactId>
        </dependency>

        <dependency>
            <groupId>io.opentelemetry</groupId>
            <artifactId>opentelemetry-api</artifactId>
        </dependency>

        <dependency>
            <groupId>jakarta.annotation</groupId>
            <artifactId>jakarta.annotation-api</artifactId>
            <optional>true</optional>
        </dependency>

        <dependency>
            <groupId>io.opentelemetry</groupId>
            <artifactId>opentelemetry-api-incubator</artifactId>
            <scope>runtime</scope>
        </dependency>

        <dependency>
            <groupId>io.opentelemetry</groupId>
            <artifactId>opentelemetry-context</artifactId>
            <scope>runtime</scope>
        </dependency>

        <dependency>
            <groupId>org.openjdk.jol</groupId>
            <artifactId>jol-core</artifactId>
            <scope>runtime</scope>
        </dependency>

        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-core</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>com.google.inject</groupId>
            <artifactId>guice</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>io.airlift</groupId>
            <artifactId>json</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>io.airlift</groupId>
            <artifactId>junit-extensions</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>io.airlift</groupId>
            <artifactId>testing</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>io.trino</groupId>
            <artifactId>trino-testing-services</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>it.unimi.dsi</groupId>
            <artifactId>fastutil</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.assertj</groupId>
            <artifactId>assertj-core</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-api</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-engine</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.openjdk.jmh</groupId>
            <artifactId>jmh-core</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.openjdk.jmh</groupId>
            <artifactId>jmh-generator-annprocess</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <resources>
            <resource>
                <filtering>true</filtering>
                <directory>src/main/resources</directory>
                <includes>
                    <include>io/trino/spi/trino-spi-version.txt</include>
                </includes>
            </resource>

            <resource>
                <filtering>false</filtering>
                <directory>src/main/resources</directory>
                <excludes>
                    <exclude>io/trino/spi/trino-spi-version.txt</exclude>
                </excludes>
            </resource>
        </resources>

        <plugins>
            <plugin>
                <groupId>org.revapi</groupId>
                <artifactId>revapi-maven-plugin</artifactId>
                <version>0.15.0</version>
                <configuration>
                    <skip>${trino.check.skip-revapi}</skip>
                    <ignoreSuggestionsFormat>xml</ignoreSuggestionsFormat>
                    <analysisConfiguration>
                        <revapi.filter>
                            <elements>
                                <exclude>
                                    <item>
                                        <matcher>java</matcher>
                                        <match>@io.trino.spi.Experimental(*) ^*;</match>
                                    </item>
                                </exclude>
                            </elements>
                        </revapi.filter>
                        <revapi.differences>
                            <ignore>true</ignore>
                            <differences>
                                <!-- Allow adding new annotations (such as @Nullable) -->
                                <item>
                                    <code>java.annotation.added</code>
                                </item>
                                <!-- Allow changing enum constant order (e.g., StandardErrorCode) -->
                                <item>
                                    <code>java.field.enumConstantOrderChanged</code>
                                </item>
                                <!-- Allow arbitrary changes to unstable APIs -->
                                <item>
                                    <regex>true</regex>
                                    <code>java.method.numberOfParametersChanged</code>
                                    <old>
                                        <matcher>java</matcher>
                                        <match>@io.trino.spi.Unstable *;</match>
                                    </old>
                                </item>
                                <!-- Allow removing things that were previously deprecated -->
                                <item>
                                    <regex>true</regex>
                                    <code>java\.(class|method|field)\.removed</code>
                                    <old>
                                        <matcher>java</matcher>
                                        <match>@java.lang.Deprecated(*) ^*;</match>
                                    </old>
                                </item>
                                <!-- Backwards incompatible changes since the previous release -->
                                <!-- Any exclusions below can be deleted after each release -->
                                <item>
                                    <ignore>true</ignore>
                                    <code>java.method.removed</code>
                                    <old>method java.lang.String io.trino.spi.block.ArrayBlock::getEncodingName()</old>
                                    <justification>Removal of bidrectional coupling of Blocks and BlockEncodings</justification>
                                </item>
                                <item>
                                    <ignore>true</ignore>
                                    <code>java.method.removed</code>
                                    <old>method java.lang.String io.trino.spi.block.Block::getEncodingName()</old>
                                    <justification>Removal of bidrectional coupling of Blocks and BlockEncodings</justification>
                                </item>
                                <item>
                                    <ignore>true</ignore>
                                    <code>java.method.addedToInterface</code>
                                    <new>method java.lang.Class&lt;? extends io.trino.spi.block.Block&gt; io.trino.spi.block.BlockEncoding::getBlockClass()</new>
                                    <justification>Removal of bidrectional coupling of Blocks and BlockEncodings</justification>
                                </item>
                                <item>
                                    <ignore>true</ignore>
                                    <code>java.method.removed</code>
                                    <old>method java.lang.String io.trino.spi.block.ByteArrayBlock::getEncodingName()</old>
                                    <justification>Removal of bidrectional coupling of Blocks and BlockEncodings</justification>
                                </item>
                                <item>
                                    <ignore>true</ignore>
                                    <code>java.method.removed</code>
                                    <old>method java.lang.String io.trino.spi.block.DictionaryBlock::getEncodingName()</old>
                                    <justification>Removal of bidrectional coupling of Blocks and BlockEncodings</justification>
                                </item>
                                <item>
                                    <ignore>true</ignore>
                                    <code>java.method.removed</code>
                                    <old>method java.lang.String io.trino.spi.block.Fixed12Block::getEncodingName()</old>
                                    <justification>Removal of bidrectional coupling of Blocks and BlockEncodings</justification>
                                </item>
                                <item>
                                    <ignore>true</ignore>
                                    <code>java.method.removed</code>
                                    <old>method java.lang.String io.trino.spi.block.Int128ArrayBlock::getEncodingName()</old>
                                    <justification>Removal of bidrectional coupling of Blocks and BlockEncodings</justification>
                                </item>
                                <item>
                                    <ignore>true</ignore>
                                    <code>java.method.removed</code>
                                    <old>method java.lang.String io.trino.spi.block.IntArrayBlock::getEncodingName()</old>
                                    <justification>Removal of bidrectional coupling of Blocks and BlockEncodings</justification>
                                </item>
                                <item>
                                    <ignore>true</ignore>
                                    <code>java.method.removed</code>
                                    <old>method java.lang.String io.trino.spi.block.LazyBlock::getEncodingName()</old>
                                    <justification>Removal of bidrectional coupling of Blocks and BlockEncodings</justification>
                                </item>
                                <item>
                                    <ignore>true</ignore>
                                    <code>java.method.removed</code>
                                    <old>method java.lang.String io.trino.spi.block.LongArrayBlock::getEncodingName()</old>
                                    <justification>Removal of bidrectional coupling of Blocks and BlockEncodings</justification>
                                </item>
                                <item>
                                    <ignore>true</ignore>
                                    <code>java.method.removed</code>
                                    <old>method java.lang.String io.trino.spi.block.MapBlock::getEncodingName()</old>
                                    <justification>Removal of bidrectional coupling of Blocks and BlockEncodings</justification>
                                </item>
                                <item>
                                    <ignore>true</ignore>
                                    <code>java.method.removed</code>
                                    <old>method java.lang.String io.trino.spi.block.RowBlock::getEncodingName()</old>
                                    <justification>Removal of bidrectional coupling of Blocks and BlockEncodings</justification>
                                </item>
                                <item>
                                    <ignore>true</ignore>
                                    <code>java.method.removed</code>
                                    <old>method java.lang.String io.trino.spi.block.RunLengthEncodedBlock::getEncodingName()</old>
                                    <justification>Removal of bidrectional coupling of Blocks and BlockEncodings</justification>
                                </item>
                                <item>
                                    <ignore>true</ignore>
                                    <code>java.method.removed</code>
                                    <old>method java.lang.String io.trino.spi.block.ShortArrayBlock::getEncodingName()</old>
                                    <justification>Removal of bidrectional coupling of Blocks and BlockEncodings</justification>
                                </item>
                                <item>
                                    <ignore>true</ignore>
                                    <code>java.method.removed</code>
                                    <old>method java.lang.String io.trino.spi.block.VariableWidthBlock::getEncodingName()</old>
                                    <justification>Removal of bidrectional coupling of Blocks and BlockEncodings</justification>
                                </item>
                                <item>
                                    <ignore>true</ignore>
                                    <code>java.method.removed</code>
                                    <old>method long io.trino.spi.connector.Connector::getInitialMemoryRequirement()</old>
                                    <justification>Remove unused connector method</justification>
                                </item>
                                <item>
                                    <ignore>true</ignore>
                                    <code>java.method.addedToInterface</code>
                                    <new>method int io.trino.spi.type.Type::getFlatVariableWidthLength(byte[], int)</new>
                                    <justification>New interface method required for new flat variable width data layouts</justification>
                                </item>
                                <item>
                                    <ignore>true</ignore>
                                    <code>java.method.removed</code>
                                    <old>method int io.trino.spi.type.Type::relocateFlatVariableWidthOffsets(byte[], int, byte[], int)</old>
                                    <justification>Remove flat offsets relocation method since offsets are no longer stored in flat representations</justification>
                                </item>
                                <item>
                                    <ignore>true</ignore>
                                    <code>java.method.removed</code>
                                    <old>method int io.trino.spi.type.AbstractVariableWidthType::relocateFlatVariableWidthOffsets(byte[], int, byte[], int)</old>
                                    <justification>Remove flat offsets relocation method since offsets are no longer stored in flat representations</justification>
                                </item>
                                <item>
                                    <ignore>true</ignore>
                                    <code>java.method.removed</code>
                                    <old>method int io.trino.spi.type.ArrayType::relocateFlatVariableWidthOffsets(byte[], int, byte[], int)</old>
                                    <justification>Remove flat offsets relocation method since offsets are no longer stored in flat representations</justification>
                                </item>
                                <item>
                                    <ignore>true</ignore>
                                    <code>java.method.removed</code>
                                    <old>method int io.trino.spi.type.FixedWidthType::relocateFlatVariableWidthOffsets(byte[], int, byte[], int)</old>
                                    <justification>Remove flat offsets relocation method since offsets are no longer stored in flat representations</justification>
                                </item>
                                <item>
                                    <ignore>true</ignore>
                                    <code>java.method.removed</code>
                                    <old>method int io.trino.spi.type.MapType::relocateFlatVariableWidthOffsets(byte[], int, byte[], int)</old>
                                    <justification>Remove flat offsets relocation method since offsets are no longer stored in flat representations</justification>
                                </item>
                                <item>
                                    <ignore>true</ignore>
                                    <code>java.method.removed</code>
                                    <old>method int io.trino.spi.type.RowType::relocateFlatVariableWidthOffsets(byte[], int, byte[], int)</old>
                                    <justification>Remove flat offsets relocation method since offsets are no longer stored in flat representations</justification>
                                </item>
                            </differences>
                        </revapi.differences>
                    </analysisConfiguration>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>org.revapi</groupId>
                        <artifactId>revapi-java</artifactId>
                        <version>0.28.1</version>
                    </dependency>
                </dependencies>
                <executions>
                    <execution>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>
