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

    <groupId>org.mule.apikit</groupId>
    <artifactId>raml-parser-interface-parent</artifactId>
    <version>2.7.17</version>
    <packaging>pom</packaging>
    <modelVersion>4.0.0</modelVersion>

    <name>RAML Interfaces Project</name>

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

    <modules>
        <module>raml-parser-interface</module>
        <module>interface-impl-v1</module>
        <module>interface-impl-v2</module>
        <module>interface-impl-amf</module>
        <module>parser-service</module>
    </modules>

    <properties>
        <licensePath>LICENSE_HEADER.txt</licensePath>
        <formatterConfigPath>formatter.xml</formatterConfigPath>

        <mule.metadata.api.version>1.9.9</mule.metadata.api.version>

        <jackson.databind.version>2.16.1</jackson.databind.version>
        <guava.version>32.1.0-jre</guava.version>
        <hamcrestVersion>1.3</hamcrestVersion>
        <junit.version>5.9.3</junit.version>
        <commons.collections4.version>4.4</commons.collections4.version>
        <mockito-junit-jupiter.version>4.11.0</mockito-junit-jupiter.version>
        <jacoco.version>0.8.10</jacoco.version>
        <allureJunitVersion>2.18.1</allureJunitVersion>
        <allureReportVersion>2.3.4</allureReportVersion>
        <allure.maven.plugin.version>2.10.0</allure.maven.plugin.version>
        <mockitoVersion>1.10.19</mockitoVersion>
        <formatter-maven-plugin.version>2.16.0</formatter-maven-plugin.version>
        <formatter.skip>false</formatter.skip>
    </properties>

    <dependencies>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
            <version>${jackson.databind.version}</version>
        </dependency>
        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
            <version>${guava.version}</version>
        </dependency>
        <dependency>
            <groupId>org.mule.runtime</groupId>
            <artifactId>mule-metadata-model-api</artifactId>
            <version>${mule.metadata.api.version}</version>
            <scope>provided</scope>
        </dependency>

        <!-- Tests -->
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-api</artifactId>
            <version>${junit.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.hamcrest</groupId>
            <artifactId>hamcrest-library</artifactId>
            <version>${hamcrestVersion}</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.mockito</groupId>
            <artifactId>mockito-junit-jupiter</artifactId>
            <version>${mockito-junit-jupiter.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-collections4</artifactId>
            <version>${commons.collections4.version}</version>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>com.mycila</groupId>
                <artifactId>license-maven-plugin</artifactId>
                <version>2.11</version>
                <configuration>
                    <header>com/mycila/maven/plugin/license/templates/CPAL.txt</header>
                    <properties>
                        <owner>MuleSoft, Inc</owner>
                        <project.url>http://www.mulesoft.com</project.url>
                    </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-compiler-plugin</artifactId>
                <version>3.8.1</version>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                    <encoding>UTF-8</encoding>
                </configuration>
            </plugin>
            <plugin>
                <groupId>net.revelc.code.formatter</groupId>
                <artifactId>formatter-maven-plugin</artifactId>
                <version>${formatter-maven-plugin.version}</version>
                <configuration>
                    <compilerCompliance>1.8</compilerCompliance>
                    <compilerSource>1.8</compilerSource>
                    <compilerTargetPlatform>1.8</compilerTargetPlatform>
                    <configFile>${basedir}/${formatterConfigPath}</configFile>
                    <configJsFile>${basedir}/${formatterConfigPath}</configJsFile>
                    <aggregator>false</aggregator>
                    <executionRoot>true</executionRoot>
                    <encoding>UTF-8</encoding>
                </configuration>
                <executions>
                    <execution>
                        <id>apply-format</id>
                        <phase>compile</phase>
                        <goals>
                            <goal>validate</goal>
                        </goals>
                        <configuration>
                            <skipFormatting>${formatter.skip}</skipFormatting>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <argLine>-Dfile.encoding=UTF-8 -javaagent:${settings.localRepository}/org/jacoco/org.jacoco.agent/${jacoco.version}/org.jacoco.agent-${jacoco.version}-runtime.jar=destfile='${session.executionRootDirectory}/target/jacoco.exec'</argLine>
                    <properties>
                        <property>
                            <name>listener</name>
                            <value>io.qameta.allure.junit4.AllureJunit4</value>
                        </property>
                    </properties>
                    <systemPropertyVariables>
                        <!-- Just propagate this variable due to surefire will not do this when forked vm for tests -->
                        <mule.freePortFinder.lockPath>${java.io.tmpdir}/mule/freePortFinder</mule.freePortFinder.lockPath>
                        <maven.projectVersion>${project.version}</maven.projectVersion>
                    </systemPropertyVariables>
                    <systemProperties>
                        <property>
                            <name>allure.results.directory</name>
                            <value>${project.build.directory}/allure-results</value>
                        </property>
                    </systemProperties>
                </configuration>
                <dependencies>
                    <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>
    </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>
</project>
