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

    <name>Mule DevKit</name>
    <description>
        Maven plug-in for generating Mule components. Includes support for developing transformers, cloud connectors and
        a lot more.
    </description>
    <url>http://github.com/mulesoft/mule-devkit</url>
    <inceptionYear>2010</inceptionYear>
    <licenses>
        <license>
            <name>MuleSoft License Agreement</name>
        </license>
    </licenses>

    <organization>
        <name>MuleSoft, Inc.</name>
        <url>http://www.mulesoft.com</url>
    </organization>

    <groupId>org.mule.tools.dmt</groupId>
    <artifactId>mule-devkit</artifactId>
    <version>1.0.0</version>
    <packaging>pom</packaging>

    <properties>
        <mule.3x.version>3.8.0</mule.3x.version>
        <mule.4x.version>4.1.1</mule.4x.version>
        <extensions.api.version>1.1.0</extensions.api.version>
        <metadata.api.version>1.1.0</metadata.api.version>
        <mule.api.version>1.0.0</mule.api.version>
        <jdk.version>1.8</jdk.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    </properties>

    <modules>
        <module>core</module>
        <module>shade</module>
        <module>tools</module>
    </modules>

    <scm>
        <connection>scm:git:git://github.com:mulesoft/mule-devkit.git</connection>
        <developerConnection>scm:git:git@github.com:mulesoft/mule-devkit.git</developerConnection>
        <url>http://github.com/mulesoft/mule-devkit</url>
        <tag>HEAD</tag>
    </scm>

    <build>
        <defaultGoal>install</defaultGoal>
        <pluginManagement>
            <plugins>
                <plugin>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>2.5</version>
                    <configuration>
                        <source>${jdk.version}</source>
                        <target>${jdk.version}</target>
                        <encoding>ISO-8859-1</encoding>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-deploy-plugin</artifactId>
                    <version>2.8.2</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <version>2.9.1</version>
                </plugin>
                <plugin>
                    <groupId>com.mycila</groupId>
                    <artifactId>license-maven-plugin</artifactId>
                    <version>2.11</version>
                    <configuration>
                        <header>LICENSE_HEADER.txt</header>
                        <excludes>
                            <exclude>target/**</exclude>
                            <exclude>.gitignore</exclude>
                            <exclude>**/*.txt</exclude>
                            <exclude>**/*.ftl</exclude>
                            <exclude>**/build-number.txt</exclude>
                            <exclude>**/*.ftl</exclude>
                            <exclude>**/org/mule/devkit/model/code/**</exclude>
                            <exclude>**/org/mule/devkit/doclet/**</exclude>
                            <exclude>**/assets/**</exclude>
                            <exclude>**/*.xsd</exclude>
                            <exclude>**/*.properties</exclude>
                            <exclude>**/*.xml</exclude>
                            <exclude>**/archetype-resources/**</exclude>
                            <exclude>**/src/main/java/package.html</exclude>
                        </excludes>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
                <version>1.3.1</version>
                <executions>
                    <execution>
                        <id>enforce-versions</id>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <failFast>true</failFast>
                    <rules>
                        <requireJavaVersion>
                            <version>[1.7,1.9)</version>
                        </requireJavaVersion>
                        <requireMavenVersion>
                            <version>[3.0.0,)</version>
                        </requireMavenVersion>
                    </rules>
                </configuration>
            </plugin>
            <!-- enable JGit plugin -->
            <plugin>
                <groupId>ru.concerteza.buildnumber</groupId>
                <artifactId>maven-jgit-buildnumber-plugin</artifactId>
                <version>1.2.1</version>
                <executions>
                    <execution>
                        <id>git-buildnumber</id>
                        <goals>
                            <goal>extract-buildnumber</goal>
                        </goals>
                        <phase>prepare-package</phase>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>2.1</version>
                <configuration>
                    <archive>
                        <manifestEntries>
                            <Specification-Title>${project.name}</Specification-Title>
                            <Specification-Version>${project.version}</Specification-Version>
                            <Specification-Vendor>${project.specification_vendor}</Specification-Vendor>
                            <Implementation-Title>${project.groupId}.${project.artifactId}</Implementation-Title>
                            <Implementation-Version>${git.buildnumber}</Implementation-Version>
                            <Implementation-Vendor>${project.implementation_vendor}</Implementation-Vendor>
                            <More-Info>For more information go to ${project.url}</More-Info>
                            <Support>Get commercial support: ${project.organization.url}/support</Support>
                            <Description>Mule Development Toolkit</Description>
                            <License>MuleSoft License Agreement</License>
                            <Vendor-Url>${project.organization.url}</Vendor-Url>
                            <Product-Url>${project.url}</Product-Url>
                            <Build-Date>${mvn.timestamp.yyyy-MM-dd-HH:mm:ss}</Build-Date>
                            <Dev-List-Email>dev@mule.codehaus.org</Dev-List-Email>
                            <Supported-Jdks>[1.6.0,1.7),[1.7.0,1.8)</Supported-Jdks>
                            <Recommended-Jdks>[1.6.0_31,1.7),[1.7.0_3,1.8)</Recommended-Jdks>
                            <X-Git-Revision>${git.revision}</X-Git-Revision>
                            <X-Git-Branch>${git.branch}</X-Git-Branch>
                            <X-Git-Tag>${git.tag}</X-Git-Tag>
                            <X-Git-Commits-Count>${git.commitsCount}</X-Git-Commits-Count>
                        </manifestEntries>
                    </archive>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <version>2.5.1</version>
            </plugin>
        </plugins>

        <resources>
            <resource>
                <filtering>false</filtering>
                <directory>src/main/resources</directory>
            </resource>
        </resources>
        <testResources>
            <testResource>
                <filtering>true</filtering>
                <directory>src/test/resources</directory>
            </testResource>
        </testResources>
    </build>

    <profiles>
        <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-pmd-plugin</artifactId>
                        <version>2.5</version>
                        <executions>
                            <execution>
                                <id>pmd</id>
                                <goals>
                                    <goal>check</goal>
                                </goals>
                                <configuration>
                                    <rulesets>
                                        <ruleset>${project.basedir}/pmd.xml</ruleset>
                                    </rulesets>
                                    <targetJdk>${jdk.version}</targetJdk>
                                    <verbose>true</verbose>
                                    <aggregate>true</aggregate>
                                    <linkXRef>false</linkXRef>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>mac_os_17</id>
            <activation>
                <file>
                    <exists>${java.home}/../lib/tools.jar</exists>
                </file>
            </activation>
            <properties>
                <toolsjar>${java.home}/../lib/tools.jar</toolsjar>
            </properties>
        </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>
                    <family>unix</family>
                    <name>Linux</name>
                </os>
            </activation>
            <properties>
                <toolsjar>${java.home}/../lib/tools.jar</toolsjar>
            </properties>
        </profile>
        <profile>
            <id>sources</id>
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <version>2.4</version>
                        <executions>
                            <execution>
                                <id>attach-sources</id>
                                <goals>
                                    <goal>jar-no-fork</goal>
                                </goals>
                                <phase>prepare-package</phase>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>integration-tests</id>
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>
            <modules>
                <module>integration-tests</module>
            </modules>
        </profile>
    </profiles>

    <repositories>
        <repository>
            <id>mulesoft-releases</id>
            <name>MuleSoft Releases</name>
            <url>http://repository-master.mulesoft.org/releases/</url>
        </repository>
        <repository>
            <id>mulesoft-snapshots</id>
            <name>MuleSoft Releases</name>
            <url>http://repository-master.mulesoft.org/snapshots/</url>
        </repository>
        <repository>
            <id>mulesoft-public</id>
            <name>Mulesoft Public Repository</name>
            <url>https://repository-master.mulesoft.org/nexus/content/repositories/public</url>
        </repository>
    </repositories>

    <pluginRepositories>
        <pluginRepository>
            <id>mulesoft-releases</id>
            <name>MuleSoft Release Repository</name>
            <url>http://repository-master.mulesoft.org/releases/</url>
        </pluginRepository>
        <pluginRepository>
            <id>mulesoft-snapshots</id>
            <name>MuleSoft Snapshot Repository</name>
            <url>http://repository-master.mulesoft.org/snapshots/</url>
        </pluginRepository>
    </pluginRepositories>

    <distributionManagement>
        <repository>
            <id>mulesoft-releases</id>
            <name>MuleSoft Release Repository</name>
            <url>http://repository-master.mulesoft.org/releases/</url>
        </repository>
        <snapshotRepository>
            <id>mulesoft-snapshots</id>
            <name>MuleSoft Snapshot Repository</name>
            <url>http://repository-master.mulesoft.org/snapshots</url>
            <uniqueVersion>false</uniqueVersion>
        </snapshotRepository>
    </distributionManagement>
</project>  
