<?xml version="1.0" encoding="UTF-8"?>
<!--
  #%L
  Add hint in spoilers
  %%
  Copyright (C) 2017 Ultreia.io
  %%
  This program is free software: you can redistribute it and/or modify
  it under the terms of the GNU General Public License as
  published by the Free Software Foundation, either version 3 of the
  License, or (at your option) any later version.
  
  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.
  
  You should have received a copy of the GNU General Public
  License along with this program.  If not, see
  <http://www.gnu.org/licenses/gpl-3.0.html>.
  #L%
  -->


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

  <parent>
    <groupId>io.ultreia.maven</groupId>
    <artifactId>pom</artifactId>
    <version>7</version>
  </parent>

  <groupId>io.ultreia.gc</groupId>
  <artifactId>hint-in-spoilers</artifactId>
  <version>1.0</version>

  <name>Add hint in spoilers</name>
  <url>https://geocaching.gitlab.io/hint-in-spoilers</url>
  <inceptionYear>2017</inceptionYear>
  <licenses>
    <license>
      <name>General Public License (GPL)</name>
      <url>http://www.gnu.org/licenses/gpl.txt</url>
      <distribution>repo</distribution>
    </license>
  </licenses>

  <developers>

    <developer>
      <name>Tony Chemit</name>
      <id>tchemit</id>
      <email>dev@tchemit.fr</email>
      <timezone>Europe/Paris</timezone>
      <organization>ultreia.io</organization>
      <organizationUrl>http://ultreia.io</organizationUrl>
      <roles>
        <role>developer</role>
      </roles>
    </developer>

  </developers>

  <scm>
    <connection>scm:git:git@gitlab.com:geocaching/hint-in-spoilers.git</connection>
    <developerConnection>scm:ssh://git:git@gitlab.com:geocaching/hint-in-spoilers.git</developerConnection>
    <url>https://gitlab.com/geocaching/hint-in-spoilers</url>
  </scm>
  <distributionManagement>
    <site>
      <id>gitlab.com</id>
      <url>scm:git:http://git@gitlab.com/geocaching/hint-in-spoilers.git</url>
    </site>
  </distributionManagement>

  <properties>

    <organizationId>geocaching</organizationId>
    <projectId>hint-in-spoilers</projectId>

    <!--deploy all-->
    <maven.deploy.skip>false</maven.deploy.skip>
    <!--build javadoc-->
    <maven.javadoc.skip>false</maven.javadoc.skip>
    <!--build sources-->
    <maven.source.skip>false</maven.source.skip>

    <!--GitLab plugin configuration-->
    <gitlab.changesTitle>Hint in spoilers</gitlab.changesTitle>
    <gitlab.changesAuthor>Tony Chemit</gitlab.changesAuthor>
    <gitlab.changesAuthorEmail>dev@tchemit.fr</gitlab.changesAuthorEmail>
    <gitlab.trackers>Bug,Feature,Task</gitlab.trackers>

    <!-- main class in JAR -->
    <maven.jar.main.class>io.ultreia.gc.spoilers.HintInSpoilers</maven.jar.main.class>

    <!-- to run via maven mvn exec:java -->
    <exec.mainClass>${maven.jar.main.class}</exec.mainClass>

    <!-- jnlp configuration -->
    <jnlpFileName>hint-into-spoilers.jnlp</jnlpFileName>
    <jnlpCodebase>https://geocaching.gitlab.io/hint-in-spoilers/jnlp</jnlpCodebase>
    <webstartPluginVersion>1.0-beta-7</webstartPluginVersion>

    <!-- license header configuration -->
    <license.licenseName>gpl_v3</license.licenseName>
    <license.organizationName>Ultreia.io</license.organizationName>

  </properties>

  <dependencies>

    <dependency>
      <groupId>commons-logging</groupId>
      <artifactId>commons-logging</artifactId>
      <version>1.2</version>
    </dependency>

    <dependency>
      <groupId>org.nuiton</groupId>
      <artifactId>nuiton-utils</artifactId>
      <version>3.0-rc-17</version>
      <exclusions>
        <exclusion>
          <groupId>org.apache.commons</groupId>
          <artifactId>commons-lang3</artifactId>
        </exclusion>
        <exclusion>
          <groupId>commons-primitives</groupId>
          <artifactId>commons-primitives</artifactId>
        </exclusion>
        <exclusion>
          <groupId>commons-io</groupId>
          <artifactId>commons-io</artifactId>
        </exclusion>
        <exclusion>
          <groupId>commons-beanutils</groupId>
          <artifactId>commons-beanutils</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.nuiton.i18n</groupId>
          <artifactId>nuiton-i18n</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.nuiton</groupId>
          <artifactId>nuiton-converter</artifactId>
        </exclusion>
      </exclusions>
    </dependency>

    <dependency>
      <groupId>org.nuiton.jaxx</groupId>
      <artifactId>jaxx-widgets-file</artifactId>
      <version>3.0-alpha-3</version>
      <exclusions>
        <exclusion>
          <groupId>commons-primitives</groupId>
          <artifactId>commons-primitives</artifactId>
        </exclusion>
        <exclusion>
          <groupId>commons-io</groupId>
          <artifactId>commons-io</artifactId>
        </exclusion>
        <exclusion>
          <groupId>commons-beanutils</groupId>
          <artifactId>commons-beanutils</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.nuiton.i18n</groupId>
          <artifactId>nuiton-i18n</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.nuiton</groupId>
          <artifactId>nuiton-converter</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.nuiton</groupId>
          <artifactId>nuiton-decorator</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.nuiton</groupId>
          <artifactId>nuiton-utils</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.swinglabs</groupId>
          <artifactId>jxlayer</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.swinglabs.swingx</groupId>
          <artifactId>swingx-core</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.nuiton.jaxx</groupId>
      <artifactId>jaxx-runtime</artifactId>
      <version>3.0-alpha-3</version>
      <exclusions>
        <exclusion>
          <groupId>commons-primitives</groupId>
          <artifactId>commons-primitives</artifactId>
        </exclusion>
        <exclusion>
          <groupId>commons-io</groupId>
          <artifactId>commons-io</artifactId>
        </exclusion>
        <exclusion>
          <groupId>commons-beanutils</groupId>
          <artifactId>commons-beanutils</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.nuiton.i18n</groupId>
          <artifactId>nuiton-i18n</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.nuiton</groupId>
          <artifactId>nuiton-converter</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.nuiton</groupId>
          <artifactId>nuiton-decorator</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.nuiton</groupId>
          <artifactId>nuiton-utils</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.swinglabs</groupId>
          <artifactId>jxlayer</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.swinglabs.swingx</groupId>
          <artifactId>swingx-core</artifactId>
        </exclusion>
      </exclusions>
    </dependency>

    <dependency>
      <groupId>log4j</groupId>
      <artifactId>log4j</artifactId>
      <version>1.2.17</version>
      <scope>runtime</scope>
    </dependency>

    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.11</version>
      <scope>test</scope>
    </dependency>

  </dependencies>

  <build>

    <pluginManagement>

      <plugins>
        <plugin>
          <artifactId>maven-site-plugin</artifactId>
          <configuration>
            <skipDeploy>true</skipDeploy><!-- don't deploy site with maven-site-plugin -->
          </configuration>
        </plugin>

        <plugin>
          <artifactId>maven-scm-publish-plugin</artifactId>
          <configuration>
            <pubScmUrl>${project.distributionManagement.site.url}</pubScmUrl>
            <scmBranch>pages</scmBranch>
            <content>${project.reporting.outputDirectory}</content><!-- mono-module doesn't require site:stage -->
          </configuration>
          <executions>
            <execution>
              <id>scm-publish</id>
              <phase>site-deploy</phase><!-- deploy site with maven-scm-publish-plugin -->
              <goals>
                <goal>publish-scm</goal>
              </goals>
            </execution>
          </executions>
        </plugin>

        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>webstart-maven-plugin</artifactId>
          <version>${webstartPluginVersion}</version>
          <configuration>
            <outputName>${jnlpFileName}</outputName>
            <codebase>${jnlpCodebase}</codebase>
            <libPath>lib</libPath>
            <makeArchive>false</makeArchive>
            <verbose>false</verbose>
            <updateManifestEntries>
              <Application-Name>Hint in Spoilers v${project.version}</Application-Name>
              <Permissions>all-permissions</Permissions>
              <Codebase>*</Codebase>
            </updateManifestEntries>
            <filenameMapping>simple</filenameMapping>
            <outputJarVersions>true</outputJarVersions>
            <jnlp>
              <mainClass>${maven.jar.main.class}</mainClass>
              <allPermissions>true</allPermissions>
              <offlineAllowed>true</offlineAllowed>
              <outputFile>${jnlpFileName}</outputFile>
            </jnlp>
            <sign>
              <keystore>${keystorepath}</keystore>
              <storepass>${keystorepass}</storepass>
              <alias>${keyalias}</alias>
              <keypass>${keypass}</keypass>
              <verify>true</verify>
              <keystoreConfig>
                <delete>false</delete>
                <gen>false</gen>
              </keystoreConfig>
            </sign>

            <gzip>true</gzip>
            <pack200>
              <enabled>true</enabled>
              <passFiles>
                <passFile>org/jdesktop/jxlayer/</passFile>
              </passFiles>
            </pack200>
          </configuration>
        </plugin>

      </plugins>
    </pluginManagement>

    <plugins>

      <plugin>
        <artifactId>maven-jar-plugin</artifactId>
        <configuration>
          <archive>
            <manifest>
              <useUniqueVersions>false</useUniqueVersions>
              <addClasspath>true</addClasspath>
              <classpathPrefix>./lib/</classpathPrefix>
              <mainClass>${maven.jar.main.class}</mainClass>
            </manifest>
          </archive>
        </configuration>
      </plugin>

    </plugins>
  </build>

  <reporting>
    <excludeDefaults>true</excludeDefaults>
  </reporting>

  <profiles>

    <!-- by default jnlp is only perform on a release stage when using the maven-release-plugin -->
    <profile>
      <id>release-jnlp-profile</id>
      <activation>
        <property>
          <name>performRelease</name>
          <value>true</value>
        </property>
      </activation>
      <build>
        <defaultGoal>package</defaultGoal>
        <plugins>
          <!-- key store secrets availables -->
          <plugin>
            <groupId>org.nuiton</groupId>
            <artifactId>helper-maven-plugin</artifactId>
            <executions>
              <execution>
                <id>get-keystore</id>
                <goals>
                  <goal>share-server-secret</goal>
                </goals>
                <phase>package</phase>
                <configuration>
                  <serverId>ultreia-keystore</serverId>
                  <privateKeyOut>keystorepath</privateKeyOut>
                  <passwordOut>keystorepass</passwordOut>
                  <usernameOut>keyalias</usernameOut>
                  <passphraseOut>keypass</passphraseOut>
                </configuration>
              </execution>
            </executions>
          </plugin>

          <!-- make webstart  -->
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>webstart-maven-plugin</artifactId>
            <executions>
              <execution>
                <id>generate-jnlp</id>
                <phase>package</phase>
                <goals>
                  <goal>jnlp-single</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>

    <profile>
      <id>assembly-profile</id>
      <activation>
        <property>
          <name>performRelease</name>
          <value>true</value>
        </property>
      </activation>

      <build>
        <plugins>

          <plugin>
            <artifactId>maven-dependency-plugin</artifactId>
            <executions>
              <execution>
                <id>copy-dependencies</id>
                <goals>
                  <goal>copy-dependencies</goal>
                </goals>
                <phase>package</phase>
                <configuration>
                  <overWriteReleases>false</overWriteReleases>
                  <overWriteSnapshots>true</overWriteSnapshots>
                  <overWriteIfNewer>true</overWriteIfNewer>
                  <outputDirectory>${project.build.directory}/lib</outputDirectory>
                  <silent>true</silent>
                </configuration>
              </execution>
            </executions>
          </plugin>

          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>build-helper-maven-plugin</artifactId>
            <executions>
              <execution>
                <id>parse-version</id>
                <goals>
                  <goal>parse-version</goal>
                </goals>
              </execution>
            </executions>
          </plugin>

          <plugin>
            <groupId>com.akathist.maven.plugins.launch4j</groupId>
            <artifactId>launch4j-maven-plugin</artifactId>
            <executions>
              <execution>
                <id>launch4j</id>
                <phase>package</phase>
                <goals>
                  <goal>launch4j</goal>
                </goals>
                <configuration>
                  <dontWrapJar>true</dontWrapJar>
                  <headerType>gui</headerType>
                  <outfile>${project.build.directory}/${project.build.finalName}.exe</outfile>
                  <jar>${project.build.finalName}.jar</jar>
                  <errTitle>${project.name}</errTitle>
                  <jre>
                    <minVersion>1.8.0</minVersion>
                  </jre>
                  <versionInfo>
                    <!--suppress MavenModelInspection -->
                    <fileVersion>${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.incrementalVersion}.0</fileVersion>
                    <txtFileVersion>${project.version}</txtFileVersion>
                    <fileDescription>${project.description}</fileDescription>
                    <productName>${project.name}</productName>
                    <!--suppress MavenModelInspection -->
                    <productVersion>${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.incrementalVersion}.0</productVersion>
                    <txtProductVersion>${project.version}</txtProductVersion>
                    <companyName>${project.organization.name}</companyName>
                    <copyright>${project.inceptionYear} 2017 ${project.organization.name}</copyright>
                    <internalName>hint-in-spoilers</internalName>
                    <originalFilename>${project.build.finalName}.exe</originalFilename>
                  </versionInfo>
                </configuration>
              </execution>
            </executions>
          </plugin>

          <plugin>
            <artifactId>maven-assembly-plugin</artifactId>
            <executions>
              <execution>
                <id>create-application-assembly</id>
                <phase>package</phase>
                <goals>
                  <goal>single</goal>
                </goals>
                <configuration>
                  <descriptors>
                    <descriptor>src/main/assembly/bin.xml</descriptor>
                  </descriptors>
                  <attach>true</attach>
                  <finalName>${project.build.finalName}</finalName>
                  <appendAssemblyId>false</appendAssemblyId>
                  <outputDirectory>${project.build.directory}</outputDirectory>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>

    <profile>
      <id>reporting</id>
      <activation>
        <property>
          <name>performRelease</name>
          <value>true</value>
        </property>
      </activation>

      <reporting>
        <plugins>

          <plugin>
            <artifactId>maven-project-info-reports-plugin</artifactId>
            <version>${projectInfoReportsPluginVersion}</version>
            <reportSets>
              <reportSet>
                <reports>
                  <report>index</report>
                  <report>project-team</report>
                  <report>mailing-list</report>
                  <report>cim</report>
                  <report>issue-tracking</report>
                  <report>license</report>
                  <report>scm</report>
                  <report>dependency-info</report>
                  <report>dependencies</report>
                  <report>dependency-convergence</report>
                  <report>plugin-management</report>
                  <report>plugins</report>
                  <report>dependency-management</report>
                  <report>summary</report>
                </reports>
              </reportSet>
            </reportSets>
          </plugin>

          <plugin>
            <artifactId>maven-changes-plugin</artifactId>
            <version>${changesPluginVersion}</version>
            <configuration>
              <issueLinkTemplatePerSystem>
                <gitlab>https://gitlab.com/${organizationId}/${projectId}/issues/%ISSUE%</gitlab>
              </issueLinkTemplatePerSystem>
              <xmlPath>${project.build.directory}/generated-site/changes.xml</xmlPath>
            </configuration>
          </plugin>

          <plugin>
            <artifactId>maven-javadoc-plugin</artifactId>
            <version>${javadocPluginVersion}</version>
            <configuration>
              <quiet>${maven.javadoc.quiet}</quiet>
              <charset>${project.reporting.outputEncoding}</charset>
              <links>
                <link>http://docs.oracle.com/javase/${javadocJreApiVersion}/docs/api/</link>
              </links>
              <tagletArtifacts>
                <tagletArtifact>
                  <groupId>org.apache.maven.plugin-tools</groupId>
                  <artifactId>maven-plugin-tools-javadoc</artifactId>
                  <version>${mavenPluginToolsJavadocVersion}</version>
                </tagletArtifact>
                <tagletArtifact>
                  <groupId>org.codehaus.plexus</groupId>
                  <artifactId>plexus-component-javadoc</artifactId>
                  <version>${plexusComponentJavadocVersion}</version>
                </tagletArtifact>
              </tagletArtifacts>
            </configuration>
            <reportSets>
              <reportSet>
                <reports>
                  <report>javadoc</report>
                  <report>test-javadoc</report>
                </reports>
              </reportSet>
            </reportSets>
          </plugin>

          <plugin>
            <artifactId>maven-changelog-plugin</artifactId>
            <version>${changelogPluginVersion}</version>
          </plugin>

          <plugin>
            <artifactId>maven-jxr-plugin</artifactId>
            <version>${jrxPluginVersion}</version>
          </plugin>

          <plugin>
            <artifactId>maven-surefire-report-plugin</artifactId>
            <version>${surefirePluginVersion}</version>
          </plugin>

          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>license-maven-plugin</artifactId>
            <version>${licensePluginVersion}</version>
          </plugin>

          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>versions-maven-plugin</artifactId>
            <version>${versionsPluginVersion}</version>
            <reportSets>
              <reportSet>
                <reports>
                  <report>dependency-updates-report</report>
                  <report>plugin-updates-report</report>
                  <report>property-updates-report</report>
                </reports>
              </reportSet>
            </reportSets>
          </plugin>

          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>webstart-maven-plugin</artifactId>
            <version>${webstartPluginVersion}</version>
            <configuration>
              <siteJnlpFile>${jnlpFileName}</siteJnlpFile>
              <codebase>${jnlpCodebase}</codebase>
            </configuration>
          </plugin>

        </plugins>
      </reporting>

      <build>

        <plugins>

          <plugin>
            <groupId>io.ultreia.maven</groupId>
            <artifactId>gitlab-maven-plugin</artifactId>
            <inherited>false</inherited>
            <executions>
              <execution>
                <inherited>false</inherited>
                <goals>
                  <goal>generate-changes</goal>
                </goals>
                <phase>pre-site</phase>
              </execution>
            </executions>
          </plugin>

        </plugins>

      </build>

    </profile>
  </profiles>
</project>
