<!-- 
    pom.xml adapted from jpl-7.4.0.pom provided
    with JPL library hosted at Maven Central.
    https://mvnrepository.com/artifact/jpl/jpl/7.4.0

    Used for convenient build management of JPL Java API.
    Adapted for use by Matthew McNally.
-->

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

    <!-- ######################### PROJECT INFO ######################### -->
    <groupId>com.github.SWI-Prolog</groupId>
    <artifactId>packages-jpl</artifactId>
    <version>7.6.1</version>
    <packaging>jar</packaging>
    
    <name>jpl</name>
    <description>A Java Interface to Prolog</description>
    <url>http://jpl7.org/</url>

    <!-- JPL uses Simplified BSD license -->
    <licenses>
        <license>
          <name>Simplified BSD License</name>
          <url>https://github.com/SWI-Prolog/swipl-devel/blob/master/LICENSE</url>
        </license>
    </licenses>

    <scm>
        <connection>scm:git:git@github.com:SWI-Prolog/packages-jpl.git</connection>
        <url>git@github.com:SWI-Prolog/packages-jpl.git</url>
    </scm>

    <!-- JPL authors -->
    <developers>
        <developer>
            <name>Paul Singleton</name>
        </developer>
        <developer>
            <name>Fred Dushin</name>
        </developer>
        <developer>
            <name>Jan Wielemaker</name>
        </developer>
        <developer>
            <name>Sebastian Sardina</name>
        </developer>
    </developers>

    <!-- ######################### PROPERTIES ######################### -->
    <properties>
        <maven.compiler.source>1.7</maven.compiler.source>
        <maven.compiler.target>1.7</maven.compiler.target>
	        

	<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <slf4jVersion>1.7.25</slf4jVersion>
        <skipTests>true</skipTests>

<!--        <jar.finalName>jpl-${version}</jar.finalName>-->
    </properties>


    <!-- ######################### DEPENDENCIES ######################### -->
    <dependencies>
        <!-- JUNIT testing framework -->
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.13.1</version>
            <!--<scope>test</scope>-->
        </dependency>


        <!-- SLF4J Logging framework -->
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>${slf4jVersion}</version>
        </dependency>

    </dependencies>

    <!-- ######################### REPOSITORIES ######################### -->


    <!-- ######################### BUILD PIPELINE  ######################### -->
    <build>
        <!-- Ensure custom source directory structure taken into account -->
        <sourceDirectory>src/main/java</sourceDirectory>
        <testSourceDirectory>src/test/java/org/jpl7</testSourceDirectory>

        <plugins>
                <!-- Java source compilation plugin -->
                <plugin>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>3.1</version>
                    <configuration>
                        <source>${maven.compiler.source}</source>
                        <target>${maven.compiler.target}</target>
                        <encoding>${project.build.sourceEncoding}</encoding>
                        <!-- Exclude tests from source compilation as JUnit is a test dependency -->
                        <excludes>
                            <exclude>org/jpl7/*.java</exclude>
                            <exclude>org/jpl7/standalone/*.java</exclude>
                        </excludes>
                    </configuration>
               </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>2.5</version>
                <configuration>
                    <excludes>
                        <exclude>org/jpl7/test/</exclude>
                        <exclude>org/jpl7/util/</exclude>
                    </excludes>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>3.0.1</version>
                <configuration>
                    <excludes>
                        <exclude>org/jpl7/test/</exclude>
                        <exclude>org/jpl7/util/</exclude>
                    </excludes>
                </configuration>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <!-- JAVADOC generation plugin -->
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>3.1.1</version>
                <configuration>
                    <encoding>${project.build.sourceEncoding}</encoding>
                    <source>8</source>
                    <excludePackageNames>org.jpl7.util;org.jpl7.test;org.jpl7.test.*</excludePackageNames>
                    <!-- NOT NEEDED - But have JAVA_HOME correctly set-up
                    <javadocExecutable>${java.home}/bin/javadoc</javadocExecutable>
                    -->
                </configuration>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <!-- Unit test execution -->
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.19.1</version>
                <configuration>
                    <!-- Check this: https://maven.apache.org/surefire/maven-surefire-plugin/examples/skipping-tests.html -->
                    <skipTests>${skipTests}</skipTests>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <!-- ######################### DISTRIBUTIONS ######################### -->
    <!-- https://maven.apache.org/plugins/maven-deploy-plugin/usage.html -->

    <distributionManagement>
        <repository>
            <id>com.github</id>
            <name>GitHub SWI-Prolog JPL Apache Maven Packages</name>
            <url>https://maven.pkg.github.com/SWI-Prolog/packages-jpl</url>
        </repository>
    </distributionManagement>



    <!-- ######################### PROFILES ######################### -->
    <profiles>
        <profile>
            <id>disable-java8-doclint</id>
            <activation>
                <jdk>[1.8,)</jdk>
            </activation>
            <properties>
                <additionalparam>-Xdoclint:none</additionalparam>
            </properties>
        </profile>
    </profiles>
</project>
