<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/maven-v4_0_0.xsd">

    <properties>
        <staging.dir>${project.build.directory}/staging</staging.dir>
        <install4j.home>NOT_CONFIGURED</install4j.home>
        <install4j.winKeystorePassword>NOT_CONFIGURED</install4j.winKeystorePassword>
        <install4j.macKeystorePassword>NOT_CONFIGURED</install4j.macKeystorePassword>
        <maven.build.timestamp.format>yyyyMMddHHmm</maven.build.timestamp.format>
        <build.timestamp>${maven.build.timestamp}</build.timestamp>
        <i4j.updates>https://s3-eu-west-1.amazonaws.com/sshtools-public/unitty/${project.version}/updates.xml</i4j.updates>
    </properties>
    <modelVersion>4.0.0</modelVersion>
    <artifactId>unitty-install4j</artifactId>
    <name>UniTTY Install4J</name>
    <description>Uses Install4J to create installer. Should not be deployed to a public repository.</description>
    <parent>
        <groupId>com.sshtools.unitty</groupId>
        <artifactId>unitty</artifactId>
        <version>3.3.0-SNAPSHOT</version>
        <relativePath>..</relativePath>
    </parent>
    <url>${scmWebRoot}/${project.artifactId}/</url>

    <build>
        <finalName>${project.artifactId}</finalName>
        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>properties-maven-plugin</artifactId>
                <version>1.0.0</version>
                <executions>
                    <execution>
                        <phase>initialize</phase>
                        <goals>
                            <goal>read-project-properties</goal>
                        </goals>
                        <configuration>
                            <quiet>true</quiet>
                            <files>
                                <file>${basedir}/jadaptive.build.properties</file>
                                <file>${user.home}/.jadaptive.build.properties</file>
                            </files>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <!-- prepare dependencies so that izpack jar tag to pickup at compile 
				time -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <executions>
                    <execution>
                        <id>copy-dependencies</id>
                        <phase>package</phase>
                        <goals>
                            <goal>copy-dependencies</goal>
                        </goals>
                        <configuration>
                            <stripVersion>true</stripVersion>
                            <outputDirectory>${staging.dir}/dependency</outputDirectory>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <configuration>
                    <forceCreation>true</forceCreation>
                    <archive>
                        <manifestEntries>
                            <I4J-Updates-Url>${i4j.updates}</I4J-Updates-Url>
                        </manifestEntries>
                    </archive>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>test-jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.sonatype.install4j</groupId>
                <artifactId>install4j-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>install-license</id>
                        <phase>package</phase>
                        <goals>
                            <goal>install-license</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>compile-installers</id>
                        <phase>package</phase>
                        <goals>
                            <goal>compile</goal>
                        </goals>
                        <configuration>
                            <projectFile>${basedir}/src/install4j/unitty.install4j</projectFile>
                            <release>${project.version}-${build.timestamp}</release>
                            <variables>
                                <i4j.updates>${i4j.updates}</i4j.updates>
                            </variables>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>wagon-maven-plugin</artifactId>
                <version>1.0-beta-4</version>
                <executions>
                    <execution>
                        <id>upload</id>
                        <phase>deploy</phase>
                        <goals>
                            <goal>upload</goal>
                        </goals>
                        <configuration>
                            <fromDir>target</fromDir>
                            <includes>*.exe,*.sh,*.dmg</includes>
                            <url>${assemblyDeploymentLocation}</url>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
    <distributionManagement>
        <repository>
            <id>libs-releases</id>
            <url>http://artifactory.javassh.com/libs-releases-local</url>
        </repository>
        <snapshotRepository>
            <id>libs-snapshots</id>
            <url>http://artifactory.javassh.com/libs-snapshots-local</url>
        </snapshotRepository>
    </distributionManagement>
    <repositories>
        <repository>
            <id>libs-releases</id>
            <url>http://artifactory.javassh.com/libs-releases-local</url>
            <releases />
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </repository>
        <repository>
            <id>libs-snapshots</id>
            <url>http://artifactory.javassh.com/libs-snapshots-local</url>
            <releases>
                <enabled>false</enabled>
            </releases>
            <snapshots />
        </repository>
        <repository>
            <id>ej</id>
            <url>https://maven.ej-technologies.com/repository/</url>
            <releases />
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </repository>
    </repositories>
    <dependencies>
        <dependency>
            <groupId>com.sshtools.unitty</groupId>
            <artifactId>unitty-macosx-app</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>com.sshtools.unitty</groupId>
            <artifactId>unitty-app</artifactId>
            <version>${project.version}</version>
            <scope>compile</scope>
            <exclusions>
                <exclusion>
                    <artifactId>sshapi-ganymed</artifactId>
                    <groupId>com.sshtools</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>sshapi-j2ssh</artifactId>
                    <groupId>com.sshtools</groupId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>com.sshtools</groupId>
            <artifactId>sshapi-maverick-16</artifactId>
            <version>${sshapiVersion}</version>
            <exclusions>
                <exclusion>
                    <groupId>net.java.dev.jna</groupId>
                    <artifactId>jna</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>net.java.dev.jna</groupId>
                    <artifactId>jna-platform</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>com.sshtools</groupId>
            <artifactId>sshapi-maverick-16-license</artifactId>
            <version>${sshapiVersion}</version>
        </dependency>
        <dependency>
            <groupId>com.sshtools</groupId>
            <artifactId>sshapi-maverick-synergy-license</artifactId>
            <version>${sshapiVersion}</version>
            <type>pom</type>
            <scope>compile</scope>
        </dependency>

        <dependency>
            <groupId>com.install4j</groupId>
            <artifactId>install4j-runtime</artifactId>
            <version>8.0.2</version>
            <scope>provided</scope>
        </dependency>

    </dependencies>
</project>