<?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/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>org.sonatype.oss</groupId>
        <artifactId>oss-parent</artifactId>
        <version>7</version>
    </parent>

    <groupId>com.lyncode</groupId>
    <artifactId>jtwig</artifactId>
    <version>3.1.1</version>
    <packaging>pom</packaging>

    <name>JTwig Root</name>
    <url>http://www.lyncode.com</url>
    <description>Twig port to Java</description>


    <licenses>
        <license>
            <name>The Apache Software License, Version 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <scm>
        <connection>scm:git:git@github.com:jtwig/jtwig.git</connection>
        <developerConnection>scm:git:git@github.com:jtwig/jtwig.git</developerConnection>
        <url>git@github.com:jtwig/jtwig.git</url>
        <tag>jtwig-3.1.1</tag>
    </scm>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <lyncode.builder.commons.version>1.0.2</lyncode.builder.commons.version>

        <spring.version>3.2.5.RELEASE</spring.version>
        <spring-security.version>3.2.0.RELEASE</spring-security.version>
        <parboiled.version>1.1.6</parboiled.version>
        <hamcrest.version>1.3</hamcrest.version>
        <mockito.version>1.9.5</mockito.version>
        <junit.version>4.11</junit.version>
        <servlet-api.version>2.5</servlet-api.version>
        <slf4j.version>1.7.7</slf4j.version>
        <commons.lang3.version>3.1</commons.lang3.version>
        <jackson.version>1.9.13</jackson.version>
        <jackson2.version>2.4.3</jackson2.version>
        <gson.version>2.3</gson.version>
        <yatspec.version>209</yatspec.version>

        <jacoco.version>0.7.2.201409121644</jacoco.version>
    </properties>

    <modules>
        <module>jtwig-core</module>
        <module>jtwig-functions</module>
        <module>jtwig-spring</module>
    </modules>


    <distributionManagement>
        <snapshotRepository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
        <repository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>
    </distributionManagement>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-gpg-plugin</artifactId>
                    <version>1.5</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <version>2.8.1</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-source-plugin</artifactId>
                    <version>2.2.1</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-release-plugin</artifactId>
                    <version>2.5</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>3.1</version>
                </plugin>
                <plugin>
                    <groupId>org.jacoco</groupId>
                    <artifactId>jacoco-maven-plugin</artifactId>
                    <version>${jacoco.version}</version>
                </plugin>
            </plugins>
        </pluginManagement>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <configuration>
                    <autoVersionSubmodules>true</autoVersionSubmodules>
                    <useReleaseProfile>false</useReleaseProfile>
                    <releaseProfiles>release</releaseProfiles>
                    <goals>deploy</goals>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>1.7</source>
                    <target>1.7</target>
                    <showDeprecation>false</showDeprecation>
                    <showWarnings>false</showWarnings>
                    <fork>true</fork>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <inherited>true</inherited>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <inherited>true</inherited>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <goals>
                            <goal>prepare-agent</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>report</id>
                        <phase>prepare-package</phase>
                        <goals>
                            <goal>report</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.eluder.coveralls</groupId>
                <artifactId>coveralls-maven-plugin</artifactId>
                <inherited>false</inherited>
                <version>3.0.1</version>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>merge-reports</id>
            <build>
                <plugins>
                    <!-- Merge jacoco reports into one -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-dependency-plugin</artifactId>
                        <inherited>false</inherited>
                        <executions>
                            <!-- Copy the ant tasks jar. Needed for ts.jacoco.report-ant . -->
                            <execution>
                                <id>jacoco-dependency-ant</id>
                                <goals>
                                    <goal>copy</goal>
                                </goals>
                                <phase>process-test-resources</phase>
                                <inherited>false</inherited>
                                <configuration>
                                    <artifactItems>
                                        <artifactItem>
                                            <groupId>org.jacoco</groupId>
                                            <artifactId>org.jacoco.ant</artifactId>
                                            <version>${jacoco.version}</version>
                                        </artifactItem>
                                    </artifactItems>
                                    <stripVersion>true</stripVersion>
                                    <outputDirectory>${basedir}/target/jacoco-jars</outputDirectory>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-antrun-plugin</artifactId>
                        <inherited>false</inherited>
                        <version>1.6</version>
                        <executions>
                            <execution>
                                <id>merge</id>
                                <phase>compile</phase>
                                <goals>
                                    <goal>run</goal>
                                </goals>
                                <configuration>
                                    <target name="merge">
                                        <echo message="Generating JaCoCo Reports" />
                                        <taskdef name="report" classname="org.jacoco.ant.ReportTask">
                                            <classpath path="${basedir}/target/jacoco-jars/org.jacoco.ant.jar" />
                                        </taskdef>
                                        <mkdir dir="${basedir}/target/site/jacoco" />
                                        <report>
                                            <executiondata>
                                                <fileset dir="jtwig-functions/target">
                                                    <include name="jacoco.exec" />
                                                </fileset>
                                                <fileset dir="jtwig-core/target">
                                                    <include name="jacoco.exec" />
                                                </fileset>
                                                <fileset dir="jtwig-spring/target">
                                                    <include name="jacoco.exec" />
                                                </fileset>
                                            </executiondata>
                                            <structure name="Jtwig Coverage">
                                                <group name="jtwig-core">
                                                    <classfiles>
                                                        <fileset dir="jtwig-core/target/classes">
                                                            <exclude name="**/*Parser*" />
                                                            <exclude name="**/*Addon*" />
                                                            <exclude name="**/parboiled/**" />
                                                        </fileset>
                                                    </classfiles>
                                                    <sourcefiles encoding="UTF-8">
                                                        <fileset dir="jtwig-core/target/generated-sources/annotations" />
                                                    </sourcefiles>
                                                </group>
                                                <group name="jtwig-functions">
                                                    <classfiles>
                                                        <fileset dir="jtwig-functions/target/classes" />
                                                    </classfiles>
                                                    <sourcefiles encoding="UTF-8">
                                                        <fileset dir="jtwig-functions/target/generated-sources/annotations" />
                                                    </sourcefiles>
                                                </group>
                                                <group name="jtwig-spring">
                                                    <classfiles>
                                                        <fileset dir="jtwig-spring/target/classes">
                                                            <exclude name="**/render/**" />
                                                            <exclude name="**/SpringFunctions*" />
                                                            <exclude name="**/BeanResolver*" />
                                                        </fileset>
                                                    </classfiles>
                                                    <sourcefiles encoding="UTF-8">
                                                        <fileset dir="jtwig-spring/target/generated-sources/annotations" />
                                                    </sourcefiles>
                                                </group>
                                            </structure>
                                            <xml destfile="${basedir}/target/site/jacoco/jacoco.xml" />
                                            <html destdir="${basedir}/target/site/jacoco" />
                                        </report>
                                    </target>
                                </configuration>
                            </execution>
                        </executions>
                        <dependencies>
                            <dependency>
                                <groupId>org.jacoco</groupId>
                                <artifactId>org.jacoco.ant</artifactId>
                                <version>${jacoco.version}</version>
                            </dependency>
                        </dependencies>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

    <developers>
        <developer>
            <name>DSpace @ Lyncode</name>
            <email>dspace@lyncode.com</email>
            <organization>Lyncode</organization>
            <organizationUrl>http://www.lyncode.com</organizationUrl>
        </developer>
    </developers>
</project>