<?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 Parent</name>
    <description>
        This is a parent POM for settings defaults in the connectors built by Mule. THIS IS FOR INTERNAL USE
        ONLY. DO NOT DISTRIBUTE.
    </description>
    <url>http://github.com/mulesoft/mule-devkit-parent</url>
    <inceptionYear>2010</inceptionYear>

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

    <groupId>org.mule.tools.devkit</groupId>
    <artifactId>mule-devkit-parent</artifactId>
    <version>3.6.0</version>
    <packaging>pom</packaging>

    <properties>
        <mule.version>3.6.0</mule.version>
        <mule.devkit.version>3.6.0</mule.devkit.version>
        <junit.version>4.10</junit.version>
        <mockito.version>1.8.5</mockito.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <jdk.version>1.7</jdk.version>
        <connector.test.version>2.0.6</connector.test.version>
        <cxf.version>2.5.9</cxf.version>
        <testdata.plugin.version>2.0.1</testdata.plugin.version>
        <testdata.apt.version>2.0.1</testdata.apt.version>
    </properties>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.mule.tools.devkit</groupId>
                    <artifactId>mule-devkit-maven-plugin</artifactId>
                    <version>${mule.devkit.version}</version>
                    <extensions>true</extensions>
                </plugin>
                <plugin>
                    <groupId>org.eclipse.m2e</groupId>
                    <artifactId>lifecycle-mapping</artifactId>
                    <version>1.0.0</version>
                    <configuration>
                        <lifecycleMappingMetadata>
                            <pluginExecutions>
                                <pluginExecution>
                                    <pluginExecutionFilter>
                                        <groupId>org.mule.tools.devkit</groupId>
                                        <artifactId>mule-devkit-maven-plugin</artifactId>
                                        <versionRange>[2.0,)</versionRange>
                                        <goals>
                                            <goal>attach-test-resources</goal>
                                            <goal>filter-resources</goal>
                                            <goal>generate-sources</goal>
                                        </goals>
                                    </pluginExecutionFilter>
                                    <action>
                                        <ignore />
                                    </action>
                                </pluginExecution>
                                <pluginExecution>
                                    <pluginExecutionFilter>
                                        <artifactId>cxf-codegen-plugin</artifactId>
                                        <groupId>org.apache.cxf</groupId>
                                        <versionRange>[2.3.0,)</versionRange>
                                        <goals>
                                            <goal>wsdl2java</goal>
                                        </goals>
                                    </pluginExecutionFilter>
                                    <action>
                                        <ignore />
                                    </action>
                                </pluginExecution>
                            </pluginExecutions>
                        </lifecycleMappingMetadata>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>com.mycila.maven-license-plugin</groupId>
                    <artifactId>maven-license-plugin</artifactId>
                    <version>1.8.0</version>
                    <configuration>
                        <header>LICENSE_HEADER.txt</header>
                        <excludes>
                            <exclude>target/**</exclude>
                            <exclude>**/.mule/*</exclude>
                            <exclude>**/.idea/*</exclude>
                            <exclude>src/main/java/com/sforce/**</exclude>
                            <exclude>**/.gitignore</exclude>
                            <exclude>**/*.txt</exclude>
                            <exclude>**/*.ftl</exclude>
                            <exclude>**/*.xml</exclude>
                            <exclude>**/*.properties</exclude>
                            <exclude>**/*.sample</exclude>
                            <exclude>**/*.md</exclude>
                            <exclude>**/build-number.txt</exclude>
                        </excludes>
                    </configuration>
                </plugin>
                 <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-deploy-plugin</artifactId>
                    <version>2.8.2</version>
                </plugin>
            </plugins>
        </pluginManagement>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>2.3.2</version>
                <executions>
                    <execution>
                        <id>default-compile</id>
                        <configuration>
                            <compilerArgument>-proc:none</compilerArgument>
                            <source>${jdk.version}</source>
                            <target>${jdk.version}</target>
                        </configuration>
                    </execution>
                    <execution>
                        <id>default-testCompile</id>
                        <configuration>
                            <compilerArgument>-proc:none</compilerArgument>
                            <source>${jdk.version}</source>
                            <target>${jdk.version}</target>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.mule.tools.devkit</groupId>
                <artifactId>mule-devkit-maven-plugin</artifactId>
                <version>${mule.devkit.version}</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>2.2</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar-no-fork</goal>
                        </goals>
                        <phase>prepare-package</phase>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>2.8</version>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                        <phase>site</phase>
                    </execution>
                </executions>
                <configuration>
                    <excludePackageNames>org.mule.tooling.ui.contribution:*</excludePackageNames>
                    <docletArtifact>
                        <groupId>org.mule.tools.devkit</groupId>
                        <artifactId>mule-devkit-doclet</artifactId>
                        <version>${mule.devkit.version}</version>
                    </docletArtifact>
                    <doclet>org.mule.devkit.doclet.Doclava</doclet>
                    <bootclasspath>${sun.boot.class.path}</bootclasspath>
                    <additionalparam><!--
                        -federate JDK http://download.oracle.com/javase/6/docs/api/index.html?
                        -federationxml JDK http://doclava.googlecode.com/svn/static/api/openjdk-6.xml -->
                        -hdf project.artifactId "${project.artifactId}"
                        -hdf project.groupId "${project.groupId}"
                        -hdf project.version "${project.version}"
                        -hdf project.name "${project.name}"
                        -hdf project.repo.name "${project.distributionManagement.repository.name}"
                        -hdf project.repo.id "${project.distributionManagement.repository.id}"
                        -hdf project.repo.url "${project.distributionManagement.repository.url}"
                        -hdf project.snapshotRepo.name "${project.distributionManagement.snapshotRepository.name}"
                        -hdf project.snapshotRepo.id "${project.distributionManagement.snapshotRepository.id}"
                        -hdf project.snapshotRepo.url "${project.distributionManagement.snapshotRepository.url}"
                        -d "${project.build.directory}/apidocs"
                    </additionalparam>
                    <useStandardDocletOptions>false</useStandardDocletOptions>
                    <additionalJOption>-J-Xmx1024m</additionalJOption>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-site-plugin</artifactId>
                <version>3.0</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <configuration>
                    <autoVersionSubmodules>true</autoVersionSubmodules>
                    <pushChanges>false</pushChanges>
                </configuration>
                <version>2.1</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
                <version>1.3.1</version>
                <configuration>
                    <failFast>true</failFast>
                    <rules>
                        <requireJavaVersion>
                            <version>[1.7,1.9]</version>
                        </requireJavaVersion>
                    </rules>
                </configuration>
            </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>
        <extensions>
            <extension>
                <groupId>org.apache.maven.wagon</groupId>
                <artifactId>wagon-ssh</artifactId>
                <version>1.0</version>
            </extension>
        </extensions>

    </build>

    <dependencies>
        <!-- Mule Dependencies -->
        <dependency>
            <groupId>org.mule</groupId>
            <artifactId>mule-core</artifactId>
            <version>${mule.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.mule.tools.devkit</groupId>
            <artifactId>mule-devkit-annotations</artifactId>
            <version>${mule.devkit.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.mule.modules</groupId>
            <artifactId>mule-module-spring-config</artifactId>
            <version>${mule.version}</version>
            <optional>true</optional>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.mule.modules</groupId>
            <artifactId>mule-module-devkit-support</artifactId>
            <version>${mule.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit-dep</artifactId>
            <version>${junit.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mule.tests</groupId>
            <artifactId>mule-tests-functional</artifactId>
            <version>${mule.version}</version>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>junit</groupId>
                    <artifactId>junit</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.mule.modules</groupId>
            <artifactId>mule-module-jersey</artifactId>
            <version>${mule.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.mule.modules</groupId>
            <artifactId>mule-module-json</artifactId>
            <version>${mule.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.mule.transports</groupId>
            <artifactId>mule-transport-http</artifactId>
            <version>${mule.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-all</artifactId>
            <version>${mockito.version}</version>
            <scope>test</scope>
        </dependency>
        <!-- Mule Connector Test Framework -->
        <dependency>
            <groupId>org.mule.modules</groupId>
            <artifactId>mule-connector-test</artifactId>
            <version>${connector.test.version}</version>
            <scope>test</scope>
        </dependency>

        <!-- Validation -->
        <dependency>
            <groupId>javax.validation</groupId>
            <artifactId>validation-api</artifactId>
            <version>1.0.0.GA</version>
            <scope>provided</scope>
        </dependency>

        <!-- Studio -->
        <dependency>
            <groupId>eclipse</groupId>
            <artifactId>eclipse-runtime</artifactId>
            <version>2.1.0</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.eclipse</groupId>
            <artifactId>eclipse-workbench</artifactId>
            <version>3.6.1.M20100826-1330</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.eclipse</groupId>
            <artifactId>eclipse-runtime</artifactId>
            <version>3.6.0.v20100505</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.osgi</groupId>
            <artifactId>core</artifactId>
            <version>4.3.0</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.mule.common</groupId>
            <artifactId>mule-common</artifactId>
            <version>${mule.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.mule.modules</groupId>
            <artifactId>mule-module-cxf</artifactId>
            <version>${mule.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.mule.tools.devkit</groupId>
            <artifactId>mule-devkit-shade</artifactId>
            <version>${mule.devkit.version}</version>
        </dependency>
    </dependencies>

    <repositories>
        <repository>
            <id>mulesoft-releases</id>
            <name>MuleSoft Releases Repository</name>
            <url>http://repository.mulesoft.org/releases/</url>
            <layout>default</layout>
        </repository>
        <repository>
            <id>mulesoft-snapshots</id>
            <name>MuleSoft Snapshots Repository</name>
            <url>http://repository.mulesoft.org/snapshots/</url>
            <layout>default</layout>
        </repository>
        <repository>
            <id>mule-codehaus</id>
            <name>Mule Repository</name>
            <url>https://repository.mulesoft.org/nexus/content/repositories/public/</url>
        </repository>
        <repository>
            <id>dev.java.net</id>
            <name>Java.net Repository for Maven</name>
            <url>http://download.java.net/maven/2/</url>
        </repository>
        <repository>
            <id>jboss</id>
            <name>JBoss Repository</name>
            <url>http://repository.jboss.com</url>
            <layout>default</layout>
        </repository>
    </repositories>

    <pluginRepositories>
        <pluginRepository>
            <id>codehaus-plugin-snapshots</id>
            <name>Codehaus Plugin Snapshot Repository</name>
            <url>http://snapshots.repository.codehaus.org</url>
            <releases>
                <enabled>false</enabled>
            </releases>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </pluginRepository>
        <pluginRepository>
            <id>mulesoft-plugin-releases</id>
            <name>MuleSoft Release Repository</name>
            <url>http://repository.mulesoft.org/releases/</url>
            <layout>default</layout>
        </pluginRepository>
        <pluginRepository>
            <id>mulesoft-plugin-snapshots</id>
            <name>MuleSoft Snapshots Repository</name>
            <url>http://repository.mulesoft.org/snapshots/</url>
            <layout>default</layout>
        </pluginRepository>
    </pluginRepositories>

    <profiles>
        <profile>
            <id>devkit-maven-shade</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-shade-plugin</artifactId>
                        <version>2.3</version>
                        <configuration>
                            <!-- devkit shade base configuration -->
                            <artifactSet>
                                <includes combine.children="append">
                                    <include>org.mule.tools.devkit:mule-devkit-shade</include>
                                </includes>
                            </artifactSet>

                            <relocations combine.children="append">
                                <relocation>
                                    <pattern>org.mule.devkit.shade</pattern>
                                    <shadedPattern>org.mule.devkit.${mule.devkit.version}.shade</shadedPattern>
                                </relocation>
                            </relocations>

                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>


        <profile>
            <id>sonar</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <properties>
                <sonar.exclusions>
                    **/*MessageProcessor.java,**/*MessageSource.java,**/*DefinitionParser.java,**/*LifecycleAdapter.java,**/*HttpCallbackAdapter.java,**/*CapabilitiesAdapter.java,**/*EnumTransformer.java,**/*NamespaceHandler.java,**/*DefaultHttpCallback.java,**/*NestedProcessorChain.java,**/*NestedProcessorString.java,**/*OAuth1Adapter.java,**/*OAuth2Adapter.java
                </sonar.exclusions>
            </properties>
        </profile>
        <profile>
            <properties>
                <devkit.studio.package.skip>false</devkit.studio.package.skip>
            </properties>
            <id>update-site</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.mule.tooling</groupId>
                        <artifactId>studio-us-signer</artifactId>
                        <version>1.1</version>
                        <executions>
                            <execution>
                                <phase>install</phase>
                                <goals>
                                    <goal>sign-us</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <id>strict-validation</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>com.mycila.maven-license-plugin</groupId>
                        <artifactId>maven-license-plugin</artifactId>
                        <version>1.8.0</version>
                        <executions>
                            <execution>
                                <phase>validate</phase>
                                <goals>
                                    <goal>check</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.mule.tools.devkit</groupId>
                        <artifactId>mule-devkit-maven-plugin</artifactId>
                        <version>${mule.devkit.version}</version>
                        <executions>
                            <execution>
                                <phase>compile</phase>
                                <goals>
                                    <goal>ensure-javadoc</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>


        <profile>
            <id>testdata-generator</id>
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>

            <dependencies>
                <dependency>
                    <groupId>com.mule.connectors.testdata</groupId>
                    <artifactId>testdata-apt-core</artifactId>
                    <version>${testdata.apt.version}</version>
                </dependency>

                <dependency>
                    <groupId>com.mule.connectors.testdata</groupId>
                    <artifactId>connector-testdata-maven-plugin</artifactId>
                    <version>${testdata.plugin.version}</version>
                </dependency>
            </dependencies>

            <properties>
                <annotations-file>${project.build.directory}/generated-sources/apt/testdata-annotations-output.xml</annotations-file>
            </properties>

            <build>
                <plugins>
                    <plugin>
                        <groupId>org.bsc.maven</groupId>
                        <artifactId>maven-processor-plugin</artifactId>
                        <version>2.2.4</version>
                        <executions>
                            <execution>
                                <id>process</id>
                                <goals>
                                    <goal>process</goal>
                                </goals>
                                <configuration>
                                    <processors>
                                        <processor>com.mule.connectors.testdata.TestDataAnnotationsProcessor</processor>
                                    </processors>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>

                    <plugin>
                        <groupId>com.mule.connectors.testdata</groupId>
                        <artifactId>connector-testdata-maven-plugin</artifactId>
                        <version>${testdata.plugin.version}</version>
                        <executions>
                            <execution>
                                <id>parse-test-data</id>
                                <goals>
                                    <goal>parse</goal>
                                </goals>
                                <configuration>
                                    <annotationsFile>${project.build.directory}/generated-sources/apt/testdata-annotations-output.xml</annotationsFile>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <id>coverage-reporter</id>
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>

            <dependencies>
                <dependency>
                    <groupId>org.mule.tools</groupId>
                    <artifactId>connector-certification-maven-plugin</artifactId>
                    <version>1.0.0</version>
                </dependency>
            </dependencies>

            <build>
                <plugins>
                    <plugin>
                        <groupId>org.bsc.maven</groupId>
                        <artifactId>maven-processor-plugin</artifactId>
                        <version>2.2.4</version>
                        <executions>
                            <execution>
                                <id>process</id>
                                <goals>
                                    <goal>process</goal>
                                </goals>
                                <configuration>
                                    <processors>
                                        <processor>org.mule.tools.automationtestcoverage.ConnectorAutomationCoverageAnnotationProcessor</processor>
                                    </processors>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>

    </profiles>
</project>
