<?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>com.mulesoft.tools</groupId>
    <artifactId>mule-migration-tool</artifactId>
    <version>1.0.0-RC</version>
    <packaging>pom</packaging>

    <name>Mule Migration Tool</name>

    <modules>
        <module>mule-migration-tool-api</module>
        <module>target-modules</module>
        <module>mule-migration-tool-tck</module>
        <module>mule-migration-tool-engine</module>
        <module>mule-migration-tool-library</module>
        <module>runner</module>
        <module>mule-migration-tool-tests</module>
        <module>mule-migration-tool-expression</module>
        <module>migration-contribution-archetype</module>
        <module>mule-migration-tool-contribution</module>

    </modules>

    <profiles>
        <profile>
            <id>compatibility</id>
            <modules>
                <module>compatibility</module>
            </modules>
        </profile>
    </profiles>

    <properties>
        <javaVersion>1.8</javaVersion>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>

        <!-- Plugin Versions -->
        <license.plugin.version>2.6</license.plugin.version>

        <maven.license.plugin.version>2.11</maven.license.plugin.version>
        <maven.javadoc.plugin.version>2.10.4</maven.javadoc.plugin.version>
        <maven.shade.plugin.version>1.6</maven.shade.plugin.version>
        <maven.surefire.plugin.version>2.22.0</maven.surefire.plugin.version>
        <maven.deploy.plugin.version>2.8.2</maven.deploy.plugin.version>
        <maven.jar.plugin.version>3.0.2</maven.jar.plugin.version>
        <checkstyle.plugin.version>2.17</checkstyle.plugin.version>
        <javaFormatter.plugin.version>1.9.2</javaFormatter.plugin.version>
        <maven.enforcer.plugin.version>3.0.0-M1</maven.enforcer.plugin.version>
        <checkstyle.version>8.0</checkstyle.version>
        <maven.help.plugin.version>3.0.1</maven.help.plugin.version>
        <maven.dependency.version>2.8</maven.dependency.version>
        <maven.site.plugin.version>3.3</maven.site.plugin.version>

        <jacoco.maven.plugin.version>0.8.2</jacoco.maven.plugin.version>
        <jacoco.report.location>${session.executionRootDirectory}/target/jacoco.exec</jacoco.report.location>

        <!-- Dependencies -->
        <gson.version>2.8.6</gson.version>
        <guava.version>19.0</guava.version>
        <jaxen.version>1.1.6</jaxen.version>
        <jdom2.version>2.0.6</jdom2.version>
        <commons.io.version>2.6</commons.io.version>
        <commons.net.version>3.6</commons.net.version>
        <commons.text.version>1.4</commons.text.version>
        <commons.cli.version>1.4</commons.cli.version>
        <commons.lang3.version>3.7</commons.lang3.version>
        <log4j.version>2.9.1</log4j.version>

        <junit.version>4.12</junit.version>
        <hamcrest.version>1.3</hamcrest.version>
        <mockito.version>2.23.0</mockito.version>
        <xmlunit.version>2.5.1</xmlunit.version>
        <powermock.module.junit4>2.0.0-beta.5</powermock.module.junit4>

        <maven.model.version>3.5.0</maven.model.version>

        <mule.runtime.version>4.2.2</mule.runtime.version>
        <munit.version>2.2.1</munit.version>

        <mule.api.version>1.1.5</mule.api.version>
        <migrant.version>2.1.10</migrant.version>
        <parser.version>2.1.3</parser.version>

        <!-- Properties -->
        <lib-dir>${basedir}/lib</lib-dir>
        <skipVerifications>false</skipVerifications>
        <skipIntegrationTests>false</skipIntegrationTests>
        <skipJaCoCoCoverage>${skipVerifications}</skipJaCoCoCoverage>

        <formatterGoal>validate</formatterGoal>
        <licensePath>LICENSE_HEADER.txt</licensePath>
        <formatterConfigPath>formatter.xml</formatterConfigPath>

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

        <!-- Tests -->
        <settingsFile>${java.io.tmpdir}/effective-settings.xml</settingsFile>

        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

        <maven.compiler.plugin.version>3.1</maven.compiler.plugin.version>
        <build.helper.maven.plugin.version>1.10</build.helper.maven.plugin.version>
        <scala.maven.plugin.version>3.2.2</scala.maven.plugin.version>
        <scalatest.maven.plugin.version>2.0.0</scalatest.maven.plugin.version>

        <java.version>1.8</java.version>
        <scala.version>2.12.7</scala.version>
        <parboiled.version>2.1.4</parboiled.version>
        <scalatest.version>3.0.1</scalatest.version>

    </properties>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>com.mycila</groupId>
                    <artifactId>license-maven-plugin</artifactId>
                    <version>${maven.license.plugin.version}</version>
                    <configuration>
                        <header>${licensePath}</header>
                        <strictCheck>true</strictCheck>
                        <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>
                        </excludes>
                        <includes>
                            <include>**/*.java</include>
                        </includes>
                        <mapping>
                            <java>SLASHSTAR_STYLE</java>
                        </mapping>
                    </configuration>
                    <executions>
                        <execution>
                            <goals>
                                <goal>check</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <version>${maven.javadoc.plugin.version}</version>
                    <configuration>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-checkstyle-plugin</artifactId>
                    <version>${checkstyle.plugin.version}</version>
                    <dependencies>
                        <dependency>
                            <groupId>com.puppycrawl.tools</groupId>
                            <artifactId>checkstyle</artifactId>
                            <version>${checkstyle.version}</version>
                        </dependency>
                    </dependencies>
                    <configuration>
                        <skip>${skipVerifications}</skip>
                        <configLocation>munit_check.xml</configLocation>
                        <failOnViolation>true</failOnViolation>
                    </configuration>
                    <executions>
                        <execution>
                            <phase>verify</phase>
                            <goals>
                                <goal>check</goal>                                
                            </goals>
                        </execution>
                    </executions>
                </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>
                        <skipFormatting>${skipVerifications}</skipFormatting>
                    </configuration>
                    <executions>
                        <execution>
                            <phase>compile</phase>
                            <goals>
                                <goal>${formatterGoal}</goal>
                            </goals>
                        </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-plugin-versions</id>
                            <goals>
                                <goal>enforce</goal>
                            </goals>
                            <configuration>
                                <rules>
                                    <banDuplicatePomDependencyVersions/>
                                    <requirePluginVersions>
                                        <message>Best Practice is to always define plugin versions!</message>
                                        <banLatest>false</banLatest>
                                        <banRelease>false</banRelease>
                                        <banSnapshots>false</banSnapshots>
                                        <banTimestamps>false</banTimestamps>
                                        <phases>clean,deploy,site</phases>
                                        <unCheckedPluginList>
                                            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-compiler-plugin,org.apache.maven.plugins:maven-surefire-plugin,org.apache.maven.plugins:maven-jar-plugin,org.apache.maven.plugins:maven-resources-plugin
                                        </unCheckedPluginList>
                                    </requirePluginVersions>

                                </rules>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-help-plugin</artifactId>
                    <version>${maven.help.plugin.version}</version>
                    <executions>
                        <execution>
                            <phase>process-test-resources</phase>
                            <id>copy-settings</id>
                            <goals>
                                <goal>effective-settings</goal>
                            </goals>
                            <configuration>
                                <output>${settingsFile}</output>
                                <showPasswords>true</showPasswords>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.jacoco</groupId>
                    <artifactId>jacoco-maven-plugin</artifactId>
                    <version>${jacoco.maven.plugin.version}</version>
                    <executions>
                        <execution>
                            <id>default-prepare-agent</id>
                            <goals>
                                <goal>prepare-agent</goal>
                            </goals>
                        </execution>                        
                    </executions>
                    <configuration>
                        <haltOnFailure>true</haltOnFailure>
                        <skip>${skipJaCoCoCoverage}</skip>
                        <append>true</append>
                        <destFile>${jacoco.report.location}</destFile>
                        <dataFile>${jacoco.report.location}</dataFile>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-dependency-plugin</artifactId>
                    <version>${maven.dependency.version}</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>
                        <systemPropertyVariables>
                            <mule.distribution>${com.mulesoft.mule.distributions:mule-ee-distribution-standalone:zip}
                            </mule.distribution>
                            <buildDirectory>${project.build.directory}</buildDirectory>
                            <settings.file>${settingsFile}</settings.file>
                            <maven.home>${maven.home}</maven.home>
                        </systemPropertyVariables>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-site-plugin</artifactId>
                    <version>${maven.site.plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-assembly-plugin</artifactId>
                    <version>3.1.0</version>
                </plugin>
                <!--TODO this we need to make it run-->
                <!--<plugin>-->
                <!--<groupId>org.apache.maven.plugins</groupId>-->
                <!--<artifactId>maven-jar-plugin</artifactId>-->
                <!--<version>${maven.jar.plugin.version}</version>-->
                <!--<configuration>-->
                <!--<archive>-->
                <!--<manifest>-->
                <!--<addClasspath>true</addClasspath>-->
                <!--<classpathPrefix>${lib-dir}</classpathPrefix>-->
                <!--<mainClass>com.mulesoft.tools.migration.MigrationRunner</mainClass>-->
                <!--</manifest>-->
                <!--</archive>-->
                <!--</configuration>-->
                <!--</plugin>-->

                <!--<plugin>-->
                <!--<groupId>org.apache.maven.plugins</groupId>-->
                <!--<artifactId>maven-shade-plugin</artifactId>-->
                <!--<version>${maven.shade.plugin.version}</version>-->
                <!--<executions>-->
                <!--<execution>-->
                <!--<phase>package</phase>-->
                <!--<goals>-->
                <!--<goal>shade</goal>-->
                <!--</goals>-->
                <!--</execution>-->
                <!--</executions>-->
                <!--</plugin>-->
            </plugins>
        </pluginManagement>
    </build>
    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.jdom</groupId>
                <artifactId>jdom2</artifactId>
                <version>${jdom2.version}</version>
            </dependency>
            <dependency>
                <groupId>jaxen</groupId>
                <artifactId>jaxen</artifactId>
                <version>${jaxen.version}</version>
            </dependency>
            <dependency>
                <groupId>org.mule.weave</groupId>
                <artifactId>migrant</artifactId>
                <version>${migrant.version}</version>
            </dependency>
            <dependency>
                <groupId>commons-cli</groupId>
                <artifactId>commons-cli</artifactId>
                <version>${commons.cli.version}</version>
            </dependency>
            <dependency>
                <groupId>com.google.code.gson</groupId>
                <artifactId>gson</artifactId>
                <version>${gson.version}</version>
            </dependency>

            <dependency>
                <groupId>org.apache.commons</groupId>
                <artifactId>commons-lang3</artifactId>
                <version>${commons.lang3.version}</version>
            </dependency>
            <dependency>
                <groupId>commons-io</groupId>
                <artifactId>commons-io</artifactId>
                <version>${commons.io.version}</version>
            </dependency>
            <dependency>
                <groupId>commons-net</groupId>
                <artifactId>commons-net</artifactId>
                <version>${commons.net.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.commons</groupId>
                <artifactId>commons-text</artifactId>
                <version>${commons.text.version}</version>
            </dependency>
            <dependency>
                <groupId>com.google.guava</groupId>
                <artifactId>guava</artifactId>
                <version>${guava.version}</version>
            </dependency>

            <!-- Test Dependencies -->
            <dependency>
                <groupId>junit</groupId>
                <artifactId>junit</artifactId>
                <version>${junit.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.mockito</groupId>
                <artifactId>mockito-core</artifactId>
                <version>${mockito.version}</version>
                <exclusions>
                    <exclusion>
                        <groupId>org.hamcrest</groupId>
                        <artifactId>hamcrest-core</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <dependency>
                <groupId>org.hamcrest</groupId>
                <artifactId>hamcrest-all</artifactId>
                <version>${hamcrest.version}</version>
            </dependency>
            <dependency>
                <groupId>org.powermock</groupId>
                <artifactId>powermock-module-junit4</artifactId>
                <version>${powermock.module.junit4}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.powermock</groupId>
                <artifactId>powermock-api-mockito2</artifactId>
                <version>${powermock.module.junit4}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.xmlunit</groupId>
                <artifactId>xmlunit-matchers</artifactId>
                <version>${xmlunit.version}</version>
                <scope>test</scope>
            </dependency>

            <dependency>
                <groupId>org.mule.runtime</groupId>
                <artifactId>mule-module-deployment-model</artifactId>
                <version>${mule.runtime.version}</version>
                <type>test-jar</type>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.mule.runtime</groupId>
                <artifactId>mule-module-artifact</artifactId>
                <version>${mule.runtime.version}</version>
                <type>test-jar</type>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.mule.distributions</groupId>
                <artifactId>mule-distro-tests</artifactId>
                <version>${mule.runtime.version}</version>
                <type>test-jar</type>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>com.mulesoft.mule.distributions</groupId>
                <artifactId>mule-system-tests</artifactId>
                <version>${mule.runtime.version}</version>
                <type>test-jar</type>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.mule.tests</groupId>
                <artifactId>mule-tests-infrastructure</artifactId>
                <version>${mule.runtime.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>com.mulesoft.mule.distributions</groupId>
                <artifactId>mule-ee-distribution-standalone</artifactId>
                <type>zip</type>
                <version>${mule.runtime.version}</version>
                <scope>test</scope>
                <exclusions>
                    <exclusion>
                        <groupId>*</groupId>
                        <artifactId>*</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>

            <dependency>
                <groupId>org.apache.logging.log4j</groupId>
                <artifactId>log4j-slf4j-impl</artifactId>
                <version>${log4j.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.logging.log4j</groupId>
                <artifactId>log4j-core</artifactId>
                <version>${log4j.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.maven</groupId>
                <artifactId>maven-model</artifactId>
                <version>${maven.model.version}</version>
            </dependency>

            <dependency>
                <groupId>org.mule.runtime</groupId>
                <artifactId>mule-api</artifactId>
                <version>${mule.api.version}</version>
            </dependency>
            <dependency>
                <groupId>org.mule.runtime</groupId>
                <artifactId>mule-module-artifact</artifactId>
                <version>${mule.runtime.version}</version>
                <scope>test</scope>
            </dependency>

            <dependency>
                <groupId>org.scala-lang</groupId>
                <artifactId>scala-library</artifactId>
                <version>${scala.version}</version>
                <scope>compile</scope>
            </dependency>
            <dependency>
                <groupId>org.parboiled</groupId>
                <artifactId>parboiled_2.12</artifactId>
                <version>${parboiled.version}</version>
                <scope>compile</scope>
            </dependency>
            <dependency>
                <groupId>org.scalatest</groupId>
                <artifactId>scalatest_2.12</artifactId>
                <version>${scalatest.version}</version>
                <scope>compile</scope>
            </dependency>
            <dependency>
                <groupId>org.mule.weave</groupId>
                <artifactId>parser</artifactId>
                <version>${parser.version}</version>
                <scope>compile</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <url>https://github.com/mulesoft/mule-migration-tool</url>
    <issueManagement>
        <system>jira</system>
        <url>https://www.mulesoft.org/jira/browse/MMT</url>
    </issueManagement>
    <organization>
        <name>MuleSoft Inc</name>
        <url>https://www.mulesoft.com/</url>
    </organization>

    <distributionManagement>
        <repository>
            <id>mule-releases</id>
            <name>MuleSoft Releases Repository</name>
            <url>https://repository-master.mulesoft.org/releases/</url>
        </repository>
        <snapshotRepository>
            <id>mule-snapshots</id>
            <name>MuleSoft Snapshots Repository</name>
            <url>https://repository-master.mulesoft.org/snapshots/</url>
        </snapshotRepository>
    </distributionManagement>

</project>
