<?xml version="1.0" encoding="UTF-8"?>
<!--
  #%L
  JAXX :: Demo

  $Id: pom.xml 2079 2010-09-07 12:38:18Z tchemit $
  $HeadURL: http://svn.nuiton.org/svn/jaxx/tags/jaxx-2.2/jaxx-tutorial/pom.xml $
  %%
  Copyright (C) 2008 - 2010 CodeLutin
  %%
  This program is free software: you can redistribute it and/or modify
  it under the terms of the GNU Lesser 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 Lesser Public License for more details.

  You should have received a copy of the GNU General Lesser Public
  License along with this program.  If not, see
  <http://www.gnu.org/licenses/lgpl-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>

  <!-- ************************************************************* -->
  <!-- *** POM Relationships *************************************** -->
  <!-- ************************************************************* -->

  <parent>
    <groupId>org.nuiton</groupId>
    <artifactId>jaxx</artifactId>
    <version>2.2</version>
  </parent>

  <groupId>org.nuiton.jaxx</groupId>
  <artifactId>jaxx-tutorial</artifactId>

  <modules>
    <module>../jaxx-tutorial-helloworld</module>
    <module>../jaxx-tutorial-helloworld2</module>
    <module>../jaxx-tutorial-css</module>
    <module>../jaxx-tutorial-databinding</module>
    <module>../jaxx-tutorial-config</module>
  </modules>

  <!-- ************************************************************* -->
  <!-- *** Project Information ************************************* -->
  <!-- ************************************************************* -->

  <name>JAXX :: Tutorial</name>
  <description>JAXX Tutorial parent pom</description>

  <!-- ************************************************************* -->
  <!-- *** Build Settings ****************************************** -->
  <!-- ************************************************************* -->

  <packaging>pom</packaging>

  <properties>

    <jnlp.skip>true</jnlp.skip>

  </properties>

  <build>
    <pluginManagement>
      <plugins>

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

        <plugin>
          <groupId>org.nuiton.jaxx</groupId>
          <artifactId>maven-jaxx-plugin</artifactId>
          <version>${project.version}</version>
        </plugin>

        <plugin>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>2.3.1</version>
        </plugin>

        <plugin>
          <artifactId>maven-dependency-plugin</artifactId>
          <version>2.1</version>
        </plugin>

        <plugin>
          <groupId>org.nuiton.i18n</groupId>
          <artifactId>maven-i18n-plugin</artifactId>
          <version>1.2.2</version>
        </plugin>

      </plugins>
    </pluginManagement>
  </build>
  <!-- ************************************************************* -->
  <!-- *** Build Environment  ************************************** -->
  <!-- ************************************************************* -->

  <profiles>

    <!-- create assemblies at release time -->
    <profile>
      <id>assembly</id>
      <activation>
        <property>
          <name>performRelease</name>
          <value>true</value>
        </property>
      </activation>
      <build>
        <plugins>

          <!-- launch in a release the assembly automaticly -->
          <plugin>
            <artifactId>maven-assembly-plugin</artifactId>
            <executions>
              <execution>
                <id>create-assemblies</id>
                <phase>verify</phase>
                <goals>
                  <goal>single</goal>
                </goals>
              </execution>
            </executions>
            <configuration>
              <attach>false</attach>
              <descriptorRefs>
                <descriptorRef>deps</descriptorRef>
                <descriptorRef>full</descriptorRef>
              </descriptorRefs>
            </configuration>
          </plugin>

        </plugins>

      </build>
    </profile>

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

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

    <!-- by default jnlp is only perform on a release stage when using the maven-release-plugin -->
    <profile>
      <id>reporting</id>
      <activation>
        <property>
          <name>performRelease</name>
          <value>true</value>
        </property>
      </activation>

      <reporting>
        <plugins>
          <plugin>
            <groupId>org.nuiton.thirdparty</groupId>
            <artifactId>webstart-maven-plugin</artifactId>
            <version>${jnlp.version}</version>
          </plugin>
        </plugins>
      </reporting>

    </profile>

  </profiles>

</project>

