<?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.tools</groupId>
    <artifactId>mule-soapkit-scaffolder</artifactId>
    <version>1.1.16</version>
    <name>APIKit for SOAP Scaffolder</name>

    <properties>
        <mule.version>4.1.5</mule.version>
        <formatterConfigPath>formatter.xml</formatterConfigPath>
        <tooling.runtime.version>4.2.2-hf5</tooling.runtime.version>
        <mule.tooling.api.version>1.2.2-hf5</mule.tooling.api.version>
        <muleWsdlParserVersion>1.1.6</muleWsdlParserVersion>
        <guavaVersion>24.1.1-jre</guavaVersion>
        <junitVersion>4.13</junitVersion>
        <commonsIoVersion>2.7</commonsIoVersion>
        <xmlbeansVersion>5.0.1</xmlbeansVersion>

        <!--plug-in-->
        <licensePath>LICENSE_HEADER.txt</licensePath>
        <javaVersion>1.8</javaVersion>
        <skipVerifications>false</skipVerifications>
        <mavenCompilerVersion>3.7.0</mavenCompilerVersion>
        <mule.extensions.maven.plugin.version>1.1.6</mule.extensions.maven.plugin.version>
        <checkstyle.plugin.version>2.17</checkstyle.plugin.version>
        <javaFormatter.plugin.version>1.9.2</javaFormatter.plugin.version>
        <formatterGoal>format</formatterGoal>

        <!--jacoco report-->
        <jacoco.version>0.8.5</jacoco.version>
        <allureJunitVersion>2.13.5</allureJunitVersion>
        <allureReportVersion>2.3.4</allureReportVersion>
        <allure.maven.plugin.version>2.10.0</allure.maven.plugin.version>
    </properties>


    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <artifactId>maven-release-plugin</artifactId>
                    <version>2.3.2</version>
                </plugin>
                <plugin>
                    <groupId>com.mycila</groupId>
                    <artifactId>license-maven-plugin</artifactId>
                    <version>2.8</version>
                    <configuration>
                        <header>${licensePath}</header>
                        <excludes>
                            <exclude>target/**</exclude>
                            <exclude>**/.gitignore</exclude>
                            <exclude>**/*.txt</exclude>
                            <exclude>**/*.groovy</exclude>
                            <exclude>**/*.sh</exclude>
                            <exclude>**/*.bat</exclude>
                            <exclude>**/*.ftl</exclude>
                            <exclude>**/*.xml</exclude>
                            <exclude>**/*.properties</exclude>
                            <exclude>**/*.sample</exclude>
                            <exclude>**/*.md</exclude>
                            <exclude>**/*.xsl</exclude>
                            <exclude>**/*.html</exclude>
                            <exclude>**/*.css</exclude>
                            <exclude>**/build-number.txt</exclude>
                            <exclude>**/*.wsdl</exclude>
                        </excludes>
                        <includes>
                            <include>**/*.java</include>
                        </includes>
                        <mapping>
                            <java>SLASHSTAR_STYLE</java>
                        </mapping>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-checkstyle-plugin</artifactId>
                    <version>${checkstyle.plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>com.marvinformatics.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>
                        <encoding>UTF-8</encoding>
                    </configuration>
                    <executions>
                        <execution>
                            <id>apply-format</id>
                            <phase>compile</phase>
                            <goals>
                                <goal>${formatterGoal}</goal>
                            </goals>
                            <configuration>
                                <skipFormatting>${skipVerifications}</skipFormatting>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </pluginManagement>

        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>${mavenCompilerVersion}</version>
                <configuration>
                    <source>${javaVersion}</source>
                    <target>${javaVersion}</target>
                    <encoding>UTF-8</encoding>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <version>2.5.3</version>
            </plugin>
            <!--
              Needed for checkstyle to find the license header file from the classpath.
              CAVEAT: you cannot build the site without mule-buildtools present in
              your local repository.

              For plugin config see below in reporting section
         -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-checkstyle-plugin</artifactId>
                <dependencies>
                    <dependency>
                        <groupId>org.mule</groupId>
                        <artifactId>mule-buildtools</artifactId>
                        <version>${mule.version}</version>
                    </dependency>
                </dependencies>
            </plugin>
            <plugin>
                <groupId>com.marvinformatics.formatter</groupId>
                <artifactId>formatter-maven-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.mule.runtime.plugins</groupId>
                <artifactId>mule-extensions-maven-plugin</artifactId>
                <version>${mule.extensions.maven.plugin.version}</version>
            </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>

        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>true</filtering>
            </resource>
        </resources>
    </build>

    <dependencies>
        <!-- Module dependencies -->
        <dependency>
            <groupId>org.mule.wsdl</groupId>
            <artifactId>mule-wsdl-parser</artifactId>
            <version>${muleWsdlParserVersion}</version>
            <exclusions>
                <exclusion>
                    <groupId>org.apache.cxf</groupId>
                    <artifactId>cxf-rt-wsdle</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.mule.apache</groupId>
                    <artifactId>xerces2-xsd11</artifactId>
                </exclusion>
                <exclusion>
                    <artifactId>xmlbeans</artifactId>
                    <groupId>org.apache.xmlbeans</groupId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.mule.tooling</groupId>
            <artifactId>mule-tooling-api</artifactId>
            <version>${mule.tooling.api.version}</version>
        </dependency>
        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
            <version>${guavaVersion}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.xmlbeans</groupId>
            <artifactId>xmlbeans</artifactId>
            <version>${xmlbeansVersion}</version>
        </dependency>
        <!-- Test dependencies -->
        <dependency>
            <groupId>org.mule.modules</groupId>
            <artifactId>mule-soapkit-common-test</artifactId>
            <version>1.1.13</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>${junitVersion}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
            <version>${commonsIoVersion}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mule.tooling</groupId>
            <artifactId>mule-tooling-bootstrap</artifactId>
            <version>${mule.tooling.api.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>io.qameta.allure</groupId>
            <artifactId>allure-junit4</artifactId>
            <version>${allureJunitVersion}</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <distributionManagement>
        <repository>
            <id>mule-ee-releases</id>
            <name>Mule Release Repository</name>
            <url>https://repository-master.mulesoft.org/nexus/content/repositories/ci-releases</url>
        </repository>
        <snapshotRepository>
            <id>mule-ee-snapshots</id>
            <name>Mule Snapshot Repository</name>
            <url>https://repository-master.mulesoft.org/nexus/content/repositories/ci-snapshots</url>
            <uniqueVersion>false</uniqueVersion>
        </snapshotRepository>
    </distributionManagement>

    <repositories>
        <repository>
            <id>mulesoft-private</id>
            <name>Mulesoft internal repository</name>
            <url>https://repository.mulesoft.org/nexus/content/repositories/private/</url>
        </repository>
    </repositories>
    <pluginRepositories>
        <pluginRepository>
            <id>mulesoft-private</id>
            <name>Mulesoft internal repository</name>
            <url>https://repository.mulesoft.org/nexus/content/repositories/private/</url>
        </pluginRepository>
    </pluginRepositories>

    <scm>
        <connection>scm:git:git://github.com:mulesoft/apikit-soap-scaffolder.git</connection>
        <developerConnection>scm:git:git@github.com:mulesoft/apikit-soap-scaffolder.git</developerConnection>
        <url>http://github.com/mulesoft/apikit-soap-scaffolder</url>
        <tag>HEAD</tag>
    </scm>

</project>