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

	<artifactId>freelib-parent</artifactId>
	<name>FreeLibrary Parent Project</name>
	<description>A Parent POM for FreeLibrary Projects</description>
	<packaging>pom</packaging>

	<properties>
		<!-- FreeLibrary projects whose versions are managed through this parent -->
		<freelib.resources.version>${project.parent.version}</freelib.resources.version>

		<!-- Dependencies managed through this parent project -->
		<junit.version>4.12</junit.version>
		<slf4j.version>1.7.25</slf4j.version>
		<xmlunit.version>1.6</xmlunit.version>
		<groovy.version>2.4.11</groovy.version>
		<logback.version>1.2.3</logback.version>
		<pegdown.version>1.6.0</pegdown.version>
		<phantomjs.version>1.9.7</phantomjs.version>
		<ghostdriver.version>1.1.0</ghostdriver.version>

		<!-- Maven plugin dependencies managed through this parent project -->
		<maven.version>3.5.3</maven.version>
		<maven.plugin.annotations.version>3.5.1</maven.plugin.annotations.version>

		<!-- Plugins managed through/in pluginManagement section -->
		<maven.verifier.version>1.6</maven.verifier.version>
		<maven.filtering.version>3.1.1</maven.filtering.version>
		<phantomjs.plugin.version>0.4</phantomjs.plugin.version>
		<exec.maven.plugin.version>1.5.0</exec.maven.plugin.version>
		<maven.plugin.plugin.version>3.5</maven.plugin.plugin.version>
		<maven.clean.plugin.version>3.0.0</maven.clean.plugin.version>
		<maven.install.plugin.version>2.5.2</maven.install.plugin.version>
		<maven.failsafe.plugin.version>2.20</maven.failsafe.plugin.version>
		<maven.enforcer.plugin.version>1.4.1</maven.enforcer.plugin.version>
		<maven.javadoc.plugin.version>2.10.4</maven.javadoc.plugin.version>
		<maven.surefire.plugin.version>2.20</maven.surefire.plugin.version>
		<maven.resources.plugin.version>3.0.2</maven.resources.plugin.version>
		<maven.dependency.plugin.version>3.0.0</maven.dependency.plugin.version>
		<build.helper.maven.plugin.version>3.0.0</build.helper.maven.plugin.version>
		<properties.maven.plugin.version>1.0.0</properties.maven.plugin.version>
		<maven.compiler.plugin.version>3.6.1</maven.compiler.plugin.version>
		<pmd.plugin.version>3.8</pmd.plugin.version>

		<!-- Configure the project's character encodings -->
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

		<!-- Default compiler settings -->
		<maven.compiler.source>1.8</maven.compiler.source>
		<maven.compiler.target>1.8</maven.compiler.target>

		<!-- Disable the default site generation; we'll use jbake instead -->
		<maven.site.skip>true</maven.site.skip>
		<jbake.outputDirectory>target/site</jbake.outputDirectory>
		<jbake.maven.plugin.version>0.0.9</jbake.maven.plugin.version>

		<!-- We want to override the skip tests directive in our parent project -->
		<maven.test.skip>false</maven.test.skip>

		<!-- Location used for finding the unpacked checkstyle-suppressions.xml 
			file -->
		<!-- It's a built-in configuration for eclipse-cs tool; make it work with 
			Maven -->
		<config_loc>${project.basedir}/src/main/tools/checkstyle</config_loc>
		<maven.checkstyle.version>3.0.0</maven.checkstyle.version>
		<checkstyle.version>8.10</checkstyle.version>

		<!-- The extension we use to push site productions up to an S3 bucket -->
		<maven.s3.wagon.version>1.2.1</maven.s3.wagon.version>

		<!-- Jacoco configuration -->
		<jacoco.dataFile>${project.build.directory}/jacoco.exec</jacoco.dataFile>
		<jacoco.maven.plugin.version>0.7.7.201606060606</jacoco.maven.plugin.version>
	</properties>

	<dependencyManagement>
		<dependencies>
			<dependency>
				<groupId>org.slf4j</groupId>
				<artifactId>slf4j-api</artifactId>
				<version>${slf4j.version}</version>
			</dependency>
			<!-- Below dependencies are only used for testing -->
			<dependency>
				<groupId>ch.qos.logback</groupId>
				<artifactId>logback-classic</artifactId>
				<version>${logback.version}</version>
				<scope>test</scope>
			</dependency>
			<dependency>
				<groupId>junit</groupId>
				<artifactId>junit</artifactId>
				<version>${junit.version}</version>
				<scope>test</scope>
			</dependency>
			<dependency>
				<groupId>xmlunit</groupId>
				<artifactId>xmlunit</artifactId>
				<version>${xmlunit.version}</version>
				<scope>test</scope>
			</dependency>
			<dependency>
				<groupId>com.github.detro.ghostdriver</groupId>
				<artifactId>phantomjsdriver</artifactId>
				<version>${ghostdriver.version}</version>
				<scope>test</scope>
			</dependency>
			<!-- Dependencies for Maven plugins -->
			<dependency>
				<groupId>org.apache.maven</groupId>
				<artifactId>maven-plugin-api</artifactId>
				<version>${maven.version}</version>
			</dependency>
			<dependency>
				<groupId>org.apache.maven.plugin-tools</groupId>
				<artifactId>maven-plugin-annotations</artifactId>
				<version>${maven.plugin.annotations.version}</version>
				<scope>provided</scope>
			</dependency>
			<dependency>
				<groupId>org.apache.maven</groupId>
				<artifactId>maven-core</artifactId>
				<version>${maven.version}</version>
			</dependency>
			<dependency>
				<groupId>org.apache.maven.shared</groupId>
				<artifactId>maven-verifier</artifactId>
				<version>${maven.verifier.version}</version>
				<scope>test</scope>
			</dependency>
		</dependencies>
	</dependencyManagement>

	<build>
		<pluginManagement>
			<plugins>
				<plugin>
					<artifactId>maven-compiler-plugin</artifactId>
					<version>${maven.compiler.plugin.version}</version>
					<configuration>
						<source>${maven.compiler.source}</source>
						<target>${maven.compiler.target}</target>
						<generatedSourcesDirectory>${project.basedir}/src/main/generated</generatedSourcesDirectory>
						<generatedTestSourcesDirectory>${project.basedir}/src/main/generated</generatedTestSourcesDirectory>
					</configuration>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-pmd-plugin</artifactId>
					<version>${pmd.plugin.version}</version>
					<configuration>
						<linkXRef>false</linkXRef>
						<rulesets>
							<ruleset>${project.basedir}/src/main/tools/pmd/pmd-rules.xml</ruleset>
						</rulesets>
						<targetJdk>1.8</targetJdk>
					</configuration>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-install-plugin</artifactId>
					<version>${maven.install.plugin.version}</version>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-plugin-plugin</artifactId>
					<version>${maven.plugin.plugin.version}</version>
				</plugin>
				<plugin>
					<groupId>org.codehaus.mojo</groupId>
					<artifactId>properties-maven-plugin</artifactId>
					<version>${properties.maven.plugin.version}</version>
				</plugin>
				<!-- Installs PhantomJS so it doesn't have to be pre-installed -->
				<plugin>
					<groupId>com.github.klieber</groupId>
					<artifactId>phantomjs-maven-plugin</artifactId>
					<version>${phantomjs.plugin.version}</version>
					<executions>
						<execution>
							<goals>
								<goal>install</goal>
							</goals>
						</execution>
					</executions>
					<configuration>
						<version>${phantomjs.version}</version>
					</configuration>
				</plugin>
				<plugin>
					<groupId>org.codehaus.mojo</groupId>
					<artifactId>build-helper-maven-plugin</artifactId>
					<version>${build.helper.maven.plugin.version}</version>
					<configuration>
						<portNames>
							<portName>http.port</portName>
							<portName>http.port.stop</portName>
						</portNames>
					</configuration>
					<executions>
						<execution>
							<id>reserve-port</id>
							<phase>initialize</phase>
							<goals>
								<goal>reserve-network-port</goal>
							</goals>
						</execution>
					</executions>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-dependency-plugin</artifactId>
					<version>${maven.dependency.plugin.version}</version>
					<executions>
						<execution>
							<id>unpack-build-resources</id>
							<phase>generate-resources</phase>
							<goals>
								<goal>unpack</goal>
							</goals>
							<configuration>
								<artifactItems>
									<artifactItem>
										<groupId>info.freelibrary</groupId>
										<artifactId>freelib-resources</artifactId>
										<version>${freelib.resources.version}</version>
										<type>jar</type>
										<includes>eclipse/**/*,checkstyle/**/*,pmd/**/*</includes>
										<outputDirectory>${basedir}/target/build-resources</outputDirectory>
									</artifactItem>
								</artifactItems>
							</configuration>
						</execution>
						<execution>
							<id>unpack-site-resources</id>
							<phase>pre-site</phase>
							<goals>
								<goal>unpack</goal>
							</goals>
							<configuration>
								<artifactItems>
									<artifactItem>
										<groupId>info.freelibrary</groupId>
										<artifactId>freelib-resources</artifactId>
										<version>${freelib.resources.version}</version>
										<type>jar</type>
										<includes>jbake/**/*</includes>
										<outputDirectory>${basedir}/target</outputDirectory>
									</artifactItem>
								</artifactItems>
							</configuration>
						</execution>
					</executions>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-resources-plugin</artifactId>
					<version>${maven.resources.plugin.version}</version>
					<dependencies>
						<dependency>
							<groupId>org.apache.maven.shared</groupId>
							<artifactId>maven-filtering</artifactId>
							<version>${maven.filtering.version}</version>
						</dependency>
					</dependencies>
					<executions>
						<execution>
							<id>copy-build-resources</id>
							<phase>process-resources</phase>
							<goals>
								<goal>copy-resources</goal>
							</goals>
							<configuration>
								<outputDirectory>${basedir}/src/main/tools</outputDirectory>
								<resources>
									<resource>
										<directory>${basedir}/target/build-resources</directory>
										<filtering>true</filtering>
									</resource>
								</resources>
							</configuration>
						</execution>
						<execution>
							<id>copy-site-resources</id>
							<phase>pre-site</phase>
							<goals>
								<goal>copy-resources</goal>
							</goals>
							<configuration>
								<outputDirectory>${basedir}/target/jbake</outputDirectory>
								<resources>
									<resource>
										<directory>${basedir}/src/main/jbake</directory>
										<filtering>true</filtering>
									</resource>
								</resources>
							</configuration>
						</execution>
					</executions>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-enforcer-plugin</artifactId>
					<version>${maven.enforcer.plugin.version}</version>
					<executions>
						<execution>
							<id>enforce-no-snapshots</id>
							<goals>
								<goal>enforce</goal>
							</goals>
							<configuration>
								<failFast>true</failFast>
								<rules>
									<requireReleaseDeps>
										<onlyWhenRelease>false</onlyWhenRelease>
										<failWhenParentIsSnapshot>false</failWhenParentIsSnapshot>
										<message>
                      <![CDATA[Sorry, dependency snapshots are not allowed! To temporarily ignore this]]>
                      <![CDATA[restriction add the following to the command line: -Denforcer.skip=true]]>
										</message>
									</requireReleaseDeps>
								</rules>
								<fail>true</fail>
							</configuration>
						</execution>
						<execution>
							<id>enforce-java</id>
							<goals>
								<goal>enforce</goal>
							</goals>
							<configuration>
								<rules>
									<requireJavaVersion>
										<version>[1.8.0,)</version>
									</requireJavaVersion>
								</rules>
							</configuration>
						</execution>
						<execution>
							<id>enforce-maven</id>
							<goals>
								<goal>enforce</goal>
							</goals>
							<configuration>
								<rules>
									<requireMavenVersion>
										<version>[3.2.2,)</version>
									</requireMavenVersion>
								</rules>
							</configuration>
						</execution>
					</executions>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-checkstyle-plugin</artifactId>
					<version>${maven.checkstyle.version}</version>
					<configuration>
						<consoleOutput>true</consoleOutput>
						<logViolationsToConsole>false</logViolationsToConsole>
						<violationSeverity>warning</violationSeverity>
						<configLocation>${basedir}/src/main/tools/checkstyle/checkstyle.xml</configLocation>
					</configuration>
					<dependencies>
						<dependency>
							<groupId>com.puppycrawl.tools</groupId>
							<artifactId>checkstyle</artifactId>
							<version>${checkstyle.version}</version>
						</dependency>
					</dependencies>
					<executions>
						<execution>
							<id>checkstyle</id>
							<phase>verify</phase>
							<goals>
								<goal>check</goal>
							</goals>
						</execution>
					</executions>
				</plugin>
				<plugin>
					<artifactId>maven-javadoc-plugin</artifactId>
					<version>${maven.javadoc.plugin.version}</version>
					<dependencies>
						<dependency>
							<groupId>info.freelibrary</groupId>
							<artifactId>freelib-resources</artifactId>
							<version>${freelib.resources.version}</version>
						</dependency>
					</dependencies>
					<configuration>
						<stylesheetfile>javadocs.css</stylesheetfile>
						<nonavbar>true</nonavbar>
						<show>public</show>
						<nosince>true</nosince>
						<notimestamp>true</notimestamp>
						<bottom> </bottom>
						<detectLinks>false</detectLinks>
						<additionalJOptions>
							<additionalJOption>-J-Dhttp.agent=maven-javadoc-plugin-${project.name}</additionalJOption>
						</additionalJOptions>
						<links>
							<link>http://javadoc.io/page/io.airlift/airline/${airline.version}</link>
							<link>https://docs.oracle.com/javase/8/docs/api/</link>
						</links>
						<sourcepath>${project.basedir}/src/main/java:src/main/generated</sourcepath>
					</configuration>
					<executions>
						<execution>
							<id>site-javadocs</id>
							<phase>site</phase>
							<goals>
								<goal>javadoc</goal>
							</goals>
						</execution>
					</executions>
				</plugin>
				<plugin>
					<groupId>br.com.ingenieux</groupId>
					<artifactId>jbake-maven-plugin</artifactId>
					<version>${jbake.maven.plugin.version}</version>
					<dependencies>
						<dependency>
							<groupId>org.pegdown</groupId>
							<artifactId>pegdown</artifactId>
							<version>${pegdown.version}</version>
						</dependency>
						<dependency>
							<groupId>org.codehaus.groovy</groupId>
							<artifactId>groovy</artifactId>
							<version>${groovy.version}</version>
						</dependency>
						<dependency>
							<groupId>org.codehaus.groovy</groupId>
							<artifactId>groovy-templates</artifactId>
							<version>${groovy.version}</version>
						</dependency>
					</dependencies>
					<configuration>
						<inputDirectory>${basedir}/target/jbake</inputDirectory>
					</configuration>
					<executions>
						<execution>
							<id>site-docs</id>
							<phase>site</phase>
							<goals>
								<goal>generate</goal>
							</goals>
						</execution>
					</executions>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-surefire-plugin</artifactId>
					<version>${maven.surefire.plugin.version}</version>
					<configuration>
						<!-- Our integration tests shouldn't be run as unit tests -->
						<excludes>
							<exclude>**/*IT.java</exclude>
							<exclude>**/*IntegrationTest.java</exclude>
							<exclude>**/*FunctionalTest.java</exclude>
						</excludes>
						<forkCount>3</forkCount>
						<reuseForks>true</reuseForks>
						<argLine>-XX:MaxMetaspaceSize=512m ${jacoco.agent.arg}</argLine>
						<systemPropertyVariables>
							<http.agent>Maven</http.agent>
						</systemPropertyVariables>
						<trimStackTrace>false</trimStackTrace>
					</configuration>
				</plugin>
				<plugin>
					<groupId>org.codehaus.mojo</groupId>
					<artifactId>exec-maven-plugin</artifactId>
					<version>${exec.maven.plugin.version}</version>
					<configuration>
						<systemProperties>
							<systemProperty>
								<key>logback.configurationFile</key>
								<value>${project.basedir}/src/main/resources/logback.xml</value>
							</systemProperty>
						</systemProperties>
					</configuration>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-failsafe-plugin</artifactId>
					<version>${maven.failsafe.plugin.version}</version>
					<configuration>
						<argLine>-XX:MaxMetaspaceSize=128m ${jacoco.agent.arg}</argLine>
						<includes>
							<include>**/*IT.java</include>
							<include>**/*IntegrationTest.java</include>
						</includes>
					</configuration>
					<executions>
						<execution>
							<goals>
								<goal>integration-test</goal>
								<goal>verify</goal>
							</goals>
						</execution>
					</executions>
				</plugin>
				<plugin>
					<groupId>org.jacoco</groupId>
					<artifactId>jacoco-maven-plugin</artifactId>
					<version>${jacoco.maven.plugin.version}</version>
					<executions>
						<execution>
							<id>default-prepare-agent</id>
							<goals>
								<goal>prepare-agent</goal>
							</goals>
							<configuration>
								<destFile>${jacoco.dataFile}</destFile>
								<propertyName>jacoco.agent.arg</propertyName>
								<append>true</append>
							</configuration>
						</execution>
						<execution>
							<id>default-prepare-agent-integration</id>
							<goals>
								<goal>prepare-agent-integration</goal>
							</goals>
							<configuration>
								<destFile>${jacoco.dataFile}</destFile>
								<propertyName>jacoco.agent.arg</propertyName>
								<append>true</append>
							</configuration>
						</execution>
						<execution>
							<id>default-report</id>
							<goals>
								<goal>report</goal>
							</goals>
							<configuration>
								<dataFile>${jacoco.dataFile}</dataFile>
							</configuration>
						</execution>
					</executions>
				</plugin>
			</plugins>
		</pluginManagement>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-enforcer-plugin</artifactId>
				<version>${maven.enforcer.plugin.version}</version>
			</plugin>
		</plugins>
		<extensions>
			<extension>
				<groupId>org.kuali.maven.wagons</groupId>
				<artifactId>maven-s3-wagon</artifactId>
				<version>${maven.s3.wagon.version}</version>
			</extension>
		</extensions>
	</build>

	<!-- Profiles that should be inherited by child projects -->
	<profiles>
		<!-- The release-sign-artifacts profile allows for the publishing of project 
			artifact -->
		<profile>
			<id>release-sign-artifacts</id>
			<activation>
				<property>
					<name>performRelease</name>
					<value>true</value>
				</property>
			</activation>
			<build>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-gpg-plugin</artifactId>
						<executions>
							<execution>
								<id>sign-artifacts</id>
								<phase>verify</phase>
								<goals>
									<goal>sign</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
		<profile>
			<!-- Bit of stupidity to work around Eclipse's m2e stupidity -->
			<id>only-eclipse</id>
			<activation>
				<property>
					<name>m2e.version</name>
				</property>
			</activation>
			<build>
				<pluginManagement>
					<plugins>
						<plugin>
							<groupId>org.eclipse.m2e</groupId>
							<artifactId>lifecycle-mapping</artifactId>
							<version>1.0.0</version>
							<configuration>
								<lifecycleMappingMetadata>
									<pluginExecutions>
										<pluginExecution>
											<pluginExecutionFilter>
												<groupId>
													com.googlecode.maven-download-plugin
												</groupId>
												<artifactId>
													download-maven-plugin
												</artifactId>
												<versionRange>
													[0.0.1,)
												</versionRange>
												<goals>
													<goal>wget</goal>
												</goals>
											</pluginExecutionFilter>
											<action>
												<ignore />
											</action>
										</pluginExecution>
										<pluginExecution>
											<pluginExecutionFilter>
												<groupId>
													info.freelibrary
												</groupId>
												<artifactId>
													freelib-utils
												</artifactId>
												<versionRange>
													[0.0.1,)
												</versionRange>
												<goals>
													<goal>generate-codes</goal>
													<goal>read-logging-properties</goal>
													<goal>set-cpumem-properties</goal>
													<goal>set-uuid-property</goal>
													<goal>set-file-perms</goal>
												</goals>
											</pluginExecutionFilter>
											<action>
												<ignore />
											</action>
										</pluginExecution>
										<pluginExecution>
											<pluginExecutionFilter>
												<groupId>
													org.codehaus.mojo
												</groupId>
												<artifactId>
													keytool-maven-plugin
												</artifactId>
												<versionRange>
													[0.0.1,)
												</versionRange>
												<goals>
													<goal>generateKeyPair</goal>
													<goal>generateSecretKey</goal>
												</goals>
											</pluginExecutionFilter>
											<action>
												<ignore />
											</action>
										</pluginExecution>
										<pluginExecution>
											<pluginExecutionFilter>
												<groupId>
													com.github.klieber
												</groupId>
												<artifactId>
													phantomjs-maven-plugin
												</artifactId>
												<versionRange>
													[0.0.1,)
												</versionRange>
												<goals>
													<goal>install</goal>
												</goals>
											</pluginExecutionFilter>
											<action>
												<ignore />
											</action>
										</pluginExecution>
									</pluginExecutions>
								</lifecycleMappingMetadata>
							</configuration>
						</plugin>
					</plugins>
				</pluginManagement>
			</build>
		</profile>
	</profiles>

	<parent>
		<groupId>info.freelibrary</groupId>
		<artifactId>freelib-build-tools</artifactId>
		<version>0.2.9</version>
	</parent>
</project>
