<?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-maven-plugin</artifactId>
    <version>3.0.0-BETA</version>
    <packaging>maven-plugin</packaging>
    <name>Mule Maven Plugin</name>
    <description>
        Maven plugin to deploy Mule applications to different kinds of servers: Standalone (both Community and Enterprise), Clustered, Anypoint Runtime Manager and CloudHub.
        Main uses are running integration tests and deploying applications.
        Some of the features are:
        Download Mule Standalone from a Maven Repository and install it locally.
        Deploy a Mule application to a server.
        Undeploy a Mule application.
        Assemble a Mule cluster and deploy applications.
    </description>
    <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>
    <properties>
        <licensePath>LICENSE_HEADER.txt</licensePath>
        <formatterConfigPath>formatter.xml</formatterConfigPath>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <mule.version>3.8.1</mule.version>
        <suite>standalone</suite>

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

        <java.source>1.8</java.source>
        <java.target>1.8</java.target>

        <javaFormatter.plugin.version>1.8.0</javaFormatter.plugin.version>
        <license.plugin.version>2.6</license.plugin.version>
        <guava.version>18.0</guava.version>
        <maven.version>3.3.9</maven.version>
        <junit.version>4.8.2</junit.version>
        <mockito.version>1.8.5</mockito.version>
        <mockito.core.version>2.5.6</mockito.core.version>
        <jersey.version>2.25</jersey.version>
        <groovy.version>2.0.1</groovy.version>
        <hamcrest.version>1.3</hamcrest.version>
        <checkstyle.plugin.version>2.17</checkstyle.plugin.version>
        <formatter.maven.plugin.version>1.8.0</formatter.maven.plugin.version>
        <log4j.version>1.2.17</log4j.version>

        <commons.io.version>2.5</commons.io.version>
        <commons.cli.version>1.3.1</commons.cli.version>
        <commons.logging.version>1.2</commons.logging.version>
        <skipVerifications>false</skipVerifications>
        <formatterGoal>validate</formatterGoal>

        <maven.dependency.tree.version>1.2</maven.dependency.tree.version>
        <maven.plugin.annotations.version>3.5</maven.plugin.annotations.version>
        <maven.dependency.plugin.version>2.10</maven.dependency.plugin.version>
        <maven.antrun.plugin.version>1.7</maven.antrun.plugin.version>
        <maven.invoker.plugin.version>2.0.0</maven.invoker.plugin.version>
        <maven.plugin.version>3.4</maven.plugin.version>
        <maven.verifier.version>1.6</maven.verifier.version>
        <!--Integration tests properties-->
        <maven.verifier.plugin.version>1.1</maven.verifier.plugin.version>
        <hamcrest.all.version>1.3</hamcrest.all.version>
        <maven.plugin.testing.harness.version>1.2</maven.plugin.testing.harness.version>
        <plexus.container.default.version>1.0-beta-3.0.5</plexus.container.default.version>
        <plexus.component.annotations.version>1.0-beta-3.0.5</plexus.component.annotations.version>
        <license.path>../LICENSE_HEADER</license.path>
        <formatter.path>../formatter.xml</formatter.path>
        <maven.plugin.plugin.version>3.5</maven.plugin.plugin.version>
        <maven.compat.version>3.3.9</maven.compat.version>
        <maven.compiler.plugin.version>3.6.1</maven.compiler.plugin.version>
        <codehaus.plexus.archiver>3.4</codehaus.plexus.archiver>
        <project.info.plugin.version>2.9</project.info.plugin.version>
        <mule.maven.client.impl.version>1.0.0-BETA</mule.maven.client.impl.version>
    </properties>

    <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-artifact</artifactId>-->
            <!--<version>${maven.artifact.version}</version>-->
        <!--</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.codehaus.plexus</groupId>
            <artifactId>plexus-archiver</artifactId>
            <version>${codehaus.plexus.archiver}</version>
        </dependency>
        <!-- TODO MMP-115 this should not be necessary or it should be test -->
        <dependency>
            <groupId>org.hamcrest</groupId>
            <artifactId>hamcrest-all</artifactId>
            <version>${hamcrest.version}</version>
        </dependency>
        <!-- TODO MMP-115 this is duplicated and ti should be test-->
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
        </dependency>
        <!-- TODO MMP-115 this should be test -->
        <dependency>
            <groupId>org.apache.maven.shared</groupId>
            <artifactId>maven-verifier</artifactId>
        </dependency>
        <dependency>
            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
            <version>${log4j.version}</version>
            <scope>test</scope>
        </dependency>
        <!-- Other Dependencies -->
        <!-- TODO MMP-115 this should not be necessary-->
        <!--<dependency>-->
            <!--<groupId>org.mule</groupId>-->
            <!--<artifactId>mule-core</artifactId>-->
            <!--<version>${mule.version}</version>-->
            <!--<classifier>tests</classifier>-->
        <!--</dependency>-->
        <!-- TODO MMP-115 this should not be necessary  -->
        <dependency>
            <groupId>org.mule.tests</groupId>
            <artifactId>mule-tests-infrastructure</artifactId>
            <version>${mule.version}</version>
        </dependency>
        <!-- TODO MMP-115 remove this -->
        <!--<dependency>-->
            <!--<groupId>org.mockito</groupId>-->
            <!--<artifactId>mockito-all</artifactId>-->
            <!--<version>${mockito.version}</version>-->
            <!--<scope>test</scope>-->
        <!--</dependency>-->
        <!-- TODO MMP-115 this should not be necessary or it should be test -->
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
            <version>${mockito.core.version}</version>
        </dependency>
        <dependency>
            <groupId>org.codehaus.groovy</groupId>
            <artifactId>groovy-all</artifactId>
            <version>${groovy.version}</version>
        </dependency>
        <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>
        <!-- TODO MMP-115 we should probably use hamcrest-all -->
        <dependency>
            <groupId>org.hamcrest</groupId>
            <artifactId>hamcrest-library</artifactId>
            <version>${hamcrest.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>commons-logging</groupId>
            <artifactId>commons-logging</artifactId>
            <version>${commons.logging.version}</version>
        </dependency>
        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
            <version>${commons.io.version}</version>
        </dependency>
        <dependency>
            <groupId>commons-cli</groupId>
            <artifactId>commons-cli</artifactId>
            <version>${commons.cli.version}</version>
        </dependency>
        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
            <version>${guava.version}</version>
        </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>org.apache.maven.plugin-testing</groupId>
            <artifactId>maven-plugin-testing-harness</artifactId>
            <version>${maven.plugin.testing.harness.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.hamcrest</groupId>
            <artifactId>hamcrest-all</artifactId>
            <version>${hamcrest.all.version}</version>
            <scope>test</scope>
        </dependency>
        <!-- TODO MMP-115 this is duplicated and should be test -->
        <dependency>
            <groupId>org.apache.maven.shared</groupId>
            <artifactId>maven-verifier</artifactId>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
        </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.mule</groupId>
            <artifactId>mule-maven-client-impl</artifactId>
            <version>${mule.maven.client.impl.version}</version>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <version>${maven.dependency.plugin.version}</version>
                <configuration>
                    <artifactItems>
                        <artifactItem>
                            <groupId>com.mulesoft.muleesb.distributions</groupId>
                            <artifactId>mule-ee-distribution-standalone</artifactId>
                            <version>${mule.version}</version>
                            <type>tar.gz</type>
                            <outputDirectory>${project.build.directory}</outputDirectory>
                        </artifactItem>
                    </artifactItems>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>unpack</goal>
                        </goals>
                        <phase>process-test-resources</phase>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <version>1.8</version>
                <executions>
                    <execution>
                        <id>reserve-ports</id>
                        <phase>process-test-resources</phase>
                        <goals>
                            <goal>reserve-network-port</goal>
                        </goals>
                        <configuration>
                            <portNames>
                                <portName>port</portName>
                            </portNames>
                        </configuration>
                    </execution>
                </executions>
            </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>org.apache.maven.plugins</groupId>
                <artifactId>maven-resources-plugin</artifactId>
                <configuration>
                    <includeEmptyDirs>true</includeEmptyDirs>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-plugin-plugin</artifactId>
                <version>${maven.plugin.version}</version>
                <configuration>
                    <skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound>
                </configuration>
                <executions>
                    <execution>
                        <id>mojo-descriptor</id>
                        <phase>process-classes</phase>
                        <goals>
                            <goal>descriptor</goal>
                        </goals>
                    </execution>
                </executions>
            </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>${javaFormatter.plugin.version}</version>
                <configuration>
                    <compilerCompliance>${java.source}</compilerCompliance>
                    <compilerSource>${java.source}</compilerSource>
                    <compilerTargetPlatform>${java.source}</compilerTargetPlatform>
                    <configFile>${basedir}/${formatterConfigPath}</configFile>
                    <configJsFile>${basedir}/${formatterConfigPath}</configJsFile>
                    <lineEnding>LF</lineEnding>
                    <aggregator>false</aggregator>
                    <executionRoot>true</executionRoot>
                    <skipFormatting>${skipVerifications}</skipFormatting>
                </configuration>
                <executions>
                    <execution>
                        <phase>compile</phase>
                        <goals>
                            <goal>${formatterGoal}</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <!-- TODO MMP-115 this should not be necessary we have no multimodule project-->
    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.apache.maven.shared</groupId>
                <artifactId>maven-verifier</artifactId>
                <version>${maven.verifier.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>junit</groupId>
                <artifactId>junit</artifactId>
                <version>${junit.version}</version>
                <scope>test</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <!-- TODO MMP-115 remove the reporting section -->
    <reporting>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-plugin-plugin</artifactId>
                <version>${maven.plugin.version}</version>
            </plugin>
            <plugin>
                <!--Workaround for https://jira.codehaus.org/browse/MPIR-251-->
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-project-info-reports-plugin</artifactId>
                <version>${project.info.plugin.version}</version>
                <configuration>
                    <dependencyDetailsEnabled>false</dependencyDetailsEnabled>
                    <dependencyLocationsEnabled>false</dependencyLocationsEnabled>
                </configuration>
            </plugin>
        </plugins>
    </reporting>

    <profiles>
        <profile>
            <id>integration</id>
            <!--<activation>-->
                <!--<activeByDefault>true</activeByDefault>-->
            <!--</activation>-->
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-invoker-plugin</artifactId>
                        <version>${maven.invoker.plugin.version}</version>
                        <configuration>
                            <skipInvocation>${skipTests}</skipInvocation>
                            <debug>${debug}</debug>
                            <streamLogs>${debug}</streamLogs>
                            <showErrors>${debug}</showErrors>
                            <projectsDirectory>src/it/${suite}</projectsDirectory>
                            <cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo>
                            <postBuildHookScript>verify</postBuildHookScript>
                            <preBuildHookScript>setup</preBuildHookScript>
                            <addTestClassPath>true</addTestClassPath>
                            <invokerPropertiesFile>invoker.properties</invokerPropertiesFile>
                            <mavenOpts>${mavenOpts}</mavenOpts>
                            <settingsFile>${maven.invoker.settings}</settingsFile>
                            <scriptVariables>
                                <muleVersion>${mule.version}</muleVersion>
                                <username>${username}</username>
                                <password>${password}</password>
                            </scriptVariables>
                            <properties>
                                <mule.version>${mule.version}</mule.version>
                                <maven.antrun.plugin.version>${maven.antrun.plugin.version}</maven.antrun.plugin.version>
                                <username>${username}</username>
                                <password>${password}</password>
                                <environment>${environment}</environment>
                                <target>${target}</target>
                                <port>${port}</port>
                                <skipProperty>skipPlugin</skipProperty>
                                <skipPlugin>true</skipPlugin>
                                <mule.timeout>120000</mule.timeout>
                            </properties>
                            <goals>
                                <goal>clean</goal>
                                <goal>verify</goal>
                            </goals>
                        </configuration>
                        <executions>
                            <execution>
                                <id>integration-test</id>
                                <phase>integration-test</phase>
                                <goals>
                                    <goal>install</goal>
                                    <goal>run</goal>
                                    <goal>report</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>release</id>
            <properties>
                <javadoc.opts>-Xdoclint:none</javadoc.opts>
            </properties>
            <build>
                <plugins>
                    <!-- TODO MMP-119 Review plugin executions. Right now javadoc plugin is failing -->
                    <!-- <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <version>2.10</version>
                        <configuration>
                            <additionalparam>${javadoc.opts}</additionalparam>
                        </configuration>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin> -->
                    <!--<plugin>-->
                        <!--<groupId>org.apache.maven.plugins</groupId>-->
                        <!--<artifactId>maven-source-plugin</artifactId>-->
                        <!--<executions>-->
                            <!--<execution>-->
                                <!--<goals>-->
                                    <!--<goal>jar</goal>-->
                                <!--</goals>-->
                            <!--</execution>-->
                        <!--</executions>-->
                    <!--</plugin>-->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>1.5</version>
                        <executions>
                            <execution>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin> 
                </plugins>
            </build>
        </profile>
        <profile>
            <id>ci</id>
            <activation>
                <property>
                    <name>env</name>
                    <value>ci</value>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <version>2.1.2</version>
                        <executions>
                            <execution>
                                <id>attach-sources</id>
                                <goals>
                                    <goal>jar-no-fork</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>windows_profile</id>
            <activation>
                <os>
                    <family>Windows</family>
                </os>
            </activation>
            <properties>
                <toolsjar>${java.home}/../lib/tools.jar</toolsjar>
            </properties>
        </profile>
        <profile>
            <id>linux_profile</id>
            <activation>
                <os>
                    <name>linux</name>
                </os>
            </activation>
            <properties>
                <toolsjar>${java.home}/../lib/tools.jar</toolsjar>
            </properties>
        </profile>
        <profile>
            <id>osx_profile</id>
            <activation>
                <os>
                    <family>mac</family>
                </os>
            </activation>
            <properties>
                <toolsjar>${java.home}/../Classes/classes.jar</toolsjar>
            </properties>
        </profile>
        <profile>
            <id>mac</id>
            <activation>
                <os>
                    <family>mac</family>
                </os>
            </activation>
            <build>
                <plugins>
                    <!--<plugin>-->
                        <!--<artifactId>maven-plugin-plugin</artifactId>-->
                        <!--<version>${maven.plugin.version}</version>-->
                        <!--<dependencies>-->
                            <!--<dependency>-->
                            <!--<groupId>org.jfrog.maven.annomojo</groupId>-->
                            <!--<artifactId>maven-plugin-tools-anno</artifactId>-->
                            <!--<version>${maven.plugin.tools.anno.version}</version>-->
                            <!--<scope>runtime</scope>-->
                            <!--</dependency>-->
                            <!--<dependency>-->
                            <!--<groupId>com.sun</groupId>-->
                            <!--<artifactId>tools</artifactId>-->
                            <!--<version>${java.version}</version>-->
                            <!--<scope>system</scope>-->
                            <!--<systemPath>${java.home}/../lib/tools.jar</systemPath>-->
                            <!--</dependency>-->
                        <!--</dependencies>-->
                    <!--</plugin>-->

                </plugins>
            </build>
        </profile>
    </profiles>

    <repositories>
        <repository>
            <id>mulesoft-private</id>
            <name>Redirect to internal repository</name>
            <url>https://repository.mulesoft.org/nexus/content/repositories/private</url>
        </repository>
    </repositories>

    <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.0.0-BETA</tag>
    </scm>

</project>
