<?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">
    <parent>
        <groupId>org.mule.runtime</groupId>
        <artifactId>mule-artifact-ast-parent</artifactId>
        <version>1.5.15</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>

    <properties>
        <javaModuleName>org.mule.runtime.artifact.ast.serialization</javaModuleName>
        <muleTestUnitVersion>4.7.0-rc1</muleTestUnitVersion>
        <commonsBeanUtilsVersion>1.9.4</commonsBeanUtilsVersion>

        <!-- exports are required until ${muleCoreExtensionModelVersion} is updated to 4.5 or higher -->
        <!-- exports from xml parser are required because surefire puts test deps in the classpath rather than the modulepath -->
        <surefire.args>
            -XX:+IgnoreUnrecognizedVMOptions
            --add-modules=net.bytebuddy.agent
            --add-exports=org.mule.runtime.api/org.mule.runtime.internal.dsl=ALL-UNNAMED
            --add-exports=org.mule.runtime.api/org.mule.runtime.internal.dsl=org.mule.runtime.extension.model
            --add-exports=org.mule.runtime.extensions.api/org.mule.runtime.extension.api.model.deprecated=ALL-UNNAMED
            --add-exports=org.mule.runtime.extensions.api/org.mule.runtime.extension.internal.loader=ALL-UNNAMED
            --add-exports=org.mule.runtime.extensions.api/org.mule.runtime.extension.internal.loader.util=org.mule.runtime.extension.model
            --add-exports=org.mule.runtime.extensions.api/org.mule.runtime.extension.internal.property=ALL-UNNAMED
            --add-exports=org.mule.runtime.extensions.api/org.mule.runtime.extension.internal.property=org.mule.runtime.extension.model

            --add-exports=org.mule.runtime.dsl.api/org.mule.runtime.dsl.internal.xml.parser=ALL-UNNAMED
            --add-exports=org.mule.runtime.artifact.ast/org.mule.runtime.ast.internal.builder=ALL-UNNAMED
            --add-exports=org.mule.runtime.artifact.ast/org.mule.runtime.ast.internal.error=ALL-UNNAMED
            <!-- Needed for serialization/deserialization compatibility tests with older versions -->
            --add-exports=org.mule.runtime.artifact.ast/org.mule.runtime.ast.internal.error=org.mule.runtime.extension.model
            --add-exports=org.mule.runtime.artifact.ast/org.mule.runtime.ast.internal.dsl=ALL-UNNAMED

            --add-reads=org.mule.runtime.artifact.ast.serialization=org.mule.runtime.extension.model

            --add-opens=org.mule.runtime.artifact.ast.serialization/org.mule.runtime.ast.test.internal.serialization.json.gson=com.google.gson
            ${surefire.args.base}
        </surefire.args>

        <formatterConfigPath>../formatter.xml</formatterConfigPath>
    </properties>

    <artifactId>mule-artifact-ast-serialization</artifactId>
    <name>Mule Artifact AST - Serialization</name>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>com.mulesoft.mule.runtime.bom</groupId>
                <artifactId>mule-test-dependencies-bom</artifactId>
                <version>${muleDependenciesBomVersion}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <dependencies>
        <dependency>
            <groupId>org.mule.runtime</groupId>
            <artifactId>mule-artifact-ast</artifactId>
            <version>${project.version}</version>
        </dependency>

        <dependency>
            <groupId>org.mule.runtime</groupId>
            <artifactId>mule-metadata-model-persistence</artifactId>
        </dependency>

        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
        </dependency>

        <!-- Test dependencies -->
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.hamcrest</groupId>
            <artifactId>hamcrest</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-inline</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>io.qameta.allure</groupId>
            <artifactId>allure-junit4</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mule.tests</groupId>
            <artifactId>mule-tests-unit</artifactId>
            <version>${muleTestUnitVersion}</version>
            <scope>test</scope>
        </dependency>

        <!--This is in order to create ASTs for applications and use them in testing-->
        <dependency>
            <groupId>org.mule.runtime</groupId>
            <artifactId>mule-artifact-ast-xml-parser</artifactId>
            <version>${project.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mule.runtime</groupId>
            <artifactId>mule-artifact-ast-dependency-graph</artifactId>
            <version>${project.version}</version>
            <scope>test</scope>
        </dependency>

        <!-- This is needed just to use its extension model to test the enrichment process -->
        <dependency>
            <groupId>org.mule.runtime</groupId>
            <artifactId>mule-runtime-extension-model</artifactId>
            <version>${muleCoreExtensionModelVersion}</version>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>*</groupId>
                    <artifactId>*</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.mule.runtime</groupId>
            <artifactId>mule-runtime-errors</artifactId>
            <version>${muleCoreExtensionModelVersion}</version>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>*</groupId>
                    <artifactId>*</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.mule.runtime</groupId>
            <artifactId>mule-module-extensions-support</artifactId>
            <version>${muleCoreExtensionModelVersion}</version>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>*</groupId>
                    <artifactId>*</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.mule.runtime</groupId>
            <artifactId>mule-module-metadata-support</artifactId>
            <version>${muleCoreExtensionModelVersion}</version>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>*</groupId>
                    <artifactId>*</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.mule.runtime</groupId>
            <artifactId>mule-core</artifactId>
            <version>${muleCoreExtensionModelVersion}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mule.runtime</groupId>
            <artifactId>mule-metadata-model-catalog</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>commons-beanutils</groupId>
            <artifactId>commons-beanutils</artifactId>
            <version>${commonsBeanUtilsVersion}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>jakarta.transaction</groupId>
            <artifactId>jakarta.transaction-api</artifactId>
            <scope>test</scope>
        </dependency>

        <!-- Full artifact dsl config test-->
        <dependency>
            <groupId>org.mule.connectors</groupId>
            <artifactId>mule-objectstore-connector</artifactId>
            <classifier>mule-plugin</classifier>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mule.connectors</groupId>
            <artifactId>mule-file-connector</artifactId>
            <classifier>mule-plugin</classifier>
            <scope>test</scope>
            <exclusions>
                <!-- Exclude transitives from connectors causing split packages -->
                <exclusion>
                    <groupId>*</groupId>
                    <artifactId>*</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.mule.connectors</groupId>
            <artifactId>mule-jms-connector</artifactId>
            <classifier>mule-plugin</classifier>
            <scope>test</scope>
            <exclusions>
                <!-- Exclude transitives from connectors causing split packages -->
                <exclusion>
                    <groupId>*</groupId>
                    <artifactId>*</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.mule.connectors</groupId>
            <artifactId>mule-http-connector</artifactId>
            <classifier>mule-plugin</classifier>
            <scope>test</scope>
            <exclusions>
                <!-- Exclude transitives from connectors causing split packages -->
                <exclusion>
                    <groupId>*</groupId>
                    <artifactId>*</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
    </dependencies>

</project>
