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

    <groupId>org.mule.runtime</groupId>
    <artifactId>mule-artifact-ast-parent</artifactId>
    <version>1.2.2</version>
    <packaging>pom</packaging>
    
    <name>Mule Artifact AST Parent pom</name>
    <url>https://github.com/mulesoft/mule-artifact-ast</url>
    <organization>
        <name>MuleSoft, Inc.</name>
        <url>http://www.mulesoft.com</url>
    </organization>
    <licenses>
        <license>
            <name>CPAL v1.0</name>
            <url>http://www.mulesoft.com/CPAL</url>
        </license>
    </licenses>
    <mailingLists>
        <mailingList>
            <name>developers</name>
            <post>mule-esb@mulesoft.com</post>
        </mailingList>
    </mailingLists>

    <developers>
        <developer>
            <id>facunlk</id>
            <name>Facundo Lopez Kauffman</name>
            <email>facundo.lopez@mulesoft.com</email>
            <roles>
                <role>Project Manager</role>
            </roles>
        </developer>
        <developer>
            <id>pablolagreca</id>
            <name>Pablo La Greca</name>
        </developer>
        <developer>
            <id>elrodro83</id>
            <name>Rodrigo Merino</name>
        </developer>
        <developer>
            <id>fsgonz</id>
            <name>Fabian Gonzalez</name>
        </developer>
        <developer>
            <id>mlischetti</id>
            <name>Mariano Lischetti</name>
        </developer>
    </developers>
    <contributors>
        <!-- Refer to https://github.com/mulesoft/mule/graphs/contributors -->
    </contributors>
    <issueManagement>
        <system>jira</system>
        <url>http://www.mulesoft.org/jira/browse/MULE</url>
    </issueManagement>

    <scm>
        <connection>scm:git:git://github.com/mulesoft-labs/mule-artifact-ast.git</connection>
        <developerConnection>scm:git:git@github.com:mulesoft-labs/mule-artifact-ast.git</developerConnection>
        <url>https://github.com/mulesoft-labs/mule-artifact-ast</url>
    </scm>

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

        <javaVersion>1.8</javaVersion>
        <javaReleaseVersion>8</javaReleaseVersion>
        <project.build.sourceEncoding>ISO-8859-1</project.build.sourceEncoding>

        <junitVersion>4.13.2</junitVersion>
        <hamcrestVersion>2.2</hamcrestVersion>
        <mockitoVersion>4.11.0</mockitoVersion>
        <muleApiVersion>1.6.2</muleApiVersion>
        <aspectjVersion>1.9.9.1</aspectjVersion>

        <muleModuleMavenPluginVersion>1.5.3</muleModuleMavenPluginVersion>
        <muleDependenciesBomVersion>1.0.18</muleDependenciesBomVersion>
        <muleCoreExtensionModelVersion>4.6.0-rc3</muleCoreExtensionModelVersion>

        <javaFormatter.plugin.version>2.14.0</javaFormatter.plugin.version>
        <formatterConfigPath>formatter.xml</formatterConfigPath>
        <formatterGoal>validate</formatterGoal>

        <revapi.maven.plugin.version>0.15.0</revapi.maven.plugin.version>
        <muleRevapiExtensionVersion>1.6.3</muleRevapiExtensionVersion>
        <oldMuleArtifactVersion>1.2.0</oldMuleArtifactVersion>

        <mulesoftLicenseVersion>1.4.0</mulesoftLicenseVersion>
        <license.maven.plugin.version>4.2</license.maven.plugin.version>
        <licensePath>LICENSE_HEADER_CPAL.txt</licensePath>
        <licenseYear>2023</licenseYear>

        <allureReportVersion>2.8.1</allureReportVersion>
        <allureJunitVersion>2.21.0</allureJunitVersion>
        <allure.maven.plugin.version>2.12.0</allure.maven.plugin.version>
        <jacoco.version>0.8.8</jacoco.version>

        <maven.surefire.plugin.version>3.1.2</maven.surefire.plugin.version>
        <maven.enforcer.plugin.version>3.2.1</maven.enforcer.plugin.version>
        <build.helper.maven.plugin.version>3.3.0</build.helper.maven.plugin.version>

        <maven.site.plugin.version>3.12.0</maven.site.plugin.version>
        <muleBomVersion>4.6.2</muleBomVersion>
    </properties>

    <modules>
        <module>test</module>
        <module>mule-ast</module>
        <module>mule-ast-dependency-graph</module>
        <module>mule-ast-xml-parser</module>
        <module>mule-ast-serialization</module>
        <module>mule-cfg</module>
    </modules>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.mule</groupId>
                <artifactId>mule-runtime-bom</artifactId>
                <version>${muleBomVersion}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>

            <!-- Test dependencies -->
            <dependency>
                <groupId>junit</groupId>
                <artifactId>junit</artifactId>
                <version>${junitVersion}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.hamcrest</groupId>
                <artifactId>hamcrest</artifactId>
                <version>${hamcrestVersion}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.hamcrest</groupId>
                <artifactId>hamcrest-core</artifactId>
                <version>${hamcrestVersion}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.mockito</groupId>
                <artifactId>mockito-inline</artifactId>
                <version>${mockitoVersion}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.mockito</groupId>
                <artifactId>mockito-core</artifactId>
                <version>${mockitoVersion}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>io.qameta.allure</groupId>
                <artifactId>allure-junit4</artifactId>
                <version>${allureJunitVersion}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.mule.runtime</groupId>
                <artifactId>mule-api</artifactId>
                <version>${muleApiVersion}</version>
                <type>test-jar</type>
                <scope>test</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>
        
    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-source-plugin</artifactId>
                    <version>3.2.1</version>
                    <executions>
                        <execution>
                            <id>attach-sources</id>
                            <goals>
                                <goal>jar-no-fork</goal>
                                <goal>test-jar-no-fork</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>3.11.0</version>
                    <executions>
                        <execution>
                            <id>default-compile</id>
                            <configuration>
                                <release>11</release>
                                <!-- no excludes: compile everything to ensure module-info contains right entries -->
                            </configuration>
                        </execution>
                        <execution>
                            <id>base-compile</id>
                            <goals>
                                <goal>compile</goal>
                            </goals>
                            <configuration>
                                <release>${javaReleaseVersion}</release>
                                <!-- recompile everything for target VM except the module-info.java -->
                                <excludes>
                                    <exclude>module-info.java</exclude>
                                </excludes>
                            </configuration>
                        </execution>
                    </executions>
                    <configuration>
                        <encoding>ISO-8859-1</encoding>
                        <proc>none</proc>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>net.revelc.code.formatter</groupId>
                    <artifactId>formatter-maven-plugin</artifactId>
                    <version>${javaFormatter.plugin.version}</version>
                    <configuration>
                        <compilerCompliance>${javaVersion}</compilerCompliance>
                        <compilerSource>${javaVersion}</compilerSource>
                        <compilerTargetPlatform>${javaVersion}</compilerTargetPlatform>
                        <configFile>${basedir}/${formatterConfigPath}</configFile>
                        <configJsFile>${basedir}/${formatterConfigPath}</configJsFile>
                        <aggregator>false</aggregator>
                        <executionRoot>true</executionRoot>
                    </configuration>
                    <executions>
                        <execution>
                            <phase>process-sources</phase>
                            <goals>
                                <goal>${formatterGoal}</goal>
                            </goals>
                            <configuration>
                                <skipFormatting>${skipVerifications}</skipFormatting>
                            </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>
                        <header>${licensePath}</header>
                        <properties>
                            <year>${licenseYear}</year>
                        </properties>
                        <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-jar-plugin</artifactId>
                    <executions>
                        <execution>
                            <id>attach-test-jar</id>
                            <goals>
                                <goal>test-jar</goal>
                            </goals>
                        </execution>
                    </executions>
                    <configuration>
                        <archive>
                            <manifestEntries>
                                <Automatic-Module-Name>${javaModuleName}</Automatic-Module-Name>
                            </manifestEntries>
                        </archive>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <executions>
                        <execution>
                            <id>attach-javadocs</id>
                            <goals>
                                <goal>jar</goal>
                            </goals>
                        </execution>
                    </executions>
                    <configuration>
                        <additionalparam>${xDocLint}</additionalparam>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.mule.tools.maven</groupId>
                    <artifactId>mule-module-maven-plugin</artifactId>
                    <version>${muleModuleMavenPluginVersion}</version>
                    <executions>
                        <execution>
                            <id>analyze</id>
                            <phase>verify</phase>
                            <goals>
                                <goal>analyze</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>build-helper-maven-plugin</artifactId>
                    <version>${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>
                        <oldVersion>${oldMuleArtifactVersion}</oldVersion>
                        <failOnUnresolvedArtifacts>true</failOnUnresolvedArtifacts>
                        <failOnMissingConfigurationFiles>false</failOnMissingConfigurationFiles>
                        <analysisConfiguration><![CDATA[
                                {
                                    "revapi" : {
                                        "java" : {
                                            "missing-classes" : {
                                                "behavior" : "report"
                                            }
                                        },
                                        "semver": {
                                          "ignore": {
                                            "enabled": true,
                                            "versionIncreaseAllows" : {
                                              "major" : "breaking",
                                              "minor" : "nonBreaking",
                                              "patch" : "equivalent"
                                            }
                                          }
                                        }
                                    }
                                }
                            ]]></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-surefire-plugin</artifactId>
                    <version>${maven.surefire.plugin.version}</version>
                    <configuration>
                        <forkNode implementation="org.apache.maven.plugin.surefire.extensions.SurefireForkNodeFactory"/>
                        <argLine>${surefire.args}</argLine>
                        <properties>
                            <property>
                                <name>listener</name>
                                <value>io.qameta.allure.junit4.AllureJunit4</value>
                            </property>
                        </properties>
                        <systemProperties>
                            <property>
                                <name>allure.results.directory</name>
                                <value>${project.build.directory}/allure-results</value>
                            </property>
                        </systemProperties>
                    </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>
            </plugins>
        </pluginManagement>
        
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-site-plugin</artifactId>
                <version>${maven.site.plugin.version}</version>
            </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>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.revapi</groupId>
                <artifactId>revapi-maven-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>io.qameta.allure</groupId>
                <artifactId>allure-maven</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
            </plugin>
        </plugins>
    </build>

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

    <profiles>
        <profile>
            <id>testJdkWithoutXmlModule</id>
            <activation>
                <!-- This profile cannot be activated based on the jdk because the jdk on which this has to be activated or not -->
                <!-- is the one used to run the tests, not the one used to run Maven. -->
                <property>
                    <name>!testJdkWithXmlModule</name>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-dependency-plugin</artifactId>
                        <version>3.5.0</version>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>properties</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <version>${maven.surefire.plugin.version}</version>
                        <configuration>
                            <additionalClasspathElements>
                                <!-- Add this to the classpath so it is available when running tests with jvm8 -->
                                <!-- but it does not interfere with the module system --> 
                                <!-- (it has colliding packages with java.xml module) when running with java11+ -->
                                <additionalClasspathElement>${org.mule.apache:xerces2-xsd11:jar:}</additionalClasspathElement>
                            </additionalClasspathElements>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
            <dependencies>
                <dependency>
                    <groupId>xml-apis</groupId>
                    <artifactId>xml-apis</artifactId>
                    <!-- This is needed only for jdk8, the required classes from here -->
                    <!-- are already available in the jdk on versions 11+ -->
                    <scope>provided</scope>
                </dependency>
            </dependencies>
        </profile>
        <profile>
            <id>release</id>
            <properties>
                <skipGpg>false</skipGpg>
                <skipNoSnapshotsEnforcerPluginRule>false</skipNoSnapshotsEnforcerPluginRule>
            </properties>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <additionalparam>${xDocLint}</additionalparam>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>3.0.1</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.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
                                            </unCheckedPluginList>
                                        </requirePluginVersions>
                                    </rules>
                                    <skip>${skipNoSnapshotsEnforcerPluginRule}</skip>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
