<?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/maven-v4_0_0.xsd">

	<modelVersion>4.0.0</modelVersion>
	<artifactId>cobertura</artifactId>
	<packaging>jar</packaging>

	<parent>
		<groupId>com.github.leeyazhou</groupId>
		<artifactId>cobertura-reactor</artifactId>
		<version>2.1.2.RELEASE</version>
	</parent>

	<description>
    Cobertura is a free Java tool that calculates the percentage of
    code accessed by tests. It can be used to identify which parts of
    your Java program are lacking test coverage. It is based on jcoverage.
  </description>

	<url>https://www.github.com/leeyazhou/cobertura</url>

	<pluginRepositories>
		<pluginRepository>
			<id>sonatype-releases</id>
			<url>http://oss.sonatype.org/content/repositories/releases</url>
		</pluginRepository>
		<pluginRepository>
			<id>clojars.org</id>
			<url>http://clojars.org/repo</url>
		</pluginRepository>
	</pluginRepositories>

	<dependencies>
		<!-- <dependency>
			<groupId>com.sun</groupId>
			<artifactId>tools</artifactId>
			<version>0</version>
			<scope>system</scope>
			<systemPath>${toolsjar}</systemPath>
		</dependency> -->
		<dependency>
			<groupId>org.apache.commons</groupId>
			<artifactId>commons-lang3</artifactId>
		</dependency>
		<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>slf4j-api</artifactId>
		</dependency>
		<dependency>
			<groupId>org.ow2.asm</groupId>
			<artifactId>asm</artifactId>
			<version>${asmVersion}</version>
		</dependency>
		<dependency>
			<groupId>org.ow2.asm</groupId>
			<artifactId>asm-tree</artifactId>
			<version>${asmVersion}</version>
		</dependency>
		<dependency>
			<groupId>org.ow2.asm</groupId>
			<artifactId>asm-commons</artifactId>
			<version>${asmVersion}</version>
		</dependency>
		<dependency>
			<groupId>org.ow2.asm</groupId>
			<artifactId>asm-util</artifactId>
			<version>${asmVersion}</version>
		</dependency>
		<dependency>
			<groupId>org.ow2.asm</groupId>
			<artifactId>asm-analysis</artifactId>
			<version>${asmVersion}</version>
		</dependency>
		<dependency>
			<groupId>oro</groupId>
			<artifactId>oro</artifactId>
			<version>${oroVersion}</version>
		</dependency>
		<dependency>
			<groupId>jaxen</groupId>
			<artifactId>jaxen</artifactId>
			<version>${jaxenVersion}</version>
		</dependency>
		<dependency>
			<groupId>org.apache.ant</groupId>
			<artifactId>ant</artifactId>
			<version>${antVersion}</version>
		</dependency>
		<dependency>
			<groupId>org.apache.ant</groupId>
			<artifactId>ant-junit</artifactId>
			<version>${antVersion}</version>
		</dependency>
		<dependency>
			<groupId>org.apache.ant</groupId>
			<artifactId>ant-junit4</artifactId>
			<version>${antVersion}</version>
		</dependency>
		<!-- Cobertura actually uses JUnit classes for report processing so scope 
			is compile. -->
		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<scope>compile</scope>
		</dependency>
		<dependency>
			<groupId>commons-io</groupId>
			<artifactId>commons-io</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.jdom</groupId>
			<artifactId>jdom</artifactId>
			<version>${jdomVersion}</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>ch.qos.logback</groupId>
			<artifactId>logback-classic</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.codehaus.groovy</groupId>
			<artifactId>groovy-all</artifactId>
			<version>${groovyVersion}</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>net.java.dev.javacc</groupId>
			<artifactId>javacc</artifactId>
			<version>${javaccVersion}</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.mockito</groupId>
			<artifactId>mockito-all</artifactId>
		</dependency>
	</dependencies>

	<profiles>
		<profile>
			<id>jdk6minus</id>
			<activation>
				<jdk>(,1.6]</jdk>
			</activation>
			<build>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-surefire-plugin</artifactId>
						<configuration>
							<excludes combine.children="append">
								<!-- These tests require JDK 7+ -->
								<exclude>com/github/leeyazhou/cobertura/jdk/JDK7Test.java</exclude>
								<exclude>com/github/leeyazhou/cobertura/test/FunctionalTest.java</exclude>
								<exclude>com/github/leeyazhou/cobertura/test/IgnoreMethodAnnotationFunctionalTest.java</exclude>
								<exclude>com/github/leeyazhou/cobertura/test/IgnoreTrivialFunctionalTest.java</exclude>
								<exclude>com/github/leeyazhou/cobertura/test/LargeFileTest.java</exclude>
								<exclude>com/github/leeyazhou/cobertura/test/PerformanceTest.java</exclude>
								<exclude>com/github/leeyazhou/cobertura/test/SwitchFunctionalTest.java</exclude>
								<exclude>com/github/leeyazhou/cobertura/thread/test/MultipleClassloaderFunctionalTest.java</exclude>
							</excludes>
						</configuration>
					</plugin>
				</plugins>
			</build>
		</profile>
		<profile>
			<id>standardToolsJar-profile</id>
			<activation>
				<activeByDefault>true</activeByDefault>
				<file>
					<exists>${java.home}/../lib/tools.jar</exists>
				</file>
			</activation>
			<properties>
				<toolsjar>${java.home}/../lib/tools.jar</toolsjar>
			</properties>
		</profile>
		<profile>
			<id>appleJdkToolsJar-profile</id>
			<activation>
				<activeByDefault>false</activeByDefault>
				<file>
					<exists>${java.home}/../Classes/classes.jar</exists>
				</file>
			</activation>
			<properties>
				<toolsjar>${java.home}/../Classes/classes.jar</toolsjar>
			</properties>
		</profile>
	</profiles>

	<build>
		<resources>
			<resource>
				<directory>src/main/resources</directory>
			</resource>
		</resources>
		<plugins>
			<plugin>
				<artifactId>maven-clean-plugin</artifactId>
				<version>2.5</version>
				<configuration>
					<filesets>
						<fileset>
							<directory>src/main/java/com/github/leeyazhou/cobertura/javancss/parser</directory>
							<includes>
								<include>**/*</include>
							</includes>
							<followSymlinks>false</followSymlinks>
						</fileset>
					</filesets>
				</configuration>
			</plugin>

			<!-- Cobertura requires custom jdk version for providing the support for 
				the latest jdk. -->
			<plugin>
				<groupId>com.code54.mojo</groupId>
				<artifactId>buildversion-plugin</artifactId>
				<version>1.0.3</version>
				<executions>
					<execution>
						<goals>
							<goal>set-properties</goal>
						</goals>
					</execution>
				</executions>
			</plugin>

			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>javacc-maven-plugin</artifactId>
				<version>2.6</version>
				<executions>
					<execution>
						<id>javacc</id>
						<phase>initialize</phase>
						<goals>
							<goal>javacc</goal>
						</goals>
						<configuration>
							<outputDirectory>src/main/java</outputDirectory>
						</configuration>
					</execution>
				</executions>
			</plugin>

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<configuration>
					<fork>true</fork>
					<excludes>
						<exclude>**/test/*.java</exclude>
					</excludes>
				</configuration>
			</plugin>

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-jar-plugin</artifactId>
				<configuration>
					<archive>
						<index />
						<manifest>
							<addDefaultImplementationEntries />
							<addDefaultSpecificationEntries />
						</manifest>
						<manifestEntries>
							<Specification-Title>A code coverage analysis tool.</Specification-Title>
							<Specification-Version>${project.version}</Specification-Version>
							<Specification-Vendor>Cobertura</Specification-Vendor>
							<Implementation-Title>A code coverage analysis tool.</Implementation-Title>
							<Implementation-Version>${project.version}</Implementation-Version>
							<Implementation-Vendor>Cobertura</Implementation-Vendor>
							<Implementation-Vendor-Id>${project.groupId}</Implementation-Vendor-Id>
						</manifestEntries>
					</archive>
				</configuration>
			</plugin>

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-surefire-plugin</artifactId>
				<configuration>
					<redirectTestOutputToFile>true</redirectTestOutputToFile>
					<excludes combine.children="append">
						<exclude>**/test/condition/**</exclude>
						<exclude>**/examples/functionaltest1/**</exclude>
						<!-- This test is failing and I don't know how to fix it -->
						<exclude>com/github/leeyazhou/cobertura/thread/test/MultipleClassloaderFunctionalTest.java</exclude>
						<!-- This test fails on Windows, see https://github.com/leeyazhou/cobertura/pull/209 -->
						<exclude>com/github/leeyazhou/cobertura/dsl/ArgumentsBuilderTest.java</exclude>
					</excludes>
				</configuration>
			</plugin>

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-failsafe-plugin</artifactId>
				<executions>
					<execution>
						<goals>
							<goal>integration-test</goal>
							<goal>verify</goal>
						</goals>
					</execution>
				</executions>
			</plugin>

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-pmd-plugin</artifactId>
			</plugin>
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>findbugs-maven-plugin</artifactId>
			</plugin>
		</plugins>
	</build>

</project>
