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

    #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#
      This file is part of the Smart Developer Hub Project:
        http://www.smartdeveloperhub.org/

      Center for Open Middleware
        http://www.centeropenmiddleware.com/
    #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#
      Copyright (C) 2015 Center for Open Middleware.
    #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#
      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.
    #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#
      Artifact    : org.smartdeveloperhub:sdh-build:0.2.0
      Bundle      : sdh-build-0.2.0.pom
    #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#

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

	<!-- =================================================================== -->
	<!--   MODULE COORDINATES                                                -->
	<!-- =================================================================== -->

	<parent>
		<groupId>org.smartdeveloperhub</groupId>
		<artifactId>sdh-parent</artifactId>
		<version>0.2.0</version>
		<relativePath>../pom.xml</relativePath>
	</parent>

	<artifactId>sdh-build</artifactId>
	<packaging>pom</packaging>

	<!-- =================================================================== -->
	<!--   PROJECT INFORMATION                                               -->
	<!-- =================================================================== -->

	<name>SDH :: Build Configuration</name>

	<description>Smart Developer Hub Build Configuration</description>

	<!-- =================================================================== -->
	<!--   BUILD SETTINGS                                                    -->
	<!-- =================================================================== -->

	<properties>
		<!--  ============================================================   -->
		<!--   Specific build configuration properties                       -->
		<!--  ============================================================   -->

		<!-- License templating -->
		<license.project.name>Smart Developer Hub</license.project.name>
		<license.project.url>http://www.smartdeveloperhub.org/</license.project.url>
		<license.project.owner>${project.organization.name}</license.project.owner>
		<license.project.duration>2015</license.project.duration>
		<license.project.inceptionYear>${project.inceptionYear}</license.project.inceptionYear>
		<license.organization.name>${project.organization.name}</license.organization.name>
		<license.organization.url>${project.organization.url}</license.organization.url>
		<license.artifact>${project.groupId}:${project.artifactId}:${project.version}</license.artifact>
		<license.bundle>${project.build.finalName}.${project.packaging}</license.bundle>

		<coverage.reports.dir>${project.build.directory}${file.separator}coverage-reports</coverage.reports.dir>

		<jacoco.ut.file>jacoco-ut.exec</jacoco.ut.file>
		<jacoco.it.file>jacoco-it.exec</jacoco.it.file>

		<sonar.language>java</sonar.language>
		<sonar.junit.reportsPath>${project.build.directory}${file.separator}surefire-reports</sonar.junit.reportsPath>
		<sonar.java.coveragePlugin>jacoco</sonar.java.coveragePlugin>
		<sonar.jacoco.reportPath>${coverage.reports.dir}${file.separator}${jacoco.ut.file}</sonar.jacoco.reportPath>
		<sonar.jacoco.itReportPath>${coverage.reports.dir}${file.separator}${jacoco.it.file}</sonar.jacoco.itReportPath>

		<config.dir>${project.build.directory}${file.separator}config</config.dir>
		<jacoco.config.includes>org.smartdeveloperhub.*</jacoco.config.includes>

		<src.archive>${project.build.directory}${file.separator}${project.artifactId}-${project.version}-sources.jar</src.archive>

		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

		<!-- JDK compatibility -->
		<compiler.version>1.7</compiler.version>
		<source.encoding>${project.build.sourceEncoding}</source.encoding>

		<!-- Reporting -->
		<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

		<surefire.arg.line></surefire.arg.line>
		<failsafe.arg.line></failsafe.arg.line>

		<!--  ============================================================   -->
		<!--   Dependency version properties                                 -->
		<!--  ============================================================   -->

		<sdh.config.version>0.2.0</sdh.config.version>

		<slf4j.version>1.7.12</slf4j.version>
		<hamcrest.version>1.3</hamcrest.version>
		<jmockit.version>1.19</jmockit.version>
		<jacoco.version>0.7.4.201502262128</jacoco.version>
		<mockito.version>1.10.19</mockito.version>
		<junit.version>4.12</junit.version>
		<guava.version>18.0</guava.version>
		<joda.time.version>2.8.2</joda.time.version>
		<javassist.version>3.15.0-GA</javassist.version>
		<commons.io.version>2.4</commons.io.version>
		<commons.beanutils.version>1.9.2</commons.beanutils.version>
		<commons.cli.version>1.3.1</commons.cli.version>
		<commons.codec.version>1.10</commons.codec.version>
		<commons.collections4.version>4.0</commons.collections4.version>
		<commons.lang3.version>3.4</commons.lang3.version>
		<commons.dbcp2.version>2.1.1</commons.dbcp2.version>
		<hibernate.version>4.3.8.Final</hibernate.version>
		<mysql.version>5.1.13</mysql.version> <!-- Check version -->
		<hsqldb.version>2.3.3</hsqldb.version>
		<dbunit.version>2.5.1</dbunit.version>
		<jaxb.api.version>2.2.11</jaxb.api.version>
		<jaxb.impl.version>2.2.11</jaxb.impl.version>
		<jaxb2-basics-runtime.version>0.6.3</jaxb2-basics-runtime.version>
		<xalan.version>2.7.2</xalan.version>
		<jtidy.version>r938</jtidy.version>
		<spring.version>3.0.7.RELEASE</spring.version>
		<spring.osgi.version>1.2.0</spring.osgi.version>
		<org.osgi.core.version>1.0.0</org.osgi.core.version>
		<httpclient.version>4.5</httpclient.version>
		<jsr311.api.version>1.1.1</jsr311.api.version>
		<cxf.version>2.7.17</cxf.version>

		<sonar.java.plugin.version>2.4</sonar.java.plugin.version>

		<git.tag>${project.version}</git.tag>
	</properties>

	<dependencyManagement>
		<dependencies>
			<!-- Internal dependencies -->
			<dependency>
				<groupId>org.smartdeveloperhub</groupId>
				<artifactId>sdh-config</artifactId>
				<version>${project.version}</version>
			</dependency>

			<!-- Testing support utilities  -->
			<dependency>
				<groupId>org.jmockit</groupId>
				<artifactId>jmockit</artifactId>
				<version>${jmockit.version}</version>
				<scope>test</scope>
			</dependency>
			<dependency>
				<groupId>org.hamcrest</groupId>
				<artifactId>hamcrest-integration</artifactId>
				<version>${hamcrest.version}</version>
				<scope>test</scope>
			</dependency>
			<dependency>
				<groupId>org.mockito</groupId>
				<artifactId>mockito-core</artifactId>
				<version>${mockito.version}</version>
				<scope>test</scope>
				<exclusions>
					<exclusion>
						<artifactId>hamcrest-core</artifactId>
						<groupId>org.hamcrest</groupId>
					</exclusion>
				</exclusions>
			</dependency>
			<dependency>
				<groupId>junit</groupId>
				<artifactId>junit</artifactId>
				<version>${junit.version}</version>
				<scope>test</scope>
				<exclusions>
					<exclusion>
						<artifactId>hamcrest-core</artifactId>
						<groupId>org.hamcrest</groupId>
					</exclusion>
				</exclusions>
			</dependency>

			<!-- Database testing support  dependencies -->
			<dependency>
				<groupId>org.dbunit</groupId>
				<artifactId>dbunit</artifactId>
				<version>${dbunit.version}</version>
			</dependency>

			<!-- REST support dependencies -->
			<dependency>
				<groupId>javax.ws.rs</groupId>
				<artifactId>jsr311-api</artifactId>
				<version>${jsr311.api.version}</version>
			</dependency>
			<dependency>
				<groupId>org.apache.httpcomponents</groupId>
				<artifactId>httpclient</artifactId>
				<version>${httpclient.version}</version>
			</dependency>
			<dependency>
				<groupId>org.apache.httpcomponents</groupId>
				<artifactId>httpclient-cache</artifactId>
				<version>${httpclient.version}</version>
			</dependency>
			<dependency>
				<groupId>org.apache.httpcomponents</groupId>
				<artifactId>httpmime</artifactId>
				<version>${httpclient.version}</version>
			</dependency>
			<dependency>
				<groupId>org.apache.httpcomponents</groupId>
				<artifactId>fluent-hc</artifactId>
				<version>${httpclient.version}</version>
			</dependency>
			<dependency>
				<groupId>org.apache.cxf</groupId>
				<artifactId>cxf-rt-frontend-jaxrs</artifactId>
				<version>${cxf.version}</version>
			</dependency>

			<!-- XML support dependencies -->
			<dependency>
				<groupId>javax.xml.bind</groupId>
				<artifactId>jaxb-api</artifactId>
				<version>${jaxb.api.version}</version>
			</dependency>
			<dependency>
				<groupId>com.sun.xml.bind</groupId>
				<artifactId>jaxb-impl</artifactId>
				<version>${jaxb.impl.version}</version>
			</dependency>
			<dependency>
				<groupId>com.sun.xml.bind</groupId>
				<artifactId>jaxb-core</artifactId>
				<version>${jaxb.impl.version}</version>
			</dependency>
			<dependency>
				<groupId>org.jvnet.jaxb2_commons</groupId>
				<artifactId>jaxb2-basics-runtime</artifactId>
				<version>${jaxb2-basics-runtime.version}</version>
			</dependency>
			<dependency>
				<groupId>xalan</groupId>
				<artifactId>xalan</artifactId>
				<version>${xalan.version}</version>
			</dependency>
			<dependency>
				<groupId>net.sf.jtidy</groupId>
				<artifactId>jtidy</artifactId>
				<version>${jtidy.version}</version>
			</dependency>

			<!-- General-purpose utilities -->
			<dependency>
				<groupId>com.google.guava</groupId>
				<artifactId>guava</artifactId>
				<version>${guava.version}</version>
			</dependency>
			<dependency>
				<groupId>commons-io</groupId>
				<artifactId>commons-io</artifactId>
				<version>${commons.io.version}</version>
			</dependency>
			<dependency>
				<groupId>commons-cli</groupId>
				<artifactId>commons-cli</artifactId>
				<version>${commons.cli.version}</version>
			</dependency>
			<dependency>
				<groupId>org.apache.commons</groupId>
				<artifactId>commons-lang3</artifactId>
				<version>${commons.lang3.version}</version>
			</dependency>
			<dependency>
				<groupId>commons-codec</groupId>
				<artifactId>commons-codec</artifactId>
				<version>${commons.codec.version}</version>
			</dependency>
			<dependency>
				<groupId>org.apache.commons</groupId>
				<artifactId>commons-collections4</artifactId>
				<version>${commons.collections4.version}</version>
			</dependency>

			<dependency>
				<groupId>joda-time</groupId>
				<artifactId>joda-time</artifactId>
				<version>${joda.time.version}</version>
			</dependency>

			<dependency>
				<groupId>org.springframework</groupId>
				<artifactId>spring-web</artifactId>
				<version>${spring.version}</version>
			</dependency>

			<dependency>
				<groupId>org.springframework</groupId>
				<artifactId>spring-context</artifactId>
				<version>${spring.version}</version>
			</dependency>
			<dependency>
				<groupId>org.apache.felix</groupId>
				<artifactId>org.osgi.core</artifactId>
				<version>${org.osgi.core.version}</version>
			</dependency>
			<dependency>
				<groupId>org.springframework.osgi</groupId>
				<artifactId>spring-osgi-core</artifactId>
				<version>${spring.osgi.version}</version>
			</dependency>
			<dependency>
				<groupId>org.springframework.osgi</groupId>
				<artifactId>spring-osgi-io</artifactId>
				<version>${spring.osgi.version}</version>
			</dependency>

			<!-- Introspection and bytecode manipulation support dependencies  -->
			<dependency>
				<groupId>commons-beanutils</groupId>
				<artifactId>commons-beanutils</artifactId>
				<version>${commons.beanutils.version}</version>
			</dependency>
			<dependency>
				<groupId>org.javassist</groupId>
				<artifactId>javassist</artifactId>
				<version>${javassist.version}</version>
			</dependency>

			<!-- Database support dependencies -->
			<dependency>
				<groupId>org.hsqldb</groupId>
				<artifactId>hsqldb</artifactId>
				<version>${hsqldb.version}</version>
			</dependency>
			<dependency>
				<groupId>mysql</groupId>
				<artifactId>mysql-connector-java</artifactId>
				<version>${mysql.version}</version>
			</dependency>
			<dependency>
				<groupId>org.hibernate</groupId>
				<artifactId>hibernate-entitymanager</artifactId>
				<version>${hibernate.version}</version>
			</dependency>
			<dependency>
				<groupId>org.apache.commons</groupId>
				<artifactId>commons-dbcp2</artifactId>
				<version>${commons.dbcp2.version}</version>
			</dependency>

			<!-- Logging utilities -->
			<dependency>
				<groupId>org.slf4j</groupId>
				<artifactId>slf4j-api</artifactId>
				<version>${slf4j.version}</version>
			</dependency>
			<dependency>
				<groupId>org.slf4j</groupId>
				<artifactId>slf4j-ext</artifactId>
				<version>${slf4j.version}</version>
			</dependency>
			<dependency>
				<groupId>org.slf4j</groupId>
				<artifactId>slf4j-log4j12</artifactId>
				<version>${slf4j.version}</version>
			</dependency>
			<dependency>
				<groupId>org.slf4j</groupId>
				<artifactId>jcl-over-slf4j</artifactId>
				<version>${slf4j.version}</version>
			</dependency>
			<dependency>
				<groupId>org.slf4j</groupId>
				<artifactId>jul-over-slf4j</artifactId>
				<version>${slf4j.version}</version>
			</dependency>
		</dependencies>
	</dependencyManagement>

	<build>
		<testResources>
			<testResource>
				<directory>src${file.separator}test${file.separator}resources</directory>
				<filtering>true</filtering>
			</testResource>
		</testResources>

		<plugins>
			<!-- ===================================== -->
			<!-- Plugins for managing the construction -->
			<!-- ===================================== -->

			<!-- Extract configuration -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-dependency-plugin</artifactId>
				<executions>
					<execution>
						<id>unpack</id>
						<phase>validate</phase>
						<goals>
							<goal>unpack</goal>
						</goals>
						<configuration>
							<artifactItems>
								<artifactItem>
									<groupId>org.smartdeveloperhub</groupId>
									<artifactId>sdh-config</artifactId>
									<version>${sdh.config.version}</version>
									<type>jar</type>
									<overWrite>false</overWrite>
									<outputDirectory>${config.dir}</outputDirectory>
								</artifactItem>
							</artifactItems>
						</configuration>
					</execution>
				</executions>
			</plugin>

			<!-- Use UTF-8 encoding for resources -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-resources-plugin</artifactId>
				<configuration>
					<encoding>${source.encoding}</encoding>
				</configuration>
				<dependencies>
					<dependency>
						<groupId>org.apache.maven.shared</groupId>
						<artifactId>maven-filtering</artifactId>
						<version>1.3</version>
					</dependency>
				</dependencies>
			</plugin>

			<!-- Enforce Jave SE 7 compliance, and UTF-8 sources -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<configuration>
					<encoding>${source.encoding}</encoding>
					<source>${compiler.version}</source>
					<target>${compiler.version}</target>
					<verbose>false</verbose>
					<showWarnings>false</showWarnings>
				</configuration>
			</plugin>

			<!-- ================================== -->
			<!-- Plugins for delivery configuration -->
			<!-- ================================== -->

			<!-- Prepare build information-->
			<plugin>
				<groupId>ru.concerteza.buildnumber</groupId>
				<artifactId>maven-jgit-buildnumber-plugin</artifactId>
				<executions>
					<execution>
						<id>git-buildnumber</id>
						<goals>
							<goal>extract-buildnumber</goal>
						</goals>
						<phase>validate</phase>
						<configuration>
							<runOnlyAtExecutionRoot>false</runOnlyAtExecutionRoot>
							<javaScriptBuildnumberCallback>
								shortRevision
							</javaScriptBuildnumberCallback>
						</configuration>
					</execution>
				</executions>
			</plugin>

			<plugin>
				<groupId>org.codehaus.groovy.maven</groupId>
				<artifactId>gmaven-plugin</artifactId>
				<executions>
					<execution>
						<id>buildNumber</id>
						<phase>validate</phase>
						<goals>
							<goal>execute</goal>
						</goals>
						<configuration>
							<color>true</color>
							<source>
								tag=project.properties.get('git.tag')
								if(tag=='') {
									tag=project.version
								}
								commitsCount=project.properties.get('git.commitsCount')
								branch=project.properties.get('git.branch')
								revision=project.properties.get('git.buildnumber')
								buildNumber="${tag} build ${commitsCount} (${branch}@${revision})"
								project.properties.setProperty('sdh.buildNumber',buildNumber)
								println "Build number: " + buildNumber
							</source>
						</configuration>
					</execution>
				</executions>
			</plugin>

			<!-- Deliver the sources together with the JARs-->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-source-plugin</artifactId>
				<executions>
					<execution>
						<id>attach-sources</id>
						<phase>package</phase>
						<goals>
							<goal>jar</goal>
						</goals>
						<configuration>
							<archive>
								<manifest>
									<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
								</manifest>
								<manifestEntries>
									<Implementation-Version>${sdh.buildNumber}</Implementation-Version>
								</manifestEntries>
								<manifestSections>
									<manifestSection>
										<name>Build</name>
										<manifestEntries>
											<Build-Tag>${git.tag}</Build-Tag>
											<Build-Branch>${git.branch}</Build-Branch>
											<Build-Revision>${git.revision}</Build-Revision>
											<Build-Commit-Count>${git.commitsCount}</Build-Commit-Count>
											<Build-Date>${maven.build.timestamp}</Build-Date>
										</manifestEntries>
									</manifestSection>
								</manifestSections>
							</archive>
						</configuration>
					</execution>
				</executions>
			</plugin>

			<!-- Deliver the sources together also when creating a WAR -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-war-plugin</artifactId>
				<configuration>
					<failOnMissingWebXml>false</failOnMissingWebXml>
					<attachClasses>true</attachClasses>
					<webResources>
						<resource>
							<directory>${config.dir}${file.separator}legal</directory>
							<filtering>true</filtering>
							<includes>
								<include>NOTICE</include>
								<include>LICENSE</include>
							</includes>
						</resource>
					</webResources>
					<archive>
					<manifest>
						<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
					</manifest>
					<manifestEntries>
						<Implementation-Version>${sdh.buildNumber}</Implementation-Version>
					</manifestEntries>
					<manifestSections>
						<manifestSection>
							<name>Build</name>
							<manifestEntries>
								<Build-Tag>${git.tag}</Build-Tag>
								<Build-Branch>${git.branch}</Build-Branch>
								<Build-Revision>${git.revision}</Build-Revision>
								<Build-Commit-Count>${git.commitsCount}</Build-Commit-Count>
								<Build-Date>${maven.build.timestamp}</Build-Date>
							</manifestEntries>
						</manifestSection>
					</manifestSections>
					</archive>
				</configuration>
			</plugin>

			<!-- Deliver the tests together with the JARs -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-jar-plugin</artifactId>
				<configuration>
					<archive>
						<manifest>
							<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
						</manifest>
						<manifestEntries>
							<Implementation-Version>${sdh.buildNumber}</Implementation-Version>
						</manifestEntries>
						<manifestSections>
							<manifestSection>
								<name>Build</name>
								<manifestEntries>
									<Build-Tag>${git.tag}</Build-Tag>
									<Build-Branch>${git.branch}</Build-Branch>
									<Build-Revision>${git.revision}</Build-Revision>
									<Build-Commit-Count>${git.commitsCount}</Build-Commit-Count>
									<Build-Date>${maven.build.timestamp}</Build-Date>
								</manifestEntries>
							</manifestSection>
						</manifestSections>
					</archive>
				</configuration>
				<executions>
					<execution>
						<id>attach-tests</id>
						<phase>package</phase>
						<goals>
							<goal>test-jar</goal>
						</goals>
						<configuration>
							<skipIfEmpty>true</skipIfEmpty>
						</configuration>
					</execution>
				</executions>
			</plugin>

			<!-- Include legal files in the sources artifact-->
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>truezip-maven-plugin</artifactId>
				<executions>
					<execution>
						<id>update-sources</id>
						<goals>
							<goal>copy</goal>
						</goals>
						<phase>package</phase>
						<configuration>
							<verbose>true</verbose>
							<fileset>
								<directory>${config.dir}${file.separator}legal</directory>
								<includes>
									<include>LICENSE</include>
									<include>NOTICE</include>
								</includes>
								<outputDirectory>${src.archive}</outputDirectory>
							</fileset>
						</configuration>
					</execution>
				</executions>
			</plugin>

			<!-- Enable on-demand release management -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-release-plugin</artifactId>
				<configuration>
					<username>${scm.username}</username>
					<password>${scm.password}</password>
					<resume>false</resume>
				</configuration>
			</plugin>

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-install-plugin</artifactId>
				<configuration>
					<createChecksum>true</createChecksum>
				</configuration>
			</plugin>

			<!-- ===================== -->
			<!-- Other utility plugins -->
			<!-- ===================== -->

			<!--
				Using the scm:bootstrap a project can be build from a fresh copy
				of the source in the scm repository.
			-->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-scm-plugin</artifactId>
				<configuration>
					<goals>install</goals>
				</configuration>
			</plugin>

			<!-- Include legal files in the binary artifacts -->
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>build-helper-maven-plugin</artifactId>
				<executions>
					<execution>
						<id>install-legal-files</id>
						<phase>generate-resources</phase>
						<goals>
							<goal>add-resource</goal>
						</goals>
						<configuration>
							<resources>
								<resource>
									<directory>${config.dir}${file.separator}legal</directory>
									<filtering>true</filtering>
									<includes>
										<include>NOTICE</include>
										<include>LICENSE</include>
									</includes>
								</resource>
							</resources>
						</configuration>
					</execution>
					<execution>
						<id>install-test-legal-files</id>
						<phase>generate-resources</phase>
						<goals>
							<goal>add-resource</goal>
						</goals>
						<configuration>
							<resources>
								<resource>
									<directory>${config.dir}${file.separator}legal</directory>
									<filtering>true</filtering>
									<includes>
										<include>NOTICE</include>
										<include>LICENSE</include>
									</includes>
								</resource>
							</resources>
						</configuration>
					</execution>
					<execution>
						<id>timestamp-property</id>
						<phase>process-sources</phase>
						<goals>
							<goal>timestamp-property</goal>
						</goals>
						<configuration>
							<name>currentYear</name>
							<pattern>yyyy</pattern>
							<units>year</units>
						</configuration>
					</execution>
				</executions>
			</plugin>

			<!-- License maintenance -->
			<plugin>
				<groupId>com.mycila</groupId>
				<artifactId>license-maven-plugin</artifactId>
				<configuration>
					<header>${config.dir}${file.separator}legal${file.separator}header.txt</header>
					<aggregate>true</aggregate>
					<mapping>
						<rdf>XML_STYLE</rdf>
						<owl>XML_STYLE</owl>
						<sparql>SCRIPT_STYLE</sparql>
						<xslt>XML_STYLE</xslt>
						<cfg>SCRIPT_STYLE</cfg>
						<ttl>SCRIPT_STYLE</ttl>
						<cmd>CMD_STYLE</cmd>
						<xjb>XML_STYLE</xjb>
						<cat>XML_STYLE</cat>
					</mapping>
					<includes>
						<include>pom.xml</include>
						<include>**/pom.xml</include>
						<include>src/**</include>
						<include>target/generated-sources/**</include>
					</includes>
					<excludes>
						<exclude>target/**</exclude>
						<exclude>**/*.bak</exclude>
					</excludes>
					<useDefaultExcludes>true</useDefaultExcludes>
					<encoding>${source.encoding}</encoding>
					<strictCheck>true</strictCheck>
					<properties>
						<url>${license.project.url}</url>
						<duration>${license.project.duration}</duration>
						<owner>${license.project.owner}</owner>
						<project>${license.project.name}</project>
						<inceptionYear>${license.project.inceptionYear}</inceptionYear>
						<organizationUrl>${license.organization.url}</organizationUrl>
						<organizationName>${license.organization.name}</organizationName>
						<bundle>${license.bundle}</bundle>
						<artifact>${license.artifact}</artifact>
					</properties>
					<headerDefinitions>
						<headerDefinition>${config.dir}${file.separator}legal${file.separator}cmd_header.xml</headerDefinition>
					</headerDefinitions>
				</configuration>
				<executions>
					<execution>
						<id>update-licenses</id>
						<phase>process-sources</phase>
						<goals>
							<goal>format</goal>
						</goals>
					</execution>
					<execution>
						<id>check-licenses</id>
						<phase>verify</phase>
						<goals>
							<goal>check</goal>
						</goals>
					</execution>
				</executions>
			</plugin>

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-javadoc-plugin</artifactId>
				<configuration>
					<show>public</show>
					<nohelp>false</nohelp>
					<keywords>true</keywords>
					<bottom><![CDATA[<br/>Copyright (C) ${license.project.duration}, <a href="${project.organization.url}">${project.organization.name}<a>]]></bottom>
					<windowtitle>${license.project.name} ${project.version}</windowtitle>
					<sourcetab>2</sourcetab>
					<quiet>true</quiet>
				</configuration>
				<executions>
					<execution>
						<id>attach-javadocs</id>
						<goals>
							<goal>jar</goal>
						</goals>
					</execution>
				</executions>
			</plugin>

			<!-- Enforce at least Java  1.7 compliance -->
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>animal-sniffer-maven-plugin</artifactId>
				<executions>
					<execution>
						<id>signature-check</id>
						<phase>verify</phase>
						<goals>
							<goal>check</goal>
						</goals>
						<configuration>
							<signature>
								<groupId>org.codehaus.mojo.signature</groupId>
								<artifactId>java17</artifactId>
								<version>1.0</version>
							</signature>
						</configuration>
					</execution>
				</executions>
			</plugin>

			<!-- ===================== -->
			<!-- Testing plugins       -->
			<!-- ===================== -->

			<plugin>
				<groupId>org.jacoco</groupId>
				<artifactId>jacoco-maven-plugin</artifactId>
				<configuration>
					<append>true</append>
				</configuration>
				<executions>
					<execution>
						<id>default-prepare-agent</id>
						<phase>initialize</phase>
						<goals>
							<goal>prepare-agent</goal>
						</goals>
						<configuration>
							<includes>
								<include>${jacoco.config.includes}</include>
							</includes>
							<destFile>${sonar.jacoco.reportPath}</destFile>
							<propertyName>jacoco.agent.ut.arg</propertyName>
						</configuration>
					</execution>
					<execution>
						<id>default-prepare-agent-integration</id>
						<phase>initialize</phase>
						<goals>
							<goal>prepare-agent-integration</goal>
						</goals>
						<configuration>
							<includes>
								<include>${jacoco.config.includes}</include>
							</includes>
							<destFile>${sonar.jacoco.itReportPath}</destFile>
							<propertyName>jacoco.agent.it.arg</propertyName>
						</configuration>
					</execution>
					<execution>
						<id>default-report</id>
						<phase>verify</phase>
						<goals>
							<goal>report</goal>
						</goals>
						<configuration>
							<dataFile>${sonar.jacoco.reportPath}</dataFile>
						</configuration>
					</execution>
					<execution>
						<id>default-report-integration</id>
						<phase>verify</phase>
						<goals>
							<goal>report-integration</goal>
						</goals>
						<configuration>
							<dataFile>${sonar.jacoco.itReportPath}</dataFile>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-surefire-plugin</artifactId>
				<dependencies>
					<dependency>
						<groupId>org.jacoco</groupId>
						<artifactId>org.jacoco.agent</artifactId>
						<version>${jacoco.version}</version>
						<classifier>runtime</classifier>
					</dependency>
				</dependencies>
				<executions>
					<execution>
						<id>default-test</id>
						<goals>
							<goal>test</goal>
						</goals>
						<configuration>
							<excludes>
								<exclude>**/*IT.java</exclude>
								<exclude>**/*ITest.java</exclude>
							</excludes>
							<argLine>${surefire.arg.line} ${jacoco.agent.ut.arg}</argLine>
							<properties>
								<property>
									<name>listener</name>
									<value>org.sonar.java.jacoco.JUnitListener</value>
								</property>
							</properties>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-failsafe-plugin</artifactId>
				<executions>
					<execution>
						<id>integration-test-execution</id>
						<phase>integration-test</phase>
						<goals>
							<goal>integration-test</goal>
						</goals>
						<configuration>
							<includes>
								<include>**/*IT.java</include>
								<include>**/*ITest.java</include>
							</includes>
							<printSummary>true</printSummary>
							<reportFormat>plain</reportFormat>
							<failIfNoSpecifiedTests>false</failIfNoSpecifiedTests>
							<failIfNoTests>false</failIfNoTests>
							<argLine>${failsafe.arg.line} ${jacoco.agent.it.arg}</argLine>
							<properties>
								<property>
									<name>listener</name>
									<value>org.sonar.java.jacoco.JUnitListener</value>
								</property>
							</properties>
						</configuration>
					</execution>
					<execution>
						<id>integration-test-verification</id>
						<phase>verify</phase>
						<goals>
							<goal>verify</goal>
						</goals>
						<configuration>
							<includes>
								<include>**/*IT.java</include>
								<include>**/*ITest.java</include>
							</includes>
							<failIfNoTests>false</failIfNoTests>
						</configuration>
					</execution>
				</executions>
			</plugin>
		</plugins>

	</build>

	<dependencies>
		<dependency>
			<groupId>org.codehaus.sonar-plugins.java</groupId>
			<artifactId>sonar-jacoco-listeners</artifactId>
			<version>${sonar.java.plugin.version}</version>
			<scope>test</scope>
		</dependency>
	</dependencies>

	<!-- =================================================================== -->
	<!--   REPORTING SETTINGS                                                -->
	<!-- =================================================================== -->

	<reporting>
		<plugins>
			<!-- Enable report addition -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-project-info-reports-plugin</artifactId>
				<version>${maven.project.info.reports.plugin.version}</version>
			</plugin>

			<!-- Include browsable source code -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-jxr-plugin</artifactId>
				<version>${maven.jxr.plugin.version}</version>
				<configuration>
					<windowTitle>${license.project.name} ${project.version} Reference</windowTitle>
					<excludes>
						<exclude>**/*Accessor.java</exclude>
						<exclude>**/*AccessorImpl.java</exclude>
					</excludes>
					<bottom><![CDATA[<br/>Copyright (C) ${license.project.duration}, <a href="${project.organization.url}">${project.organization.name}<a>]]></bottom>
				</configuration>
			</plugin>

			<!-- Include JavaDoc -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-javadoc-plugin</artifactId>
				<version>${maven.javadoc.plugin.version}</version>
				<configuration>
					<show>public</show>
					<nohelp>false</nohelp>
					<bottom><![CDATA[<br/>Copyright (C) ${license.project.duration}, <a href="${project.organization.url}">${project.organization.name}<a>]]></bottom>
					<windowtitle>${license.project.name} ${project.version}</windowtitle>
					<level>protected</level>
				</configuration>
				<reportSets>
					<reportSet>
						<id>default</id>
						<reports>
							<report>javadoc</report>
						</reports>
					</reportSet>
					<reportSet>
						<id>aggregate</id>
						<reports>
							<report>aggregate</report>
						</reports>
					</reportSet>
					<reportSet>
						<id>test-default</id>
						<reports>
							<report>test-javadoc</report>
						</reports>
					</reportSet>
					<reportSet>
						<id>test-aggregate</id>
						<reports>
							<report>test-aggregate</report>
						</reports>
					</reportSet>
				</reportSets>
			</plugin>

			<!-- Include PMD Report -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-pmd-plugin</artifactId>
				<version>${maven.pmd.plugin.version}</version>
				<configuration>
					<linkXref>true</linkXref>
					<sourceEncoding>utf-8</sourceEncoding>
					<rulesets>
						<ruleset>${config.dir}${file.separator}quality${file.separator}pmd.xml</ruleset>
					</rulesets>
				</configuration>
			</plugin>

			<!-- Include FindBugs Report -->
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>findbugs-maven-plugin</artifactId>
				<version>${findbugs.maven.plugin.version}</version>
				<configuration>
					<effort>Max</effort>
					<threshold>Low</threshold>
					<xmlOutput>true</xmlOutput>
				</configuration>
			</plugin>

			<!-- Include Checkstyle Report -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-checkstyle-plugin</artifactId>
				<version>${maven.checkstyle.plugin.version}</version>
				<configuration>
					<configLocation>${config.dir}${file.separator}quality${file.separator}checkstyle.xml</configLocation>
				</configuration>
				<reportSets>
					<reportSet>
						<reports>
							<report>checkstyle</report>
						</reports>
					</reportSet>
				</reportSets>
			</plugin>

			<!-- Include tag lists -->
			<!-- TODO: Check if we  can make it check other files, i.e., XML -->
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>taglist-maven-plugin</artifactId>
				<version>${taglist.maven.plugin.version}</version>
				<configuration>
					<encoding>UTF-8</encoding>
					<sourceFileLocale>en</sourceFileLocale>
					<emptyComments>false</emptyComments>
					<tagListOptions>
						<tagClasses>
							<tagClass>
								<displayName>Todo Work</displayName>
								<tags>
									<tag>
										<matchString>todo</matchString>
										<matchType>ignoreCase</matchType>
									</tag>
									<tag>
										<matchString>FIXME</matchString>
										<matchType>exact</matchType>
									</tag>
								</tags>
							</tagClass>
						</tagClasses>
					</tagListOptions>
				</configuration>
			</plugin>

			<!-- Include Testing Report -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-surefire-report-plugin</artifactId>
				<version>${maven.surefire.plugin.version}</version>
				<reportSets>
					<reportSet>
						<id>unit-testing-report</id>
						<configuration>
							<reportsDirectories>
								<reportsDirectory>${project.build.directory}/surefire-reports</reportsDirectory>
							</reportsDirectories>
						</configuration>
						<reports>
							<report>report-only</report>
						</reports>
					</reportSet>
					<reportSet>
						<id>integration-testing-report</id>
						<configuration>
							<reportsDirectories>
								<reportsDirectory>${project.build.directory}/failsafe-reports</reportsDirectory>
							</reportsDirectories>
						</configuration>
						<reports>
							<report>failsafe-report-only</report>
						</reports>
					</reportSet>
				</reportSets>
			</plugin>

			<!-- Include Codecoverage Peport -->
			<plugin>
				<groupId>org.jacoco</groupId>
				<artifactId>jacoco-maven-plugin</artifactId>
				<version>${jacoco.maven.plugin.version}</version>
				<configuration>
					<dataFile>${sonar.jacoco.reportPath}</dataFile>
				</configuration>
			</plugin>
		</plugins>
	</reporting>

</project>