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

  <parent>
    <groupId>com.github.jnr</groupId>
    <artifactId>jnr-parent</artifactId>
    <version>0.0.1</version>
    <relativePath/>
  </parent>

  <artifactId>jnr-posix</artifactId>
  <packaging>jar</packaging>
  <version>3.2.0</version>
  <name>jnr-posix</name>
  <description>
    Common cross-project/cross-platform POSIX APIs
  </description>
  <url>http://github.com/jnr/jnr-posix</url>

  <issueManagement>
    <system>JIRA</system>
    <url>http://github.com/jnr/jnr-posix/issues</url>
  </issueManagement>

  <scm>
    <connection>scm:git:git@github.com:jnr/jnr-posix.git</connection>
    <developerConnection>scm:git:git@github.com:jnr/jnr-posix.git</developerConnection>
    <url>git@github.com:jnr/jnr-posix.git</url>
  </scm>

  <licenses>
    <license>
      <name>Eclipse Public License - v 2.0</name>
      <url>https://www.eclipse.org/legal/epl-2.0/</url>
      <distribution>repo</distribution>
    </license>
    <license>
      <name>GNU General Public License Version 2</name>
      <url>http://www.gnu.org/copyleft/gpl.html</url>
      <distribution>repo</distribution>
    </license>
    <license>
      <name>GNU Lesser General Public License Version 2.1</name>
      <url>http://www.gnu.org/licenses/lgpl.html</url>
      <distribution>repo</distribution>
    </license>
  </licenses>

  <developers>
    <developer>
      <id>enebo</id>
      <name>Thomas E Enebo</name>
      <email>tom.enebo@gmail.com</email>
    </developer>
    <developer>
      <id>wmeissner</id>
      <name>Wayne Meissner</name>
      <email>wmeissner@gmail.com</email>
    </developer>
    <developer>
      <id>headius</id>
      <name>Charles Oliver Nutter</name>
      <email>headius@headius.com</email>
    </developer>
  </developers>

  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.13.2</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.github.jnr</groupId>
      <artifactId>jnr-ffi</artifactId>
      <version>2.3.0</version>
    </dependency>
    <dependency>
      <groupId>com.github.jnr</groupId>
      <artifactId>jnr-constants</artifactId>
      <version>0.11.0</version>
    </dependency>
  </dependencies>

  <build>
    <extensions>
      <extension>
        <groupId>org.apache.maven.wagon</groupId>
        <artifactId>wagon-webdav-jackrabbit</artifactId>
        <version>1.0-beta-7</version>
      </extension>
    </extensions>
    <plugins>
      <plugin>
        <artifactId>maven-javadoc-plugin</artifactId>
        <configuration>
          <!-- Javadoc barfs if running in JDK 9+ and documenting SunMiscSignal when unable to access sun.misc.
               We already require toolchain version 8 for other things so we use it here as well (for now). -->
          <jdkToolchain>
            <version>8</version>
          </jdkToolchain>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <!-- This is a bit gross; we can't access sun.misc without jdk.supported, but we can't add jdk.unsupported
             while also setting release 8. For now we require a JDK 8 toolchain to compile this one class. -->
        <executions>
          <execution>
            <id>default-compile</id>
            <configuration>
              <jdkToolchain>
                <version>8</version>
              </jdkToolchain>
              <includes>
                <include>jnr/posix/util/SunMiscSignal.java</include>
              </includes>
            </configuration>
          </execution>
          <execution>
            <id>java9-compile</id>
            <phase>compile</phase>
            <goals><goal>compile</goal></goals>
            <configuration>
              <excludes>
                <exclude>jnr/posix/util/SunMiscSignal.java</exclude>
              </excludes>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.sonatype.central</groupId>
        <artifactId>central-publishing-maven-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <version>2.3.1</version>
        <configuration>
          <archive>
            <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
            <manifestEntries>
              <Automatic-Module-Name>org.jnrproject.posix</Automatic-Module-Name>
            </manifestEntries>
          </archive>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.felix</groupId>
        <artifactId>maven-bundle-plugin</artifactId>
        <configuration>
          <instructions>
            <Implementation-Title>JNA-POSIX</Implementation-Title>
            <Implementation-Version>0.5</Implementation-Version>
            <_nouses>true</_nouses>
            <Import-Package>!sun.misc,*</Import-Package>
          </instructions>
        </configuration>
        <executions>
          <execution>
            <id>bundle-manifest</id>
            <phase>process-classes</phase>
            <goals>
              <goal>manifest</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
  <profiles>
    <profile>
      <id>non-windows-unit-tests</id>
      <activation><os><family>!windows</family></os></activation>
      <build>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-surefire-plugin</artifactId>
          <configuration>
            <forkCount>2</forkCount>
            <reuseForks>false</reuseForks>
            <includes>
              <include>**/*Test.java</include>
            </includes>
            <excludes>
              <exclude>**/windows/*Test.java</exclude>
            </excludes>
          </configuration>
        </plugin>
      </plugins>
      </build>
    </profile>
    <profile>
      <id>windows-unit-tests</id>
      <activation><os><family>windows</family></os></activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <configuration>
              <forkCount>2</forkCount>
              <reuseForks>false</reuseForks>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>release</id>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-gpg-plugin</artifactId>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
