<?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>org.mule.extensions</groupId>
        <artifactId>mule-core-modules-parent</artifactId>
        <version>1.10.0-SNAPSHOT</version>
        <relativePath/>
    </parent>

    <groupId>org.mule.modules</groupId>
    <artifactId>mule-kerberos-module</artifactId>
    <version>0.1.0-SNAPSHOT</version>
    <name>Kerberos Authentication Module</name>
    <packaging>mule-extension</packaging>
    <description>A Mule extension for Kerberos authentication and proxy support</description>

    <properties>
        <mule.version>4.10.0-SNAPSHOT</mule.version>
        <muleHttpConnectorVersion>1.11.0-SNAPSHOT</muleHttpConnectorVersion>
        <java.release.version>17</java.release.version>
        
        <!-- Test Dependencies Versions -->
        <junit.jupiter.version>5.9.3</junit.jupiter.version>
        <mockito.version>4.6.1</mockito.version>
    </properties>

    <dependencies>
        <!-- HTTP API  -->
        <dependency>
            <groupId>org.mule.runtime</groupId>
            <artifactId>mule-service-http-api</artifactId>
            <version>${mule.version}</version>
            <scope>provided</scope>
        </dependency>

        <!-- HTTP Connector -->
        <dependency>
            <groupId>org.mule.connectors</groupId>
            <artifactId>mule-http-connector</artifactId>
            <version>${muleHttpConnectorVersion}</version>
            <classifier>mule-plugin</classifier>
        </dependency>

        <!-- Kerberos authentication using Java's built-in JAAS - no external dependencies needed -->

        <!-- Test Dependencies -->
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-engine</artifactId>
            <version>${junit.jupiter.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-api</artifactId>
            <version>${junit.jupiter.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
            <version>${mockito.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-inline</artifactId>
            <version>${mockito.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-junit-jupiter</artifactId>
            <version>${mockito.version}</version>
            <scope>test</scope>
        </dependency>
        <!-- Add missing activation dependency for HTTP extension tests -->
        <dependency>
            <groupId>javax.activation</groupId>
            <artifactId>activation</artifactId>
            <version>1.1.1</version>
            <scope>test</scope>
        </dependency>
        <!-- Exclude conflicting JUnit 4 dependencies -->
        <dependency>
            <groupId>org.mule.tests</groupId>
            <artifactId>mule-tests-unit</artifactId>
            <version>${mule.version}</version>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>junit</groupId>
                    <artifactId>junit</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.junit.platform</groupId>
                    <artifactId>junit-platform-launcher</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.mule.runtime.plugins</groupId>
                <artifactId>mule-extensions-maven-plugin</artifactId>
                <version>1.10.0-SNAPSHOT</version>
                <dependencies>
                    <!-- Force plugin to use the updated http-api -->
                    <dependency>
                        <groupId>org.mule.runtime</groupId>
                        <artifactId>mule-service-http-api</artifactId>
                        <version>${mule.version}</version>
                    </dependency>
                </dependencies>
            </plugin>
            <!-- Configure Surefire to exclude Allure -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <excludedGroups>allure</excludedGroups>
                    <systemPropertyVariables>
                        <junit.platform.launcher.interceptors.enabled>false</junit.platform.launcher.interceptors.enabled>
                    </systemPropertyVariables>
                    <classpathDependencyExcludes>
                        <classpathDependencyExclude>io.qameta.allure:allure-junit-platform</classpathDependencyExclude>
                        <classpathDependencyExclude>io.qameta.allure:allure-java-commons</classpathDependencyExclude>
                        <classpathDependencyExclude>io.qameta.allure:allure-model</classpathDependencyExclude>
                        <classpathDependencyExclude>io.qameta.allure:allure-test-filter</classpathDependencyExclude>
                        <classpathDependencyExclude>org.mule.tests:mule-tests-allure</classpathDependencyExclude>
                    </classpathDependencyExcludes>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>
