<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~    Copyright 2017 Frederic Thevenet
  ~
  ~    Licensed under the Apache License, Version 2.0 (the "License");
  ~    you may not use this file except in compliance with the License.
  ~    You may obtain a copy of the License at
  ~
  ~         http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~    Unless required by applicable law or agreed to in writing, software
  ~    distributed under the License is distributed on an "AS IS" BASIS,
  ~    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~    See the License for the specific language governing permissions and
  ~    limitations under the License.
  ~
  -->

<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>eu.fthevenet</groupId>
    <artifactId>binjr</artifactId>
    <name>binjr</name>
    <url>http://www.binjr.eu</url>
    <version>1.6.0</version>
    <packaging>jar</packaging>
    <description>Flexible Time Series Visualization</description>
    <organization>
        <name>Frederic Thevenet</name>
        <url>http://www.fthevenet.eu/</url>
    </organization>
    <developers>
        <developer>
            <name>Frederic Thevenet</name>
            <url>http://www.fthevenet.eu/</url>
        </developer>
    </developers>
    <licenses>
        <license>
            <name>Apache License, Version 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
            <distribution>repo</distribution>
        </license>
    </licenses>
    <properties>
        <detailedDescription>binjr is a Java based, open source, time series visualization tool. It can plot time series data from multiple sources as a set of charts, which end users can navigate or zoom in and out.</detailedDescription>
        <license.name>Apache Software License 2.0</license.name>
        <License.url>http://www.apache.org/licenses/LICENSE-2.0</License.url>
        <license.shortName>ASL 2.0</license.shortName>
        <releaseUrl>https://github.com/fthevenet/binjr/releases</releaseUrl>
        <helpUrl>https://github.com/fthevenet/binjr/wiki</helpUrl>
        <github.global.server>github</github.global.server>
        <project.scm.id>${github.global.server}</project.scm.id>
        <skipDeploy>true</skipDeploy>
        <compiler-source-version>8</compiler-source-version>
        <compiler-target-version>8</compiler-target-version>
        <controlfx-version>8.40.14</controlfx-version>
    </properties>
    <scm>
        <connection>scm:git:https://github.com/fthevenet/binjr.git</connection>
        <url>https://github.com/fthevenet/binjr</url>
        <developerConnection>scm:git:https://github.com/fthevenet/binjr.git</developerConnection>
        <tag>v1.6.0</tag>
    </scm>
    <profiles>
        <profile>
            <id>java10</id>
            <properties>
                <compilier-target-version>10</compilier-target-version>
                <compilier-source-version>10</compilier-source-version>
                <controlfx-version>9.0.0</controlfx-version>
            </properties>
            <dependencies>
                <dependency>
                    <groupId>javax.xml.bind</groupId>
                    <artifactId>jaxb-api</artifactId>
                    <version>2.4.0-b180830.0359</version>
                </dependency>
                <dependency>
                    <groupId>org.glassfish.jaxb</groupId>
                    <artifactId>jaxb-runtime</artifactId>
                    <version>2.4.0-b180725.0644</version>
                </dependency>
            </dependencies>
        </profile>
        <profile>
            <id>build-extras</id>
            <build>
                <plugins>
                    <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>3.0.1</version>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                                <configuration>
                                    <doclint>none</doclint>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>sign</id>
            <properties>
                <skipDeploy>false</skipDeploy>
            </properties>
            <build>
                <plugins>
                    <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>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>buildNativeBundles</id>
            <activation>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>build-helper-maven-plugin</artifactId>
                        <version>3.0.0</version>
                        <executions>
                            <execution>
                                <id>clean-version</id>
                                <phase>validate</phase>
                                <goals>
                                    <goal>regex-property</goal>
                                </goals>
                                <configuration>
                                    <name>bundle.version</name>
                                    <value>${project.version}</value>
                                    <regex>^([0-9]+)\.([0-9]+)\.([0-9]+)(-SNAPSHOT)?$</regex>
                                    <replacement>$1.$2.$3</replacement>
                                    <failIfNoMatch>true</failIfNoMatch>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <artifactId>maven-resources-plugin</artifactId>
                        <groupId>org.apache.maven.plugins</groupId>
                        <version>3.1.0</version>
                        <executions>
                            <execution>
                                <id>installer-windows</id>
                                <phase>package</phase>
                                <goals>
                                    <goal>copy-resources</goal>
                                </goals>
                                <configuration>
                                    <outputDirectory>${project.basedir}/src/main/deploy/package/windows</outputDirectory>
                                    <resources>
                                        <resource>
                                            <directory>src/main/resources/bundlers</directory>
                                            <includes>
                                                <include>*.wxs</include>
                                            </includes>
                                            <filtering>true</filtering>
                                        </resource>
                                    </resources>
                                </configuration>
                            </execution>
                            <execution>
                                <id>installer-linux</id>
                                <phase>package</phase>
                                <goals>
                                    <goal>copy-resources</goal>
                                </goals>
                                <configuration>
                                    <outputDirectory>${project.basedir}/src/main/deploy/package/linux</outputDirectory>
                                    <resources>
                                        <resource>
                                            <directory>src/main/resources/bundlers</directory>
                                            <includes>
                                                <include>*.spec</include>
                                                <include>control</include>
                                                <include>copyright</include>
                                            </includes>
                                            <filtering>true</filtering>
                                        </resource>
                                    </resources>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>com.zenjava</groupId>
                        <artifactId>javafx-maven-plugin</artifactId>
                        <version>8.8.3</version>
                        <configuration>
                            <mainClass>eu.fthevenet.binjr.Bootstrap</mainClass>
                            <vendor>${project.organization.name}</vendor>
                            <bundler>all</bundler>
                            <nativeReleaseVersion>${project.version}</nativeReleaseVersion>
                            <appName>${project.build.finalName}</appName>
                            <additionalAppResources>${project.basedir}/src/main/deploy/resources</additionalAppResources>
                            <additionalBundlerResources>${project.basedir}/src/main/deploy/bundlers</additionalBundlerResources>
                            <jvmArgs>
                                <jvmArg>-splash:splashscreen.png</jvmArg>
                                <jvmArg>-XX:+UseG1GC</jvmArg>
                                <jvmArg>-XX:MaxGCPauseMillis=200</jvmArg>
                                <jvmArg>-Xmx2048m</jvmArg>
                            </jvmArgs>
                            <manifestAttributes>
                                <Main-Class>eu.fthevenet.binjr.Bootstrap</Main-Class>
                                <Specification-Title>${project.name}</Specification-Title>
                                <Specification-Version>${project.version}</Specification-Version>
                                <Specification-Vendor>${project.organization.name}</Specification-Vendor>
                                <Implementation-Title>${project.name}</Implementation-Title>
                                <Implementation-Version>${project.version}</Implementation-Version>
                                <Implementation-Vendor>${project.organization.name}</Implementation-Vendor>
                                <SplashScreen-Image>images/splashscreen.png</SplashScreen-Image>
                                <Build-Number>${env.BINJR_BUILD_NUMBER}</Build-Number>
                            </manifestAttributes>
                            <verbose>true</verbose>
                            <description>A time-series visualization studio</description>
                            <title>binjr</title>
                            <fileAssociations>
                                <fileAssociation>
                                    <extensions>bjr</extensions>
                                    <description>binjr Workspace Files</description>
                                    <contentType>bjr</contentType>
                                    <icon>binjr.ico</icon>
                                </fileAssociation>
                            </fileAssociations>
                            <bundleArguments>
                                <!--<runtime />-->
                                <licenseFile>LICENSE</licenseFile>
                                <win.menuGroup>binjr</win.menuGroup>
                            </bundleArguments>
                            <skipJNLP>true</skipJNLP>
                        </configuration>
                        <executions>
                            <execution>
                                <!-- required before build-native -->
                                <id>fromUrl-jfxjar</id>
                                <phase>install</phase>
                                <goals>
                                    <goal>build-jar</goal>
                                </goals>
                            </execution>
                            <execution>
                                <id>fromUrl-native</id>
                                <phase>install</phase>
                                <goals>
                                    <goal>build-native</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>de.jutzig</groupId>
                        <artifactId>github-release-plugin</artifactId>
                        <version>1.2.0</version>
                        <executions>
                            <execution>
                                <phase>deploy</phase>
                                <goals>
                                    <goal>release</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <description>binjr v${project.version}</description>
                            <releaseName>binjr v${project.version}</releaseName>
                            <tag>v${project.version}</tag>
                            <prerelease>${github.deploy.prerelease}</prerelease>
                            <overwriteArtifact>true</overwriteArtifact>
                            <fileSets>
                                <fileSet>
                                    <directory>${project.build.directory}</directory>
                                    <includes>
                                        <include>${project.name}-${project.version}</include>
                                    </includes>
                                </fileSet>
                                <fileSet>
                                    <directory>${project.build.directory}/jfx/native/</directory>
                                    <includes>
                                        <include>${project.artifactId}*.msi</include>
                                        <include>${project.artifactId}*.deb</include>
                                        <include>${project.artifactId}*.rpm</include>
                                        <include>${project.artifactId}*.dmg</include>
                                    </includes>
                                </fileSet>
                            </fileSets>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
    <build>
        <finalName>${project.name}</finalName>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.7.0</version>
                <configuration>
                    <encoding>UTF-8</encoding>
                    <source>${compiler-source-version}</source>
                    <target>${compiler-target-version}</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <version>3.1.1</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                        <configuration>
                            <finalName>${project.name}-${project.version}</finalName>
                            <shadedArtifactAttached>true</shadedArtifactAttached>
                            <transformers>
                                <transformer implementation="com.github.edwgiz.mavenShadePlugin.log4j2CacheTransformer.PluginsCacheFileTransformer" />
                                <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
                                    <manifestEntries>
                                        <Main-Class>eu.fthevenet.binjr.Bootstrap</Main-Class>
                                        <Specification-Title>${project.name}</Specification-Title>
                                        <Specification-Version>${project.version}</Specification-Version>
                                        <Specification-Vendor>${project.organization.name}</Specification-Vendor>
                                        <Implementation-Title>${project.name}</Implementation-Title>
                                        <Implementation-Version>${project.version}</Implementation-Version>
                                        <Implementation-Vendor>${project.organization.name}</Implementation-Vendor>
                                        <SplashScreen-Image>images/splashscreen.png</SplashScreen-Image>
                                        <Build-Number>${env.BINJR_BUILD_NUMBER}</Build-Number>
                                    </manifestEntries>
                                </transformer>
                            </transformers>
                        </configuration>
                    </execution>
                </executions>
                <dependencies>
                    <dependency>
                        <groupId>com.github.edwgiz</groupId>
                        <artifactId>maven-shade-plugin.log4j2-cachefile-transformer</artifactId>
                        <version>2.8.1</version>
                    </dependency>
                </dependencies>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>3.1.0</version>
                <configuration>
                    <archive>
                        <index>true</index>
                        <!--<manifest>-->
                        <!--<addClasspath>true</addClasspath>-->
                        <!--</manifest>-->
                        <manifestEntries>
                            <Main-Class>eu.fthevenet.binjr.Bootstrap</Main-Class>
                            <Specification-Title>${project.name}</Specification-Title>
                            <Specification-Version>${project.version}</Specification-Version>
                            <Specification-Vendor>${project.organization.name}</Specification-Vendor>
                            <Implementation-Title>${project.name}</Implementation-Title>
                            <Implementation-Version>${project.version}</Implementation-Version>
                            <Implementation-Vendor>${project.organization.name}</Implementation-Vendor>
                            <SplashScreen-Image>images/splashscreen.png</SplashScreen-Image>
                            <Build-Number>${env.BINJR_BUILD_NUMBER}</Build-Number>
                        </manifestEntries>
                    </archive>
                </configuration>
            </plugin>
            <!-- Release -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <version>2.5.3</version>
                <configuration>
                    <tagNameFormat>v@{project.version}</tagNameFormat>
                    <autoVersionSubmodules>true</autoVersionSubmodules>
                    <useReleaseProfile>false</useReleaseProfile>
                    <checkModificationExcludes>
                        <checkModificationExclude>pom.xml</checkModificationExclude>
                    </checkModificationExcludes>
                    <!--<scmCommentPrefix>[maven-release-plugin] [ci skip]</scmCommentPrefix>-->
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>org.apache.maven.scm</groupId>
                        <artifactId>maven-scm-provider-gitexe</artifactId>
                        <version>1.9.5</version>
                    </dependency>
                </dependencies>
            </plugin>
            <plugin>
                <groupId>org.sonatype.plugins</groupId>
                <artifactId>nexus-staging-maven-plugin</artifactId>
                <version>1.6.8</version>
                <extensions>true</extensions>
                <configuration>
                    <skipNexusStagingDeployMojo>${skipDeploy}</skipNexusStagingDeployMojo>
                    <serverId>ossrh</serverId>
                    <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                    <autoReleaseAfterClose>true</autoReleaseAfterClose>
                </configuration>
            </plugin>
            <plugin>
                <groupId>de.jutzig</groupId>
                <artifactId>github-release-plugin</artifactId>
                <version>1.2.0</version>
                <executions>
                    <execution>
                        <phase>deploy</phase>
                        <goals>
                            <goal>release</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <description>${project.name} v${project.version}</description>
                    <releaseName>${project.name} v${project.version}</releaseName>
                    <tag>v${project.version}</tag>
                    <prerelease>${github.deploy.prerelease}</prerelease>
                    <overwriteArtifact>true</overwriteArtifact>
                    <fileSets>
                        <fileSet>
                            <directory>${project.build.directory}</directory>
                            <includes>
                                <include>${project.name}-${project.version}.jar</include>
                            </includes>
                        </fileSet>
                    </fileSets>
                </configuration>
            </plugin>
        </plugins>
    </build>
    <dependencies>
        <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-core</artifactId>
            <version>2.11.1</version>
        </dependency>
        <dependency>
            <groupId>org.apache.httpcomponents</groupId>
            <artifactId>httpclient</artifactId>
            <version>4.5.6</version>
        </dependency>
        <dependency>
            <groupId>org.controlsfx</groupId>
            <artifactId>controlsfx</artifactId>
            <version>${controlfx-version}</version>
        </dependency>
        <dependency>
            <groupId>org.gillius</groupId>
            <artifactId>jfxutils</artifactId>
            <version>1.0</version>
        </dependency>
        <dependency>
            <groupId>com.google.code.gson</groupId>
            <artifactId>gson</artifactId>
            <version>2.8.5</version>
        </dependency>
        <dependency>
            <groupId>com.migesok</groupId>
            <artifactId>jaxb-java-time-adapters</artifactId>
            <version>1.1.3</version>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-csv</artifactId>
            <version>1.5</version>
        </dependency>
    </dependencies>
    <distributionManagement>
        <repository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>
        <snapshotRepository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
    </distributionManagement>
</project>