<?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>com.github.ptitnoony.components</groupId>
    <artifactId>fxtreemap</artifactId>
    <version>0.2</version>
    <packaging>jar</packaging>

    <name>FxTreeMap</name>

    <description>A small library to build tree maps using JavaFx</description>

    <url>https://github.com/PtitNoony/FxTreeMap</url>

    <licenses>
        <license>
            <name>MIT License</name>
            <url>http://www.opensource.org/licenses/mit-license.php</url>
        </license>
    </licenses>

    <developers>
        <developer>
            <name>Hamon Arnaud</name>
            <email>hamonar@gmail.com</email>
            <organization>PtitNoonY</organization>
            <organizationUrl>https://github.com/PtitNoony/</organizationUrl>
        </developer>
    </developers>

    <scm>
        <connection>scm:git:git@github.com:ptitnoony/fxtreemap.git</connection>
        <developerConnection>scm:git:git@github.com:ptitnoony/fxtreemap.git</developerConnection>
        <url>git@github.com:ptitnoony/fxtreemap.git</url>
    </scm>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <mainClass>com.github.ptitnoony.components.fxtreemap.sample.MainApp</mainClass>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
    </properties>

    <organization>
        <name>H-K</name>
    </organization>

    <dependencies>
        <dependency>
            <groupId>org.controlsfx</groupId>
            <artifactId>controlsfx</artifactId>
            <version>8.40.13</version>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.12</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.hamcrest</groupId>
            <artifactId>hamcrest-core</artifactId>
            <version>1.3</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <distributionManagement>
        <snapshotRepository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
        <repository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>
    </distributionManagement>

    <profiles>
        <profile>
            <id>Dev</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-dependency-plugin</artifactId>
                        <version>3.0.1</version>
                        <executions>
                            <execution>
                                <id>unpack-dependencies</id>
                                <phase>package</phase>
                                <goals>
                                    <goal>unpack-dependencies</goal>
                                </goals>
                                <configuration>
                                    <excludeScope>system</excludeScope>
                                    <excludeGroupIds>junit,org.mockito,org.hamcrest</excludeGroupIds>
                                    <outputDirectory>${project.build.directory}/classes</outputDirectory>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>exec-maven-plugin</artifactId>
                        <version>1.6.0</version>
                        <executions>
                            <execution>
                                <id>unpack-dependencies</id>
                                <phase>package</phase>
                                <goals>
                                    <goal>exec</goal>
                                </goals>
                                <configuration>
                                    <executable>${java.home}/../bin/javapackager</executable>
                                    <arguments>
                                        <argument>-createjar</argument>
                                        <argument>-nocss2bin</argument>
                                        <argument>-appclass</argument>
                                        <argument>${mainClass}</argument>
                                        <argument>-srcdir</argument>
                                        <argument>${project.build.directory}/classes</argument>
                                        <argument>-outdir</argument>
                                        <argument>${project.build.directory}</argument>
                                        <argument>-outfile</argument>
                                        <argument>${project.build.finalName}.jar</argument>
                                    </arguments>
                                </configuration>
                            </execution>
                            <execution>
                                <id>default-cli</id>
                                <goals>
                                    <goal>exec</goal>                            
                                </goals>
                                <configuration>
                                    <executable>${java.home}/bin/java</executable>
                                    <commandlineArgs>${runfx.args}</commandlineArgs>
                                </configuration>
                            </execution>
                        </executions>  
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-compiler-plugin</artifactId>
                        <version>3.6.1</version>
                        <configuration>
                            <source>1.8</source>
                            <target>1.8</target>
                            <compilerArguments>
                                <bootclasspath>${sun.boot.class.path}${path.separator}${java.home}/lib/jfxrt.jar</bootclasspath>
                            </compilerArguments>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <version>2.20</version>
                        <configuration>
                            <additionalClasspathElements>
                                <additionalClasspathElement>${java.home}/lib/jfxrt.jar</additionalClasspathElement>
                            </additionalClasspathElements>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <version>2.10.4</version>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <id>Release</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-dependency-plugin</artifactId>
                        <version>3.0.1</version>
                        <executions>
                            <execution>
                                <id>unpack-dependencies</id>
                                <phase>package</phase>
                                <goals>
                                    <goal>unpack-dependencies</goal>
                                </goals>
                                <configuration>
                                    <excludeScope>system</excludeScope>
                                    <excludeGroupIds>junit,org.mockito,org.hamcrest</excludeGroupIds>
                                    <outputDirectory>${project.build.directory}/classes</outputDirectory>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>exec-maven-plugin</artifactId>
                        <version>1.6.0</version>
                        <executions>
                            <execution>
                                <id>unpack-dependencies</id>
                                <phase>package</phase>
                                <goals>
                                    <goal>exec</goal>
                                </goals>
                                <configuration>
                                    <executable>${java.home}/../bin/javapackager</executable>
                                    <arguments>
                                        <argument>-createjar</argument>
                                        <argument>-nocss2bin</argument>
                                        <argument>-appclass</argument>
                                        <argument>${mainClass}</argument>
                                        <argument>-srcdir</argument>
                                        <argument>${project.build.directory}/classes</argument>
                                        <argument>-outdir</argument>
                                        <argument>${project.build.directory}</argument>
                                        <argument>-outfile</argument>
                                        <argument>${project.build.finalName}.jar</argument>
                                    </arguments>
                                </configuration>
                            </execution>
                            <execution>
                                <id>default-cli</id>
                                <goals>
                                    <goal>exec</goal>                            
                                </goals>
                                <configuration>
                                    <executable>${java.home}/bin/java</executable>
                                    <commandlineArgs>${runfx.args}</commandlineArgs>
                                </configuration>
                            </execution>
                        </executions>  
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-compiler-plugin</artifactId>
                        <version>3.6.1</version>
                        <configuration>
                            <source>1.8</source>
                            <target>1.8</target>
                            <compilerArguments>
                                <bootclasspath>${sun.boot.class.path}${path.separator}${java.home}/lib/jfxrt.jar</bootclasspath>
                            </compilerArguments>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <version>2.20</version>
                        <configuration>
                            <additionalClasspathElements>
                                <additionalClasspathElement>${java.home}/lib/jfxrt.jar</additionalClasspathElement>
                            </additionalClasspathElements>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <version>3.0.1</version>
                        <executions>
                            <execution>
                                <id>attach-sources</id>
                                <goals>
                                    <goal>jar-no-fork</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <version>2.10.4</version>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>1.6</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                        <version>1.6.8</version>
                        <extensions>true</extensions>
                        <configuration>
                            <serverId>ossrh</serverId>
                            <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                            <autoReleaseAfterClose>true</autoReleaseAfterClose>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>

    </profiles>

</project>
