<?xml version="1.0" encoding="UTF-8"?>
<!--
  Copyright 2017 Rob Spoor

  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->

<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>

  <groupId>com.github.robtimus</groupId>
  <artifactId>i18n-maven-plugin</artifactId>
  <version>1.0</version>
  <packaging>maven-plugin</packaging>

  <name>I18N Maven Plugin</name>
  <description>A Maven plugin for generating accessor classes for I18N resources</description>
  <url>https://robtimus.github.io/i18n-maven-plugin/</url>
  <inceptionYear>2017</inceptionYear>

  <licenses>
    <license>
      <name>The Apache Software License, Version 2.0</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
    </license>
  </licenses>

  <developers>
    <developer>
      <name>Rob Spoor</name>
      <email>robtimus@users.noreply.github.com</email>
    </developer>
  </developers>

  <prerequisites>
    <maven>${version.maven}</maven>
  </prerequisites>

  <scm>
    <connection>scm:git:git@github.com:robtimus/i18n-maven-plugin.git</connection>
    <developerConnection>scm:git:git@github.com:robtimus/i18n-maven-plugin.git</developerConnection>
    <tag>i18n-maven-plugin-1.0</tag>
    <url>https://github.com/robtimus/i18n-maven-plugin</url>
  </scm>

  <issueManagement>
    <system>GitHub</system>
    <url>https://github.com/robtimus/i18n-maven-plugin/issues</url>
  </issueManagement>

  <distributionManagement>
    <repository>
      <id>ossrh</id>
      <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
    </repository>
    <snapshotRepository>
      <id>ossrh</id>
      <url>https://oss.sonatype.org/content/repositories/snapshots</url>
    </snapshotRepository>
  </distributionManagement>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

    <version.java>1.7</version.java>

    <version.commons-collections>3.2.2</version.commons-collections>
    <version.commons-lang>2.6</version.commons-lang>
    <version.hamcrest>1.3</version.hamcrest>
    <version.junit>4.12</version.junit>
    <version.maven>3.0</version.maven>
    <version.maven-annotations>3.5</version.maven-annotations>
    <version.maven-plugin>3.5</version.maven-plugin>
    <version.mockito>1.10.19</version.mockito>
    <version.velocity>1.7</version.velocity>

    <version.plugin.antrun>1.8</version.plugin.antrun>
    <version.plugin.clean>3.0.0</version.plugin.clean>
    <version.plugin.compiler>3.6.1</version.plugin.compiler>
    <version.plugin.dependency>3.0.1</version.plugin.dependency>
    <version.plugin.deploy>2.8.2</version.plugin.deploy>
    <version.plugin.gpg>1.6</version.plugin.gpg>
    <version.plugin.nexus-staging>1.6.8</version.plugin.nexus-staging>
    <version.plugin.info-reports>2.9</version.plugin.info-reports>
    <version.plugin.install>2.5.2</version.plugin.install>
    <!-- do not use 3.0.1 or 3.0.2 to prevent error "org.codehaus.plexus.archiver.jar.Manifest.write(java.io.PrintWriter)" -->
    <version.plugin.jar>3.0.0</version.plugin.jar>
    <version.plugin.javadoc>2.10.4</version.plugin.javadoc>
    <version.plugin.release>2.5.3</version.plugin.release>
    <version.plugin.resources>3.0.2</version.plugin.resources>
    <version.plugin.site>3.6</version.plugin.site>
    <version.plugin.source>3.0.1</version.plugin.source>
    <version.plugin.surefire>2.20</version.plugin.surefire>
  </properties>

  <dependencies>
    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-core</artifactId>
      <version>${version.maven}</version>
    </dependency>

    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-plugin-api</artifactId>
      <version>${version.maven}</version>
    </dependency>

    <dependency>
      <groupId>org.apache.maven.plugin-tools</groupId>
      <artifactId>maven-plugin-annotations</artifactId>
      <version>${version.maven-annotations}</version>
      <scope>provided</scope>
    </dependency>

    <dependency>
      <groupId>org.apache.velocity</groupId>
      <artifactId>velocity</artifactId>
      <version>${version.velocity}</version>
    </dependency>

    <dependency>
      <groupId>commons-lang</groupId>
      <artifactId>commons-lang</artifactId>
      <version>${version.commons-lang}</version>
    </dependency>

    <dependency>
      <groupId>commons-collections</groupId>
      <artifactId>commons-collections</artifactId>
      <version>${version.commons-collections}</version>
    </dependency>

    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>${version.junit}</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.hamcrest</groupId>
      <artifactId>hamcrest-library</artifactId>
      <version>${version.hamcrest}</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-all</artifactId>
      <version>${version.mockito}</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <resources>
      <!-- add LICENSE.txt to META-INF besides the main resources -->
      <resource>
        <directory>src/main/resources</directory>
      </resource>
      <resource>
        <directory>${project.basedir}</directory>
        <targetPath>META-INF</targetPath>
        <includes>
          <include>LICENSE.txt</include>
        </includes>
      </resource>
    </resources>

    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-javadoc-plugin</artifactId>
          <version>${version.plugin.javadoc}</version>
          <configuration>
            <charset>UTF-8</charset>
            <docencoding>UTF-8</docencoding>
            <splitindex>true</splitindex>
            <author>true</author>
            <version>true</version>
            <notimestamp>true</notimestamp>
            <links>
              <!-- Use an HTTPS URL to the JSE docs -->
              <link>https://docs.oracle.com/javase/8/docs/api/</link>
            </links>
          </configuration>
        </plugin>

        <!-- this plugin is required to make Eclipse lifecycle errors disappear -->
        <plugin>
          <groupId>org.eclipse.m2e</groupId>
          <artifactId>lifecycle-mapping</artifactId>
          <version>1.0.0</version>
          <configuration>
            <lifecycleMappingMetadata>
              <pluginExecutions>
                <pluginExecution>
                  <pluginExecutionFilter>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-antrun-plugin</artifactId>
                    <versionRange>[1.0,)</versionRange>
                    <goals>
                      <goal>run</goal>
                    </goals>
                  </pluginExecutionFilter>
                  <action>
                    <ignore />
                  </action>
                </pluginExecution>
              </pluginExecutions>
            </lifecycleMappingMetadata>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>

    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>${version.plugin.compiler}</version>
        <configuration>
          <source>${version.java}</source>
          <target>${version.java}</target>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
        <version>${version.plugin.dependency}</version>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <version>${version.plugin.jar}</version>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
        <version>${version.plugin.source}</version>
        <executions>
          <execution>
            <phase>verify</phase>
            <goals>
              <goal>jar-no-fork</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-resources-plugin</artifactId>
        <version>${version.plugin.resources}</version>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <executions>
          <execution>
            <phase>verify</phase>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-plugin-plugin</artifactId>
        <version>${version.maven-plugin}</version>
        <executions>
          <execution>
            <phase>generate-sources</phase>
            <goals>
              <goal>helpmojo</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-antrun-plugin</artifactId>
        <version>${version.plugin.antrun}</version>
        <executions>
          <execution>
            <id>copy-license</id>
            <phase>generate-sources</phase>
            <goals>
              <goal>run</goal>
            </goals>
            <configuration>
              <target>
                <copy todir="${project.build.directory}/apidocs/META-INF">
                  <fileset dir="${project.basedir}">
                    <include name="LICENSE.txt" />
                  </fileset>
                </copy>
              </target>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-clean-plugin</artifactId>
        <version>${version.plugin.clean}</version>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>${version.plugin.surefire}</version>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-install-plugin</artifactId>
        <version>${version.plugin.install}</version>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-release-plugin</artifactId>
        <version>${version.plugin.release}</version>
        <configuration>
          <useReleaseProfile>false</useReleaseProfile>
          <releaseProfiles>release</releaseProfiles>
          <goals>deploy</goals>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-gpg-plugin</artifactId>
        <version>${version.plugin.gpg}</version>
        <executions>
          <execution>
            <phase>verify</phase>
            <goals>
              <goal>sign</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.sonatype.plugins</groupId>
        <artifactId>nexus-staging-maven-plugin</artifactId>
        <version>${version.plugin.nexus-staging}</version>
        <extensions>true</extensions>
        <configuration>
          <serverId>ossrh</serverId>
          <nexusUrl>https://oss.sonatype.org/</nexusUrl>
          <autoReleaseAfterClose>true</autoReleaseAfterClose>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-deploy-plugin</artifactId>
        <version>${version.plugin.deploy}</version>
        <executions>
          <execution>
            <phase>deploy</phase>
            <goals>
              <goal>deploy</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-site-plugin</artifactId>
        <version>${version.plugin.site}</version>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-project-info-reports-plugin</artifactId>
        <version>${version.plugin.info-reports}</version>
      </plugin>
    </plugins>
  </build>

  <reporting>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-project-info-reports-plugin</artifactId>
        <version>${version.plugin.info-reports}</version>
        <reportSets>
          <reportSet>
            <reports>
              <report>summary</report>
              <report>dependency-info</report>
              <report>dependencies</report>
              <report>license</report>
              <report>project-team</report>
              <report>scm</report>
              <report>issue-tracking</report>
            </reports>
          </reportSet>
        </reportSets>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>${version.plugin.javadoc}</version>
        <reportSets>
          <reportSet>
            <reports>
              <report>javadoc</report>
            </reports>
          </reportSet>
        </reportSets>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-plugin-plugin</artifactId>
        <version>${version.maven-plugin}</version>
      </plugin>
    </plugins>
  </reporting>

  <profiles>
    <profile>
      <id>generate-messages</id>

      <build>
        <plugins>
          <plugin>
            <groupId>com.github.robtimus</groupId>
            <artifactId>i18n-maven-plugin</artifactId>
            <version>${project.version}</version>
            <executions>
              <execution>
                <goals>
                  <goal>generate</goal>
                </goals>
                <configuration>
                  <bundleName>com.github.robtimus.maven.plugins.i18n.i18n</bundleName>
                  <className>com.github.robtimus.maven.plugins.i18n.Messages</className>
                  <outputDirectory>${project.basedir}/src/main/java</outputDirectory>
                  <licenseText>Apache-2.0</licenseText>
                  <licenseCopyrightHolder>Rob Spoor</licenseCopyrightHolder>
                  <publicVisibility>false</publicVisibility>
                  <suppressWarnings>nls</suppressWarnings>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
