<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.runtime.modules</groupId>
        <artifactId>mule-modules</artifactId>
        <version>4.7.2</version>
    </parent>
    <artifactId>mule-module-plugin-ee</artifactId>
    <packaging>jar</packaging>
    <name>Mule Plugin Module</name>
    <description>Support for Mule Plugins</description>

    <properties>
        <!-- TODO W-13151134 remove this config -->
        <!-- core ext models are test dependencies so they are not in the module-path, open its required packages -->
        <surefire.args>
            -XX:+IgnoreUnrecognizedVMOptions
            --add-opens=org.mule.runtime.api/org.mule.runtime.internal.config.custom=ALL-UNNAMED
            --add-opens=org.mule.runtime.api/org.mule.runtime.internal.dsl=ALL-UNNAMED
            --add-opens=org.mule.runtime.api/org.mule.runtime.internal.util.collection=ALL-UNNAMED
            --add-exports=org.mule.runtime.core/org.mule.runtime.core.internal.config=com.mulesoft.mule.runtime.plugin
            --add-exports=org.mule.runtime.artifact/org.mule.runtime.module.artifact.internal.util=ALL-UNNAMED
            --add-exports=org.mule.runtime.deployment/org.mule.runtime.module.deployment.internal=ALL-UNNAMED
            --add-exports=org.mule.runtime.deployment/org.mule.runtime.module.deployment.internal.processor=ALL-UNNAMED
            --add-exports=org.mule.runtime.deployment.model.impl/org.mule.runtime.module.deployment.impl.internal=ALL-UNNAMED
            --add-exports=org.mule.runtime.deployment.model.impl/org.mule.runtime.module.deployment.impl.internal.maven=ALL-UNNAMED
            --add-exports=org.mule.runtime.launcher/org.mule.runtime.module.launcher.coreextension=ALL-UNNAMED
            --add-exports=org.mule.runtime.log4j/org.mule.runtime.module.log4j.internal=ALL-UNNAMED
            --add-exports=org.mule.runtime.memory.management/org.mule.runtime.internal.memory.management=ALL-UNNAMED
            --add-exports=org.mule.runtime.repository/org.mule.runtime.module.repository.internal=ALL-UNNAMED
            --add-exports=org.mule.runtime.tooling.support/org.mule.runtime.module.tooling.internal=ALL-UNNAMED
            --add-exports=com.mulesoft.mule.runtime.plugin/com.mulesoft.mule.runtime.plugin.integration=org.mule.runtime.core
            ${surefire.args.base}
        </surefire.args>
        
        <javaModuleName>com.mulesoft.mule.runtime.plugin</javaModuleName>
        <skipExportTests>false</skipExportTests>
        <formatterConfigPath>../../formatter.xml</formatterConfigPath>
    </properties>

    <dependencies>
        <dependency>
            <groupId>com.mulesoft.mule.runtime</groupId>
            <artifactId>mule-core-ee</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>org.mule.runtime</groupId>
            <artifactId>mule-module-launcher</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>org.mule.runtime.boot</groupId>
            <artifactId>mule-module-boot-api</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>org.mule.runtime</groupId>
            <artifactId>mule-module-deployment</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-beans</artifactId>
        </dependency>
        <dependency>
            <groupId>org.mule.runtime</groupId>
            <artifactId>mule-profiling-api</artifactId>
        </dependency>
        <dependency>
            <groupId>jakarta.inject</groupId>
            <artifactId>jakarta.inject-api</artifactId>
        </dependency>

        <dependency>
            <groupId>org.mule.tests</groupId>
            <artifactId>mule-tests-functional</artifactId>
            <version>${project.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mule.tests</groupId>
            <artifactId>mule-tests-infrastructure</artifactId>
            <version>${project.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mule.runtime</groupId>
            <artifactId>mule-module-deployment-model-impl</artifactId>
            <version>${project.version}</version>
            <type>test-jar</type>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>*</groupId>
                    <artifactId>*</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>com.mulesoft.mule.tests</groupId>
            <artifactId>mule-tests-allure</artifactId>
            <version>${project.version}</version>
            <scope>test</scope>
        </dependency>
    </dependencies>
    
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <!-- TODO W-13151134 remove this config -->
                    <!-- since modules do not export the mule-module.properties file in their module-info.java, the container classloader does not export any packages for those modularized modules -->
                    <useModulePath>false</useModulePath>

                    <systemPropertyVariables>
                        <xmlApisLib>${xml-apis:xml-apis:jar}</xmlApisLib>
                        <apiAnnotationsLib>${org.mule.runtime:api-annotations:jar}</apiAnnotationsLib>
                    </systemPropertyVariables>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>
