<?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>
    <groupId>io.inkstand</groupId>
    <artifactId>inkstand-parent</artifactId>
    <version>0.1.2</version>
    <name>${project.groupId}:${project.artifactId}</name>
    <packaging>pom</packaging>
    <description>A lightweight infrastructure for standalone rest based microservices. Based on the idea
        and basic implementation by John Ament, https://github.com/johnament/hammock. Inkstand consists of
        a CDI container (Weld), a WebServer/Servlet Container (Undertow) and Jax-RS implementation and webapp (RestEasy).
        It provides auto resource and provider discovery and base support for JCR-based persistence.
    </description>
    <url>https://inkstand.io/</url>

    <developers>
        <developer>
            <name>Gerald Muecke</name>
            <email>gerald@inkstand.io</email>
            <organization>Inkstand.io</organization>
            <organizationUrl>https://github.com/inkstand-io</organizationUrl>
        </developer>
    </developers>

    <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>

    <issueManagement>
        <system>Jira</system>
        <url>https://inkstand.atlassian.net/</url>
    </issueManagement>

    <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>

    <scm>
        <developerConnection>scm:git:git@github.com:inkstand-io/inkstand.git</developerConnection>
        <url>https://github.com/inkstand-io/inkstand</url>
        <connection>scm:git:https://github.com/inkstand-io/inkstand.git</connection>
    </scm>

    <properties>
        <!-- Common Libraries Versions -->
        <logging.slf4j.version>1.7.6</logging.slf4j.version>
        <logging.log4j.version>2.0-rc1</logging.log4j.version>

        <!-- Sonar and Code Coverage -->
        <coverage.unit.test.path>${project.basedir}/target/jacoco-ut.exec</coverage.unit.test.path>
        <coverage.integration.test.path>${project.basedir}/target/jacoco-it.exec</coverage.integration.test.path>
        <sonar.core.codeCoveragePlugin>jacoco</sonar.core.codeCoveragePlugin>
        <sonar.dynamicAnalysis>reuseReports</sonar.dynamicAnalysis>
        <sonar.jacoco.reportPath>${coverage.unit.test.path}</sonar.jacoco.reportPath>
        <sonar.jacoco.itReportPath>${coverage.integration.test.path}</sonar.jacoco.itReportPath>
        <sonar.language>java</sonar.language>
        <coverage.jacoco.version>0.7.2.201409121644</coverage.jacoco.version>

        <!-- Test lib versions -->
        <test.junit.version>4.11</test.junit.version>
        <test.mockito.version>1.9.5</test.mockito.version>
        <test.htmlunit.version>2.8</test.htmlunit.version>
        <test.scribble.version>0.1.0</test.scribble.version>
        <test.jsonassert.version>1.2.3</test.jsonassert.version>
        <test.arquillian.version>1.1.5.Final</test.arquillian.version>
        <test.arquillian.weld.version>1.0.0.CR8</test.arquillian.weld.version>
        <!-- javax library versions -->
        <javax.jcr.version>2.0</javax.jcr.version>
        <javax.javaee-api.version>7.0</javax.javaee-api.version>
        <javax.ws.rs-api.version>2.0.1</javax.ws.rs-api.version>
        <javax.validation-api.version>1.0.0.GA</javax.validation-api.version>
        <!-- Apache Library Version -->
        <apache.commons.io.version>2.4</apache.commons.io.version>
        <apache.deltaspike.version>1.1.0</apache.deltaspike.version>
        <apache.jackrabbit.version>2.8.0</apache.jackrabbit.version>
        <apache.ds.server.version>2.0.0-M19</apache.ds.server.version>
        <apache.ds.ldap.api.version>1.0.0-M27</apache.ds.ldap.api.version>
        <!-- JBoss Library Version -->
        <jboss.resteasy.version>3.0.10.Final</jboss.resteasy.version>
        <jboss.weld.se.version>2.2.6.Final</jboss.weld.se.version>
        <jboss.undertow.version>1.2.0.Beta3</jboss.undertow.version>
        <!-- Library Versions -->
        <halite.version>0.0.15</halite.version>
    </properties>

    <dependencyManagement>
        <dependencies>
            <!-- Javax -->
            <dependency>
                <groupId>javax</groupId>
                <artifactId>javaee-api</artifactId>
                <version>${javax.javaee-api.version}</version>
            </dependency>
            <dependency>
                <groupId>javax.jcr</groupId>
                <artifactId>jcr</artifactId>
                <version>${javax.jcr.version}</version>
            </dependency>
            <dependency>
                <groupId>javax.ws.rs</groupId>
                <artifactId>javax.ws.rs-api</artifactId>
                <version>${javax.ws.rs-api.version}</version>
            </dependency>
            <dependency>
                <groupId>javax.validation</groupId>
                <artifactId>validation-api</artifactId>
                <version>${javax.validation-api.version}</version>
            </dependency>

            <!-- Apache Commons -->
            <dependency>
                <groupId>commons-io</groupId>
                <artifactId>commons-io</artifactId>
                <version>${apache.commons.io.version}</version>
            </dependency>
            <!-- Apache Deltaspike -->
            <dependency>
                <groupId>org.apache.deltaspike.core</groupId>
                <artifactId>deltaspike-core-api</artifactId>
                <version>${apache.deltaspike.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.deltaspike.core</groupId>
                <artifactId>deltaspike-core-impl</artifactId>
                <version>${apache.deltaspike.version}</version>
            </dependency>
            <!-- Apache DS -->
            <dependency>
                <groupId>org.apache.directory.api</groupId>
                <artifactId>api-ldap-client-api</artifactId>
                <version>${apache.ds.ldap.api.version}</version>
                <exclusions>
                    <exclusion>
                        <groupId>org.apache.directory.api</groupId>
                        <artifactId>api-ldap-schema-data</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>

            <!-- JBoss Resteasy -->
            <dependency>
                <groupId>org.jboss.resteasy</groupId>
                <artifactId>jaxrs-api</artifactId>
                <version>${jboss.resteasy.version}</version>
            </dependency>
            <dependency>
                <groupId>org.jboss.resteasy</groupId>
                <artifactId>resteasy-jaxrs</artifactId>
                <version>${jboss.resteasy.version}</version>
            </dependency>
            <dependency>
                <groupId>org.jboss.resteasy</groupId>
                <artifactId>resteasy-cdi</artifactId>
                <version>${jboss.resteasy.version}</version>
            </dependency>
            <dependency>
                <groupId>org.jboss.resteasy</groupId>
                <artifactId>async-http-servlet-3.0</artifactId>
                <version>${jboss.resteasy.version}</version>
            </dependency>
            <dependency>
                <groupId>org.jboss.resteasy</groupId>
                <artifactId>resteasy-client</artifactId>
                <version>${jboss.resteasy.version}</version>
            </dependency>

            <!-- Weld CDI Container -->
            <dependency>
                <groupId>org.jboss.weld.se</groupId>
                <artifactId>weld-se</artifactId>
                <version>${jboss.weld.se.version}</version>
            </dependency>
            <dependency>
                <groupId>io.undertow</groupId>
                <artifactId>undertow-core</artifactId>
                <version>${jboss.undertow.version}</version>
            </dependency>
            <dependency>
                <groupId>io.undertow</groupId>
                <artifactId>undertow-servlet</artifactId>
                <version>${jboss.undertow.version}</version>
            </dependency>
            <!-- Test Dependencies -->
            <dependency>
                <groupId>junit</groupId>
                <artifactId>junit</artifactId>
                <version>${test.junit.version}</version>
            </dependency>
            <dependency>
                <groupId>org.mockito</groupId>
                <artifactId>mockito-all</artifactId>
                <version>${test.mockito.version}</version>
            </dependency>
            <!-- Arquillian -->
            <dependency>
                <groupId>org.jboss.arquillian</groupId>
                <artifactId>arquillian-bom</artifactId>
                <version>${test.arquillian.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>org.jboss.arquillian.container</groupId>
                <artifactId>arquillian-weld-se-embedded-1.1</artifactId>
                <version>${test.arquillian.weld.version}</version>
                <scope>test</scope>
            </dependency>

            <!-- Code Coverage -->
            <dependency>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <version>${coverage.jacoco.version}</version>
            </dependency>
            <!-- Logging -->
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-api</artifactId>
                <version>${logging.slf4j.version}</version>
            </dependency>
            <!-- Binding for Log4J -->
            <dependency>
                <groupId>org.apache.logging.log4j</groupId>
                <artifactId>log4j-slf4j-impl</artifactId>
                <version>${logging.log4j.version}</version>
            </dependency>
            <!-- Log4j API and Core implementation required for binding -->
            <dependency>
                <groupId>org.apache.logging.log4j</groupId>
                <artifactId>log4j-api</artifactId>
                <version>${logging.log4j.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.logging.log4j</groupId>
                <artifactId>log4j-core</artifactId>
                <version>${logging.log4j.version}</version>
            </dependency>
            <!-- Test Dependencies -->
            <dependency>
                <groupId>io.inkstand</groupId>
                <artifactId>scribble</artifactId>
                <version>${test.scribble.version}</version>
                <scope>test</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>



    <profiles>
        <profile>
            <id>development</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <properties>
                <surefireArgLine />
                <tests.json.strict.validation.disabled>false</tests.json.strict.validation.disabled>
            </properties>
        </profile>
        <profile>
            <id>qa</id>
            <properties>
                <tests.json.strict.validation.disabled>true</tests.json.strict.validation.disabled>
            </properties>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.jacoco</groupId>
                        <artifactId>jacoco-maven-plugin</artifactId>
                        <version>${coverage.jacoco.version}</version>
                        <configuration>
                            <skip>${skipTests}</skip>
                            <includes>
                                <include>io.inkstand.*</include>
                            </includes>
                            <excludes>
                                <exclude>io.inkstand.scribble.*</exclude>
                            </excludes>
                        </configuration>
                        <executions>
                            <execution>
                                <id>prepare-agent</id>
                                <goals>
                                    <goal>prepare-agent</goal>
                                </goals>
                                <configuration>
                                    <destFile>${coverage.unit.test.path}</destFile>
                                    <append>true</append>
                                    <propertyName>surefireArgLine</propertyName>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>sonar-maven-plugin</artifactId>
                        <version>2.4</version>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>release</id>
            <properties>
                <surefireArgLine />
            </properties>
            <build>
                <plugins>
                    <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>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <version>2.10.1</version>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <additionalJOptions>
                                <additionalJOption>-J-Xmx16m </additionalJOption>
                            </additionalJOptions>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>1.5</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>external.atlassian.jgitflow</groupId>
                        <artifactId>jgitflow-maven-plugin</artifactId>
                        <version>1.0-m4.3</version>
                        <configuration>
                            <enableSshAgent>false</enableSshAgent>
                            <autoVersionSubmodules>true</autoVersionSubmodules>
                            <pushFeatures>true</pushFeatures>
                            <pushReleases>true</pushReleases>
                            <pushHotfixes>true</pushHotfixes>
                            <noDeploy>false</noDeploy>
                            <alwaysUpdateOrigin>true</alwaysUpdateOrigin>
                            <flowInitContext>
                                <developBranchName>development</developBranchName>
                                <versionTagPrefix>rev-</versionTagPrefix>
                            </flowInitContext>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                        <version>1.6.5</version>
                        <extensions>true</extensions>
                        <configuration>
                            <serverId>ossrh</serverId>
                            <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                            <autoReleaseAfterClose>true</autoReleaseAfterClose>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

    <build>
        <defaultGoal>clean verify</defaultGoal>
        <plugins>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.1</version>
                <configuration>
                    <source>1.7</source>
                    <target>1.7</target>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-jar-plugin</artifactId>
                <version>2.4</version>
                <configuration>
                    <archive>
                        <manifest>
                            <mainClass>Inkstand</mainClass>
                        </manifest>
                    </archive>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.17</version>
                <configuration>
                    <forkCount>1</forkCount>
                    <reuseForks>false</reuseForks>
                    <runOrder>random</runOrder>
                    <enableAssertions>true</enableAssertions>
                    <argLine>-Xms16M -Xmx512M ${surefireArgLine}</argLine>
                    <systemPropertyVariables>
                        <tests.json.strict.validation.disabled>${tests.json.strict.validation.disabled}</tests.json.strict.validation.disabled>
                    </systemPropertyVariables>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <version>${coverage.jacoco.version}</version>
                <configuration>
                    <skip>${skipTests}</skip>
                    <includes>
                        <include>io.inkstand.*</include>
                    </includes>
                    <excludes>
                        <exclude>io.inkstand.scribble.*</exclude>
                    </excludes>
                </configuration>
                <executions>
                    <execution>
                        <id>prepare-agent</id>
                        <goals>
                            <goal>prepare-agent</goal>
                        </goals>
                        <configuration>
                            <destFile>${coverage.unit.test.path}</destFile>
                            <append>true</append>
                            <propertyName>surefire.argLine</propertyName>
                        </configuration>
                    </execution>
                    <execution>
                        <id>prepare-it-agent</id>
                        <phase>pre-integration-test</phase>
                        <goals>
                            <goal>prepare-agent</goal>
                        </goals>
                        <configuration>
                            <destFile>${coverage.integration.test.path}</destFile>
                            <propertyName>failsafe.argLine</propertyName>
                            <append>true</append>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>sonar-maven-plugin</artifactId>
                <version>2.4</version>
            </plugin>
        </plugins>
    </build>

</project>
