<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright (C) 2011 Pcap4J.org -->

<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>pcap4j-core</artifactId>
  <packaging>jar</packaging>
  <name>Pcap4J Core</name>
  <description>The core module of Pcap4J.</description>

  <parent>
    <groupId>org.pcap4j</groupId>
    <artifactId>pcap4j</artifactId>
    <version>1.8.2</version>
  </parent>

  <dependencies>
    <dependency>
      <groupId>net.java.dev.jna</groupId>
      <artifactId>jna</artifactId>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
    </dependency>
    <dependency>
      <groupId>ch.qos.logback</groupId>
      <artifactId>logback-core</artifactId>
      <scope>test</scope>
      <optional>true</optional>
    </dependency>
    <dependency>
      <groupId>ch.qos.logback</groupId>
      <artifactId>logback-classic</artifactId>
      <scope>test</scope>
      <optional>true</optional>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <resources>
      <resource>
        <directory>src/main/java</directory>
        <includes>
          <include>**/*.properties</include>
        </includes>
        <filtering>false</filtering>
      </resource>
    </resources>
  </build>

  <profiles>
    <profile>
      <id>test-coverage</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <configuration>
              <argLine>${argLine}</argLine>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>

    <profile>
      <id>jre6-test</id>
      <activation>
        <property>
          <name>org.pcap4j.jre6-test.jvm</name>
        </property>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-antrun-plugin</artifactId>
            <executions>
              <execution>
                <id>jre6-test</id>
                <phase>verify</phase>
                <goals>
                  <goal>run</goal>
                </goals>
                <configuration>
                  <target>
                    <delete>
                      <!-- Remove module-info.class for maven-surefire-plugin to run JRE 6 tests with class paths rather than module paths. -->
                      <fileset dir="${project.build.outputDirectory}" includes="**/module-info.class" />
                    </delete>
                  </target>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <executions>
              <execution>
                <id>jre6-test</id>
                <phase>verify</phase>
                <goals>
                  <goal>testCompile</goal>
                </goals>
                <configuration>
                  <release>6</release>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <executions>
              <execution>
                <id>jre6-test</id>
                <phase>verify</phase>
                <goals>
                  <goal>test</goal>
                </goals>
                <configuration>
                  <jvm>${org.pcap4j.jre6-test.jvm}</jvm>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
