<?xml version="1.0" encoding="UTF-8"?>
<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>
  <groupId>com.github.jknack</groupId>
  <artifactId>handlebars.java</artifactId>
  <version>2.2.3</version>
  <packaging>pom</packaging>

  <name>Handlebars.java</name>
  <description>Logic-less and semantic templates with Java</description>

  <url>https://github.com/jknack/handlebars.java</url>

  <modules>
    <module>handlebars</module>
    <module>handlebars-helpers</module>
    <module>handlebars-springmvc</module>
    <module>handlebars-json</module>
    <module>handlebars-jackson2</module>
    <module>handlebars-markdown</module>
    <module>handlebars-humanize</module>
    <module>handlebars-proto</module>
    <module>handlebars-guava-cache</module>
    <module>handlebars-maven-plugin</module>
    <module>handlebars-maven-plugin-tests</module>
    <module>integration-tests</module>
  </modules>

  <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>
      <id>jknack</id>
      <name>Edgar Espina</name>
      <url>https://github.com/jknack</url>
    </developer>
  </developers>

  <scm>
    <connection>scm:git:git@github.com:jknack/handlebars.java.git</connection>
    <developerConnection>scm:git:git@github.com:jknack/handlebars.java.git</developerConnection>
    <url>scm:git:git@github.com:jknack/handlebars.java.git</url>
    <tag>HEAD</tag>
  </scm>

  <distributionManagement>
    <snapshotRepository>
      <id>ossrh</id>
      <name>Sonatype Nexus Snapshots</name>
      <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
    </snapshotRepository>
    <repository>
      <id>ossrh</id>
      <name>Nexus Release Repository</name>
      <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
    </repository>
  </distributionManagement>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>org.apache.commons</groupId>
        <artifactId>commons-lang3</artifactId>
        <version>3.1</version>
      </dependency>

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

      <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-webmvc</artifactId>
        <version>3.1.1.RELEASE</version>
      </dependency>

      <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-test</artifactId>
        <version>3.1.1.RELEASE</version>
        <scope>test</scope>
      </dependency>

      <!-- Rhino -->
      <dependency>
        <groupId>org.mozilla</groupId>
        <artifactId>rhino</artifactId>
        <version>1.7R4</version>
      </dependency>

      <!-- Logging System -->
      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-api</artifactId>
        <version>1.6.4</version>
      </dependency>

      <!-- Servlet API -->
      <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>servlet-api</artifactId>
        <version>2.5</version>
        <scope>provided</scope>
      </dependency>

      <!-- Jackson 1.x -->
      <dependency>
        <groupId>org.codehaus.jackson</groupId>
        <artifactId>jackson-mapper-asl</artifactId>
        <version>${jackson-version}</version>
      </dependency>

      <!-- Jackson 2.x -->
      <dependency>
        <groupId>com.fasterxml.jackson.core</groupId>
        <artifactId>jackson-databind</artifactId>
        <version>${jackson2-version}</version>
      </dependency>

      <!-- Markdown -->
      <dependency>
        <groupId>org.pegdown</groupId>
        <artifactId>pegdown</artifactId>
        <version>1.2.1</version>
      </dependency>

      <!-- Humanize -->
      <dependency>
        <groupId>com.github.mfornos</groupId>
        <artifactId>humanize-slim</artifactId>
        <version>1.1.1</version>
      </dependency>

      <!-- Test dependencies -->
      <dependency>
        <groupId>ch.qos.logback</groupId>
        <artifactId>logback-classic</artifactId>
        <version>1.0.3</version>
        <scope>test</scope>
      </dependency>

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

      <dependency>
        <groupId>org.yaml</groupId>
        <artifactId>snakeyaml</artifactId>
        <version>1.10</version>
        <scope>test</scope>
      </dependency>

      <dependency>
        <groupId>org.easymock</groupId>
        <artifactId>easymock</artifactId>
        <version>3.1</version>
      </dependency>

      <dependency>
        <groupId>org.powermock</groupId>
        <artifactId>powermock-api-easymock</artifactId>
        <version>1.5.2</version>
        <scope>test</scope>
        <exclusions>
          <exclusion>
            <groupId>org.easymock</groupId>
            <artifactId>easymock</artifactId>
          </exclusion>
        </exclusions>
      </dependency>

      <dependency>
        <groupId>org.powermock</groupId>
        <artifactId>powermock-module-junit4</artifactId>
        <version>1.5.2</version>
        <scope>test</scope>
      </dependency>

    </dependencies>
  </dependencyManagement>

  <build>
    <plugins>
      <!-- We're on 1.6 -->
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.1</version>
        <configuration>
          <source>1.6</source>
          <target>1.6</target>
        </configuration>
      </plugin>

      <plugin>
        <artifactId>maven-jar-plugin</artifactId>
        <version>2.4</version>
      </plugin>

      <!-- sure-fire -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>2.16</version>
        <configuration>
          <!-- set default locale of the test JVM to en_US because some tests expect e.g. the dollar sign as currency symbol -->
          <argLine>-Duser.language=en -Duser.country=US</argLine>
          <includes>
            <include>**/*Test.java</include>
            <include>**/Issue*.java</include>
          </includes>
          <excludes>
            <exclude>**/*BenchTest.java</exclude>
          </excludes>
        </configuration>
      </plugin>

      <!-- Eclipse setup -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-eclipse-plugin</artifactId>
        <version>2.9</version>
        <configuration>
          <downloadSources>true</downloadSources>
        </configuration>
      </plugin>

      <!-- Checkstyle -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-checkstyle-plugin</artifactId>
        <version>2.9.1</version>
        <configuration>
          <consoleOutput>true</consoleOutput>
          <configLocation>checkstyle.xml</configLocation>
          <failsOnError>true</failsOnError>
          <excludes>**/HbsServer*</excludes>
        </configuration>
        <executions>
          <execution>
            <id>checkstyle</id>
            <phase>verify</phase>
            <goals>
              <goal>checkstyle</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <!-- Coveralls -->
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>cobertura-maven-plugin</artifactId>
        <version>2.6</version>
        <configuration>
          <format>xml</format>
          <maxmem>256m</maxmem>
          <aggregate>true</aggregate>
          <instrumentation>
            <ignores>
              <ignore>com.github.jknack.handlebars.server.*</ignore>
            </ignores>
            <excludes>
              <exclude>com/github/jknack/handlebars/internal/Hbs*.class</exclude>
              <exclude>com/github/jknack/handlebars/server/Hbs*.class</exclude>
            </excludes>
          </instrumentation>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.eluder.coveralls</groupId>
        <artifactId>coveralls-maven-plugin</artifactId>
        <version>2.1.0</version>
      </plugin>

      <plugin>
        <groupId>com.mycila.maven-license-plugin</groupId>
        <artifactId>maven-license-plugin</artifactId>
        <version>1.10.b1</version>
        <configuration>
          <header>LICENSE</header>
          <strictCheck>true</strictCheck>
          <skipExistingHeaders>true</skipExistingHeaders>
          <includes>
            <include>src/main/java/**/*.java</include>
          </includes>
        </configuration>
        <executions>
          <execution>
            <phase>verify</phase>
            <goals>
              <goal>format</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <!-- Deploy plugin -->
      <plugin>
        <groupId>org.sonatype.plugins</groupId>
        <artifactId>nexus-staging-maven-plugin</artifactId>
        <version>1.6.3</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>2.8.1</version>
      </plugin>

    </plugins>
  </build>

  <profiles>
    <profile>
      <id>bench</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>2.12.3</version>
            <inherited>false</inherited>
            <configuration>
              <includes>
                <include>**/*BenchTest.java</include>
              </includes>
              <systemProperties>
                <property>
                  <name>run.bench</name>
                  <value>true</value>
                </property>
              </systemProperties>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>

    <profile>
      <id>sonatype-oss-release</id>
      <build>
        <plugins>
          <!-- This is a workaround to get submodules working with the maven release plugin -->
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>exec-maven-plugin</artifactId>
            <version>1.2.1</version>
            <executions>
              <execution>
                <phase>initialize</phase>
                <id>invoke build</id>
                <goals>
                  <goal>exec</goal>
                </goals>
              </execution>
            </executions>
            <configuration>
              <executable>git</executable>
              <arguments>
                <argument>submodule</argument>
                <argument>update</argument>
                <argument>--init</argument>
                <argument>--recursive</argument>
              </arguments>
              <successCodes>
                <successCode>0</successCode>
                <!-- git submodule fails in child projects, just ignore the error and continue -->
                <successCode>1</successCode>
              </successCodes>
            </configuration>
          </plugin>

          <!-- Source -->
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-source-plugin</artifactId>
            <version>2.2.1</version>
            <executions>
              <execution>
                <id>attach-sources</id>
                <goals>
                  <goal>jar-no-fork</goal>
                </goals>
              </execution>
            </executions>
          </plugin>

          <!-- Javadoc -->
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <version>2.9.1</version>
            <executions>
              <execution>
                <id>attach-javadocs</id>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>
          </plugin>

          <!-- GPG -->
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>1.4</version>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
              </execution>
            </executions>
          </plugin>

          <!-- Release plugin -->
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-release-plugin</artifactId>
            <version>2.4.2</version>
            <configuration>
              <mavenExecutorId>forked-path</mavenExecutorId>
              <useReleaseProfile>false</useReleaseProfile>
              <arguments>-Psonatype-oss-release</arguments>
              <autoVersionSubmodules>true</autoVersionSubmodules>
              <tagNameFormat>v@{project.version}</tagNameFormat>
              <scmCommentPrefix>release</scmCommentPrefix>
              <goals>deploy</goals>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

  <prerequisites>
    <maven>3.0</maven>
  </prerequisites>

  <properties>
    <!-- Encoding UTF-8 -->
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <jackson2-version>2.1.4</jackson2-version>
    <jackson-version>1.9.12</jackson-version>
    <maven.build.timestamp.format>yyyy-MM-dd HH:mm:ssa</maven.build.timestamp.format>
    <timestamp>${maven.build.timestamp}</timestamp>
  </properties>
</project>
