<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>dev.metaschema</groupId>
		<artifactId>oss-maven</artifactId>
		<version>7</version>
	</parent>
	<artifactId>oss-parent</artifactId>
	<packaging>pom</packaging>
	<name>Parent POM</name>
	<description>A Common Maven Build Parent for Metaschema Open Source Projects, that provides for centralized management of plugin versions, code style, and other code quality checks.</description>

	<url>${site.url}/${project.artifactId}</url>

	<distributionManagement>
		<site>
				<id>pages</id>
				<url>${site.url}/${project.artifactId}/</url>
		</site>
	</distributionManagement>

	<scm>
		<url>${scm.url}/tree/develop/oss-parent</url>
	  <tag>v7</tag>
  </scm>

	<build>
		<pluginManagement>
			<plugins>
				<plugin>
					<groupId>net.revelc.code.formatter</groupId>
					<artifactId>formatter-maven-plugin</artifactId>
					<configuration>
						<!--
						<overrideConfigCompilerVersion>true</overrideConfigCompilerVersion> -->
						<compilerSource>${maven.compiler.source}</compilerSource>
						<compilerCompliance>${maven.compiler.source}</compilerCompliance>
						<compilerTargetPlatform>${maven.compiler.target}</compilerTargetPlatform>
						<lineEnding>KEEP</lineEnding>
						<encoding>${project.build.sourceEncoding}</encoding>
						<configFile>checkstyle/eclipse/eclipse-formatter.xml</configFile>
					</configuration>
					<executions>
						<execution>
							<id>default</id>
							<phase>process-sources</phase>
							<goals>
								<goal>format</goal>
							</goals>
						</execution>
					</executions>
					<dependencies>
						<dependency>
							<groupId>dev.metaschema</groupId>
							<artifactId>oss-build-support</artifactId>
							<version>7</version>
						</dependency>
					</dependencies>
				</plugin>
				<plugin>
					<groupId>com.mycila</groupId>
					<artifactId>license-maven-plugin</artifactId>
					<executions>
						<execution>
							<id>format-license</id>
							<phase>process-sources</phase>
							<goals>
								<goal>format</goal>
							</goals>
							<configuration>
								<licenseSets>
									<licenseSet>
										<header>cc0-dedication.txt</header>
										<includes>
											<include>src/main/java/**/*.java</include>
											<include>target/generated-sources/**/*.java</include>
										</includes>
									</licenseSet>
								</licenseSets>
							</configuration>
						</execution>
						<execution>
							<id>format-license-tests</id>
							<phase>process-test-sources</phase>
							<goals>
								<goal>format</goal>
							</goals>
							<configuration>
								<licenseSets>
									<licenseSet>
										<header>cc0-dedication.txt</header>
										<includes>
											<include>src/test/java/**/*.java</include>
											<include>target/generated-test-sources/**/*.java</include>
										</includes>
									</licenseSet>
								</licenseSets>
							</configuration>
						</execution>
					</executions>
					<dependencies>
						<dependency>
							<groupId>dev.metaschema</groupId>
							<artifactId>oss-build-support</artifactId>
							<version>7</version>
						</dependency>
					</dependencies>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-checkstyle-plugin</artifactId>
					<configuration>
						<configLocation>checkstyle/checkstyle.xml</configLocation>
						<consoleOutput>true</consoleOutput>
						<failsOnError>true</failsOnError>
						<failOnViolation>false</failOnViolation>
						<linkXRef>true</linkXRef>
						<excludes>module\-info\.java$</excludes>
					</configuration>
					<executions>
						<execution>
							<id>checkstyle-sources</id>
							<phase>verify</phase>
							<goals>
								<goal>check</goal>
							</goals>
							<!--
							<configuration>
								<sourceDirectories>
									<sourceDirectory>${project.build.sourceDirectory}</sourceDirectory>
								</sourceDirectories>
								<testSourceDirectories>
									<sourceDirectory>${project.build.testSourceDirectory}</sourceDirectory>
								</testSourceDirectories>
							</configuration>
-->
						</execution>
					</executions>
					<dependencies>
						<dependency>
							<groupId>dev.metaschema</groupId>
							<artifactId>oss-build-support</artifactId>
							<version>7</version>
						</dependency>
						<dependency>
							<groupId>com.puppycrawl.tools</groupId>
							<artifactId>checkstyle</artifactId>
							<version>${dependency.checkstyle.version}</version>
						</dependency>
					</dependencies>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-pmd-plugin</artifactId>
					<configuration>
