<!-- ~ Copyright 2014 Gerald Muecke ~ ~ 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/maven-v4_0_0.xsd">
	<modelVersion>4.0.0</modelVersion>
	<groupId>li.moskito</groupId>
	<artifactId>inkstand</artifactId>
	<version>0.0.1</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://github.com/moskitoli/inkstand/wiki</url>

	<developers>
		<developer>
			<name>Gerald Muecke</name>
			<email>gerald@moskito.li</email>
			<organization>Moskito.li</organization>
			<organizationUrl>https://github.com/moskitoli</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>GitHub</system>
		<url>https://github.com/moskitoli/inkstand/issues</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:moskitoli/inkstand.git</developerConnection>
		<url>https://github.com/moskitoli/inkstand</url>
		<connection>scm:git:https://github.com/moskitoli/inkstand.git</connection>
	</scm>
	
    <modules>
        <module>inkstand-core</module>
        <module>inkstand-jcr</module>
        <module>inkstand-jcr-jackrabbit</module>
        <module>inkstand-http-undertow</module>
        <module>inkstand-deployments</module>
        <module>inkstand-test-util</module>
        <module>inkstand-ms</module>
    </modules>
	
	<properties>
		<!-- Common Libraries Versions -->
		<slf4j.version>1.7.6</slf4j.version>
		<log4j.version>2.0-rc1</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>
		<jacoco.version>0.7.2.201409121644</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.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>
		<!-- 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>

	<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>${jacoco.version}</version>
						<configuration>
							<skip>${skipTests}</skip>
							<includes>
								<include>li.moskito.inkstand.*</include>
							</includes>
						</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>

	<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>
			<!-- 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>
		</dependencies>
	</dependencyManagement>

	<dependencies>
		<!-- Code Coverage -->
		<dependency>
			<groupId>org.jacoco</groupId>
			<artifactId>jacoco-maven-plugin</artifactId>
			<version>${jacoco.version}</version>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>slf4j-api</artifactId>
			<version>${slf4j.version}</version>
		</dependency>
		<!-- Binding for Log4J -->
		<dependency>
			<groupId>org.apache.logging.log4j</groupId>
			<artifactId>log4j-slf4j-impl</artifactId>
			<version>${log4j.version}</version>
		</dependency>
		<!-- Log4j API and Core implementation required for binding -->
		<dependency>
			<groupId>org.apache.logging.log4j</groupId>
			<artifactId>log4j-api</artifactId>
			<version>${log4j.version}</version>
		</dependency>
		<dependency>
			<groupId>org.apache.logging.log4j</groupId>
			<artifactId>log4j-core</artifactId>
			<version>${log4j.version}</version>
		</dependency>
		<!-- Test libraries -->
		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.mockito</groupId>
			<artifactId>mockito-all</artifactId>
			<scope>test</scope>
		</dependency>
	</dependencies>

	<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>li.moskito.inkstand.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>${jacoco.version}</version>
				<configuration>
					<skip>${skipTests}</skip>
					<includes>
						<include>li.moskito.inkstand.*</include>
					</includes>
				</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>
