<?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>395</version>
    </parent>

    <groupId>io.trino</groupId>
    <artifactId>trino-maven-plugin</artifactId>
    <version>22</version>
    <packaging>maven-plugin</packaging>

    <name>Trino Maven Build Extension</name>
    <description>The Trino Maven Plugin provides a packing and lifecycle for Trino plugins</description>
    <url>https://github.com/trinodb/trino-maven-plugin</url>

    <inceptionYear>2013</inceptionYear>

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

    <prerequisites>
        <maven>[3.9.14,)</maven>
    </prerequisites>

    <scm>
        <connection>scm:git:https://github.com/trinodb/trino-maven-plugin.git</connection>
        <developerConnection>scm:git:git@github.com:trinodb/trino-maven-plugin.git</developerConnection>
        <tag>trino-maven-plugin-22</tag>
        <url>https://github.com/trinodb/trino-maven-plugin</url>
    </scm>

    <properties>
        <project.build.targetJdk>25</project.build.targetJdk>
        <air.java.version>25</air.java.version>
        <air.maven.version>3.9.14</air.maven.version>
        <air.javadoc.lint>all,-missing</air.javadoc.lint>
        <!-- keep the historical trino-maven-plugin-NN tag naming instead of airbase's bare version -->
        <air.release.tag-name-format>@{project.artifactId}-@{project.version}</air.release.tag-name-format>

        <!-- the sources carry no license headers yet -->
        <air.check.skip-license>true</air.check.skip-license>
        <!-- airbase's ruleset references /rulesets/java/basic.xml, which PMD 7 dropped -->
        <air.check.skip-pmd>true</air.check.skip-pmd>

        <mavenVersion>3.9.14</mavenVersion>
        <!-- Compile against the maven-resolver shipped by the minimum supported Maven (3.9.14) so we never call an
         API absent from the runtime; the dependency is provided, so the runtime's own copy is used. -->
        <mavenResolverVersion>1.9.27</mavenResolverVersion>
        <mavenPluginPluginVersion>3.15.2</mavenPluginPluginVersion>

        <njord.enabled>true</njord.enabled>
        <njord.autoPublish>false</njord.autoPublish>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.ow2.asm</groupId>
            <artifactId>asm</artifactId>
            <version>${dep.asm.version}</version>
        </dependency>
        <dependency>
            <groupId>javax.inject</groupId>
            <artifactId>javax.inject</artifactId>
            <version>1</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.apache.maven</groupId>
            <artifactId>maven-artifact</artifactId>
            <version>${mavenVersion}</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.apache.maven</groupId>
            <artifactId>maven-core</artifactId>
            <version>${mavenVersion}</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.apache.maven</groupId>
            <artifactId>maven-model</artifactId>
            <version>${mavenVersion}</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.apache.maven</groupId>
            <artifactId>maven-plugin-api</artifactId>
            <version>${mavenVersion}</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.apache.maven.plugin-tools</groupId>
            <artifactId>maven-plugin-annotations</artifactId>
            <version>${mavenPluginPluginVersion}</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.apache.maven.resolver</groupId>
            <artifactId>maven-resolver-api</artifactId>
            <version>${mavenResolverVersion}</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.apache.maven.resolver</groupId>
            <artifactId>maven-resolver-util</artifactId>
            <version>${mavenResolverVersion}</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.codehaus.plexus</groupId>
            <artifactId>plexus-utils</artifactId>
            <version>3.6.0</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>io.takari.maven.plugins</groupId>
            <artifactId>takari-plugin-integration-testing</artifactId>
            <version>3.1.1</version>
            <type>pom</type>
            <scope>test</scope>
        </dependency>

        <!-- for testing -->
        <dependency>
            <groupId>io.takari.maven.plugins</groupId>
            <artifactId>takari-plugin-testing</artifactId>
            <version>3.1.1</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.assertj</groupId>
            <artifactId>assertj-core</artifactId>
            <version>3.27.7</version>
            <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>
    </dependencies>

    <build>
        <resources>
            <resource>
                <directory>src/main/resources</directory>
            </resource>
        </resources>

        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-plugin-plugin</artifactId>
                <version>${mavenPluginPluginVersion}</version>
            </plugin>
            <plugin>
                <groupId>io.takari.maven.plugins</groupId>
                <artifactId>takari-lifecycle-plugin</artifactId>
                <version>2.3.2</version>
                <executions>
                    <execution>
                        <id>testProperties</id>
                        <goals>
                            <goal>testProperties</goal>
                        </goals>
                        <phase>process-test-resources</phase>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.gaul</groupId>
                <artifactId>modernizer-maven-plugin</artifactId>
                <configuration>
                    <exclusions>
                        <!-- Trino's code style mandates the static format() over String.formatted() -->
                        <exclusion>java/lang/String.format:(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;</exclusion>
                    </exclusions>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.eclipse.sisu</groupId>
                <artifactId>sisu-maven-plugin</artifactId>
                <version>1.0.1</version>
                <dependencies>
                    <!-- pin the class scanner to airbase's ASM so it can read current bytecode -->
                    <dependency>
                        <groupId>org.ow2.asm</groupId>
                        <artifactId>asm</artifactId>
                        <version>${dep.asm.version}</version>
                    </dependency>
                </dependencies>
                <executions>
                    <execution>
                        <id>index-project</id>
                        <goals>
                            <goal>main-index</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

</project>