<!--						<targetJdk>${maven.compiler.target}</targetJdk>-->
						<analysisCache>true</analysisCache>
						<rulesets>
							<!-- Custom rule set -->
							<ruleset>pmd/category/java/custom.xml</ruleset>
						</rulesets>
					</configuration>
					<executions>
						<execution>
							<id>cpd-verify</id>
							<goals>
								<goal>cpd-check</goal>
							</goals>
							<configuration>
								<printFailingErrors>true</printFailingErrors>
								<failOnViolation>false</failOnViolation>
							</configuration>
						</execution>
						<execution>
							<id>pmd-verify</id>
							<goals>
								<goal>check</goal>
							</goals>
							<configuration>
								<failurePriority>2</failurePriority>
								<!-- fail on error for all builds -->
								<failOnViolation>true</failOnViolation>
								<printFailingErrors>true</printFailingErrors>
							</configuration>
						</execution>
					</executions>
					<dependencies>
						<dependency>
							<groupId>net.sourceforge.pmd</groupId>
							<artifactId>pmd-core</artifactId>
							<version>${dependency.pmd.version}</version>
						</dependency>
						<dependency>
							<groupId>net.sourceforge.pmd</groupId>
							<artifactId>pmd-java</artifactId>
							<version>${dependency.pmd.version}</version>
						</dependency>
						<dependency>
							<groupId>net.sourceforge.pmd</groupId>
							<artifactId>pmd-javascript</artifactId>
							<version>${dependency.pmd.version}</version>
						</dependency>
						<dependency>
							<groupId>net.sourceforge.pmd</groupId>
							<artifactId>pmd-jsp</artifactId>
							<version>${dependency.pmd.version}</version>
						</dependency>
						<!-- fix for inconsistent asm classes -->
						<dependency>
							<groupId>org.ow2.asm</groupId>
							<artifactId>asm</artifactId>
							<version>${dependency.asm.version}</version>
						</dependency>
						<dependency>
							<groupId>dev.metaschema</groupId>
							<artifactId>oss-build-support</artifactId>
							<version>7</version>
						</dependency>
					</dependencies>
				</plugin>
				<plugin>
					<groupId>com.github.spotbugs</groupId>
					<artifactId>spotbugs-maven-plugin</artifactId>
					<executions>
						<execution>
							<phase>verify</phase>
							<goals>
								<goal>check</goal>
							</goals>
						</execution>
					</executions>
				</plugin>
				<plugin>
					<groupId>org.jacoco</groupId>
					<artifactId>jacoco-maven-plugin</artifactId>
					<executions>
						<execution>
							<id>default-prepare-agent</id>
							<goals>
								<goal>prepare-agent</goal>
							</goals>
						</execution>
						<execution>
							<id>default-report</id>
							<goals>
								<goal>report</goal>
							</goals>
						</execution>
						<execution>
							<id>default-check</id>
							<goals>
								<goal>check</goal>
							</goals>
							<configuration>
								<haltOnFailure>false</haltOnFailure>
								<rules>
									<rule>
										<element>BUNDLE</element>
										<limits>
											<limit>
												<counter>COMPLEXITY</counter>
												<value>COVEREDRATIO</value>
												<minimum>0.60</minimum>
											</limit>
										</limits>
									</rule>
								</rules>
							</configuration>
						</execution>
					</executions>
				</plugin>
			</plugins>
		</pluginManagement>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-surefire-plugin</artifactId>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-jar-plugin</artifactId>
			</plugin>
			<plugin>
				<groupId>com.mycila</groupId>
				<artifactId>license-maven-plugin</artifactId>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-release-plugin</artifactId>
			</plugin>
		</plugins>
	</build>
	<reporting>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-jxr-plugin</artifactId>
				<reportSets>
					<reportSet>
						<reports>
							<report>jxr-no-fork</report>
							<report>test-jxr-no-fork</report>
						</reports>
						<configuration>
							<linkJavadoc>true</linkJavadoc>
						</configuration>
					</reportSet>
				</reportSets>
			</plugin>
<!--
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>jdepend-maven-plugin</artifactId>
				<reportSets>
					<reportSet>
						<reports>
							<report>generate-no-fork</report>
						</reports>
					</reportSet>
				</reportSets>
			</plugin>
