<?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>com.mulesoft.mule.tests</groupId>
        <artifactId>mule-ee-integration-tests</artifactId>
        <version>4.6.7</version>
    </parent>
    <artifactId>mule-tests-integration-kryo</artifactId>
    <packaging>jar</packaging>

    <properties>
        <surefire.args>
            --add-opens=java.base/java.lang=org.mule.test.unit
            --add-opens=java.base/java.lang=kryo.shaded
            --add-opens=org.mule.runtime.api/org.mule.runtime.api.lifecycle=org.mule.test.unit
            --add-exports=com.mulesoft.mule.runtime.kryo/com.mulesoft.mule.runtime.module.serialization.kryo.internal=com.mulesoft.mule.test.integration.kryo
            --add-exports=com.mulesoft.mule.runtime.kryo/com.mulesoft.mule.runtime.module.serialization.kryo.internal.compression=com.mulesoft.mule.test.integration.kryo
            --add-exports=com.mulesoft.mule.runtime.kryo/com.mulesoft.mule.runtime.module.serialization.kryo.internal.protocol=com.mulesoft.mule.test.integration.kryo
            ${surefire.slf4j.module.args}
        </surefire.args>

        <javaModuleName>com.mulesoft.mule.test.integration.kryo</javaModuleName>
        <formatterConfigPath>../formatter.xml</formatterConfigPath>
    </properties>

    <dependencies>
        <!-- Kryo module dependency -->
        <dependency>
            <groupId>com.mulesoft.mule.runtime.modules</groupId>
            <artifactId>mule-module-kryo-serializer-ee</artifactId>
            <scope>provided</scope>
        </dependency>

        <!-- Dependencies containing the objects that we want to serialize -->

        <!-- W-15425364: ResourceOwnerOAuthContextWithRefreshState -->
        <dependency>
            <groupId>org.mule.commons</groupId>
            <artifactId>mule-oauth-client-api</artifactId>
            <scope>provided</scope>
        </dependency>

        <!-- Mule Runtime needed dependencies -->
        <dependency>
            <groupId>com.mulesoft.mule.runtime</groupId>
            <artifactId>mule-core-ee</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.mule.runtime</groupId>
            <artifactId>mule-module-spring-config</artifactId>
            <scope>provided</scope>
        </dependency>

        <!-- Testing framework dependencies -->
        <dependency>
            <groupId>com.mulesoft.mule.tests</groupId>
            <artifactId>mule-tests-allure</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mule.tests</groupId>
            <artifactId>mule-tests-unit</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <executions>
                    <execution>
                        <id>default-testCompile</id>
                        <configuration>
                            <!-- Configure the exports needed in COMPILE time -->
                            <compilerArgs>
                                <arg>--add-exports=com.mulesoft.mule.runtime.kryo/com.mulesoft.mule.runtime.module.serialization.kryo.internal=com.mulesoft.mule.test.integration.kryo</arg>
                                <arg>--add-exports=com.mulesoft.mule.runtime.kryo/com.mulesoft.mule.runtime.module.serialization.kryo.internal.compression=com.mulesoft.mule.test.integration.kryo</arg>
                                <arg>--add-exports=com.mulesoft.mule.runtime.kryo/com.mulesoft.mule.runtime.module.serialization.kryo.internal.protocol=com.mulesoft.mule.test.integration.kryo</arg>
                            </compilerArgs>
                            <testRelease>11</testRelease>
                        </configuration>
                    </execution>
                    <execution>
                        <id>base-testCompile</id>
                        <goals>
                            <goal>testCompile</goal>
                        </goals>
                        <configuration>
                            <testRelease>${javaReleaseVersion}</testRelease>
                            <!-- recompile everything for target VM except the module-info.java -->
                            <testExcludes>
                                <testExclude>module-info.java</testExclude>
                            </testExcludes>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>
