<?xml version="1.0"?>
<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.maven</groupId>
    <artifactId>mule-artifact-tools</artifactId>
    <version>3.2.1</version>
    <packaging>pom</packaging>

    <name>Mule Artifact Tools</name>

    <url>https://github.com/mulesoft/mule-maven-plugin</url>

    <licenses>
        <license>
            <name>CPAL v1.0</name>
            <url>https://www.mulesoft.com/CPAL</url>
        </license>
    </licenses>
    <mailingLists>
        <mailingList>
            <name>developers</name>
            <post>munit@mulesoft.com</post>
        </mailingList>
    </mailingLists>
    <issueManagement>
        <system>jira</system>
        <url>https://www.mulesoft.org/jira/browse/MMP</url>
    </issueManagement>
    <organization>
        <name>MuleSoft Inc</name>
        <url>https://www.mulesoft.com/</url>
    </organization>

    <modules>
        <module>mule-packager</module>
        <module>mule-classloader-model</module>
        <module>mule-deployer</module>
        <module>mule-maven-plugin</module>
        <module>mule-artifact-it</module>
    </modules>

    <properties>
        <java.source>1.8</java.source>
        <java.target>1.8</java.target>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

        <mule.api.version>1.1.4</mule.api.version>
        <mule.core.version>4.0.0</mule.core.version>
        <mule.maven.client.impl.version>1.2.0</mule.maven.client.impl.version>
        <mule.distribution.standalone.version>4.1.4</mule.distribution.standalone.version>
        <gson.version>2.8.0</gson.version>
        <guava.version>18.0</guava.version>
        <jackson.dataformat.yaml.version>2.9.6</jackson.dataformat.yaml.version>
        <jackson.databind.version>2.9.6</jackson.databind.version>
        <semver4j.version>2.2.0</semver4j.version>
        <semantic.version.version>1.1.0</semantic.version.version>
        <log4j.version>1.2.17</log4j.version>
        <commons.io.version>2.5</commons.io.version>
        <commons.exec.version>1.2</commons.exec.version>
        <commons.lang.version>3.7</commons.lang.version>
        <commons.cli.version>1.3.1</commons.cli.version>
        <slf4j.api.version>1.8.0-alpha2</slf4j.api.version>
        <commons.logging.version>1.2</commons.logging.version>
        <jdom2.version>2.0.5</jdom2.version>

        <maven.version>3.5.0</maven.version>
        <maven.compat.version>3.5.0</maven.compat.version>
        <maven.verifier.version>1.6</maven.verifier.version>
        <maven.dependency.tree.version>1.2</maven.dependency.tree.version>
        <plexus.container.default.version>1.6</plexus.container.default.version>
        <plexus.component.annotations.version>1.7.1</plexus.component.annotations.version>

        <jersey.version>2.25</jersey.version>
        <jersey.media.moxy>2.15</jersey.media.moxy>

        <junit.version>4.12</junit.version>
        <mockito.version>1.8.5</mockito.version>
        <hamcrest.version>1.3</hamcrest.version>
        <hamcrest.all.version>1.3</hamcrest.all.version>
        <mockito.core.version>2.8.9</mockito.core.version>
        <powermock.version>1.7.0</powermock.version>
        <mockserver.netty.version>5.3.0</mockserver.netty.version>

        <!-- Plugin Versions -->
        <maven.plugin.version>3.5</maven.plugin.version>
        <license.plugin.version>2.6</license.plugin.version>
        <codehaus.plexus.archiver>3.6.0</codehaus.plexus.archiver>
        <checkstyle.plugin.version>2.17</checkstyle.plugin.version>
        <jacoco.maven.plugin.version>0.8.2</jacoco.maven.plugin.version>
        <spotbugs.maven.plugin.version>3.1.6</spotbugs.maven.plugin.version>
        <spotbugs.version>3.1.7</spotbugs.version>
        <formatter.maven.plugin.version>1.9.0</formatter.maven.plugin.version>
        <build.helper.maven.plugin.version>1.8</build.helper.maven.plugin.version>

        <maven.plugin.plugin.version>3.5</maven.plugin.plugin.version>
        <maven.invoker.plugin.version>2.0.0</maven.invoker.plugin.version>
        <maven.compiler.plugin.version>3.6.1</maven.compiler.plugin.version>
        <maven.dependency.plugin.version>2.10</maven.dependency.plugin.version>
        <maven.plugin.annotations.version>3.5</maven.plugin.annotations.version>

        <maven.surefire.plugin.version>2.20</maven.surefire.plugin.version>
        <maven.resources.plugin.version>2.7</maven.resources.plugin.version>

        <suite>standalone</suite>
        <target>server-name</target>
        <environment>Production</environment>

        <formatterGoal>validate</formatterGoal>
        <skipVerifications>false</skipVerifications>

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

        <skipTests>false</skipTests>
        <jacoco.report.location>${session.executionRootDirectory}/target/jacoco.exec</jacoco.report.location>
        <jacoco.agent.argLine>
            -javaagent:'${settings.localRepository}/org/jacoco/org.jacoco.agent/${jacoco.maven.plugin.version}/org.jacoco.agent-${jacoco.maven.plugin.version}-runtime.jar'=destfile='${session.executionRootDirectory}/target/jacoco.exec'
        </jacoco.agent.argLine>
        <coverageLineLimit>0.99</coverageLineLimit>
        <coverageBranchLimit>0.99</coverageBranchLimit>
        <skipJaCoCoCoverage>${skipTests}</skipJaCoCoCoverage>
    </properties>


    <dependencyManagement>
        <dependencies>
            <!-- Maven Plugin Dependencies -->
            <dependency>
                <groupId>org.apache.maven</groupId>
                <artifactId>maven-plugin-api</artifactId>
                <version>${maven.version}</version>
                <exclusions>
                    <exclusion>
                        <groupId>org.apache.maven</groupId>
                        <artifactId>maven-model</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>org.apache.maven</groupId>
                        <artifactId>maven-artifact</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>org.eclipse.sisu</groupId>
                        <artifactId>org.eclipse.sisu.plexus</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <dependency>
                <groupId>org.apache.maven</groupId>
                <artifactId>maven-core</artifactId>
                <version>${maven.version}</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>org.apache.maven.plugin-tools</groupId>
                <artifactId>maven-plugin-annotations</artifactId>
                <version>${maven.plugin.annotations.version}</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>org.mule</groupId>
                <artifactId>mule-maven-client-impl</artifactId>
                <version>${mule.maven.client.impl.version}</version>
            </dependency>
            <dependency>
                <groupId>org.codehaus.plexus</groupId>
                <artifactId>plexus-archiver</artifactId>
                <version>${codehaus.plexus.archiver}</version>
            </dependency>


            <!-- Mule -->
            <dependency>
                <groupId>org.mule.runtime</groupId>
                <artifactId>mule-api</artifactId>
                <version>${mule.api.version}</version>
            </dependency>
            <dependency>
                <groupId>org.mule.runtime</groupId>
                <artifactId>mule-core</artifactId>
                <version>${mule.core.version}</version>
            </dependency>

            <!-- Apache -->
            <dependency>
                <groupId>org.apache.commons</groupId>
                <artifactId>commons-lang3</artifactId>
                <version>${commons.lang.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.commons</groupId>
                <artifactId>commons-exec</artifactId>
                <version>${commons.exec.version}</version>
            </dependency>
            <dependency>
                <groupId>commons-io</groupId>
                <artifactId>commons-io</artifactId>
                <version>${commons.io.version}</version>
            </dependency>
            <dependency>
                <groupId>commons-logging</groupId>
                <artifactId>commons-logging</artifactId>
                <version>${commons.logging.version}</version>
            </dependency>
            <dependency>
                <groupId>commons-cli</groupId>
                <artifactId>commons-cli</artifactId>
                <version>${commons.cli.version}</version>
            </dependency>
            <dependency>
                <groupId>org.jdom</groupId>
                <artifactId>jdom2</artifactId>
                <version>${jdom2.version}</version>
            </dependency>

            <dependency>
                <groupId>com.google.guava</groupId>
                <artifactId>guava</artifactId>
                <version>${guava.version}</version>
            </dependency>
            <dependency>
                <groupId>com.google.code.gson</groupId>
                <artifactId>gson</artifactId>
                <version>${gson.version}</version>
            </dependency>

            <dependency>
                <groupId>com.fasterxml.jackson.dataformat</groupId>
                <artifactId>jackson-dataformat-yaml</artifactId>
                <version>${jackson.dataformat.yaml.version}</version>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson.core</groupId>
                <artifactId>jackson-databind</artifactId>
                <version>${jackson.databind.version}</version>
            </dependency>

            <dependency>
                <groupId>com.vdurmont</groupId>
                <artifactId>semver4j</artifactId>
                <version>${semver4j.version}</version>
            </dependency>

            <dependency>
                <groupId>de.skuzzle</groupId>
                <artifactId>semantic-version</artifactId>
                <version>${semantic.version.version}</version>
            </dependency>


            <!-- Jersey -->
            <dependency>
                <groupId>org.glassfish.jersey.core</groupId>
                <artifactId>jersey-client</artifactId>
                <version>${jersey.version}</version>
            </dependency>
            <dependency>
                <groupId>org.glassfish.jersey.media</groupId>
                <artifactId>jersey-media-multipart</artifactId>
                <version>${jersey.version}</version>
            </dependency>
            <dependency>
                <groupId>org.glassfish.jersey.media</groupId>
                <artifactId>jersey-media-moxy</artifactId>
                <version>${jersey.media.moxy}</version>
            </dependency>
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-api</artifactId>
                <version>${slf4j.api.version}</version>
            </dependency>

            <!-- The Plexus annotations -->
            <dependency>
                <groupId>org.codehaus.plexus</groupId>
                <artifactId>plexus-component-annotations</artifactId>
                <version>${plexus.component.annotations.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.maven</groupId>
                <artifactId>maven-compat</artifactId>
                <version>${maven.compat.version}</version>
            </dependency>
            <dependency>
                <groupId>org.codehaus.plexus</groupId>
                <artifactId>plexus-container-default</artifactId>
                <version>${plexus.container.default.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.maven.shared</groupId>
                <artifactId>maven-dependency-tree</artifactId>
                <version>${maven.dependency.tree.version}</version>
            </dependency>

            <dependency>
                <groupId>org.apache.maven.shared</groupId>
                <artifactId>maven-verifier</artifactId>
                <version>${maven.verifier.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-verifier-plugin</artifactId>
                <version>${maven.verifier.plugin.version}</version>
                <type>maven-plugin</type>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>junit</groupId>
                <artifactId>junit</artifactId>
                <version>${junit.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.hamcrest</groupId>
                <artifactId>hamcrest-all</artifactId>
                <version>${hamcrest.all.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.mockito</groupId>
                <artifactId>mockito-core</artifactId>
                <version>${mockito.core.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.powermock</groupId>
                <artifactId>powermock-module-junit4</artifactId>
                <version>${powermock.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.powermock</groupId>
                <artifactId>powermock-api-mockito2</artifactId>
                <version>${powermock.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.mock-server</groupId>
                <artifactId>mockserver-netty</artifactId>
                <version>${mockserver.netty.version}</version>
            </dependency>
            <dependency>
                <groupId>log4j</groupId>
                <artifactId>log4j</artifactId>
                <version>${log4j.version}</version>
                <scope>test</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-resources-plugin</artifactId>
                    <version>${maven.resources.plugin.version}</version>
                    <configuration>
                        <includeEmptyDirs>true</includeEmptyDirs>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>${maven.compiler.plugin.version}</version>
                    <configuration>
                        <source>${java.source}</source>
                        <target>${java.target}</target>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>com.mycila</groupId>
                    <artifactId>license-maven-plugin</artifactId>
                    <version>${license.plugin.version}</version>
                    <configuration>
                        <header>${licensePath}</header>
                        <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>com.marvinformatics.formatter</groupId>
                    <artifactId>formatter-maven-plugin</artifactId>
                    <version>${formatter.maven.plugin.version}</version>
                    <configuration>
                        <compilerCompliance>${java.source}</compilerCompliance>
                        <compilerSource>${java.source}</compilerSource>
                        <compilerTargetPlatform>${java.source}</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-surefire-plugin</artifactId>
                    <version>${maven.surefire.plugin.version}</version>
                    <configuration>
                        <argLine>${jacoco.agent.argLine}</argLine>
                        <systemPropertyVariables>
                            <mule.maven.plugin.version>${project.version}</mule.maven.plugin.version>
                            <mule.home.test>${project.build.directory}</mule.home.test>
                            <argLine>
                                -javaagent:${settings.localRepository}/org/jacoco/org.jacoco.agent/${jacoco.maven.plugin.version}/org.jacoco.agent-${jacoco.maven.plugin.version}-runtime.jar=destfile=${session.executionRootDirectory}/target/jacoco-it.exec
                            </argLine>
                        </systemPropertyVariables>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <configuration>
                    <archive>
                        <manifest>
                            <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
                            <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                        </manifest>
                    </archive>
                </configuration>
            </plugin>
            <plugin>
                <groupId>com.github.spotbugs</groupId>
                <artifactId>spotbugs-maven-plugin</artifactId>
                <version>${spotbugs.maven.plugin.version}</version>
                <configuration>
                    <xmlOutput>true</xmlOutput>
                </configuration>
                <executions>
                    <execution>
                        <phase>verify</phase>
                        <goals>
                            <goal>spotbugs</goal>
                        </goals>
                    </execution>
                </executions>
                <dependencies>
                    <dependency>
                      <groupId>com.github.spotbugs</groupId>
                      <artifactId>spotbugs</artifactId>
                      <version>${spotbugs.version}</version>
                    </dependency>
                </dependencies>
            </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>
                    <execution>
                        <id>default-report</id>
                        <goals>
                            <goal>report</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>default-check</id>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <haltOnFailure>true</haltOnFailure>
                    <skip>${skipJaCoCoCoverage}</skip>
                    <append>true</append>
                    <destFile>${jacoco.report.location}</destFile>
                    <dataFile>${jacoco.report.location}</dataFile>
                    <rules>
                        <rule>
                            <element>BUNDLE</element>
                            <limits>
                                <limit>
                                    <counter>LINE</counter>
                                    <value>COVEREDRATIO</value>
                                    <minimum>${coverageLineLimit}</minimum>
                                </limit>
                                <limit>
                                    <counter>BRANCH</counter>
                                    <value>COVEREDRATIO</value>
                                    <minimum>${coverageBranchLimit}</minimum>
                                </limit>
                            </limits>
                        </rule>
                    </rules>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <reporting>
        <plugins>
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <version>${jacoco.maven.plugin.version}</version>
            </plugin>
            <plugin>
                <groupId>com.github.spotbugs</groupId>
                <artifactId>spotbugs-maven-plugin</artifactId>
                <version>${spotbugs.maven.plugin.version}</version>
            </plugin>
        </plugins>
    </reporting>


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

    <scm>
        <connection>scm:git:git://github.com/mulesoft/mule-maven-plugin.git</connection>
        <developerConnection>scm:git:git@github.com:mulesoft/mule-maven-plugin.git</developerConnection>
        <url>https://github.com/mulesoft/mule-maven-plugin</url>
        <tag>v3.2.1</tag>
    </scm>

</project>
