<?xml version="1.0" encoding="UTF-8"?>
<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>

	<parent>
		<groupId>com.github.bordertech.common</groupId>
		<artifactId>bordertech-parent</artifactId>
		<version>1.0.7</version>
	</parent>

	<artifactId>qa-parent</artifactId>
	<packaging>pom</packaging>

	<properties>
		<bt.qa.skip>true</bt.qa.skip><!-- Basically a backwards compatible alias for wc.qa.skip -->
		<wc.qa.skip>${bt.qa.skip}</wc.qa.skip>
		<checkstyle.skip>${wc.qa.skip}</checkstyle.skip>
		<findbugs.skip>${wc.qa.skip}</findbugs.skip>
		<pmd.skip>${wc.qa.skip}</pmd.skip>

		<javadoc.excluded.packages />
		<checkstyle.excludes />

		<!--
			OWASP dependency vulnerability scanner.
		-->
		<!-- allow for proxy settings -->
		<bt.owasp.dependency-check.proxy />
	</properties>

	<description>
		Quality assurance configuration for BorderTech java projects.
		Note that projects inheriting from this POM also inherit the release
		configuration from bordertech-parent.
	</description>


	<build>
		<pluginManagement>
			<plugins>
				<plugin>
					<groupId>org.owasp</groupId>
					<artifactId>dependency-check-maven</artifactId>
					<version>4.0.1</version>
					<configuration>
						<failBuildOnAnyVulnerability>true</failBuildOnAnyVulnerability>
						<mavenSettingsProxyId>${bt.owasp.dependency-check.proxy}</mavenSettingsProxyId>
						<retireJsAnalyzerEnabled>false</retireJsAnalyzerEnabled><!-- see https://github.com/jeremylong/DependencyCheck/issues/1467 before turning this on -->
						<nspAnalyzerEnabled>false</nspAnalyzerEnabled>
						<nuspecAnalyzerEnabled>false</nuspecAnalyzerEnabled>
						<swiftPackageManagerAnalyzerEnabled>false</swiftPackageManagerAnalyzerEnabled>
						<assemblyAnalyzerEnabled>false</assemblyAnalyzerEnabled>
					</configuration>
				</plugin>
			</plugins>
		</pluginManagement>
		<plugins>
			<!-- Check the code style. -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-checkstyle-plugin</artifactId>
				<version>3.0.0</version>
				<configuration>
					<configLocation>bordertech/checkstyle.xml</configLocation>
					<consoleOutput>true</consoleOutput>
					<failsOnError>true</failsOnError>
					<failOnViolation>true</failOnViolation>
					<linkXRef>false</linkXRef>
					<includeTestSourceDirectory>false</includeTestSourceDirectory>
				</configuration>
				<dependencies>
					<dependency>
						<groupId>com.github.bordertech.common</groupId>
						<artifactId>build-tools</artifactId>
						<version>1.0.7</version>
					</dependency>
				</dependencies>
				<executions>
					<execution>
						<id>checkStyle</id>
						<phase>verify</phase>
						<goals>
							<goal>check</goal>
						</goals>
					</execution>
				</executions>
			</plugin>

			<!-- PMD Check. -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-pmd-plugin</artifactId>
				<version>3.5</version>
				<configuration>
					<failurePriority>2</failurePriority>
					<printFailingErrors>true</printFailingErrors>
					<includeTests>false</includeTests>
					<format>xml</format>
				</configuration>
				<executions>
					<execution>
						<id>checkPmd</id>
						<phase>verify</phase>
						<goals>
							<goal>check</goal>
						</goals>
					</execution>
				</executions>
			</plugin>

			<!-- Findbugs check. -->
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>findbugs-maven-plugin</artifactId>
				<version>3.0.5</version>
				<configuration>
					<failOnError>true</failOnError>
					<effort>Max</effort>
					<includeTests>false</includeTests>
					<threshold>Medium</threshold>
					<excludeFilterFile>bordertech/findbugs-exclude-filter.xml</excludeFilterFile>
				</configuration>
				<dependencies>
					<dependency>
						<groupId>com.github.bordertech.common</groupId>
						<artifactId>build-tools</artifactId>
						<version>1.0.7</version>
					</dependency>
				</dependencies>
				<executions>
					<execution>
						<id>checkFindbugs</id>
						<phase>verify</phase>
						<goals>
							<goal>check</goal>
						</goals>
					</execution>
				</executions>
			</plugin>

			<!-- Code coverage. -->
			<!-- Run twice for the report. -->
			<plugin>
				<groupId>org.jacoco</groupId>
				<artifactId>jacoco-maven-plugin</artifactId>
				<version>0.8.2</version>
				<executions>
					<!-- Prepare jacco agent. -->
					<execution>
						<id>jacoco-agent</id>
						<goals>
							<goal>prepare-agent</goal>
						</goals>
						<configuration>
							<propertyName>surefireArgLine</propertyName>
						</configuration>
					</execution>
				</executions>
			</plugin>

			<plugin>
				<groupId>org.owasp</groupId>
				<artifactId>dependency-check-maven</artifactId>
				<executions>
					<execution>
						<id>checkDependencies</id>
						<phase>verify</phase>
						<goals>
							<goal>check</goal>
						</goals>
					</execution>
				</executions>
			</plugin>

		</plugins>
	</build>

</project>
