<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">
	<!-- <parent> <groupId>org.sonatype.oss</groupId> <artifactId>oss-parent</artifactId> <version>9</version> </parent> -->
	<modelVersion>4.0.0</modelVersion>
	<groupId>net.osgiliath</groupId>
	<artifactId>net.osgiliath.parent</artifactId>
	<version>0.2.3</version>
	<packaging>pom</packaging>
	<prerequisites>
		<maven>2.2.1</maven>
	</prerequisites>
	<name>Pom Osgiliath framework</name>
	<url>http://osgiliathenterprise.github.io/projects.documentations/products/osgiliath-enterprise-framework/</url>
	<description>
	This is the parent pom for the entire Osgiliath framework.
	It contains dependencies definitions, features and helpers, archetypes, as well as a reference sample
	</description>
	<ciManagement>
		<system>Jenkins</system>
		<url>https://build.osgiliath.net</url>
	</ciManagement>
	<issueManagement>
		<system>Redmine</system>
		<url>https://issues.osgiliath.net/</url>
	</issueManagement>
	<inceptionYear>2013</inceptionYear>
	<licenses>
		<license>
			<name>Apache Licence 2.0</name>
			<distribution>repo</distribution>
			<url>http://www.apache.org/licenses/LICENSE-2.0.html</url>
		</license>
	</licenses>
	<developers>
		<developer>
			<id>cmordant</id>
			<name>Charlie mordant</name>
			<organization>Osgiliath.net</organization>
			<organizationUrl>https://blog.osgiliath.net</organizationUrl>
			<roles>
				<role>Architect</role>
			</roles>
		</developer>
	</developers>
	<mailingLists>
		<mailingList>
			<name>Osgiliath Enterprise framework developer discussion list</name>
			<subscribe>osgiliath-enterprise-framework+subscribe@googlegroups.com</subscribe>
			<unsubscribe>osgiliath-enterprise-framework+unsubscribe@googlegroups.com</unsubscribe>
			<post>osgiliath-enterprise-framework@googlegroups.com</post>
			<archive>https://groups.google.com/forum/#!forum/osgiliath-enterprise-framework</archive>
		</mailingList>
	</mailingLists>
	<modules>
		<module>net.osgiliath.poms</module>
		<module>net.osgiliath.archetypes</module>
		<module>net.osgiliath.framework</module>
		<module>net.osgiliath.samples</module>
	</modules>
	
	<reporting>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-javadoc-plugin</artifactId>
				<configuration>
					<minmemory>128m</minmemory>
					<maxmemory>1024m</maxmemory>
				</configuration>
				<reportSets>
					<reportSet>
						<id>aggregated</id>
						<inherited>false</inherited>
						<reports>
							<report>aggregate</report>
						</reports>
					</reportSet>
				</reportSets>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-jxr-plugin</artifactId>
				<reportSets>
					<reportSet>
						<id>jxr-aggregate</id>
						<inherited>false</inherited>
						<reports>
							<report>aggregate</report>
							<report>test-aggregate</report>
						</reports>
					</reportSet>
				</reportSets>
			</plugin>
		</plugins>
	</reporting>
	<!-- <distributionManagement> Distribution des artefacts compilés Rajoutez ceci dans votre fichier ~.m2/settings.xml <servers> <server> <id>releases</id> <username>username</username> <password>password</password> </server> <server> <id>snapshots</id> 
		<username>username</username> <password>password</password> </server> </servers> <repository> <id>releases</id> <name>Nexus Releases public</name> <url>http://dist.osgiliath.net/nexus/content/repositories/releases</url> </repository> <snapshotRepository> 
		<id>snapshots</id> <name>Nexus Snapshots public</name> <url>http://dist.osgiliath.net/nexus/content/repositories/snapshots</url> </snapshotRepository> <site> <id>Osgiliath</id> <name>Osgiliath</name> <url>http://blog.osgiliath.net/</url> </site> </distributionManagement> -->
	<scm>
		<connection>scm:git:git@github.com:OsgiliathEnterprise/net.osgiliath.parent.git</connection>
		<developerConnection>scm:git:git@github.com:OsgiliathEnterprise/net.osgiliath.parent.git</developerConnection>
		<url>https://github.com/OsgiliathEnterprise/net.osgiliath.parent</url>
		<tag>net.osgiliath.parent-0.2.3</tag>
	</scm>
	<distributionManagement>
		<snapshotRepository>
			<id>snapshots</id>
			<name>Osgiliath Snapshots public</name>
			<url>https://dist.osgiliath.net/nexus/content/repositories/snapshots</url>
		</snapshotRepository>
		<repository>
			<id>releases</id>
			<name>Sonatype OSS Nexus Release Repository</name>
			<url>https://oss.sonatype.org/</url>
		</repository>
		<site>
			<id>github-pages</id>
			<name>Github GH Pages</name>
			<url>scm:git:git@github.com:OsgiliathEnterprise/net.osgiliath.parent.git</url>
		</site>
	</distributionManagement>

	<properties>
		<apache-rat-plugin.version>0.11</apache-rat-plugin.version>
		<parentPropertiesFile>build.properties</parentPropertiesFile>
		<com.github.downloads-maven-plugin.version>0.6</com.github.downloads-maven-plugin.version>
		<doxia-module-markdown.version>1.6</doxia-module-markdown.version>
		<github.global.server>github</github.global.server>
		<maven-jxr-plugin.version>2.5</maven-jxr-plugin.version>
		<license-maven-plugin.version>1.7</license-maven-plugin.version>
		<maven-antrun-plugin.version>1.7</maven-antrun-plugin.version>
		<maven.compiler.source>1.8</maven.compiler.source>
		<maven.compiler.target>1.8</maven.compiler.target>
		<maven-enforcer-plugin.version>1.2</maven-enforcer-plugin.version>
		<maven-gpg-plugin.version>1.5</maven-gpg-plugin.version>
		<maven-javadoc-plugin.version>2.10.1</maven-javadoc-plugin.version>
		<maven-release-plugin.version>2.5.2</maven-release-plugin.version>
		<maven-source-plugin.version>2.4</maven-source-plugin.version>
		<nexus-staging-maven-plugin.version>1.6.5</nexus-staging-maven-plugin.version>
		<org.apache.maven.plugins_maven-scm-publish-plugin.version>1.1</org.apache.maven.plugins_maven-scm-publish-plugin.version>
		<org.apache.maven.plugins_maven-site-plugin.version>3.4</org.apache.maven.plugins_maven-site-plugin.version>
		<org.apache.maven.wagon_wagon-scm.version>2.7</org.apache.maven.wagon_wagon-scm.version>
		<org.codehaus.gmavenplus_gmavenplus-plugin.version>1.2</org.codehaus.gmavenplus_gmavenplus-plugin.version>
		<org.codehaus.groovy_groovy-all.version>2.3.7</org.codehaus.groovy_groovy-all.version>
		<org.codehaus.mojo_properties-maven-plugin.version>1.0-alpha-2</org.codehaus.mojo_properties-maven-plugin.version>
		<org.kohsuke_pgp-maven-plugin.version>1.1</org.kohsuke_pgp-maven-plugin.version>
		<encoding>UTF-8</encoding>
		<project.reporting.outputEncoding>${encoding}</project.reporting.outputEncoding>
		<project.build.sourceEncoding>${encoding}</project.build.sourceEncoding>
		<project.license>apache_v2</project.license>
		<sonar.java.coveragePlugin>jacoco</sonar.java.coveragePlugin>
		<sonar.jacoco.reportPath>${parent.path}/target/jacoco.exec</sonar.jacoco.reportPath>
		<sonar.jacoco.itReportPath>${parent.path}/target/jacoco-it.exec</sonar.jacoco.itReportPath>
		<sonar-maven-plugin.version>2.6</sonar-maven-plugin.version>
		
		<maven-scm.version>1.9.1</maven-scm.version>
		<site.deploy.dir>/tmp/deploy</site.deploy.dir>
	</properties>
	<profiles>
		<profile>
			<id>fill-parent-path-property</id>
			<activation>
				<file>
					<exists>${parentPropertiesFile}</exists>
				</file>
			</activation>
			<build>
				<plugins>
					<plugin>
						<groupId>org.codehaus.gmavenplus</groupId>
						<artifactId>gmavenplus-plugin</artifactId>
						<executions>
							<execution>
								<id>fill-parent-property-file</id>
								<goals>
									<goal>execute</goal>
								</goals>
								<phase>validate</phase>
								<configuration>
									<properties>
										<property>
											<name>parentPropertiesFile</name>
											<value>${parentPropertiesFile}</value>
										</property>
										<property>
											<name>appArtifactId</name>
											<value>${project.artifactId}</value>
										</property>
									</properties>
									<scripts>
										<script> 
									<![CDATA[ 
										import java.io.*;
										String filename = parentPropertiesFile
										File propertyFile = new File(filename)
										if (propertyFile.exists()) {
										try{
											FileWriter fstream = new FileWriter(propertyFile.getAbsolutePath())
											BufferedWriter out = new BufferedWriter(fstream)
											String parentPath = propertyFile.getAbsolutePath().substring(0, propertyFile.getAbsolutePath().lastIndexOf(File.separator))
											if (File.separator != "/") {
												parentPath = parentPath.replace(File.separator,File.separator+File.separator)
											}
											out.write("parent.path = " + parentPath)
											out.close()
										}catch (Exception e){
											e.printStackTrace()
										}
									}
								]]>
										</script>
									</scripts>
								</configuration>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
		<profile>
			<id>readme-md-to-site</id>
			<activation>
				<file>
					<exists>readme.md</exists>
				</file>
			</activation>
			<build>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-antrun-plugin</artifactId>
						<executions>
							<execution>
								<id>copy-readme-dir</id>
								<phase>pre-site</phase>
								<configuration>
									<tasks>
										<mkdir dir="src/site/markdown" />
										<copy file="readme.md" tofile="src/site/markdown/readme.md" overwrite="true" />
									</tasks>
								</configuration>
								<goals>
									<goal>run</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
					<plugin>
						<groupId>org.codehaus.gmavenplus</groupId>
						<artifactId>gmavenplus-plugin</artifactId>
						<executions>
							<execution>
								<id>copy-site-xml</id>
								<goals>
									<goal>execute</goal>
								</goals>
								<phase>pre-site</phase>
								<configuration>
									<scripts>
										<script> <![CDATA[ 
								import java.io.BufferedWriter
								import java.io.File
								import java.nio.charset.Charset
								import java.nio.file.StandardCopyOption
								import java.nio.file.Files
								import java.nio.file.StandardOpenOption
								String siteXmlPath = "src/site/site.xml"
								String readme_file = "readme.md"
								String currentPath = "${project.basedir}"
								if (new File(currentPath + "/" + readme_file).exists() && !(new File(currentPath + "/" + siteXmlPath).exists())) { 
									while (!(new File(currentPath + "/" + siteXmlPath).exists())) {
										currentPath = currentPath + "/.." 
										if (new File(currentPath + "/" + siteXmlPath).exists()) { 
											Files.copy(new File(currentPath + "/" + siteXmlPath).toPath(), new File("${project.basedir}/" + siteXmlPath).toPath(), StandardCopyOption.REPLACE_EXISTING)
											File newlyCreatedFile = new File("${project.basedir}/" + siteXmlPath)
											BufferedWriter newFileWriter = Files.newBufferedWriter(newlyCreatedFile.toPath(), Charset.defaultCharset(), StandardOpenOption.APPEND)
											newFileWriter.append("<!-- @generated -->")
											newFileWriter.close() 
										} else if (!(new File(currentPath + "/pom.xml").exists())) { break; } 
									} 
								} ]]>
										</script>
									</scripts>
								</configuration>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
		<profile>
			<id>release</id>
			<build>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-source-plugin</artifactId>
						<executions>
							<execution>
								<id>attach-sources</id>
								<goals>
									<goal>jar</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-javadoc-plugin</artifactId>
						<executions>
							<execution>
								<id>attach-javadocs</id>
								<goals>
									<goal>jar</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
					<plugin>
						<groupId>org.kohsuke</groupId>
						<artifactId>pgp-maven-plugin</artifactId>
						<executions>
							<execution>
								<id>sign-artifacts</id>
								<phase>verify</phase>
								<goals>
									<goal>sign</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
		<profile>
			<id>nexus-pro</id>
			<build>
				<plugins>
					<plugin>
						<groupId>org.sonatype.plugins</groupId>
						<artifactId>nexus-staging-maven-plugin</artifactId>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>
	<build>
		<defaultGoal>install</defaultGoal>
		<extensions>
			<extension>
				<groupId>org.apache.maven.wagon</groupId>
				<artifactId>wagon-scm</artifactId>
				<version>${org.apache.maven.wagon_wagon-scm.version}</version>
			</extension>
			<extension>
				<groupId>org.apache.maven.scm</groupId>
				<artifactId>maven-scm-manager-plexus</artifactId>
				<version>${maven-scm.version}</version>
			</extension>
			<extension>
				<groupId>org.apache.maven.scm</groupId>
				<artifactId>maven-scm-provider-gitexe</artifactId>
				<version>${maven-scm.version}</version>
			</extension>
		</extensions>
		<pluginManagement>
			<plugins>
				<plugin>
					<groupId>com.github.github</groupId>
					<artifactId>downloads-maven-plugin</artifactId>
					<version>${com.github.downloads-maven-plugin.version}</version>
					<configuration>
						<description>${project.version} release of ${project.name}</description>
						<override>true</override>
						<includeAttached>true</includeAttached>
					</configuration>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-antrun-plugin</artifactId>
					<version>${maven-antrun-plugin.version}</version>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-enforcer-plugin</artifactId>
					<version>${maven-enforcer-plugin.version}</version>
					<executions>
						<execution>
							<id>enforce-maven</id>
							<goals>
								<goal>enforce</goal>
							</goals>
							<configuration>
								<rules>
									<requireMavenVersion>
										<version>(,2.1.0),(2.1.0,2.2.0),(2.2.0,)</version>
										<message>Maven 2.1.0 and 2.2.0 produce incorrect GPG
											signatures
											and checksums respectively.</message>
									</requireMavenVersion>
								</rules>
							</configuration>
						</execution>
					</executions>
				</plugin>
				<plugin>
					<groupId>org.codehaus.gmavenplus</groupId>
					<artifactId>gmavenplus-plugin</artifactId>
					<version>${org.codehaus.gmavenplus_gmavenplus-plugin.version}</version>
					<dependencies>
						<dependency>
							<groupId>org.codehaus.groovy</groupId>
							<artifactId>groovy-all</artifactId>
							<version>${org.codehaus.groovy_groovy-all.version}</version>
							<scope>runtime</scope>
						</dependency>
					</dependencies>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-gpg-plugin</artifactId>
					<version>${maven-gpg-plugin.version}</version>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-javadoc-plugin</artifactId>
					<version>${maven-javadoc-plugin.version}</version>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-jxr-plugin</artifactId>
					<version>${maven-jxr-plugin.version}</version>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-release-plugin</artifactId>
					<version>${maven-release-plugin.version}</version>
					<configuration>
						<mavenExecutorId>forked-path</mavenExecutorId>
						<releaseProfiles>release</releaseProfiles>
						<useReleaseProfile>false</useReleaseProfile>
						<checkModificationExcludes>
							<checkModificationExclude>build.properties</checkModificationExclude>
						</checkModificationExcludes>
					</configuration>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-scm-publish-plugin</artifactId>
					<version>${org.apache.maven.plugins_maven-scm-publish-plugin.version}</version>
					<configuration>
						<scmBranch>gh-pages</scmBranch>
					</configuration>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-site-plugin</artifactId>
					<version>${org.apache.maven.plugins_maven-site-plugin.version}</version>
					<configuration>
						<skipDeploy>true</skipDeploy>
						<inputEncoding>${encoding}</inputEncoding>
						<outputEncoding>${encoding}</outputEncoding>
					</configuration>
					<executions>
						<execution>
							<id>attach-descriptor</id>
							<goals>
								<goal>attach-descriptor</goal>
							</goals>
						</execution>
					</executions>
					<dependencies>
						<dependency>
							<groupId>org.apache.maven.doxia</groupId>
							<artifactId>doxia-module-markdown</artifactId>
							<version>${doxia-module-markdown.version}</version>
						</dependency>
					</dependencies>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-source-plugin</artifactId>
					<version>${maven-source-plugin.version}</version>
				</plugin>
				<plugin>
					<groupId>org.apache.rat</groupId>
					<artifactId>apache-rat-plugin</artifactId>
					<version>${apache-rat-plugin.version}</version>
					<configuration>
						<excludeSubProjects>false</excludeSubProjects>
						<excludes combine.children="append">
							<exclude>**/README</exclude>
							<exclude>**/README.txt</exclude>
							<exclude>**/readme.md</exclude>
							<exclude>**/README.md</exclude>
							<exclude>**/resources/**/*.xsd</exclude>
							<exclude>**/node_modules/**/*</exclude>
							<exclude>**/bower_components/**/*</exclude>
							<exclude>**/test/resources/**/*</exclude>
							<exclude>**/.gitignore</exclude>
							<exclude>**/.git/**/*</exclude>
							<exclude>**/target/**/*</exclude>
							<exclude>**/eclipse-classes/**/*</exclude>
							<exclude>**/.*</exclude>
							<exclude>**/.settings/**/*</exclude>
							<exclude>**/*.iml</exclude>
							<exclude>**/.idea/**/*</exclude>
							<exclude>**/OSGI-INF/bundle.info</exclude>
						</excludes>
					</configuration>
				</plugin>
				<plugin>
					<groupId>org.codehaus.mojo</groupId>
					<artifactId>license-maven-plugin</artifactId>
					<version>${license-maven-plugin.version}</version>
					<configuration>
						<licenseName>${project.license}</licenseName>
						<excludes>
							<exclude>**/*persistence.xml</exclude>
						</excludes>
						<extraExtensions>
							<bnd>properties</bnd>
						</extraExtensions>
					</configuration>
					<executions>
						<execution>
							<id>first</id>
							<goals>
								<goal>update-file-header</goal>
							</goals>
							<phase>process-sources</phase>
						</execution>
						<execution>
							<id>second</id>
							<goals>
								<goal>update-project-license</goal>
							</goals>
							<phase>process-sources</phase>
						</execution>
					</executions>
				</plugin>
				<plugin>
					<groupId>org.codehaus.mojo</groupId>
					<artifactId>properties-maven-plugin</artifactId>
					<version>${org.codehaus.mojo_properties-maven-plugin.version}</version>
				</plugin>
				<plugin>
					<groupId>org.codehaus.mojo</groupId>
					<artifactId>sonar-maven-plugin</artifactId>
					<version>${sonar-maven-plugin.version}</version>
				</plugin>
				<plugin>
					<groupId>org.kohsuke</groupId>
					<artifactId>pgp-maven-plugin</artifactId>
					<version>${org.kohsuke_pgp-maven-plugin.version}</version>
				</plugin>
				<plugin>
					<groupId>org.sonatype.plugins</groupId>
					<artifactId>nexus-staging-maven-plugin</artifactId>
					<version>${nexus-staging-maven-plugin.version}</version>
					<extensions>true</extensions>
					<configuration>
						<serverId>releases</serverId>
						<nexusUrl>https://oss.sonatype.org/</nexusUrl>
					</configuration>
				</plugin>
			</plugins>
		</pluginManagement>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-release-plugin</artifactId>
				<dependencies>
					<dependency>
						<groupId>org.apache.maven.scm</groupId>
						<artifactId>maven-scm-provider-gitexe</artifactId>
						<version>${maven-scm.version}</version>
					</dependency>
				</dependencies>
				<configuration>
					<localCheckout>true</localCheckout>
					<pushChanges>true</pushChanges>
					<useReleaseProfile>false</useReleaseProfile>
					<preparationGoals>clean install</preparationGoals>
					<goals>deploy</goals>
					<!-- The profile we want to use when doing the release -->
					<releaseProfiles>release</releaseProfiles>
					<autoVersionSubmodules>true</autoVersionSubmodules>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-enforcer-plugin</artifactId>
			</plugin>
			<plugin>
				<groupId>org.apache.rat</groupId>
				<artifactId>apache-rat-plugin</artifactId>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-site-plugin</artifactId>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-scm-publish-plugin</artifactId>
				<executions>
					<execution>
						<id>scm-publish</id>
						<goals>
							<goal>publish-scm</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.codehaus.gmavenplus</groupId>
				<artifactId>gmavenplus-plugin</artifactId>
				<executions>
					<execution>
						<id>find-parent-property-file</id>
						<goals>
							<goal>execute</goal>
						</goals>
						<phase>initialize</phase>
						<configuration>
							<properties>
								<property>
									<name>parentPropertiesFile</name>
									<value>${parentPropertiesFile}</value>
								</property>
							</properties>
							<scripts>
								<script>
									<![CDATA[ 
										import java.io.*;
										String filename = parentPropertiesFile;
										File file = new File((String)filename);
										String ret = "../";
										while (!file.exists()) {
											file = new File(ret + filename);
											ret+= "../";
										}
										project.properties['property-maven-plugin-file-path'] = file.getAbsolutePath();
									]]>
								</script>
							</scripts>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>properties-maven-plugin</artifactId>
				<executions>
					<execution>
						<phase>initialize</phase>
						<goals>
							<goal>read-project-properties</goal>
						</goals>
						<configuration>
							<files>
								<file>${property-maven-plugin-file-path}</file>
							</files>
						</configuration>
					</execution>
				</executions>
			</plugin>
				<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>sonar-maven-plugin</artifactId>
			</plugin>
		
		</plugins>
	</build>
</project>
