<?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</groupId>
        <artifactId>mule-plugin-mgmt-parent-pom</artifactId>
        <version>4.11.2</version>
        <relativePath/>
    </parent>
    <modelVersion>4.0.0</modelVersion>
    <groupId>org.mule.runtime</groupId>
    <artifactId>mule-module-tooling-support</artifactId>
    <version>4.11.2</version>
         
    <!-- Organization -->
    <organization>
        <name>MuleSoft, Inc.</name>
        <url>http://www.mulesoft.com</url>
    </organization>

    <!-- Project -->
    <name>Mule Tooling Support</name>
    <description>This modules provides a set of services for tooling applications.</description>
    <url>https://developer.mulesoft.com/</url>
    <inceptionYear>2003</inceptionYear>
    <licenses>
        <license>
            <name>CPAL v1.0</name>
            <url>http://www.mulesoft.com/CPAL</url>
        </license>
    </licenses>

    <properties>
        <javaVersion>17</javaVersion>
        <javaReleaseVersion>${javaVersion}</javaReleaseVersion>

        <muleModuleMavenPluginVersion>1.11.2</muleModuleMavenPluginVersion>

        <mule.version>4.11.2</mule.version>
        <artifactDeclarationVersion>1.11.2</artifactDeclarationVersion>

        <weaveVersion>2.11.1</weaveVersion>

        <javaModuleName>org.mule.runtime.tooling.support</javaModuleName>
        <surefire.args.junit>-Djunit.jupiter.execution.timeout.mode=disabled_on_debug</surefire.args.junit>
        <surefire.args.base>
            -XX:+TieredCompilation
            ${surefire.args.encoding}
            ${surefire.args.junit}
            ${surefire.args.mockito}
            ${surefire.args.aspectj}
            ${surefire.args.jacoco}
        </surefire.args.base>
        <surefire.test.unit.open.args.target>org.mule.runtime.jpms.utils</surefire.test.unit.open.args.target>
        <surefire.test.unit.open.args>
            -XX:+IgnoreUnrecognizedVMOptions
            --add-opens=java.base/java.lang=${surefire.test.unit.open.args.target}
            --add-opens=java.base/java.lang.reflect=${surefire.test.unit.open.args.target}
            --add-opens=java.base/java.lang.invoke=${surefire.test.unit.open.args.target}
            --add-opens=java.sql/java.sql=${surefire.test.unit.open.args.target}
            --add-opens=java.naming/javax.naming=${surefire.test.unit.open.args.target}
            ${surefire.args.base}
        </surefire.test.unit.open.args>
        <surefire.module.path>
            ${org.slf4j:slf4j-api:jar}
        </surefire.module.path>
        <surefire.add.modules>
            org.slf4j
        </surefire.add.modules>
        <surefire.module.args>
            -XX:+IgnoreUnrecognizedVMOptions
            --module-path=${surefire.module.path}
            --add-modules=${surefire.add.modules}
            ${surefire.test.unit.open.args}
        </surefire.module.args>
        <!-- Emulate the behaviour in standalone, where slf4j is loaded in the boot layer -->
        <surefire.slf4j.module.args>
            -XX:+IgnoreUnrecognizedVMOptions
            --module-path=${org.slf4j:slf4j-api:jar}
            --add-modules=org.slf4j
            ${surefire.test.unit.open.args}
        </surefire.slf4j.module.args>

        <!-- Add visibility required by the tests exclusively -->
        <surefire.module.path>
            ${org.slf4j:slf4j-api:jar}${path.separator}${org.mule.runtime.boot:mule-module-jpms-utils:jar}
        </surefire.module.path>
        <surefire.add.modules>
            org.slf4j,org.mule.runtime.jpms.utils
        </surefire.add.modules>
        <surefire.args>
            -XX:+IgnoreUnrecognizedVMOptions
            ${surefire.module.args}
        </surefire.args>

        <licensePath>LICENSE_HEADER_CPAL.txt</licensePath>
        <licenseYear>2023</licenseYear>
        
        <skipRevapiCheck>true</skipRevapiCheck>
    </properties>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>net.revelc.code.formatter</groupId>
                    <artifactId>formatter-maven-plugin</artifactId>
                    <configuration>
                        <compilerCompliance>${javaVersion}</compilerCompliance>
                        <compilerSource>${javaVersion}</compilerSource>
                        <compilerTargetPlatform>${javaVersion}</compilerTargetPlatform>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <configuration>
                        <source>${javaVersion}</source>
                        <target>${javaVersion}</target>
                        <release>${javaReleaseVersion}</release>
                        <testSource>${javaVersion}</testSource>
                        <testTarget>${javaVersion}</testTarget>
                        <testRelease>${javaReleaseVersion}</testRelease>
                        <parameters>true</parameters>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-jar-plugin</artifactId>
                    <executions>
                        <execution>
                            <id>attach-test-jar</id>
                            <goals>
                                <goal>test-jar</goal>
                            </goals>
                        </execution>
                    </executions>
                    <configuration>
                        <archive>
                            <!-- Custom Entries -->
                            <manifestEntries>
                                <Git-tags>${git.tags}</Git-tags>
                                <Git-branch>${git.branch}</Git-branch>
                                <Git-remote-origin-url>${git.remote.origin.url}</Git-remote-origin-url>
                                <Git-commit-id>${git.commit.id}</Git-commit-id>
                                <Git-commit-id-describe>${git.commit.id.describe}</Git-commit-id-describe>
                                <Git-commit-time>${git.commit.time}</Git-commit-time>
                                <Multi-Release>true</Multi-Release>
                            </manifestEntries>
                        </archive>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.mule.tools.maven</groupId>
                    <artifactId>mule-module-maven-plugin</artifactId>
                    <version>${muleModuleMavenPluginVersion}</version>
                    <executions>
                        <execution>
                            <goals>
                                <goal>generate</goal>
                            </goals>
                        </execution>
                        <execution>
                            <id>analyze</id>
                            <phase>verify</phase>
                            <goals>
                                <goal>analyze</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </pluginManagement>
    
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <executions>
                    <execution>
                        <goals>
                            <goal>properties</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <executions>
                    <execution>
                        <id>default-testCompile</id>
                        <configuration>
                            <compilerArgs>
                                <arg>--add-exports=org.mule.runtime.core/org.mule.runtime.core.internal.context=org.mule.runtime.tooling.support</arg>
                                <arg>--add-exports=org.mule.runtime.core/org.mule.runtime.core.internal.value.cache=org.mule.runtime.tooling.support</arg>
                                <arg>--add-exports=org.mule.runtime.metadata.support/org.mule.runtime.metadata.internal=org.mule.runtime.tooling.support</arg>
                            </compilerArgs>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <!-- Module layer is created by the tests-runner, don't need surefire to config the boot layer for the JVM -->
                    <useModulePath>false</useModulePath>
                    <systemPropertyVariables>
                        <!-- Just propagate this variable due to surefire will not do this when forked vm for tests -->
                        <maven.projectVersion>${mule.version}</maven.projectVersion>
                    </systemPropertyVariables>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-site-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>net.revelc.code.formatter</groupId>
                <artifactId>formatter-maven-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>com.mycila</groupId>
                <artifactId>license-maven-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.mule.tools.maven</groupId>
                <artifactId>mule-module-maven-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>io.qameta.allure</groupId>
                <artifactId>allure-maven</artifactId>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.revapi</groupId>
                <artifactId>revapi-maven-plugin</artifactId>
                <configuration>
                    <skip>${skipRevapiCheck}</skip>
                    <oldVersion>${oldMuleArtifactVersion}</oldVersion>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>pl.project13.maven</groupId>
                <artifactId>git-commit-id-plugin</artifactId>
                <executions>
                    <execution>
                        <id>get-the-git-infos</id>
                        <goals>
                            <goal>revision</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <useNativeGit>true</useNativeGit>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.mule</groupId>
                <artifactId>mule-runtime-bom</artifactId>
                <version>${mule.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>org.mule</groupId>
                <artifactId>mule-tests-bom</artifactId>
                <version>${mule.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>org.mule.runtime</groupId>
                <artifactId>mule-artifact-declaration</artifactId>
                <version>${artifactDeclarationVersion}</version>
            </dependency>
            <dependency>
                <groupId>org.mule.runtime</groupId>
                <artifactId>mule-artifact-declaration-persistence</artifactId>
                <version>${artifactDeclarationVersion}</version>
            </dependency>

            <!-- NOT the service (with mule-service classifier) -->
            <!-- this raw jar is used in unit tests only -->
            <dependency>
                <groupId>org.mule.services</groupId>
                <artifactId>mule-service-weave</artifactId>
                <version>${weaveVersion}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <dependencies>
        <dependency>
            <groupId>org.mule.runtime</groupId>
            <artifactId>mule-core</artifactId>
            <version>${mule.version}</version>
        </dependency>
        <dependency>
            <groupId>org.mule.runtime.boot</groupId>
            <artifactId>mule-module-jpms-utils</artifactId>
            <version>${mule.version}</version>
        </dependency>
        <dependency>
            <groupId>org.mule.runtime</groupId>
            <artifactId>mule-module-spring-config</artifactId>
            <version>${mule.version}</version>
        </dependency>
        <dependency>
            <groupId>org.mule.runtime</groupId>
            <artifactId>mule-module-repository</artifactId>
            <version>${mule.version}</version>
        </dependency>
        <dependency>
            <groupId>org.mule.runtime</groupId>
            <artifactId>mule-module-deployment</artifactId>
            <version>${mule.version}</version>
        </dependency>
        <dependency>
            <groupId>org.mule.runtime</groupId>
            <artifactId>mule-module-launcher</artifactId>
            <version>${mule.version}</version>
        </dependency>

        <dependency>
            <groupId>org.mule.runtime</groupId>
            <artifactId>mule-artifact-declaration</artifactId>
        </dependency>
        <dependency>
            <groupId>org.mule.runtime</groupId>
            <artifactId>mule-artifact-declaration-persistence</artifactId>
        </dependency>

        <!-- Add logging libraries required by maven-client -->
        <dependency>
            <groupId>org.mule.runtime.boot</groupId>
            <artifactId>mule-module-logging</artifactId>
            <version>${mule.version}</version>
        </dependency>

        <dependency>
            <groupId>org.mule.services</groupId>
            <artifactId>mule-service-weave</artifactId>
            <classifier>mule-service</classifier>
            <scope>provided</scope>
            <exclusions>
                <exclusion>
                    <groupId>*</groupId>
                    <artifactId>*</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.mule.runtime</groupId>
            <artifactId>mule-dwb-api</artifactId> 
            <scope>provided</scope>             
        </dependency>         

        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
        </dependency>

        <dependency>
            <groupId>org.mule.tests</groupId>
            <artifactId>mule-tests-unit</artifactId>
            <version>${mule.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mule.tests</groupId>
            <artifactId>mule-tests-functional</artifactId>
            <version>${mule.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mule.runtime</groupId>
            <artifactId>mule-module-extensions-support</artifactId>
            <version>${mule.version}</version>
            <type>test-jar</type>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mule.tests</groupId>
            <artifactId>mule-tests-runner</artifactId>
            <version>${mule.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mule.services</groupId>
            <artifactId>mule-service-weave</artifactId>
            <scope>test</scope>
        </dependency>
         <dependency>
            <groupId>org.mule.services</groupId>
            <artifactId>mule-service-http</artifactId>
            <classifier>mule-service</classifier>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.mule.services</groupId>
            <artifactId>mule-service-oauth</artifactId>
            <classifier>mule-service</classifier>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.mule.services</groupId>
            <artifactId>mule-service-scheduler</artifactId>
            <classifier>mule-service</classifier>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.mule.tests</groupId>
            <artifactId>mule-tests-allure</artifactId>
            <version>${mule.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mule.runtime</groupId>
            <artifactId>mule-module-spring-config</artifactId>
            <version>${mule.version}</version>
            <type>test-jar</type>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.mule.tests</groupId>
            <artifactId>mule-vegan-extension</artifactId>
            <version>${mule.version}</version>
            <classifier>mule-plugin</classifier>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mule.tests</groupId>
            <artifactId>mule-values-extension</artifactId>
            <version>${mule.version}</version>
            <classifier>mule-plugin</classifier>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mule.tests</groupId>
            <artifactId>mule-some-extension</artifactId>
            <version>${mule.version}</version>
            <classifier>mule-plugin</classifier>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mule.tests</groupId>
            <artifactId>mule-sample-data-extension</artifactId>
            <version>${mule.version}</version>
            <classifier>mule-plugin</classifier>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mule.tests</groupId>
            <artifactId>mule-petstore-extension</artifactId>
            <version>${mule.version}</version>
            <classifier>mule-plugin</classifier>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mule.tests</groupId>
            <artifactId>mule-metadata-extension</artifactId>
            <version>${mule.version}</version>
            <classifier>mule-plugin</classifier>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mule.tests</groupId>
            <artifactId>mule-marvel-extension</artifactId>
            <version>${mule.version}</version>
            <classifier>mule-plugin</classifier>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mule.tests</groupId>
            <artifactId>mule-javax-inject-extension</artifactId>
            <version>${mule.version}</version>
            <classifier>mule-plugin</classifier>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mule.tests</groupId>
            <artifactId>mule-heisenberg-extension</artifactId>
            <version>${mule.version}</version>
            <classifier>mule-plugin</classifier>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mule.tests</groupId>
            <artifactId>classloading-extension</artifactId>
            <version>${mule.version}</version>
            <classifier>mule-plugin</classifier>
            <scope>test</scope>
        </dependency>
         <dependency>
             <groupId>org.mule.tests</groupId>
            <artifactId>smart-connector-using-file</artifactId>
            <classifier>mule-plugin</classifier>
            <version>${project.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mule.tests</groupId>
            <artifactId>smart-connector-using-http-oauth-authorization-code</artifactId>
            <classifier>mule-plugin</classifier>
            <version>${project.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mule.tests</groupId>
            <artifactId>mule-tests-model</artifactId>
            <version>${mule.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mule.tests.plugin</groupId>
            <artifactId>mule-tests-component-plugin</artifactId>
            <version>${mule.version}</version>
            <classifier>mule-plugin</classifier>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mule.skyscreamer</groupId>
            <artifactId>jsonassert</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <distributionManagement>
        <downloadUrl>http://www.mulesoft.org/display/MULE/Download</downloadUrl>
        <repository>
            <id>mule-releases</id>
            <name>Mule Release Repository</name>
            <url>https://repository-master.mulesoft.org/nexus/content/repositories/releases</url>
        </repository>
        <snapshotRepository>
            <id>mule-snapshots</id>
            <name>Mule Snapshot Repository</name>
            <url>https://repository-master.mulesoft.org/nexus/content/repositories/snapshots</url>
            <uniqueVersion>false</uniqueVersion>
        </snapshotRepository>
    </distributionManagement>

    <repositories>
        <repository>
            <id>mule</id>
            <name>Mule Repository</name>
            <url>https://repository.mulesoft.org/nexus/content/repositories/public/</url>
        </repository>
    </repositories>

    <pluginRepositories>
        <pluginRepository>
            <id>mule-plugin</id>
            <name>Mule Repository</name>
            <url>https://repository.mulesoft.org/nexus/content/repositories/public/</url>
        </pluginRepository>
    </pluginRepositories>

</project>
