<?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.tools</groupId>
    <artifactId>apikit-studio-plugin</artifactId>
    <version>1.1.0-SNAPSHOT</version>
    <name>APIKit Studio Plugin</name>
    <packaging>pom</packaging>

    <properties>
        <apikit.version>1.1-SNAPSHOT</apikit.version>

        <tycho.groupid>org.eclipse.tycho</tycho.groupid>
        <tycho.version>0.16.0</tycho.version>
        <tycho-extras.groupid>org.eclipse.tycho</tycho-extras.groupid>
        <tycho-extras.version>0.16.0</tycho-extras.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

        <keystore.path>${project.parent.basedir}/apikit.ks</keystore.path>
        <keystore.type>JKS</keystore.type>
        <keystore.alias>mulesoft</keystore.alias>
        <keystore.store.password>mulemani$here</keystore.store.password>

        <jarsigner.tsa>https://timestamp.geotrust.com/tsa</jarsigner.tsa>
        <skipSign>true</skipSign>
    </properties>

    <modules>
        <module>org.mule.tooling.apikit.target</module>
        <module>org.mule.tooling.apikit</module>
        <module>org.mule.tooling.apikit.feature</module>
        <module>org.mule.tooling.apikit.deps</module>
        <module>org.mule.tooling.apikit.p2</module>
    </modules>

    <build>
        <plugins>
            <plugin>
                <groupId>${tycho.groupid}</groupId>
                <artifactId>tycho-maven-plugin</artifactId>
                <version>${tycho.version}</version>
                <extensions>true</extensions>
            </plugin>
            <plugin>
                <groupId>${tycho.groupid}</groupId>
                <artifactId>target-platform-configuration</artifactId>
                <version>${tycho.version}</version>
                <configuration>
                    <resolver>p2</resolver>
                    <ignoreTychoRepositories>true</ignoreTychoRepositories>
                    <target>
                        <artifact>
                            <groupId>org.mule.tools</groupId>
                            <artifactId>apikit</artifactId>
                            <version>1.1.0-SNAPSHOT</version>
                        </artifact>
                    </target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jarsigner-plugin</artifactId>
                <version>1.2</version>
                <executions>
                    <execution>
                        <id>sign</id>
                        <goals>
                            <goal>sign</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>verify</id>
                        <goals>
                            <goal>verify</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <certs>true</certs>
                    <verbose>false</verbose>
                    <storetype>${keystore.type}</storetype>
                    <keystore>${keystore.path}</keystore>
                    <alias>${keystore.alias}</alias>
                    <storepass>${keystore.store.password}</storepass>
                    <arguments>
                        <argument>-tsa</argument>
                        <argument>${jarsigner.tsa}</argument>
                    </arguments>
                </configuration>
            </plugin>
        </plugins>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>${tycho.groupid}</groupId>
                    <artifactId>tycho-compiler-plugin</artifactId>
                    <version>${tycho.version}</version>
                </plugin>
                <plugin>
                    <groupId>${tycho.groupid}</groupId>
                    <artifactId>tycho-surefire-plugin</artifactId>
                    <version>${tycho.version}</version>
                </plugin>
                <plugin>
                    <groupId>${tycho.groupid}</groupId>
                    <artifactId>tycho-p2-repository-plugin</artifactId>
                    <version>${tycho.version}</version>
                </plugin>
                <plugin>
                    <groupId>${tycho.groupid}</groupId>
                    <artifactId>tycho-p2-publisher-plugin</artifactId>
                    <version>${tycho.version}</version>
                </plugin>
                <plugin>
                    <groupId>${tycho.groupid}</groupId>
                    <artifactId>tycho-p2-director-plugin</artifactId>
                    <version>${tycho.version}</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>
            </plugins>
        </pluginManagement>
    </build>

    <distributionManagement>
        <repository>
            <id>mulesoft-releases</id>
            <name>MuleSoft Releases Repository</name>
            <url>https://repository-master.mulesoft.org/releases/</url>
        </repository>
        <snapshotRepository>
            <id>mulesoft-snapshots</id>
            <name>MuleSoft Snapshots Repository</name>
            <url>https://repository-master.mulesoft.org/snapshots/</url>
        </snapshotRepository>
    </distributionManagement>

</project>
