<?xml version="1.0" encoding="utf-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

  <modelVersion>4.0.0</modelVersion>
  <groupId>org.mule.tooling.hl7</groupId>
  <artifactId>mule-hl7-ui-eclipse</artifactId>
  <version>2.0.2</version>
  <packaging>pom</packaging>

    <properties>
        <mule.devkit.version>3.6.0</mule.devkit.version>
        <hl7Module.version>2.0.2</hl7Module.version>
        <tycho.groupid>org.eclipse.tycho</tycho.groupid>
        <tycho-extras.groupid>org.eclipse.tycho.extras</tycho-extras.groupid>
        <tycho-version>0.20.0</tycho-version>
        <tycho-extras.version>0.20.0</tycho-extras.version>
        <target-platform>studio-3.8</target-platform>
        <target-platform.version>1.0.0</target-platform.version>
        <maven.clean.plugin.version>2.4.1</maven.clean.plugin.version>
        <eclipse-updatesite>http://download.eclipse.org/eclipse/updates/3.8/R-3.8.1-201209141540</eclipse-updatesite>
        <studio-updatesite>http://studio-nightly-update.s3.amazonaws.com</studio-updatesite>
        <eclipse-gef-updatesite>http://download.eclipse.org/releases/juno/201209280900</eclipse-gef-updatesite>
        <maven.build.timestamp.format>yyyyMMddHHmm</maven.build.timestamp.format>
        <build.qualifier>${maven.build.timestamp}</build.qualifier>
    </properties>

    <modules>
        <module>org.mule.tooling.hl7.targets</module>
        <module>org.mule.tooling.datamapper.hl7</module>
        <module>org.mule.tooling.ui.contribution.hl7</module>
        <module>org.mule.tooling.hl7</module>
        <module>org.mule.tooling.hl7.updatesite</module>
    </modules>

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

    <build>
        <pluginManagement>
            <plugins>
                <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>**/.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>
                            <exclude>**/*.xsd</exclude>
                            <exclude>**/*.xls</exclude>
                            <exclude>**/*.html</exclude>
                        </excludes>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-deploy-plugin</artifactId>
                    <version>2.7</version>
                </plugin>
                <plugin>
                    <groupId>${tycho-extras.groupid}</groupId>
                    <artifactId>tycho-p2-extras-plugin</artifactId>
                    <version>${tycho-extras.version}</version>
                </plugin>
                <plugin>
                    <groupId>${tycho-extras.groupid}</groupId>
                    <artifactId>target-platform-validation-plugin</artifactId>
                    <version>${tycho-extras.version}</version>
                </plugin>
                <plugin>
                    <groupId>${tycho.groupid}</groupId>
                    <artifactId>target-platform-configuration</artifactId>
                    <version>${tycho-version}</version>
                    <configuration>
                        <resolver>p2</resolver>
                        <ignoreTychoRepositories>true</ignoreTychoRepositories>
                        <pomDependencies>consider</pomDependencies>
                        <target>
                            <artifact>
                                <groupId>org.mule.tooling.hl7.targets</groupId>
                                <artifactId>${target-platform}</artifactId>
                                <version>${target-platform.version}</version>
                            </artifact>
                        </target>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
        <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.eclipse.tycho</groupId>
                <artifactId>tycho-maven-plugin</artifactId>
                <version>${tycho-version}</version>
                <extensions>true</extensions>
            </plugin>
            <plugin>
                <groupId>org.eclipse.tycho</groupId>
                <artifactId>target-platform-configuration</artifactId>
                <version>${tycho-version}</version>
            </plugin>
            <plugin>
                <groupId>org.eclipse.tycho</groupId>
                <artifactId>tycho-packaging-plugin</artifactId>
                <version>${tycho-version}</version>
                <configuration>
                    <qualifier>${build.qualifier}</qualifier>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>update-site</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-jarsigner-plugin</artifactId>
                        <version>1.4</version>
                        <executions>
                            <execution>
                               <id>sign</id>
                               <phase>verify</phase>
                               <goals>
                                   <goal>sign</goal>
                               </goals>
                            </execution>
                         </executions>
                         <configuration>
                            <keystore>${keystorePath}</keystore>
                            <alias>${alias}</alias>
                            <storepass>${storepass}</storepass>
                            <keypass>${keypass}</keypass>
                         </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

    <distributionManagement>
        <repository>
            <id>mulesoft-releases</id>
            <name>MuleSoft 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>

    <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>
    </repositories>
</project>