-->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-pmd-plugin</artifactId>
				<reportSets>
					<reportSet>
						<reports>
							<report>pmd</report>
							<report>cpd</report>
						</reports>
					</reportSet>
				</reportSets>
			</plugin>
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>taglist-maven-plugin</artifactId>
				<configuration>
					<tagListOptions>
						<tagClasses>
							<tagClass>
								<displayName>Todo Work</displayName>
								<tags>
									<tag>
										<matchString>TODO</matchString>
										<matchType>ignoreCase</matchType>
									</tag>
									<tag>
										<matchString>FIXME</matchString>
										<matchType>ignoreCase</matchType>
									</tag>
								</tags>
							</tagClass>
						</tagClasses>
					</tagListOptions>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-checkstyle-plugin</artifactId>
				<reportSets>
					<reportSet>
						<reports>
							<report>checkstyle</report>
						</reports>
					</reportSet>
				</reportSets>
			</plugin>
			<plugin>
				<groupId>com.github.spotbugs</groupId>
				<artifactId>spotbugs-maven-plugin</artifactId>
				<reportSets>
					<reportSet>
						<reports>
							<report>spotbugs</report>
						</reports>
					</reportSet>
				</reportSets>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-javadoc-plugin</artifactId>
				<reportSets>
					<reportSet>
						<id>default</id>
						<reports>
							<report>javadoc-no-fork</report>
						</reports>
						<configuration>
							<linksource>true</linksource>
						</configuration>
					</reportSet>
				</reportSets>
			</plugin>
			<plugin>
				<groupId>org.jacoco</groupId>
				<artifactId>jacoco-maven-plugin</artifactId>
				<reportSets>
					<reportSet>
						<id>default-report</id>
						<reports>
							<report>report</report>
						</reports>
					</reportSet>
				</reportSets>
			</plugin>
		</plugins>
	</reporting>
	<profiles>
		<profile>
			<id>release</id>
			<build>
				<pluginManagement>
					<plugins>
						<plugin>
							<groupId>org.apache.maven.plugins</groupId>
							<artifactId>maven-checkstyle-plugin</artifactId>
							<configuration>
								<!-- fail on validation for release -->
								<failOnViolation>true</failOnViolation>
							</configuration>
						</plugin>
						<plugin>
							<groupId>org.apache.maven.plugins</groupId>
							<artifactId>maven-source-plugin</artifactId>
							<executions>
								<execution>
									<!-- build source JAR for release -->
									<id>attach-sources</id>
									<goals>
										<goal>jar-no-fork</goal>
									</goals>
								</execution>
							</executions>
						</plugin>
						<plugin>
							<groupId>org.apache.maven.plugins</groupId>
							<artifactId>maven-javadoc-plugin</artifactId>
							<executions>
								<execution>
									<!-- build javadoc JAR for release -->
									<id>attach-javadocs</id>
									<goals>
										<goal>jar</goal>
									</goals>
								</execution>
							</executions>
						</plugin>
					</plugins>
				</pluginManagement>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-source-plugin</artifactId>
					</plugin>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-javadoc-plugin</artifactId>
					</plugin>
				</plugins>
			</build>
		</profile>
		<profile>
			<id>CI</id>
			<build>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-checkstyle-plugin</artifactId>
					</plugin>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-pmd-plugin</artifactId>
					</plugin>
					<plugin>
						<groupId>com.github.spotbugs</groupId>
						<artifactId>spotbugs-maven-plugin</artifactId>
					</plugin>
					<plugin>
						<groupId>org.jacoco</groupId>
						<artifactId>jacoco-maven-plugin</artifactId>
					</plugin>
				</plugins>
			</build>
		</profile>
		<profile>
			<id>only-eclipse</id>
			<activation>
				<property>
					<name>m2e.version</name>
				</property>
			</activation>
			<build>
				<pluginManagement>
					<plugins>
						<!-- for the m2e peeps -->
						<plugin>
			                <!--This plugin's configuration is used to store
							Eclipse m2e settings only. It has no influence
							on the Maven build itself. -->
							<groupId>org.eclipse.m2e</groupId>
							<artifactId>lifecycle-mapping</artifactId>
							<version>1.0.0</version>
							<configuration>
								<lifecycleMappingMetadata>
									<pluginExecutions>
									</pluginExecutions>
								</lifecycleMappingMetadata>
							</configuration>
						</plugin>
					</plugins>
				</pluginManagement>
			</build>
		</profile>
	</profiles>
</project>