<?xml version="1.0" encoding="UTF-8"?>
<!--
  #%L
  Tutti :: UI
  %%
  Copyright (C) 2012 - 2013 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>fr.ifremer</groupId>
    <artifactId>tutti</artifactId>
    <version>4.5-beta-2-SNAPSHOT</version>
  </parent>

  <groupId>fr.ifremer.tutti</groupId>
  <artifactId>tutti-ui-swing</artifactId>

  <name>Tutti :: UI</name>

  <properties>

    <!-- jaxx configuration -->
    <jaxx.addProjectClassPath>true</jaxx.addProjectClassPath>
    <jaxx.addSourcesToClassPath>true</jaxx.addSourcesToClassPath>
    <jaxx.defaultErrorUIFQN>
      jaxx.runtime.validator.swing.ui.ImageValidationUI
    </jaxx.defaultErrorUIFQN>
    <!--<jaxx.useUIManagerForIcon>true</jaxx.useUIManagerForIcon>-->
    <jaxx.generateHelp>true</jaxx.generateHelp>
    <jaxx.generateSearch>false</jaxx.generateSearch>
    <jaxx.autoImportCss>true</jaxx.autoImportCss>
    <jaxx.autoRecurseInCss>false</jaxx.autoRecurseInCss>
    <jaxx.addAutoHandlerUI>true</jaxx.addAutoHandlerUI>
    <jaxx.commonCss>${project.basedir}/src/main/java/fr/ifremer/tutti/ui/swing/content/Common.jcss</jaxx.commonCss>


    <!-- jaxx help configuration -->
    <jaxx.helpsetName>tutti</jaxx.helpsetName>
    <jaxx.locales>fr</jaxx.locales>
    <jaxx.mergeIdsToInput>true</jaxx.mergeIdsToInput>
    <jaxx.inputHelpDirectory>
      src/main/filtered-resources
    </jaxx.inputHelpDirectory>
    <jaxx.inputHelpFilenamePrefix>tutti-help</jaxx.inputHelpFilenamePrefix>
    <jaxx.helpBrokerFQN>
      fr.ifremer.tutti.ui.swing.TuttiHelpBroker
    </jaxx.helpBrokerFQN>
    <jaxx.cssExtension>jcss</jaxx.cssExtension>

    <i18n.bundleOutputName>${projectId}-i18n</i18n.bundleOutputName>
    <i18n.bundleCsvFile>
      ${project.build.directory}/generated-sources/resources/META-INF/${projectId}-i18n.csv
    </i18n.bundleCsvFile>
    <i18n.bundleCsvSeparator>|</i18n.bundleCsvSeparator>

    <!-- generate license bundled files -->
    <license.generateBundle>true</license.generateBundle>
    <license.bundleThirdPartyPath>
      META-INF/tutti-THIRD-PARTY.txt
    </license.bundleThirdPartyPath>
    <license.bundleLicensePath>
      META-INF/tutti-LICENSE.txt
    </license.bundleLicensePath>

    <maven.jar.main.class>
      fr.ifremer.tutti.ui.swing.RunTutti
    </maven.jar.main.class>

    <bundlePrefix>tutti-${project.version}</bundlePrefix>

    <tutti.log.file>
      \$\{java.io.tmpdir\}/tutti-${project.version}.log
    </tutti.log.file>

    <!-- Post Release configuration -->
    <skipPostRelease>false</skipPostRelease>
    
    <maven.deploy.skip>false</maven.deploy.skip>

  </properties>

  <dependencies>

    <!-- Sibling dependencies -->
    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>tutti-persistence</artifactId>
      <version>${project.version}</version>
    </dependency>
    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>tutti-service</artifactId>
      <version>${project.version}</version>
    </dependency>
    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>tutti-ichtyometer</artifactId>
      <version>${project.version}</version>
    </dependency>
    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>tutti-ui-swing-updater</artifactId>
      <version>${project.version}</version>
    </dependency>

    <!-- Adagio -->
    <dependency>
      <groupId>fr.ifremer.adagio</groupId>
      <artifactId>adagio-core-shared</artifactId>
    </dependency>
    <dependency>
      <groupId>fr.ifremer.adagio</groupId>
      <artifactId>adagio-core-allegro</artifactId>
    </dependency>

    <!-- Nuiton -->
    <dependency>
      <groupId>org.nuiton</groupId>
      <artifactId>nuiton-version</artifactId>
    </dependency>
    <dependency>
      <groupId>org.nuiton</groupId>
      <artifactId>nuiton-utils</artifactId>
    </dependency>
    <dependency>
      <groupId>org.nuiton</groupId>
      <artifactId>nuiton-updater</artifactId>
    </dependency>
    <dependency>
      <groupId>org.nuiton</groupId>
      <artifactId>nuiton-decorator</artifactId>
    </dependency>
    <dependency>
      <groupId>org.nuiton</groupId>
      <artifactId>nuiton-csv</artifactId>
    </dependency>
    <dependency>
      <groupId>org.nuiton.i18n</groupId>
      <artifactId>nuiton-i18n</artifactId>
    </dependency>
    <dependency>
      <groupId>org.nuiton</groupId>
      <artifactId>nuiton-validator</artifactId>
    </dependency>
    <dependency>
      <groupId>org.nuiton</groupId>
      <artifactId>nuiton-converter</artifactId>
    </dependency>
    <dependency>
      <groupId>org.nuiton</groupId>
      <artifactId>nuiton-config</artifactId>
    </dependency>

    <!-- Guava -->
    <dependency>
      <groupId>com.google.guava</groupId>
      <artifactId>guava</artifactId>
    </dependency>

    <!-- Commons -->
    <dependency>
      <groupId>commons-io</groupId>
      <artifactId>commons-io</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-lang3</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-collections4</artifactId>
    </dependency>
    <dependency>
      <groupId>commons-logging</groupId>
      <artifactId>commons-logging</artifactId>
    </dependency>
    <dependency>
      <groupId>commons-beanutils</groupId>
      <artifactId>commons-beanutils</artifactId>
    </dependency>
    <!-- used forApplicationUpdater -->
    <dependency>
      <groupId>commons-httpclient</groupId>
      <artifactId>commons-httpclient</artifactId>
      <scope>runtime</scope>
    </dependency>

    <!-- JAXX -->
    <dependency>
      <groupId>org.nuiton.jaxx</groupId>
      <artifactId>jaxx-runtime</artifactId>
    </dependency>
    <dependency>
      <groupId>org.nuiton.jaxx</groupId>
      <artifactId>jaxx-config</artifactId>
    </dependency>
    <dependency>
      <groupId>org.nuiton.jaxx</groupId>
      <artifactId>jaxx-validator</artifactId>
    </dependency>
    <dependency>
      <groupId>org.nuiton.jaxx</groupId>
      <artifactId>jaxx-widgets</artifactId>
    </dependency>
    <dependency>
      <groupId>org.nuiton.jaxx</groupId>
      <artifactId>jaxx-widgets-number</artifactId>
    </dependency>
    <dependency>
      <groupId>org.nuiton.jaxx</groupId>
      <artifactId>jaxx-application-api</artifactId>
    </dependency>
    <dependency>
      <groupId>org.nuiton.jaxx</groupId>
      <artifactId>jaxx-application-swing</artifactId>
    </dependency>

    <!-- SwingX -->
    <dependency>
      <groupId>org.swinglabs.swingx</groupId>
      <artifactId>swingx-core</artifactId>
    </dependency>
    <dependency>
      <groupId>org.swinglabs.swingx</groupId>
      <artifactId>swingx-common</artifactId>
    </dependency>
    <dependency>
      <groupId>org.swinglabs.swingx</groupId>
      <artifactId>swingx-autocomplete</artifactId>
    </dependency>

    <!-- Spring -->
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-core</artifactId>
      <scope>runtime</scope>
    </dependency>
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-beans</artifactId>
      <scope>runtime</scope>
    </dependency>
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-context</artifactId>
      <scope>runtime</scope>
    </dependency>
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-jdbc</artifactId>
      <scope>runtime</scope>
    </dependency>
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-tx</artifactId>
      <scope>runtime</scope>
    </dependency>
    <!-- Utilisé par adagio pour que les versions de spring sont syncho -->
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-aop</artifactId>
      <scope>runtime</scope>
    </dependency>
    <!-- Utilisé par adagio pour que les versions de spring sont syncho -->
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-orm</artifactId>
      <scope>runtime</scope>
    </dependency>
    <!-- Utilisé par adagio pour que les versions de spring sont syncho -->
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-context-support</artifactId>
      <scope>runtime</scope>
    </dependency>

    <!-- Logging -->
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-jcl</artifactId>
      <scope>runtime</scope>
    </dependency>
    <dependency>
      <groupId>log4j</groupId>
      <artifactId>log4j</artifactId>
      <scope>runtime</scope>
    </dependency>

    <dependency>
      <groupId>org.jfree</groupId>
      <artifactId>jfreechart</artifactId>
    </dependency>

    <dependency>
      <groupId>org.apache.xmlgraphics</groupId>
      <artifactId>batik-swing</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.xmlgraphics</groupId>
      <artifactId>batik-bridge</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.xmlgraphics</groupId>
      <artifactId>batik-ext</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.xmlgraphics</groupId>
      <artifactId>batik-svg-dom</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.xmlgraphics</groupId>
      <artifactId>batik-util</artifactId>
    </dependency>

    <dependency>
      <groupId>xml-apis</groupId>
      <artifactId>xml-apis</artifactId>
    </dependency>
    <dependency>
      <groupId>xml-apis</groupId>
      <artifactId>xml-apis-ext</artifactId>
    </dependency>

    <!-- Tests -->
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
    </dependency>
    <dependency>
      <groupId>org.nuiton</groupId>
      <artifactId>nuiton-validator</artifactId>
      <scope>test</scope>
      <classifier>tests</classifier>
    </dependency>

  </dependencies>

  <build>
    <resources>
      <resource>
        <directory>src/main/filtered-resources</directory>
        <filtering>true</filtering>
        <includes>
          <include>*.config</include>
          <include>*.properties</include>
        </includes>
      </resource>
      <resource>
        <directory>src/main/resources</directory>
        <includes>
          <include>**/*</include>
        </includes>
      </resource>
    </resources>
    <plugins>

      <plugin>
        <groupId>org.nuiton.jaxx</groupId>
        <artifactId>jaxx-maven-plugin</artifactId>
        <executions>
          <execution>
            <goals>
              <goal>generate</goal>
              <goal>generate-help-ids</goal>
            </goals>
          </execution>
        </executions>
        <!-- Can't remove this, AdagionConfiguration expose it -->
        <dependencies>
          <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context</artifactId>
            <version>${springVersion}</version>
            <scope>runtime</scope>
          </dependency>
        </dependencies>
      </plugin>

      <plugin>
        <groupId>org.nuiton.i18n</groupId>
        <artifactId>i18n-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>scan-sources</id>
            <configuration>
              <entries>
                <entry>
                  <specificGoal>parserValidation</specificGoal>
                  <basedir>${project.basedir}/src/main/java/</basedir>
                  <includes>
                    <param>**/**-validation.xml</param>
                  </includes>
                </entry>
                <entry>
                  <basedir>${project.build.directory}/generated-sources/java/</basedir>
                </entry>
              </entries>
            </configuration>
            <goals>
              <goal>parserJava</goal>
              <goal>parserValidation</goal>
              <goal>gen</goal>
            </goals>
          </execution>
          <execution>
            <id>make-bundle</id>
            <goals>
              <goal>bundle</goal>
              <goal>generate-csv-bundle</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

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

          <execution>
            <id>get-report-generator-env</id>
            <phase>prepare-package</phase>
            <goals>
              <goal>unpack</goal>
            </goals>
            <configuration>
              <outputDirectory>
                ${project.build.directory}/tutti-report-generator
              </outputDirectory>
              <artifactItems>
                <artifactItem>
                  <groupId>${project.groupId}</groupId>
                  <artifactId>tutti-report-generator</artifactId>
                  <version>${project.version}</version>
                  <type>zip</type>
                  <classifier>bin</classifier>
                </artifactItem>
              </artifactItems>
            </configuration>
          </execution>

        </executions>
      </plugin>

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

  <profiles>

    <profile>
      <id>add-release-properties</id>
      <activation>
        <property>
          <name>performRelease</name>
          <value>true</value>
        </property>
      </activation>
      <properties>
        <tutti.log.file>$\{tutti.log.file\}</tutti.log.file>
      </properties>

    </profile>

    <profile>
      <id>default-bundle</id>
      <activation>
        <property>
          <name>performRelease</name>
          <value>true</value>
        </property>
      </activation>
      <build>
        <defaultGoal>package</defaultGoal>
        <plugins>

 <plugin>
            <artifactId>maven-dependency-plugin</artifactId>
            <executions>
              <execution>
                <id>get-tutti-launcher</id>
                <phase>prepare-package</phase>
                <goals>
                  <goal>copy</goal>
                </goals>
                <configuration>
                  <outputDirectory>${project.build.directory}</outputDirectory>
                  <artifactItems>
                    <artifactItem>
                      <groupId>${project.groupId}</groupId>
                      <artifactId>tutti-launcher</artifactId>
                      <version>${launcherVersion}</version>
                      <type>exe</type>
                      <classifier>bin</classifier>
                    </artifactItem>
                    <artifactItem>
                      <groupId>${project.groupId}</groupId>
                      <artifactId>tutti-launcher</artifactId>
                      <version>${launcherVersion}</version>
                    </artifactItem>
                  </artifactItems>
                </configuration>
              </execution>
            </executions>
          </plugin>

          <plugin>
            <artifactId>maven-assembly-plugin</artifactId>
            <executions>
              <execution>
                <id>assembly-standalone</id>
                <phase>package</phase>
                <goals>
                  <goal>single</goal>
                </goals>
                <configuration>
                  <descriptors>
                    <descriptor>
                      src/main/assembly/standalone.xml
                    </descriptor>
                  </descriptors>
                </configuration>
              </execution>
              <execution>
                <id>assembly-i18n</id>
                <phase>package</phase>
                <goals>
                  <goal>single</goal>
                </goals>
                <configuration>
                  <descriptors>
                    <descriptor>
                      src/main/assembly/i18n.xml
                    </descriptor>
                  </descriptors>
                </configuration>
              </execution>
              <execution>
                <id>assembly-help</id>
                <phase>package</phase>
                <goals>
                  <goal>single</goal>
                </goals>
                <configuration>
                  <descriptors>
                    <descriptor>
                      src/main/assembly/help.xml
                    </descriptor>
                  </descriptors>
                </configuration>
              </execution>
              <execution>
                <id>assembly-ichtyometer</id>
                <phase>package</phase>
                <goals>
                  <goal>single</goal>
                </goals>
                <configuration>
                  <descriptors>
                    <descriptor>
                      src/main/assembly/ichtyometer.xml
                    </descriptor>
                  </descriptors>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>

    <profile>
      <id>prepare-full-release</id>
      <activation>
        <property>
          <name>performFullRelease</name>
          <value>true</value>
        </property>
      </activation>
      <properties>

        <redmine.releaseFiles>
          ${project.build.directory}/${bundlePrefix}-full-windows-i586.zip,
          ${project.build.directory}/${bundlePrefix}-full-linux-i586.zip
          <!--${project.build.directory}/${bundlePrefix}-full-windows-x64.zip,-->
          <!--${project.build.directory}/${bundlePrefix}-full-linux-x64.zip-->
        </redmine.releaseFiles>
      </properties>
      <build>

      </build>
    </profile>

    <profile>
      <id>linux-x64-bundle</id>
      <!--activation>
        <property>
          <name>performFullRelease</name>
          <value>true</value>
        </property>
      </activation-->
      <build>
        <defaultGoal>package</defaultGoal>
        <plugins>

          <plugin>
            <artifactId>maven-dependency-plugin</artifactId>
            <executions>
              <execution>
                <id>get-linux-x64-jre</id>
                <phase>prepare-package</phase>
                <goals>
                  <goal>unpack</goal>
                </goals>
                <configuration>
                  <outputDirectory>
                    ${project.build.directory}/jre-linux-x64
                  </outputDirectory>
                  <artifactItems>
                    <artifactItem>
                      <groupId>com.oracle</groupId>
                      <artifactId>jre</artifactId>
                      <version>${jreVersion}</version>
                      <type>zip</type>
                      <classifier>linux-x64</classifier>
                    </artifactItem>
                  </artifactItems>
                </configuration>
              </execution>
              <execution>
                <id>get-linux-x64-launcher</id>
                <phase>prepare-package</phase>
                <goals>
                  <goal>copy</goal>
                </goals>
                <configuration>
                  <outputDirectory>${project.build.directory}</outputDirectory>
                  <artifactItems>
                    <artifactItem>
                      <groupId>${project.groupId}</groupId>
                      <artifactId>tutti-launcher</artifactId>
                      <version>${launcherVersion}</version>
                    </artifactItem>
                  </artifactItems>
                </configuration>
              </execution>
            </executions>
          </plugin>

          <plugin>
            <artifactId>maven-assembly-plugin</artifactId>
            <configuration>
              <finalName>${bundlePrefix}</finalName>
            </configuration>
            <executions>
              <execution>
                <id>assembly-full-linux-x64</id>
                <phase>package</phase>
                <goals>
                  <goal>single</goal>
                </goals>
                <configuration>
                  <attach>false</attach>
                  <descriptors>
                    <descriptor>
                      src/main/assembly/full-linux-x64.xml
                    </descriptor>
                  </descriptors>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>

    <profile>
      <id>linux-i586-bundle</id>
      <activation>
        <property>
          <name>performFullRelease</name>
          <value>true</value>
        </property>
      </activation>
      <build>
        <defaultGoal>package</defaultGoal>
        <plugins>

          <plugin>
            <artifactId>maven-dependency-plugin</artifactId>
            <executions>
              <execution>
                <id>get-linux-i586-jre</id>
                <phase>prepare-package</phase>
                <goals>
                  <goal>unpack</goal>
                </goals>
                <configuration>
                  <outputDirectory>
                    ${project.build.directory}/jre-linux-i586
                  </outputDirectory>
                  <artifactItems>
                    <artifactItem>
                      <groupId>com.oracle</groupId>
                      <artifactId>jre</artifactId>
                      <version>${jreVersion}</version>
                      <type>zip</type>
                      <classifier>linux-i586</classifier>
                    </artifactItem>
                  </artifactItems>
                </configuration>
              </execution>
              <execution>
                <id>get-linux-586-launcher</id>
                <phase>prepare-package</phase>
                <goals>
                  <goal>copy</goal>
                </goals>
                <configuration>
                  <outputDirectory>${project.build.directory}</outputDirectory>
                  <artifactItems>
                    <artifactItem>
                      <groupId>${project.groupId}</groupId>
                      <artifactId>tutti-launcher</artifactId>
                      <version>${launcherVersion}</version>
                    </artifactItem>
                  </artifactItems>
                </configuration>
              </execution>
            </executions>
          </plugin>

          <plugin>
            <artifactId>maven-assembly-plugin</artifactId>
            <configuration>
              <finalName>${bundlePrefix}</finalName>
            </configuration>
            <executions>
              <execution>
                <id>assembly-full-linux-i586</id>
                <phase>package</phase>
                <goals>
                  <goal>single</goal>
                </goals>
                <configuration>
                  <attach>false</attach>
                  <descriptors>
                    <descriptor>
                      src/main/assembly/full-linux-i586.xml
                    </descriptor>
                  </descriptors>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>

    <profile>
      <id>windows-i586-bundle</id>
      <activation>
        <property>
          <name>performFullRelease</name>
          <value>true</value>
        </property>
      </activation>
      <build>
        <defaultGoal>package</defaultGoal>
        <plugins>

          <plugin>
            <artifactId>maven-dependency-plugin</artifactId>
            <executions>
              <execution>
                <id>get-windows-i586-jre</id>
                <phase>prepare-package</phase>
                <goals>
                  <goal>unpack</goal>
                </goals>
                <configuration>
                  <outputDirectory>
                    ${project.build.directory}/jre-windows-i586
                  </outputDirectory>
                  <artifactItems>
                    <artifactItem>
                      <groupId>com.oracle</groupId>
                      <artifactId>jre</artifactId>
                      <version>${jreVersion}</version>
                      <type>zip</type>
                      <classifier>windows-i586</classifier>
                    </artifactItem>
                  </artifactItems>
                </configuration>
              </execution>
              <execution>
                <id>get-windows-i586-launcher</id>
                <phase>prepare-package</phase>
                <goals>
                  <goal>copy</goal>
                </goals>
                <configuration>
                  <outputDirectory>${project.build.directory}</outputDirectory>
                  <artifactItems>
                    <artifactItem>
                      <groupId>${project.groupId}</groupId>
                      <artifactId>tutti-launcher</artifactId>
                      <version>${launcherVersion}</version>
                      <type>exe</type>
                      <classifier>bin</classifier>
                    </artifactItem>
                    <artifactItem>
                      <groupId>${project.groupId}</groupId>
                      <artifactId>tutti-launcher</artifactId>
                      <version>${launcherVersion}</version>
                    </artifactItem>
                  </artifactItems>
                </configuration>
              </execution>
            </executions>
          </plugin>

          <plugin>
            <artifactId>maven-assembly-plugin</artifactId>
            <configuration>
              <finalName>${bundlePrefix}</finalName>
            </configuration>
            <executions>
              <execution>
                <id>assembly-full-windows-i586</id>
                <phase>package</phase>
                <goals>
                  <goal>single</goal>
                </goals>
                <configuration>
                  <attach>false</attach>
                  <descriptors>
                    <descriptor>
                      src/main/assembly/full-windows-i586.xml
                    </descriptor>
                  </descriptors>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>

    <profile>
      <id>window-x64-bundle</id>
      <!--activation>
        <property>
          <name>performFullRelease</name>
          <value>true</value>
        </property>
      </activation-->
      <build>
        <defaultGoal>package</defaultGoal>
        <plugins>

          <plugin>
            <artifactId>maven-dependency-plugin</artifactId>
            <executions>
              <execution>
                <id>get-windows-x64-jre</id>
                <phase>prepare-package</phase>
                <goals>
                  <goal>unpack</goal>
                </goals>
                <configuration>
                  <outputDirectory>
                    ${project.build.directory}/jre-windows-x64
                  </outputDirectory>
                  <artifactItems>
                    <artifactItem>
                      <groupId>com.oracle</groupId>
                      <artifactId>jre</artifactId>
                      <version>${jreVersion}</version>
                      <type>zip</type>
                      <classifier>windows-x64</classifier>
                    </artifactItem>
                  </artifactItems>
                </configuration>
              </execution>
              <execution>
                <id>get-windows-x64-launcher</id>
                <phase>prepare-package</phase>
                <goals>
                  <goal>copy</goal>
                </goals>
                <configuration>
                  <outputDirectory>${project.build.directory}</outputDirectory>
                  <artifactItems>
                    <artifactItem>
                      <groupId>${project.groupId}</groupId>
                      <artifactId>tutti-launcher</artifactId>
                      <version>${launcherVersion}</version>
                      <type>exe</type>
                      <classifier>bin</classifier>
                    </artifactItem>
                    <artifactItem>
                      <groupId>${project.groupId}</groupId>
                      <artifactId>tutti-launcher</artifactId>
                      <version>${launcherVersion}</version>
                    </artifactItem>
                  </artifactItems>
                </configuration>
              </execution>
            </executions>
          </plugin>

          <plugin>
            <artifactId>maven-assembly-plugin</artifactId>
            <configuration>
              <finalName>${bundlePrefix}</finalName>
            </configuration>
            <executions>
              <execution>
                <id>assembly-full-windows-x64</id>
                <phase>package</phase>
                <goals>
                  <goal>single</goal>
                </goals>
                <configuration>
                  <attach>false</attach>
                  <descriptors>
                    <descriptor>
                      src/main/assembly/full-windows-x64.xml
                    </descriptor>
                  </descriptors>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>

    <profile>
      <id>launcher-bundle</id>
      <activation>
        <property>
          <name>performLauncherRelease</name>
          <value>true</value>
        </property>
      </activation>
      <build>
        <defaultGoal>package</defaultGoal>
        <plugins>

          <plugin>
            <artifactId>maven-dependency-plugin</artifactId>
            <executions>
              <execution>
                <id>get-launcher</id>
                <phase>prepare-package</phase>
                <goals>
                  <goal>copy</goal>
                </goals>
                <configuration>
                  <outputDirectory>${project.build.directory}</outputDirectory>
                  <artifactItems>
                    <artifactItem>
                      <groupId>${project.groupId}</groupId>
                      <artifactId>tutti-launcher</artifactId>
                      <version>${launcherVersion}</version>
                      <type>exe</type>
                      <classifier>bin</classifier>
                    </artifactItem>
                    <artifactItem>
                      <groupId>${project.groupId}</groupId>
                      <artifactId>tutti-launcher</artifactId>
                      <version>${launcherVersion}</version>
                    </artifactItem>
                  </artifactItems>
                </configuration>
              </execution>
            </executions>
          </plugin>

          <plugin>
            <artifactId>maven-assembly-plugin</artifactId>
            <executions>
              <execution>
                <id>assembly-launcher</id>
                <phase>package</phase>
                <goals>
                  <goal>single</goal>
                </goals>
                <configuration>
                  <finalName>${project.artifactId}-${launcherVersion}</finalName>
                  <attach>false</attach>
                  <descriptors>
                    <descriptor>
                      src/main/assembly/launcher.xml
                    </descriptor>
                  </descriptors>
                </configuration>
              </execution>
            </executions>
          </plugin>

          <plugin>
            <artifactId>maven-deploy-plugin</artifactId>
            <executions>
              <execution>
                <id>deploy-launcher-bundle</id>
                <goals>
                  <goal>deploy-file</goal>
                </goals>
                <phase>deploy</phase>
                <configuration>
                  <file>${project.build.directory}/${project.artifactId}-${launcherVersion}-launcher.zip</file>
                  <groupId>fr.ifremer.tutti</groupId>
                  <artifactId>tutti-launcher</artifactId>
                  <version>${launcherVersion}</version>
                  <generatePom>false</generatePom>
                  <repositoryId>${release.server}</repositoryId>
                  <url>${release.repository}</url>
                </configuration>
              </execution>
            </executions>
          </plugin>

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

    <profile>
      <id>profiling</id>

      <build>
        <resources>
          <resource>
            <directory>src/main/profiling</directory>
            <includes>
              <include>**/*</include>
            </includes>
          </resource>
        </resources>
      </build>

      <dependencies>

        <dependency>
          <groupId>org.nuiton</groupId>
          <artifactId>nuiton-profiling</artifactId>
          <scope>runtime</scope>
        </dependency>
      </dependencies>
    </profile>
  </profiles>
</project>
