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

	<groupId>de.rcenvironment</groupId>
	<version>1.0.0</version>
	<artifactId>de.rcenvironment.build.runner.checkstyle</artifactId>
	<name>RCE Standalone Checkstyle Runner</name>
	<packaging>pom</packaging>

	<properties>
		<projects-root>../../../..</projects-root>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
	</properties>

	<build>
		<defaultGoal>initialize</defaultGoal>
		<!-- define the root of the repository as the "source directory" to scan -->
		<sourceDirectory>${projects-root}</sourceDirectory>
		<!-- redirect the output directory (the "target" directory) -->
		<directory>${projects-root}/de.rcenvironment/build/target/checkstyle</directory>

		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-clean-plugin</artifactId>
				<version>3.2.0</version>
				<executions>
					<execution>
						<!-- cleans the XML output and report, but not the cache file -->
						<id>clean-output</id>
						<goals>
							<goal>clean</goal>
						</goals>
						<phase>initialize</phase>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-checkstyle-plugin</artifactId>
				<version>3.2.0</version>
				<dependencies>
					<dependency>
						<groupId>com.puppycrawl.tools</groupId>
						<artifactId>checkstyle</artifactId>
						<!-- this should typically match the version used by the Eclipse plugin -->
						<version>9.1</version>
					</dependency>
				</dependencies>
				<executions>
					<execution>
						<id>run-checkstyle</id>
						<phase>initialize</phase>
						<configuration>
							<configLocation>${projects-root}/de.rcenvironment/checkstyle/checks.xml</configLocation>
							<outputFile>${project.build.directory}/checkstyle-report.txt</outputFile>
							<outputFileFormat>plain</outputFileFormat>
							<!-- separate cache directory to simplify setting up cache persistence -->
							<cacheFile>${projects-root}/de.rcenvironment/build/target/cache/checkstyle/cachefile</cacheFile>
							<propertyExpansion>config_loc=${basedir}/${projects-root}/de.rcenvironment/checkstyle</propertyExpansion>
							<encoding>UTF-8</encoding>
							<consoleOutput>true</consoleOutput>
							<violationSeverity>error</violationSeverity>
							<failOnViolation>false</failOnViolation>
							<logViolationsToConsole>true</logViolationsToConsole>
							<linkXRef>false</linkXRef>
						</configuration>
						<goals>
							<goal>check</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
		</plugins>
	</build>

</project>