<?xml version="1.0" encoding="UTF-8"?>
<!--
  #%L
  I18n :: Maven Plugin
  %%
  Copyright (C) 2007 - 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/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <parent>
    <groupId>org.nuiton</groupId>
    <artifactId>i18n</artifactId>
    <version>4.0-rc-1</version>
  </parent>

  <groupId>org.nuiton.i18n</groupId>
  <artifactId>i18n-maven-plugin</artifactId>
  <packaging>maven-plugin</packaging>
  <name>I18n :: Maven Plugin</name>
  <description>
    Maven plugin to deal with i18n stuff in a project, mainly base on the
    nuiton-i18n api (but not only).
  </description>
  <inceptionYear>2007</inceptionYear>

  <properties>

    <javaVersion>1.7</javaVersion>
    <signatureArtifactId>java17</signatureArtifactId>
    <signatureVersion>1.0</signatureVersion>

    <!-- Post Release configuration -->
    <skipPostRelease>true</skipPostRelease>
  </properties>
  <dependencies>

    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>nuiton-i18n</artifactId>
      <version>${project.version}</version>
    </dependency>

    <dependency>
      <groupId>org.nuiton</groupId>
      <artifactId>nuiton-csv</artifactId>
    </dependency>
    
    <dependency>
      <groupId>com.google.guava</groupId>
      <artifactId>guava</artifactId>
    </dependency>

    <dependency>
      <groupId>com.tunnelvisionlabs</groupId>
      <artifactId>antlr4-runtime</artifactId>
    </dependency>
    <dependency>
      <groupId>com.tunnelvisionlabs</groupId>
      <artifactId>antlr4-annotations</artifactId>
      <scope>runtime</scope>
    </dependency>
    <dependency>
      <groupId>org.nuiton.processor</groupId>
      <artifactId>nuiton-processor</artifactId>
    </dependency>

    <dependency>
      <groupId>org.nuiton</groupId>
      <artifactId>helper-maven-plugin-api</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>commons-io</groupId>
      <artifactId>commons-io</artifactId>
    </dependency>

    <dependency>
      <groupId>org.apache.maven.shared</groupId>
      <artifactId>maven-dependency-tree</artifactId>
    </dependency>

    <!-- provided dependencies -->

    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-core</artifactId>
    </dependency>

    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-model</artifactId>
    </dependency>

    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-artifact</artifactId>
    </dependency>

    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-plugin-api</artifactId>
      <scope>compile</scope>
    </dependency>

    <!-- dependencies to mojo annotations -->
    <dependency>
      <groupId>org.apache.maven.plugin-tools</groupId>
      <artifactId>maven-plugin-annotations</artifactId>
    </dependency>

    <!-- pour parser les fichiers de validation -->
    <dependency>
      <groupId>org.apache.struts</groupId>
      <artifactId>struts2-core</artifactId>
      <exclusions>
        <exclusion>
          <groupId>asm</groupId>
          <artifactId>asm</artifactId>
        </exclusion>
        <exclusion>
          <groupId>asm</groupId>
          <artifactId>asm-commons</artifactId>
        </exclusion>
        <exclusion>
          <groupId>ognl</groupId>
          <artifactId>ognl</artifactId>
        </exclusion>
      </exclusions>
    </dependency>

    <dependency>
      <groupId>org.codehaus.plexus</groupId>
      <artifactId>plexus-utils</artifactId>
    </dependency>

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

    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
    </dependency>

  </dependencies>

  <build>
    <plugins>

      <!-- expose new plexus components -->
      <plugin>
        <groupId>org.codehaus.plexus</groupId>
        <artifactId>plexus-component-metadata</artifactId>
        <executions>
          <execution>
            <goals>
              <goal>generate-metadata</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <artifactId>maven-plugin-plugin</artifactId>
        <configuration>
          <skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound>
        </configuration>
        <executions>
          <execution>
            <goals>
              <goal>helpmojo</goal>
              <goal>descriptor</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

    </plugins>
  </build>

  <profiles>

    <!-- perform only 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>
            <artifactId>maven-plugin-plugin</artifactId>
            <version>${pluginPluginVersion}</version>
          </plugin>

          <plugin>
            <artifactId>maven-invoker-plugin</artifactId>
            <version>${invokerPluginVersion}</version>
          </plugin>

          <plugin>
            <groupId>org.codehaus.plexus</groupId>
            <artifactId>plexus-maven-plugin</artifactId>
            <version>${plexusPluginVersion}</version>
          </plugin>

          <plugin>
            <artifactId>maven-javadoc-plugin</artifactId>
            <version>${javadocPluginVersion}</version>
            <configuration>
              <quiet>true</quiet>
              <tagletArtifacts>
                <tagletArtifact>
                  <groupId>org.apache.maven.plugin-tools</groupId>
                  <artifactId>maven-plugin-tools-javadoc</artifactId>
                  <version>${pluginPluginVersion}</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>

        </plugins>
      </reporting>

    </profile>

    <profile>
      <id>run-its</id>
      <activation>
        <property>
          <name>maven.test.skip</name>
          <value>!true</value>
        </property>
      </activation>
      <build>
        <defaultGoal>verify</defaultGoal>
        <plugins>
          <plugin>
            <artifactId>maven-invoker-plugin</artifactId>
            <configuration>
              <pomIncludes>
                <pomInclude>**/pom.xml</pomInclude>
              </pomIncludes>
              <postBuildHookScript>verify</postBuildHookScript>
              <localRepositoryPath>${basedir}/target/local-repo
              </localRepositoryPath>
              <settingsFile>src/it/settings.xml</settingsFile>
              <cloneProjectsTo>${project.build.directory}/its</cloneProjectsTo>
            </configuration>
            <executions>
              <execution>
                <id>integration-test</id>
                <goals>
                  <goal>install</goal>
                  <goal>run</goal>
                </goals>
                <phase>integration-test</phase>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>

    <profile>
      <id>generate-java-parser</id>

      <build>
        <defaultGoal>generate-sources</defaultGoal>
        <plugins>
          <plugin>
            <groupId>org.antlr</groupId>
            <artifactId>antlr4-maven-plugin</artifactId>
            <executions>
              <execution>
                <goals>
                  <goal>antlr4</goal>
                </goals>
                <phase>generate-sources</phase>
                <configuration>
                  <encoding>UTF-8</encoding>
                  <listener>true</listener>
                  <visitor>true</visitor>
                  <sourceDirectory>${project.basedir}/src/main/antlr4</sourceDirectory>
                  <outputDirectory>${project.basedir}/src/main/java/org/nuiton/i18n/plugin/parser/java</outputDirectory>
                  <arguments>
                    <argument>-package</argument>
                    <argument>org.nuiton.i18n.plugin.parser.java</argument>
                  </arguments>
                </configuration>
              </execution>
            </executions>

          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
