<?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</groupId>
        <artifactId>mule-plugin-mgmt-parent-pom</artifactId>
        <version>4.10.1</version>
        <relativePath/>
    </parent>

    <groupId>com.mulesoft.connectivity</groupId>
    <artifactId>connectivity-mule-adapter</artifactId>
    <version>1.0.1</version>

    <name>Parent Module - Mule Runtime Interpreted Connectivity Extension</name>
    <description>A parent module for Mule runtime Extensions and test connector</description>

    <packaging>pom</packaging>

    <properties>
        <maven.compiler.release>17</maven.compiler.release>
        <weave.version>2.10.1</weave.version>
        <mule.api.version>1.10.1</mule.api.version>
        <mule.runtime.version>4.10.1</mule.runtime.version>
        <hamcrest.version>3.0</hamcrest.version>
        <junit.jupiter.version>5.13.2</junit.jupiter.version>
        <link.weave.version>1.4.1</link.weave.version>
        <ic.data.weave.service.api.version>1.0.1</ic.data.weave.service.api.version>

        <lombok.version>1.18.36</lombok.version>
        <checkstyle.version>10.24.0</checkstyle.version>
        <maven.checkstyle.plugin.version>3.6.0</maven.checkstyle.plugin.version>
        <jacoco.maven.plugin.version>0.8.13</jacoco.maven.plugin.version>
        <javaFormatter.plugin.version>2.26.0</javaFormatter.plugin.version>
        <maven.impsort.plugin.version>1.12.0</maven.impsort.plugin.version>
        <maven.compiler.plugin.version>3.14.0</maven.compiler.plugin.version>
        <plexus.utils.version>4.0.2</plexus.utils.version>
        <mule.module.maven.plugin.version>1.10.1</mule.module.maven.plugin.version>
        <surefirePluginVersion>3.5.2</surefirePluginVersion>
        <commons.io.version>2.16.1</commons.io.version>

        <data.weave.version>2.10.1</data.weave.version>
        <data.weave.http.version>2.10.0</data.weave.http.version>
        <data.weave.http.module.version>${data.weave.http.version}</data.weave.http.module.version>
        <data.weave.http.netty.module.version>${data.weave.http.version}</data.weave.http.netty.module.version>
        <data.weave.testing.framework.version>2.10.0</data.weave.testing.framework.version>

        <skipVerifications>false</skipVerifications>
        <formatterConfigPath>formatter.xml</formatterConfigPath>
        <formatterGoal>validate</formatterGoal>
        <importGoal>check</importGoal>

        <sonar.coverage.jacoco.xmlReportPaths>${project.basedir}/../report-aggregate/target/site/jacoco-aggregate/jacoco.xml</sonar.coverage.jacoco.xmlReportPaths>
        <licensePath>LICENSE_HEADER.txt</licensePath>
        <licenseYear>2023</licenseYear>
    </properties>

    <profiles>
        <profile>
            <id>toolingTestsEnabled</id>
            <modules>
                <module>connectivity-mule-tooling-tests</module>
                <module>connectivity-mule-pulse-test-connector</module>
            </modules>
        </profile>
    </profiles>

    <modules>
        <module>connectivity-mule-extension</module>
        <module>connectivity-test-commons</module>
        <module>extensions-interpreted-connectivity-support</module>
        <module>connectivity-mule-persistence</module>
        <module>connectivity-mule-maven-plugin</module>
        <module>connectivity-mule-functional-tests</module>
        <module>report-aggregate</module>
        <module>mule-module-extensions-ic-bom</module>
    </modules>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>${maven.compiler.plugin.version}</version>
                <configuration>
                    <source>${maven.compiler.release}</source>
                    <target>${maven.compiler.release}</target>
                    <annotationProcessorPaths>
                        <path>
                            <groupId>org.projectlombok</groupId>
                            <artifactId>lombok</artifactId>
                            <version>${lombok.version}</version>
                        </path>
                    </annotationProcessorPaths>
                </configuration>
            </plugin>
            <plugin>
                <groupId>net.revelc.code</groupId>
                <artifactId>impsort-maven-plugin</artifactId>
                <version>${maven.impsort.plugin.version}</version>
                <dependencies>
                    <dependency>
                        <groupId>org.codehaus.plexus</groupId>
                        <artifactId>plexus-utils</artifactId>
                        <version>${plexus.utils.version}</version>
                    </dependency>
                </dependencies>
                <configuration>
                    <groups>org.mule.,com.mulesoft.,java.,javax.</groups>
                    <staticGroups>org.mule.,com.mulesoft.,java.,javax.</staticGroups>
                </configuration>
                <executions>
                    <execution>
                        <id>validate-imports</id>
                        <phase>compile</phase>
                        <goals>
                            <goal>${importGoal}</goal>
                        </goals>
                        <configuration>
                            <skip>${skipVerifications}</skip>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>net.revelc.code.formatter</groupId>
                <artifactId>formatter-maven-plugin</artifactId>
                <version>${javaFormatter.plugin.version}</version>
                <configuration>
                    <encoding>UTF-8</encoding>
                    <compilerCompliance>${maven.compiler.release}</compilerCompliance>
                    <compilerSource>${maven.compiler.release}</compilerSource>
                    <compilerTargetPlatform>${maven.compiler.release}</compilerTargetPlatform>
                    <configFile>${formatterConfigPath}</configFile>
                    <configJsFile>${formatterConfigPath}</configJsFile>
                    <aggregator>false</aggregator>
                    <executionRoot>true</executionRoot>
                </configuration>
                <executions>
                    <execution>
                        <id>apply-format</id>
                        <phase>compile</phase>
                        <goals>
                            <goal>${formatterGoal}</goal>
                        </goals>
                        <configuration>
                            <skipFormatting>${skipVerifications}</skipFormatting>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-checkstyle-plugin</artifactId>
                <version>${maven.checkstyle.plugin.version}</version>
                <dependencies>
                    <dependency>
                        <!--
                        CheckStyle Maven plugin uses an old version of CheckStyle by default, which has some bugs.
                        -->
                        <groupId>com.puppycrawl.tools</groupId>
                        <artifactId>checkstyle</artifactId>
                        <version>${checkstyle.version}</version>
                    </dependency>
                </dependencies>
                <executions>
                    <execution>
                        <id>verify-style</id>
                        <phase>validate</phase>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <skip>${skipVerifications}</skip>
                    <logViolationsToConsole>true</logViolationsToConsole>
                    <failOnViolation>true</failOnViolation>
                    <checkstyleRules>
                        <module name="Checker">
                            <module name="TreeWalker">
                                <module name="AvoidDoubleBraceInitialization"/>
                                <!--<module name="AvoidNestedBlocks"/>-->
                                <module name="AvoidNoArgumentSuperConstructorCall"/>
                                <module name="AvoidStarImport"/>
                                <module name="ConstantName"/>
                                <module name="EmptyBlock"/>
                                <module name="EmptyCatchBlock"/>
                                <module name="EmptyStatement"/>
                                <module name="EqualsAvoidNull"/>
                                <module name="HideUtilityClassConstructor"/>
                                <module name="InvalidJavadocPosition"/>
                                <module name="JavadocBlockTagLocation"/>
                                <module name="JavadocMethod"/>
                                <module name="JavadocStyle"/>
                                <module name="JavadocType">
                                    <property name="allowMissingParamTags" value="true"/>
                                    <property name="allowUnknownTags" value="true"/>
                                </module>
                                <module name="MissingSwitchDefault"/>
                                <module name="NeedBraces"/>
                                <module name="NoEnumTrailingComma"/>
                                <module name="NoFinalizer"/>
                                <module name="RedundantImport"/>
                                <module name="SimplifyBooleanExpression"/>
                                <module name="SimplifyBooleanReturn"/>
                                <module name="UnnecessaryParentheses"/>
                                <module name="UnnecessarySemicolonAfterOuterTypeDeclaration"/>
                                <module name="UnnecessarySemicolonAfterTypeMemberDeclaration"/>
                                <module name="UnnecessarySemicolonInEnumeration"/>
                                <module name="UnnecessarySemicolonInTryWithResources"/>
                                <module name="UnusedLocalVariable"/>
                                <module name="UnusedImports"/>
                            </module>
                        </module>
                    </checkstyleRules>
                </configuration>
            </plugin>
            <plugin>
                <groupId>com.mycila</groupId>
                <artifactId>license-maven-plugin</artifactId>
            </plugin>
        </plugins>

        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.jacoco</groupId>
                    <artifactId>jacoco-maven-plugin</artifactId>
                    <version>${jacoco.maven.plugin.version}</version>
                    <executions>
                        <execution>
                            <id>jacoco-prepare-agent</id>
                            <goals>
                                <goal>prepare-agent</goal>
                            </goals>
                            <configuration>
                                <destFile>${project.build.directory}/jacoco.exec</destFile>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

    <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>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.junit</groupId>
                <artifactId>junit-bom</artifactId>
                <version>${junit.jupiter.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>org.mockito</groupId>
                <artifactId>mockito-bom</artifactId>
                <version>${mockitoVersion}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <scm>
        <connection>scm:git:git://github.com/mulesoft-emu/interpreted-connectivity-mule-adapter.git</connection>
        <developerConnection>scm:git:git@github.com:mulesoft-emu/interpreted-connectivity-mule-adapter.git</developerConnection>
        <url>https://github.com/mulesoft-emu/interpreted-connectivity-mule-adapter</url>
    </scm>

</project>
