<?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/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>org.restlet</groupId>
        <artifactId>org.restlet.parent</artifactId>
        <version>3.0.0-m2</version>
        <relativePath>../pom.xml</relativePath>
    </parent>

    <artifactId>org.restlet</artifactId>
    <name>Restlet Framework - Core</name>
    <description>Restlet API and Engine</description>

    <properties>
        <grpc.version>1.85.1</grpc.version>
        <mcp.version>2.1.0</mcp.version>
        <smithy-java.version>1.8.0</smithy-java.version>
        <!-- Known high-priority SpotBugs findings, to be fixed (see Engine, Resource, ...) -->
        <spotbugs.max.violations>9</spotbugs.max.violations>
        <!-- Native QUIC library for the HTTP/3 tests, overridden per platform by the profiles
             below. On other platforms, the HTTP/3 tests are skipped. -->
        <netty.quic.classifier>linux-x86_64</netty.quic.classifier>
    </properties>

    <dependencies>
        <dependency>
            <groupId>io.netty</groupId>
            <artifactId>netty-codec-http</artifactId>
        </dependency>
        <dependency>
            <groupId>io.netty</groupId>
            <artifactId>netty-codec-http2</artifactId>
        </dependency>
        <dependency>
            <groupId>io.netty</groupId>
            <artifactId>netty-handler</artifactId>
        </dependency>
        <dependency>
            <groupId>io.netty</groupId>
            <artifactId>netty-handler-proxy</artifactId>
        </dependency>
        <!-- Experimental HTTP/3: optional, applications add it (with its native QUIC library for
             their platform) to enable HTTP/3. The native libraries are test dependencies here. -->
        <dependency>
            <groupId>io.netty</groupId>
            <artifactId>netty-codec-http3</artifactId>
            <optional>true</optional>
            <exclusions>
                <exclusion>
                    <groupId>io.netty</groupId>
                    <artifactId>netty-codec-native-quic</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>io.netty</groupId>
            <artifactId>netty-codec-native-quic</artifactId>
            <classifier>${netty.quic.classifier}</classifier>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-api</artifactId>
            <version>${lib-junit-version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-params</artifactId>
            <version>${lib-junit-version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.hamcrest</groupId>
            <artifactId>hamcrest</artifactId>
            <version>${lib-hamcrest-version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>io.grpc</groupId>
            <artifactId>grpc-core</artifactId>
            <version>${grpc.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>io.grpc</groupId>
            <artifactId>grpc-protobuf</artifactId>
            <version>${grpc.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>io.grpc</groupId>
            <artifactId>grpc-stub</artifactId>
            <version>${grpc.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>io.grpc</groupId>
            <artifactId>grpc-netty-shaded</artifactId>
            <version>${grpc.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>io.modelcontextprotocol.sdk</groupId>
            <artifactId>mcp-core</artifactId>
            <version>${mcp.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>io.modelcontextprotocol.sdk</groupId>
            <artifactId>mcp-json-jackson2</artifactId>
            <version>${mcp.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>software.amazon.smithy.java</groupId>
            <artifactId>dynamic-client</artifactId>
            <version>${smithy-java.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>software.amazon.smithy.java</groupId>
            <artifactId>aws-client-restjson</artifactId>
            <version>${smithy-java.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>software.amazon.smithy.java</groupId>
            <artifactId>client-rpcv2-cbor</artifactId>
            <version>${smithy-java.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>software.amazon.smithy.java</groupId>
            <artifactId>server-core</artifactId>
            <version>${smithy-java.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>software.amazon.smithy.java</groupId>
            <artifactId>aws-server-restjson</artifactId>
            <version>${smithy-java.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>software.amazon.smithy.java</groupId>
            <artifactId>server-rpcv2-cbor</artifactId>
            <version>${smithy-java.version}</version>
            <scope>test</scope>
        </dependency>
    </dependencies>
    <build>
        <testResources>
            <testResource>
                <directory>${basedir}/src/test/resources</directory>
                <filtering>true</filtering>
            </testResource>
        </testResources>
        <plugins>
            <plugin>
                <artifactId>maven-surefire-plugin</artifactId>
                <executions>
                    <!-- Java object (de)serialization is disabled by default and the flags are
                         final: most tests need it enabled... -->
                    <execution>
                        <id>default-test</id>
                        <configuration>
                            <excludedGroups>serialization-disabled</excludedGroups>
                            <systemPropertyVariables>
                                <org.restlet.representation.ObjectRepresentation.VARIANT_OBJECT_XML_SUPPORTED>true</org.restlet.representation.ObjectRepresentation.VARIANT_OBJECT_XML_SUPPORTED>
                                <org.restlet.representation.ObjectRepresentation.VARIANT_OBJECT_BINARY_SUPPORTED>true</org.restlet.representation.ObjectRepresentation.VARIANT_OBJECT_BINARY_SUPPORTED>
                            </systemPropertyVariables>
                        </configuration>
                    </execution>
                    <!-- ...and a few need the default configuration, in a fresh JVM. -->
                    <execution>
                        <id>serialization-disabled</id>
                        <phase>test</phase>
                        <goals>
                            <goal>test</goal>
                        </goals>
                        <configuration>
                            <groups>serialization-disabled</groups>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-javadoc-plugin</artifactId>
                <configuration>
                    <excludePackageNames>org.restlet.engine.internal</excludePackageNames>
                    <groups>
                        <group>
                            <title>Restlet API</title>
                            <packages>
                                org.restlet:org.restlet.data*:org.restlet.representation*:org.restlet.resource*:org.restlet.routing*:org.restlet.security*:org.restlet.service*:org.restlet.util*
                            </packages>
                        </group>
                        <group>
                            <title>Restlet Engine</title>
                            <packages>org.restlet.engine*</packages>
                        </group>
                    </groups>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>m2e-test-modules</id>
            <activation>
                <property><name>m2e.version</name></property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-compiler-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>default-testCompile</id>
                                <configuration>
                                    <!-- JDT patches tests into the main module; Maven uses the
                                         classpath and must not receive these module-only flags. -->
                                    <compilerArgs combine.children="append">
                                        <arg>--add-reads</arg>
                                        <arg>org.restlet=java.net.http</arg>
                                    </compilerArgs>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <!-- CI logging: the FINE level of the Restlet loggers goes to target/restlet-fine.log. -->
        <profile>
            <id>ci-logging</id>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>default-test</id>
                                <configuration>
                                    <systemPropertyVariables combine.children="append">
                                        <java.util.logging.config.file>${project.basedir}/src/test/ci-logging.properties</java.util.logging.config.file>
                                    </systemPropertyVariables>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <!-- Native QUIC library of the build platform, used by the experimental HTTP/3 tests. -->
        <profile>
            <id>quic-linux-x86_64</id>
            <activation>
                <os><family>unix</family><name>Linux</name><arch>amd64</arch></os>
            </activation>
            <properties><netty.quic.classifier>linux-x86_64</netty.quic.classifier></properties>
        </profile>
        <profile>
            <id>quic-linux-aarch_64</id>
            <activation>
                <os><family>unix</family><name>Linux</name><arch>aarch64</arch></os>
            </activation>
            <properties><netty.quic.classifier>linux-aarch_64</netty.quic.classifier></properties>
        </profile>
        <profile>
            <id>quic-osx-x86_64</id>
            <activation>
                <os><family>mac</family><arch>x86_64</arch></os>
            </activation>
            <properties><netty.quic.classifier>osx-x86_64</netty.quic.classifier></properties>
        </profile>
        <profile>
            <id>quic-osx-aarch_64</id>
            <activation>
                <os><family>mac</family><arch>aarch64</arch></os>
            </activation>
            <properties><netty.quic.classifier>osx-aarch_64</netty.quic.classifier></properties>
        </profile>
        <profile>
            <id>quic-windows-x86_64</id>
            <activation>
                <os><family>windows</family><arch>amd64</arch></os>
            </activation>
            <properties><netty.quic.classifier>windows-x86_64</netty.quic.classifier></properties>
        </profile>
    </profiles>
</project>
