<?xml version='1.0' encoding='UTF-8'?>

<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
         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-runtime-bom-parent</artifactId>
        <version>4.8.4</version>
    </parent>
         
    <modelVersion>4.0.0</modelVersion>
    <artifactId>mule-plugin-mgmt-parent-pom</artifactId>
    <packaging>pom</packaging>

    <properties>
        <project.build.sourceEncoding>ISO-8859-1</project.build.sourceEncoding>

        <maven.compiler.plugin.version>3.13.0</maven.compiler.plugin.version>
        <maven.dependency.plugin.version>3.7.1</maven.dependency.plugin.version>
        <maven.surefire.plugin.version>3.3.1</maven.surefire.plugin.version>
        <maven.resources.plugin.version>3.3.1</maven.resources.plugin.version>
        <maven.help.plugin.version>3.4.1</maven.help.plugin.version>
        <maven.checkstyle.plugin.version>3.4.0</maven.checkstyle.plugin.version>
        <maven.build.helper.maven.plugin.version>3.6.0</maven.build.helper.maven.plugin.version>
        <maven.jar.plugin.version>3.4.2</maven.jar.plugin.version>
        <maven.assembly.plugin.version>3.7.1</maven.assembly.plugin.version>
        <maven.project.info.reports.plugin.version>3.6.2</maven.project.info.reports.plugin.version>
        <maven.release.plugin.version>3.1.1</maven.release.plugin.version>
        <maven.gpg.plugin.version>3.2.4</maven.gpg.plugin.version>
        <maven.invoker.plugin.version>3.7.0</maven.invoker.plugin.version>
        <maven.shade.plugin.version>3.6.0</maven.shade.plugin.version>
        <maven.replacer.plugin>1.5.3</maven.replacer.plugin>
        <maven.buildnumber.plugin.version>3.2.0</maven.buildnumber.plugin.version>
        <maven.exec.plugin.version>3.4.0</maven.exec.plugin.version>
        <maven.git.commit.id.plugin.version>4.9.10</maven.git.commit.id.plugin.version>
        <maven.archetype.plugin.version>3.2.1</maven.archetype.plugin.version>
        <nexus.staging.plugin.version>1.7.0</nexus.staging.plugin.version>

        <javaFormatter.plugin.version>2.14.0</javaFormatter.plugin.version>
        <license.maven.plugin.version>4.5</license.maven.plugin.version>

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

        <mulesoftLicenseVersion>1.4.0</mulesoftLicenseVersion>

        <jacoco.version>0.8.12</jacoco.version>

        <allureJunit4Version>2.28.1</allureJunit4Version>
        <allureReportVersion>2.21.0</allureReportVersion>
        <allure.maven.plugin.version>2.13.0</allure.maven.plugin.version>

        <revapi-maven-plugin.version>0.15.0</revapi-maven-plugin.version>
        <muleRevapiExtensionVersion>1.8.4</muleRevapiExtensionVersion>

        <exchange.mule.maven.plugin.version>0.0.23</exchange.mule.maven.plugin.version>

        <surefire.args.encoding>-Dfile.encoding=UTF-8</surefire.args.encoding>
        <surefire.args.aspectj>-javaagent:${settings.localRepository}/org/aspectj/aspectjweaver/${aspectjVersion}/aspectjweaver-${aspectjVersion}.jar</surefire.args.aspectj>
        <surefire.additional.jacoco.args></surefire.additional.jacoco.args>
        <surefire.args.jacoco>-javaagent:${settings.localRepository}/org/jacoco/org.jacoco.agent/${jacoco.version}/org.jacoco.agent-${jacoco.version}-runtime.jar=destfile='${session.executionRootDirectory}/target/jacoco.exec'${surefire.additional.jacoco.args}</surefire.args.jacoco>

        <surefire.args.base>
            ${surefire.args.encoding}
            ${surefire.args.aspectj}
            ${surefire.args.jacoco}
        </surefire.args.base>
        <surefire.args>${surefire.args.base}</surefire.args>

        <doclint>none</doclint>
        <xDocLint>-Xdoclint:${doclint}</xDocLint>

        <skipNoSnapshotsEnforcerPluginRule>true</skipNoSnapshotsEnforcerPluginRule>
    </properties>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>${maven.compiler.plugin.version}</version>
                    <configuration>
                        <encoding>${project.build.sourceEncoding}</encoding>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-dependency-plugin</artifactId>
                    <version>${maven.dependency.plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-clean-plugin</artifactId>
                    <version>${maven.clean.plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-install-plugin</artifactId>
                    <version>${maven.install.plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-deploy-plugin</artifactId>
                    <version>${maven.deploy.plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-source-plugin</artifactId>
                    <version>${maven.source.plugin.version}</version>
                    <executions>
                        <execution>
                            <id>attach-sources</id>
                            <goals>
                                <goal>jar-no-fork</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-resources-plugin</artifactId>
                    <version>${maven.resources.plugin.version}</version>
                    <configuration>
                        <encoding>${project.build.sourceEncoding}</encoding>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-jar-plugin</artifactId>
                    <version>${maven.jar.plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-checkstyle-plugin</artifactId>
                    <version>${maven.checkstyle.plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <version>${maven.javadoc.plugin.version}</version>
                    <executions>
                        <execution>
                            <id>attach-javadocs</id>
                            <goals>
                                <goal>jar</goal>
                            </goals>
                        </execution>
                    </executions>
                    <configuration>
                        <doclint>${doclint}</doclint>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>net.revelc.code.formatter</groupId>
                    <artifactId>formatter-maven-plugin</artifactId>
                    <version>${javaFormatter.plugin.version}</version>
                    <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.apache.maven.plugins</groupId>
                    <artifactId>maven-enforcer-plugin</artifactId>
                    <version>${maven.enforcer.plugin.version}</version>
                    <executions>
                        <execution>
                            <id>enforce-no-snapshots-in-deps</id>
                            <goals>
                                <goal>enforce</goal>
                            </goals>
                            <configuration>
                                <rules>
                                    <requireReleaseDeps>
                                        <message>No Snapshots Allowed in Deps!</message>
                                    </requireReleaseDeps>
                                    <requireReleaseVersion>
                                        <message>No Snapshots Allowed in Project Version!</message>
                                    </requireReleaseVersion>
                                    <requirePluginVersions>
                                        <message>Best Practice is to always define plugin versions!</message>
                                        <unCheckedPluginList>
                                            org.apache.maven.plugins:maven-source-plugin,
                                            org.apache.maven.plugins:maven-site-plugin,
                                            org.apache.maven.plugins:maven-javadoc-plugin,
                                            org.apache.maven.plugins:maven-resources-plugin,
                                            org.apache.maven.plugins:maven-surefire-plugin,
                                            org.apache.maven.plugins:maven-jar-plugin,
                                            org.apache.maven.plugins:maven-clean-plugin,
                                            org.apache.maven.plugins:maven-install-plugin,
                                            org.apache.maven.plugins:maven-deploy-plugin,
                                            org.apache.maven.plugins:maven-dependency-plugin,
                                            org.apache.maven.plugins:maven-help-plugin
                                        </unCheckedPluginList>
                                    </requirePluginVersions>
                                </rules>
                                <skip>${skipNoSnapshotsEnforcerPluginRule}</skip>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>com.mycila</groupId>
                    <artifactId>license-maven-plugin</artifactId>
                    <version>${license.maven.plugin.version}</version>
                    <dependencies>
                        <dependency>
                            <groupId>com.mulesoft.license</groupId>
                            <artifactId>license</artifactId>
                            <version>${mulesoftLicenseVersion}</version>
                        </dependency>
                    </dependencies>
                    <configuration>
                        <excludes>
                            <exclude>target/**</exclude>
                            <exclude>.gitignore</exclude>
                            <exclude>**/*.txt</exclude>
                            <exclude>**/*.ftl</exclude>
                            <exclude>**/build-number.txt</exclude>
                            <exclude>**/*.ftl</exclude>
                            <exclude>**/assets/**</exclude>
                            <exclude>**/*.xsd</exclude>
                            <exclude>**/*.properties</exclude>
                            <exclude>**/*.xml</exclude>
                            <exclude>**/archetype-resources/**</exclude>
                            <exclude>**/src/main/java/package.html</exclude>
                        </excludes>
                        <includes>
                            <include>**/*.java</include>
                        </includes>
                        <mapping>
                            <java>SLASHSTAR_STYLE</java>
                        </mapping>
                    </configuration>
                    <executions>
                        <execution>
                            <phase>compile</phase>
                            <goals>
                                <goal>check</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>${maven.surefire.plugin.version}</version>
                    <configuration>
                        <argLine>${surefire.args}</argLine>
                        <properties>
                            <property>
                                <name>listener</name>
                                <value>io.qameta.allure.junit4.AllureJunit4</value>
                            </property>
                        </properties>
                        <systemPropertyVariables>
                            <allure.results.directory>${project.build.directory}/allure-results</allure.results.directory>
                        </systemPropertyVariables>
                        <additionalClasspathDependencies>
                            <dependency>
                                <groupId>io.qameta.allure</groupId>
                                <artifactId>allure-junit4</artifactId>
                                <version>${allureJunit4Version}</version>
                                <exclusions>
                                    <!-- Dependency management is not applicable to this additionalClasspathDependencies section -->
                                    <!-- prevent split package with newer hamcrest versions that have different gav -->
                                    <exclusion>
                                        <groupId>org.hamcrest</groupId>
                                        <artifactId>hamcrest-core</artifactId>
                                    </exclusion>
                                    <!-- Dependency management is not applicable to this additionalClasspathDependencies section -->
                                    <!-- need tu bump slf4j to prevent both versions to be dicovered -->
                                    <exclusion>
                                        <groupId>org.slf4j</groupId>
                                        <artifactId>slf4j-api</artifactId>
                                    </exclusion>
                                </exclusions>
                            </dependency>
                            <!-- Dependency management is not applicable to this additionalClasspathDependencies section -->
                            <!-- need tu bump slf4j to prevent both versions to be dicovered -->
                            <dependency>
                                <groupId>org.slf4j</groupId>
                                <artifactId>slf4j-api</artifactId>
                                <version>${slf4jVersion}</version>
                            </dependency>
                        </additionalClasspathDependencies>
                    </configuration>
                    <dependencies>
                        <dependency>
                            <groupId>org.aspectj</groupId>
                            <artifactId>aspectjweaver</artifactId>
                            <version>${aspectjVersion}</version>
                        </dependency>
                        <dependency>
                            <groupId>org.jacoco</groupId>
                            <artifactId>org.jacoco.agent</artifactId>
                            <version>${jacoco.version}</version>
                            <classifier>runtime</classifier>
                        </dependency>
                    </dependencies>
                </plugin>
                <plugin>
                    <groupId>io.qameta.allure</groupId>
                    <artifactId>allure-maven</artifactId>
                    <version>${allure.maven.plugin.version}</version>
                    <configuration>
                        <reportVersion>${allureReportVersion}</reportVersion>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>build-helper-maven-plugin</artifactId>
                    <version>${maven.build.helper.maven.plugin.version}</version>
                    <executions>
                        <execution>
                            <id>parse-version</id>
                            <goals>
                                <goal>parse-version</goal>
                            </goals>
                            <phase>validate</phase>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.revapi</groupId>
                    <artifactId>revapi-maven-plugin</artifactId>
                    <version>${revapi-maven-plugin.version}</version>
                    <dependencies>
                        <dependency>
                            <groupId>org.mule.tools.maven</groupId>
                            <artifactId>mule-revapi-extension</artifactId>
                            <version>${muleRevapiExtensionVersion}</version>
                        </dependency>
                    </dependencies>
                    <configuration>
                        <failOnUnresolvedArtifacts>true</failOnUnresolvedArtifacts>
                        <failOnMissingConfigurationFiles>false</failOnMissingConfigurationFiles>
                        <analysisConfiguration><![CDATA[
                                {
                                    "revapi" : {
                                        "java" : {
                                            "missing-classes" : {
                                                "behavior" : "report"
                                            }
                                        },
                                        "versions": {
                                          "enabled": true,
                                          "onAllowed": {
                                            "criticality" : "documented"
                                          }
                                        },
                                        "differences": {
                                          "differences": [
                                            {
                                              "code": "java.annotation.removed",
                                              "annotationType": "jdk.internal.HotSpotIntrinsicCandidate",
                                              "annotation": "@jdk.internal.HotSpotIntrinsicCandidate",
                                              "elementKind": "method",
                                              "justification": "This annotation is in jdk class, this is a false positive."
                                            },
                                            {
                                              "code": "java.annotation.removed",
                                              "annotationType": "jdk.internal.vm.annotation.IntrinsicCandidate",
                                              "annotation": "@jdk.internal.vm.annotation.IntrinsicCandidate",
                                              "elementKind": "method",
                                              "justification": "This annotation is in jdk class, this is a false positive."
                                            }
                                          ]
                                        }
                                    }
                                }
                            ]]></analysisConfiguration>
                        <analysisConfigurationFiles combine.children="append">
                            <configurationFile>
                                <path>api-changes.json</path>
                                <roots>
                                    <root>
                                        ${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.incrementalVersion}
                                    </root>
                                </roots>
                            </configurationFile>
                        </analysisConfigurationFiles>
                    </configuration>
                    <executions>
                        <execution>
                            <id>api-check</id>
                            <goals>
                                <goal>check</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-help-plugin</artifactId>
                    <version>${maven.help.plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-plugin-plugin</artifactId>
                    <version>${maven.plugin.plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-assembly-plugin</artifactId>
                    <version>${maven.assembly.plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-project-info-reports-plugin</artifactId>
                    <version>${maven.project.info.reports.plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-invoker-plugin</artifactId>
                    <version>${maven.invoker.plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-shade-plugin</artifactId>
                    <version>${maven.shade.plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-release-plugin</artifactId>
                    <version>${maven.release.plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-gpg-plugin</artifactId>
                    <version>${maven.gpg.plugin.version}</version>
                    <executions>
                        <execution>
                            <id>sign-artifacts</id>
                            <phase>verify</phase>
                            <goals>
                                <goal>sign</goal>
                            </goals>
                        </execution>
                    </executions>
                    <configuration>
                        <skip>${skipGpg}</skip>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.jacoco</groupId>
                    <artifactId>jacoco-maven-plugin</artifactId>
                    <version>${jacoco.version}</version>
                </plugin>
                <plugin>
                    <groupId>com.google.code.maven-replacer-plugin</groupId>
                    <artifactId>replacer</artifactId>
                    <version>${maven.replacer.plugin}</version>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>buildnumber-maven-plugin</artifactId>
                    <version>${maven.buildnumber.plugin.version}</version>
                    <executions>
                        <execution>
                            <phase>validate</phase>
                            <goals>
                                <goal>create</goal>
                            </goals>
                        </execution>
                    </executions>
                    <configuration>
                        <doCheck>false</doCheck>
                        <doUpdate>false</doUpdate>
                        <timestampFormat>yyyy-MMM-dd HH:mm:ss</timestampFormat>
                        <shortRevisionLength>8</shortRevisionLength>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>exec-maven-plugin</artifactId>
                    <version>${maven.exec.plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>pl.project13.maven</groupId>
                    <artifactId>git-commit-id-plugin</artifactId>
                    <version>${maven.git.commit.id.plugin.version}</version>
                    <executions>
                        <execution>
                            <id>get-the-git-infos</id>
                            <goals>
                                <goal>revision</goal>
                            </goals>
                        </execution>
                    </executions>
                    <configuration>
                        <useNativeGit>true</useNativeGit>
                        <injectAllReactorProjects>true</injectAllReactorProjects>
                    </configuration>
                </plugin>
                <plugin>
                    <artifactId>maven-archetype-plugin</artifactId>
                    <version>${maven.archetype.plugin.version}</version>
                    <configuration>
                        <ignoreEOLStyle>true</ignoreEOLStyle>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.sonatype.plugins</groupId>
                    <artifactId>nexus-staging-maven-plugin</artifactId>
                    <version>${nexus.staging.plugin.version}</version>
                    <configuration>
                        <serverId>sonatype-nexus-staging</serverId>
                        <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                        <autoReleaseAfterClose>false</autoReleaseAfterClose>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.eclipse.sisu</groupId>
                    <artifactId>sisu-maven-plugin</artifactId>
                    <version>${eclipse.sisu.plexus.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.mule.tools.maven</groupId>
                    <artifactId>exchange-mule-maven-plugin</artifactId>
                    <version>${exchange.mule.maven.plugin.version}</version>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

    <dependencyManagement>
        <dependencies>
            <!-- This is declared here to enforce consistency between this and the allure report version -->
            <dependency>
                <groupId>io.qameta.allure</groupId>
                <artifactId>allure-junit4</artifactId>
                <version>${allureJunit4Version}</version>
            </dependency>

            <dependency>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-assembly-plugin</artifactId>
                <version>${maven.assembly.plugin.version}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

</project>
