<?xml version="1.0" encoding="UTF-8"?>

<!--
   Copyright 2013-2016 Linagora, Université Joseph Fourier, Floralis

   The present code is developed in the scope of the joint LINAGORA -
   Université Joseph Fourier - Floralis research program and is designated
   as a "Result" pursuant to the terms and conditions of the LINAGORA
   - Université Joseph Fourier - Floralis research program. Each copyright
   holder of Results enumerated here above fully & independently holds complete
   ownership of the complete Intellectual Property rights applicable to the whole
   of said Results, and may freely exploit it in any manner which does not infringe
   the moral rights of the other copyright holders.

   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>
	<prerequisites>
		<maven>3.0.3</maven>
	</prerequisites>
	
	<groupId>net.roboconf</groupId>
	<artifactId>roboconf-parent</artifactId>
	<version>1.10</version>
	<name>Roboconf :: Parent</name>
	<description>A solution for elastic deployments</description>
	<packaging>pom</packaging>
	<url>http://roboconf.net</url>
	

	<!-- ////////////////////// -->
	<!--      Properties        -->
	<!-- ////////////////////// -->

	<properties>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
		<java.compiler.version>1.7</java.compiler.version>
		<build.resources.url>http://roboconf.net/resources/build</build.resources.url>
		<javadoc.plugin.version>2.9.1</javadoc.plugin.version>
		<checkstyle.xml.exclusions />
		<checkstyle.xml.inclusions />
	</properties>
		
	
	<!-- ////////////////////////////// -->
	<!--     Plug-ins Configuration     -->
	<!-- ////////////////////////////// -->
	
	<build>
		<defaultGoal>install</defaultGoal>
		<pluginManagement>
			<plugins>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-jar-plugin</artifactId>
					<version>2.4</version>
				</plugin>

				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-compiler-plugin</artifactId>
					<configuration>
						<source>${java.compiler.version}</source>
						<target>${java.compiler.version}</target>
					</configuration>
				</plugin>

				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-antrun-plugin</artifactId>
					<version>1.8</version>
				</plugin>
			</plugins>
		</pluginManagement>
		
		<plugins>
			<!-- Find Unused Dependencies -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-dependency-plugin</artifactId>
				<version>2.8</version>
				<executions>
					<execution>
						<id>analyze</id>
						<phase>test-compile</phase>
						<goals>
							<goal>analyze-only</goal>
						</goals>
						<configuration>
							<ignoreNonCompile>false</ignoreNonCompile>
							<failOnWarning>false</failOnWarning>
						</configuration>
					</execution>
				</executions>
			</plugin>
			
			<!-- Enforcer Rules -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-enforcer-plugin</artifactId>
				<version>1.1.1</version>
				<executions>
					<execution>
						<id>analyze</id>
						<goals>
							<goal>enforce</goal>
						</goals>
						<configuration>
							<fail>true</fail>
							<rules>
								<DependencyConvergence />
							</rules>
						</configuration>
					</execution>
				</executions>
			</plugin>
			
			<!-- CheckStyle -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-checkstyle-plugin</artifactId>
				<version>2.13</version>
				<configuration>
					<consoleOutput>true</consoleOutput>
					<logViolationsToConsole>true</logViolationsToConsole>
					<includeTestSourceDirectory>true</includeTestSourceDirectory>
				</configuration>
				
				<executions>
				
					<!-- Java Files -->
					<execution>
						<id>check-java</id>
               			<phase>process-sources</phase>
						<goals>
							<goal>check</goal>
						</goals>
						<configuration>
							<configLocation>${build.resources.url}/checkstyle/checkstyle-java-rules.xml</configLocation>
							<headerLocation>${build.resources.url}/checkstyle/header-java.txt</headerLocation>
							<includes>**/*.java</includes>
						</configuration>
					</execution>
					
					<!-- Root XML Files -->
					<execution>
						<id>check-xml</id>
               			<phase>process-sources</phase>
						<goals>
							<goal>check</goal>
						</goals>
						<configuration>
							<configLocation>${build.resources.url}/checkstyle/checkstyle-xml-rules.xml</configLocation>
							<headerLocation>${build.resources.url}/checkstyle/header-xml.txt</headerLocation>

							<includeResources>false</includeResources>
							<includeTestResources>false</includeTestResources>

							<!-- Process the pom.xml file too -->
							<includes>**/pom.xml, **/*.xsd, ${checkstyle.xml.inclusions}</includes>
							<excludes>**/target/**/*, **/*.properties, ${checkstyle.xml.exclusions}</excludes>
							<sourceDirectory>${project.basedir}</sourceDirectory>
							<testSourceDirectories />
						</configuration>
					</execution>
				</executions>
			</plugin>
			
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-release-plugin</artifactId>
				<version>2.5</version>
				<configuration>
					<releaseProfiles>jdoc-and-sources,signature</releaseProfiles>
				</configuration>
			</plugin>
			
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-deploy-plugin</artifactId>
				<version>2.8.2</version>
				<configuration>
					<deployAtEnd>-true</deployAtEnd>
				</configuration>
			</plugin>
		</plugins>
	</build>
	
	
	<!-- ////////////////////// -->
	<!--        Profiles        -->
	<!-- ////////////////////// -->
	
	<profiles>
		<!-- Sonar extension (tailored for a local installation) -->
		<profile>
			<id>sonar</id>
			<activation>
				<activeByDefault>false</activeByDefault>
			</activation>
	
			<properties>
				<sonar.jdbc.url>jdbc:h2:tcp://localhost:9092/sonar</sonar.jdbc.url>
				<sonar.jdbc.username>sonar</sonar.jdbc.username>
				<sonar.jdbc.password>sonar</sonar.jdbc.password>
				<!-- Optional URL to server. Default value is http://localhost:9000 -->
				<!-- <sonar.host.url>http://myserver:9000</sonar.host.url> -->
			</properties>
		</profile>
	
		<!-- A profile to generate javadoc and sources JAR -->
		<profile>
			<id>jdoc-and-sources</id>
			<activation>
				<activeByDefault>false</activeByDefault>
			</activation>
	
			<build>
				<plugins>

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

					<!-- Download the stylesheet for the javadoc -->
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-antrun-plugin</artifactId>
						<executions>
							<execution>
								<phase>generate-sources</phase>
								<configuration>
									<exportAntProperties>true</exportAntProperties>
									<target>
										<property name="dir" value="${java.io.tmpdir}/roboconf-javadoc" />
										<mkdir dir="${dir}" />
										<property name="javadoc.stylesheet" value="${dir}/roboconf-javadoc.css" />
										<get src="${build.resources.url}/javadoc/stylesheet.css" dest="${javadoc.stylesheet}" skipexisting="true" />
									</target>	
								</configuration>
								<goals>
									<goal>run</goal>
								</goals>
							</execution>
						</executions>
					</plugin>

					<!-- Generate the JAR with the javadoc -->
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-javadoc-plugin</artifactId>
						<version>${javadoc.plugin.version}</version>
						<executions>
							<execution>
								<id>attach-javadoc</id>
								<goals>
									<goal>jar</goal>
								</goals>
								<configuration>
									<stylesheetfile>${javadoc.stylesheet}</stylesheetfile>
								</configuration>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>

		<!-- Disable Java 8 Xdoclint checks by default. This profile is active iff:
		      - Java version is greater or equal to 1.8
		    AND
		      - the roboconf.javadoc.check is NOT defined
		 -->
		<profile>
			<id>java8-xdoclint-none</id>
			<activation>
				<jdk>[1.8,)</jdk>
				<property>
					<name>!roboconf.javadoc.check</name>
				</property>
			</activation>
			<build>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-javadoc-plugin</artifactId>
						<version>${javadoc.plugin.version}</version>
						<configuration>
							<additionalparam>-Xdoclint:none</additionalparam>
						</configuration>
					</plugin>
				</plugins>
			</build>
		</profile>

		<!-- Enable some of Java 8 Xdoclint checks. The set of javadoc checks is the content of the
		     roboconf.javadoc.check property. This profile is active iff:
		      - Java version is greater or equal to 1.8
		    AND
		      - the roboconf.javadoc.check is defined
		 -->
		<profile>
			<id>java8-xdoclint-active</id>
			<activation>
				<jdk>[1.8,)</jdk>
				<property>
					<name>roboconf.javadoc.check</name>
				</property>
			</activation>
			<build>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-javadoc-plugin</artifactId>
						<version>${javadoc.plugin.version}</version>
						<configuration>
							<additionalparam>-Xdoclint:reference</additionalparam>
							<additionalparam>-Xdoclint:html</additionalparam>
							<additionalparam>-Xdoclint:syntax</additionalparam>
						</configuration>
					</plugin>
				</plugins>
			</build>
		</profile>

		<!-- We also have a profile to sign our artifacts -->
		<profile>
			<id>signature</id>
			<activation>
				<activeByDefault>false</activeByDefault>
			</activation>
	
			<build>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-gpg-plugin</artifactId>
						<version>1.5</version>
						<configuration>
							<useAgent>true</useAgent>
						</configuration>
						<executions>
							<execution>
								<id>sign-artifacts</id>
								<phase>verify</phase>
								<goals>
									<goal>sign</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>


	<!-- ////////////////////// -->
	<!--       Miscellaneous    -->
	<!-- ////////////////////// -->

	<!-- Required Information to publish artifacts to Maven Central -->
	<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>Vincent ZURCZAK</name>
			<email>vzurczak (at) linagora.com</email>
			<url>https://github.com/vincent-zurczak</url>
			<organization>Linagora</organization>
			<organizationUrl>http://linagora.com</organizationUrl>
			<timezone>+1</timezone>
		</developer>
		<developer>
			<name>Pierre-Yves GIBELLO</name>
			<email>pygibello (at) linagora.com</email>
			<url>https://github.com/gibello</url>
			<organization>Linagora</organization>
			<organizationUrl>http://linagora.com</organizationUrl>
			<timezone>+1</timezone>
		</developer>
		<developer>
			<name>Didier DONSEZ</name>
			<email>didier.donsez (at) imag.fr</email>
			<organization>LIG (Université Grenoble-Alpes)</organization>
			<organizationUrl>http://www.liglab.fr</organizationUrl>
			<timezone>+1</timezone>
		</developer>
		<developer>
			<name>Pierre BOURRET</name>
			<email>pierre.bourret (at) imag.fr</email>
			<url>https://github.com/bourretp</url>
			<organization>LIG (Université Joseph Fourier)</organization>
			<organizationUrl>http://www.liglab.fr</organizationUrl>
			<timezone>+1</timezone>
		</developer>
		<developer>
			<name>Amadou DIARRA</name>
			<email>amadou.diarra (at) imag.fr</email>
			<url>https://github.com/diarraa</url>
			<organization>LIG (Université Grenoble-Alpes)</organization>
			<organizationUrl>http://www.liglab.fr</organizationUrl>
			<timezone>+1</timezone>
		</developer>
	</developers>
	
	<contributors>
		<contributor>
			<name>Noël DE PALMA</name>
			<email>noel.depalma (at) imag.fr</email>
			<organization>LIG (Université Joseph Fourier)</organization>
			<organizationUrl>http://www.liglab.fr</organizationUrl>
			<timezone>+1</timezone>
		</contributor>
		<contributor>
			<name>Linh-Manh PHAM</name>
			<email>Linh-Manh.Pham (at) imag.fr</email>
			<organization>LIG (Université Joseph Fourier)</organization>
			<organizationUrl>http://www.liglab.fr</organizationUrl>
			<timezone>+1</timezone>
		</contributor>
		<contributor>
			<name>Thomas SARBONI</name>
			<email>tsarboni (at) linagora.com</email>
			<organization>Linagora</organization>
			<organizationUrl>http://linagora.com</organizationUrl>
			<timezone>+1</timezone>
		</contributor>
		<contributor>
			<name>Christophe DENEUX</name>
			<email>cdneux (at) linagora.com</email>
			<organization>Linagora</organization>
			<organizationUrl>http://linagora.com</organizationUrl>
			<timezone>+1</timezone>
		</contributor>
		<contributor>
			<name>Christophe HAMERLING</name>
			<email>chamerling (at) linagora.com</email>
			<organization>Linagora</organization>
			<organizationUrl>http://linagora.com</organizationUrl>
			<timezone>+1</timezone>
		</contributor>
		<contributor>
			<name>Graham CROSMARIE</name>
			<email>gcrosmarie (at) linagora.com</email>
			<organization>Linagora</organization>
			<organizationUrl>http://linagora.com</organizationUrl>
			<timezone>+1</timezone>
		</contributor>
	</contributors>

	<scm>
		<connection>scm:git:git@github.com:roboconf/roboconf-parent.git</connection>
		<developerConnection>scm:git:git@github.com:roboconf/roboconf-parent.git</developerConnection>
		<url>http://github.com/roboconf/roboconf-parent</url>
		<tag>roboconf-parent-1.10</tag>
	</scm>

	<distributionManagement>
		<snapshotRepository>
			<id>sonatype-snapshots</id>
			<name>Sonatype Nexus snapshot repository</name>
			<url>https://oss.sonatype.org/content/repositories/snapshots</url>
		</snapshotRepository>
		<repository>
			<id>sonatype-release-staging</id>
			<name>Sonatype Nexus release repository</name>
			<url>https://oss.sonatype.org/service/local/staging/deploy/maven2</url>
		</repository>
	</distributionManagement>
	
</project>
