<?xml version="1.0" encoding="UTF-8"?>
<!--
  #%L
  Ifremer :: CALI
  %%
  Copyright (C) 2018 Ultreia.io, Ifremer
  %%
  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>2018.17</version>
  </parent>

  <groupId>io.ultreia.ifremer</groupId>
  <artifactId>cali</artifactId>
  <version>0.1</version>

  <name>Ifremer :: CALI</name>
  <description>Ifremer Cali</description>
  <url>https://gitlab.com/ultreiaio/ifremer-cali</url>
  <inceptionYear>2018</inceptionYear>

  <organization>
    <name>Ultreia.io</name>
    <url>http://ultreia.io</url>
  </organization>
  <licenses>
    <license>
      <name>General Public License (GPL)</name>
      <url>http://www.gnu.org/licenses/gpl.txt</url>
      <distribution>repo</distribution>
    </license>
  </licenses>

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


  <scm>
    <url>https://gitlab.com/${projectPath}</url>
    <connection>scm:git:git@gitlab.com:${projectPath}.git</connection>
    <developerConnection>scm:git:ssh://git@gitlab.com:${projectPath}.git</developerConnection>
  </scm>
  <distributionManagement>
    <site>
      <id>gitlab.com</id>
      <url>scm:git:https://git@gitlab.com/${projectPath}.git</url>
    </site>
  </distributionManagement>

  <properties>
    <!--<lib.version.java4all.jaxx>3.0-alpha-28-SNAPSHOT</lib.version.java4all.jaxx>-->
    <!--<lib.version.nuiton.config>3.5</lib.version.nuiton.config>-->

    <organizationId>ultreiaio</organizationId>
    <projectId>ifremer-cali</projectId>
    <applicationName>cali</applicationName>

    <!-- i18n configuration -->
    <i18n.bundles>fr_FR</i18n.bundles>
    <i18n.failsIfAnyKeyMissingValue>true</i18n.failsIfAnyKeyMissingValue>
    <i18n.checkBundle>true</i18n.checkBundle>
    <i18n.showEmpty>true</i18n.showEmpty>
    <i18n.failsIfDuplicatedKeys>true</i18n.failsIfDuplicatedKeys>
    <i18n.removeDuplicatedKeys>true</i18n.removeDuplicatedKeys>
    <i18n.bundleOutputName>${applicationName}-i18n</i18n.bundleOutputName>

    <!--jaxx configuration-->
    <jaxx.commonCss>${project.baseUri}/src/main/java/io/ultreia/ifremer/cali/ui/Common.jcss</jaxx.commonCss>

    <!-- License configuration -->
    <license.licenseName>gpl_v3</license.licenseName>
    <license.organizationName>Ultreia.io, Ifremer</license.organizationName>
    <license.generateBundle>true</license.generateBundle>
    <license.bundleThirdPartyPath>META-INF/${applicationName}-THIRD-PARTY.txt</license.bundleThirdPartyPath>
    <license.bundleLicensePath>META-INF/${applicationName}-LICENSE.txt</license.bundleLicensePath>

    <!--Gitlab configuration-->
    <gitlab.changesTitle>Ifremer CALI changelog</gitlab.changesTitle>
    <gitlab.changesAuthor>Tony Chemit</gitlab.changesAuthor>
    <gitlab.changesAuthorEmail>dev@tchemit.fr</gitlab.changesAuthorEmail>
    <gitlab.trackers>Evolution,Anomalie,Tâche</gitlab.trackers>

    <!--config configuration-->
    <config.useNuitonI18n>true</config.useNuitonI18n>
    <config.generatePropertyChangeSupport>true</config.generatePropertyChangeSupport>

    <!-- Site configuration -->
    <locales>en</locales>

    <maven.jar.main.class>io.ultreia.ifremer.cali.RunCali</maven.jar.main.class>

    <maven.javadoc.skip>false</maven.javadoc.skip>
    <maven.source.skip>false</maven.source.skip>
    <maven.deploy.skip>false</maven.deploy.skip>

  </properties>

  <dependencies>

    <dependency>
      <groupId>io.ultreia.java4all</groupId>
      <artifactId>java-lang</artifactId>
    </dependency>
    <dependency>
      <groupId>io.ultreia.java4all</groupId>
      <artifactId>java-bean</artifactId>
    </dependency>
    <dependency>
      <groupId>io.ultreia.java4all.i18n</groupId>
      <artifactId>i18n-api</artifactId>
    </dependency>

    <dependency>
      <groupId>io.ultreia.java4all.config</groupId>
      <artifactId>nuiton-config</artifactId>
    </dependency>

    <dependency>
      <groupId>io.ultreia.java4all.jaxx</groupId>
      <artifactId>jaxx-runtime-spi</artifactId>
    </dependency>
    <dependency>
      <groupId>io.ultreia.java4all.jaxx</groupId>
      <artifactId>jaxx-runtime</artifactId>
    </dependency>
    <dependency>
      <groupId>io.ultreia.java4all.jaxx</groupId>
      <artifactId>jaxx-runtime-application</artifactId>
      <exclusions>
        <exclusion>
          <groupId>org.nuiton</groupId>
          <artifactId>nuiton-config</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>io.ultreia.java4all.jaxx</groupId>
      <artifactId>jaxx-widgets-status</artifactId>
    </dependency>
    <dependency>
      <groupId>io.ultreia.java4all.jaxx</groupId>
      <artifactId>jaxx-widgets-error</artifactId>
    </dependency>
    <dependency>
      <groupId>io.ultreia.java4all.jaxx</groupId>
      <artifactId>jaxx-widgets-number</artifactId>
    </dependency>
    <dependency>
      <groupId>io.ultreia.java4all.jaxx</groupId>
      <artifactId>jaxx-runtime-swing-session</artifactId>
    </dependency>

    <dependency>
      <groupId>commons-logging</groupId>
      <artifactId>commons-logging</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-lang3</artifactId>
    </dependency>
    <dependency>
      <groupId>com.google.guava</groupId>
      <artifactId>guava</artifactId>
    </dependency>

    <dependency>
      <groupId>com.google.auto.service</groupId>
      <artifactId>auto-service</artifactId>
      <scope>compile</scope>
    </dependency>

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

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

  </dependencies>

  <build>

    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>license-maven-plugin</artifactId>
          <version>${plugin.version.license}</version>
          <configuration>
            <extraExtensions>
              <jcss>java</jcss>
            </extraExtensions>
          </configuration>
        </plugin>
        <plugin>
          <groupId>io.ultreia.maven</groupId>
          <artifactId>gitlab-maven-plugin</artifactId>
          <configuration>
            <releaseArtifacts>
              <releaseArtifact>
                <flatLayout>true</flatLayout>
                <groupId>io.ultreia.ifremer.cali</groupId>
                <artifactId>cali</artifactId>
                <name>Application</name>
                <type>zip</type>
              </releaseArtifact>
            </releaseArtifacts>
          </configuration>
        </plugin>


        <plugin>
          <groupId>io.ultreia.java4all.i18n</groupId>
          <artifactId>i18n-maven-plugin</artifactId>
          <executions>
            <execution>
              <id>default-parse-java-enumerations</id>
              <configuration>
                <generateHelper>true</generateHelper>
                <enumerationSets>
                  <enumerationSet>
                    <name>label</name>
                    <!--suppress MavenModelInspection -->
                    <pattern>cali.board.@CLASS_SIMPLE_NAME@.@NAME@</pattern>
                    <enums>
                      <enum>io.ultreia.ifremer.cali.api.BoardDataEntryMode</enum>
                    </enums>
                  </enumerationSet>
                </enumerationSets>
              </configuration>
            </execution>
            <!--execution>
              <id>default-bundle</id>
              <configuration>
                <templateExtension>ftl</templateExtension>
                <templateList>
                  <template>AboutTemplate</template>
                </templateList>
              </configuration>
            </execution-->
          </executions>
        </plugin>

      </plugins>
    </pluginManagement>
  </build>

  <profiles>

    <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>${plugin.version.projectInfoReports}</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>${plugin.version.changes}</version>
            <configuration>
              <issueLinkTemplatePerSystem>
                <gitlab>https://gitlab.com/${projectPath}/issues/%ISSUE%</gitlab>
              </issueLinkTemplatePerSystem>
              <xmlPath>${project.build.directory}/generated-site/changes.xml</xmlPath>
            </configuration>
            <reportSets>
              <reportSet>
                <reports>
                  <report>changes-report</report>
                </reports>
              </reportSet>
            </reportSets>
          </plugin>

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

          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>license-maven-plugin</artifactId>
            <version>${plugin.version.license}</version>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <version>${plugin.version.javadoc}</version>
            <reportSets>
              <reportSet>
                <reports>
                  <report>javadoc-no-fork</report>
                  <report>test-javadoc-no-fork</report>
                </reports>
              </reportSet>
            </reportSets>
          </plugin>
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>versions-maven-plugin</artifactId>
            <version>${plugin.version.versions}</version>
            <reportSets>
              <reportSet>
                <reports>
                  <report>dependency-updates-report</report>
                  <report>plugin-updates-report</report>
                  <report>property-updates-report</report>
                </reports>
              </reportSet>
            </reportSets>
          </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>


    <profile>
      <id>release-profile</id>
      <activation>
        <property>
          <name>performRelease</name>
          <value>true</value>
        </property>
      </activation>
      <properties>
        <devMode>false</devMode>
      </properties>
      <build>
        <plugins>

          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>license-maven-plugin</artifactId>
            <executions>
              <execution>
                <id>attach-licenses</id>
                <goals>
                  <goal>update-project-license</goal>
                  <goal>add-third-party</goal>
                </goals>
              </execution>
            </executions>
          </plugin>

          <plugin>
            <artifactId>maven-antrun-plugin</artifactId>
            <inherited>false</inherited>
            <executions>
              <execution>
                <id>Copy change log</id>
                <phase>generate-resources</phase>
                <configuration>
                  <target>
                    <copy failonerror="true" overwrite="true" file="CHANGELOG.md" tofile="${project.build.outputDirectory}/META-INF/${applicationName}-CHANGELOG.md" />
                  </target>
                </configuration>
                <goals>
                  <goal>run</goal>
                </goals>
              </execution>
            </executions>
          </plugin>

        </plugins>
      </build>
    </profile>

  </profiles>
</project>
