<?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/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.kohlschutter.junixsocket</groupId>
  <artifactId>junixsocket-parent</artifactId>
  <version>2.3.2</version>
  <packaging>pom</packaging>
  <parent>
    <groupId>com.kohlschutter</groupId>
    <artifactId>kohlschutter-parent</artifactId>
    <version>1.3.4</version>
    <relativePath>../kohlschutter-parent/pom.xml</relativePath>
  </parent>
  <name>junixsocket-parent</name>
  <inceptionYear>2009</inceptionYear>
  <description>junixsocket is a Java/JNI library that allows the use of Unix Domain Sockets (AF_UNIX sockets) from Java.

In contrast to other implementations, junixsocket extends the Java Sockets API (java.net.Socket, java.net.SocketAddress etc.) and even supports RMI over AF_UNIX. It is also possible to use it in conjunction with Connector/J to connect to a local MySQL server via Unix domain sockets.</description>
  <url>https://github.com/kohlschutter/junixsocket</url>
  <organization>
    <name>Kohlschütter Search Intelligence</name>
    <url>https://www.kohlschutter.com/</url>
  </organization>
  <developers>
    <developer>
      <name>Christian Kohlschütter</name>
      <email>christian@kohlschutter.com</email>
    </developer>
  </developers>
  <licenses>
    <license>
      <name>Apache License, Version 2.0</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
      <distribution>repo</distribution>
    </license>
  </licenses>
  <scm>
    <url>https://github.com/kohlschutter/junixsocket</url>
    <connection>scm:git:https://github.com/kohlschutter/junixsocket.git</connection>
    <developerConnection>scm:git:https://github.com/kohlschutter/junixsocket.git</developerConnection>
  </scm>
  <distributionManagement>
    <snapshotRepository>
      <id>ossrh</id>
      <url>https://oss.sonatype.org/content/repositories/snapshots</url>
    </snapshotRepository>
    <site>
      <id>github.com/kohlschutter/junixsocket</id>
      <url>gitsite:git@github.com/kohlschutter/junixsocket.git</url>
    </site>
  </distributionManagement>
  <issueManagement>
    <system>GitHub</system>
    <url>https://github.com/kohlschutter/junixsocket/issues</url>
  </issueManagement>
  <properties>
    <kohlschutter.project.base.directory>${project.basedir}</kohlschutter.project.base.directory>
    <kohlschutter.parent.directory>${project.parent.basedir}</kohlschutter.parent.directory>
    <java.version>9</java.version>
    <maven.compiler.source>${java.version}</maven.compiler.source>
    <maven.compiler.target>${java.version}</maven.compiler.target>
    <junit.version>5.6.0-M1</junit.version>
    <junixsocket.native.aol></junixsocket.native.aol>
    <junixsocket.native.jnilib.extension>so</junixsocket.native.jnilib.extension>
    <junixsocket.native.crossclang.toolPath>${project.basedir}/crossclang/bin/</junixsocket.native.crossclang.toolPath>
    <junixsocket.native.llvm.target></junixsocket.native.llvm.target>
    <junixsocket.native.llvm.toolPath>${junixsocket.native.crossclang.toolPath}</junixsocket.native.llvm.toolPath>
    <junixsocket.native.default.toolPath></junixsocket.native.default.toolPath>
    <junixsocket.native.default.linkerName></junixsocket.native.default.linkerName>
    <junixsocket.cross.disabled>true</junixsocket.cross.disabled>
    <junixsocket.custom.arch></junixsocket.custom.arch>

    <junixsocket.java8.release>7</junixsocket.java8.release>
  </properties>

  <modules>
    <module>junixsocket-common</module>
    <module>junixsocket-server</module>
    <module>junixsocket-rmi</module>
    <module>junixsocket-mysql</module>
    <module>junixsocket-core</module>
    <module>junixsocket-demo</module>
    <module>junixsocket-selftest</module>
    <module>junixsocket-dist</module>
  </modules>

  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>com.github.maven-nar</groupId>
          <artifactId>nar-maven-plugin</artifactId>
          <version>3.6.0</version>
          <dependencies>
            <dependency>
              <groupId>org.apache.bcel</groupId>
              <artifactId>bcel</artifactId>
              <version>6.4.1</version>
            </dependency>
          </dependencies>
        </plugin>
      </plugins>
    </pluginManagement>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <configuration>
          <archive>
            <manifestEntries>
              <Multi-Release>true</Multi-Release>
            </manifestEntries>
          </archive>
        </configuration>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <profile>
      <id>release</id>
      <modules>
        <module>junixsocket-native</module>
        <module>junixsocket-native-cross</module>
        <module>junixsocket-native-custom</module>
        <module>junixsocket-native-common</module>
      </modules>
    </profile>
    <profile>
      <id>with-native</id>
      <activation>
        <property>
          <name>!m2e.version</name>
        </property>
      </activation>
      <modules>
        <module>junixsocket-native</module>
        <module>junixsocket-native-custom</module>
        <module>junixsocket-native-common</module>
      </modules>
    </profile>
    <profile>
      <id>cross</id>
      <activation>
        <property>
          <name>cross</name>
          <value>true</value>
        </property>
      </activation>
      <properties>
        <junixsocket.cross.disabled>false</junixsocket.cross.disabled>
      </properties>
      <modules>
        <module>junixsocket-native-cross</module>
      </modules>
    </profile>
    <profile>
      <id>release-native</id>
      <modules>
        <module>junixsocket-native</module>
        <module>junixsocket-native-cross</module>
        <module>junixsocket-native-custom</module>
        <module>junixsocket-native-common</module>
      </modules>
    </profile>
    <profile>
      <id>arch-x86_64-MacOSX</id>
      <activation>
        <os>
          <arch>x86_64</arch>
          <name>Mac OS X</name>
        </os>
      </activation>
      <properties>
        <!-- Specify "junixsocket.native.aol" to override the architecture
          AOL for this environment; see nar-maven-plugin for details -->
        <junixsocket.native.aol>x86_64-MacOSX-clang</junixsocket.native.aol>
        <junixsocket.native.llvm.target>current</junixsocket.native.llvm.target>
        <junixsocket.native.jnilib.extension>dylib</junixsocket.native.jnilib.extension>
        <junixsocket.native.default.toolPath>${junixsocket.native.crossclang.toolPath}</junixsocket.native.default.toolPath>
        <junixsocket.native.default.linkerName>clang</junixsocket.native.default.linkerName>
      </properties>
    </profile>

    <profile>
      <id>arch-amd64-Linux</id>
      <activation>
        <os>
          <arch>amd64</arch>
          <name>Linux</name>
        </os>
      </activation>
      <properties>
        <!-- Specify "junixsocket.native.aol" to override the architecture
          AOL for this environment; see nar-maven-plugin for details -->
        <junixsocket.native.aol>amd64-Linux-clang</junixsocket.native.aol>
        <junixsocket.native.llvm.target>current</junixsocket.native.llvm.target>
        <junixsocket.native.jnilib.extension>so</junixsocket.native.jnilib.extension>
        <junixsocket.native.default.toolPath>${junixsocket.native.crossclang.toolPath}</junixsocket.native.default.toolPath>
        <junixsocket.native.default.linkerName>clang</junixsocket.native.default.linkerName>
      </properties>
    </profile>

    <profile>
      <id>java8-support</id>
      <activation>
        <!-- Java 8 support is enabled by default, unless you're in Eclipse,
          which doesn't support compiling with multiple compilers -->
        <property>
          <name>!m2e.version</name>
        </property>
      </activation>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-compiler-plugin</artifactId>
            <configuration>
              <target>9</target>
              <release>9</release>
              <multiReleaseOutput>true</multiReleaseOutput>
            </configuration>
            <executions>
              <execution>
                <id>java8-compile</id>
                <goals>
                  <goal>compile</goal>
                </goals>
                <configuration>
                  <target>1.${junixsocket.java8.release}</target>
                  <release>${junixsocket.java8.release}</release>
                  <multiReleaseOutput>false</multiReleaseOutput>
                  <excludes>
                    <exclude>module-info.java</exclude>
                  </excludes>
                  <testExcludes>
                    <testExclude>**/*</testExclude>
                  </testExcludes>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-resources-plugin</artifactId>
            <version>3.1.0</version>
            <executions>
              <execution>
                <!-- module-info.class needs to be in the root of the jar -->
                <id>copy-module-info-to-root-level</id>
                <phase>prepare-package</phase>
                <goals>
                  <goal>copy-resources</goal>
                </goals>
                <configuration>
                  <outputDirectory>${project.build.outputDirectory}</outputDirectory>
                  <resources>
                    <resource>
                      <directory>${project.build.outputDirectory}/META-INF/versions/9</directory>
                      <includes>
                        <include>module-info.class</include>
                      </includes>
                    </resource>
                  </resources>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-jar-plugin</artifactId>
            <version>3.1.1</version>
            <configuration>
              <archive>
                <manifestEntries>
                  <Multi-Release>true</Multi-Release>
                </manifestEntries>
              </archive>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

  <dependencies>
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter-api</artifactId>
      <version>${junit.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter-engine</artifactId>
      <version>${junit.version}</version>
      <scope>test</scope>
    </dependency>
  </dependencies>
</project>
