<?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">
    <groupId>com.gliwka.hyperscan</groupId>
    <artifactId>native</artifactId>
    <version>5.4.12-2.0.4</version>
    <name>hyperscan-java-native</name>
    <description>Native libraries for hyperscan java bindings</description>
    <url>https://github.com/gliwka/hyperscan-java-native</url>
    <licenses>
        <license>
            <name>3-Clause BSD License</name>
            <url>https://opensource.org/licenses/BSD-3-Clause</url>
        </license>
    </licenses>
    <developers>
        <developer>
            <name>Matthias Gliwka</name>
            <email>matthias@gliwka.eu</email>
        </developer>
    </developers>
    <scm>
        <connection>scm:git:git://github.com/gliwka/hyperscan-java-native.git</connection>
        <developerConnection>scm:git:ssh://github.com/gliwka/hyperscan-java-native.git</developerConnection>
        <url>https://github.com/gliwka/hyperscan-java-native</url>
    </scm>
    <modelVersion>4.0.0</modelVersion>
    <properties>
        <maven.compiler.target>1.8</maven.compiler.target>
        <maven.compiler.source>1.8</maven.compiler.source>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <javacpp.version>1.5.12</javacpp.version>
        <altDeploymentRepository>local::file:./target/staging-deploy</altDeploymentRepository>
    </properties>
    <build>
        <defaultGoal>deploy</defaultGoal>
        <extensions>
            <extension>
                <groupId>kr.motd.maven</groupId>
                <artifactId>os-maven-plugin</artifactId>
                <version>1.7.1</version>
            </extension>
        </extensions>
        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>versions-maven-plugin</artifactId>
                <version>2.19.1</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>3.5.4</version>
                <configuration>
                    <argLine>-Djava.library.path=${project.build.directory}/native/com/gliwka/hyperscan/jni/${env.DETECTED_PLATFORM}</argLine>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.14.1</version>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                </configuration>
                <executions>
                    <execution>
                        <id>default-compile</id>
                    </execution>
                    <execution>
                        <id>javacpp-parser</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>compile</goal>
                        </goals>
                        <configuration>
                            <includes>
                                <include>com/gliwka/hyperscan/jni/JavaCppPreset.java</include>
                            </includes>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <version>3.6.1</version>
                <executions>
                    <execution>
                        <id>add-source</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>add-source</goal>
                        </goals>
                        <configuration>
                            <sources>
                                <source>${project.build.directory}/generated-sources</source>
                            </sources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.bytedeco</groupId>
                <artifactId>javacpp</artifactId>
                <version>${javacpp.version}</version>
                <configuration>
                    <classPath>${project.build.outputDirectory}</classPath>
                    <includePath>${project.build.directory}/../cppbuild/include/</includePath>
                    <linkPath>${project.build.directory}/../cppbuild/lib/</linkPath>
                </configuration>
                <executions>
                    <execution>
                        <id>javacpp-parser</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>build</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${project.build.directory}/generated-sources/</outputDirectory>
                            <classOrPackageName>com.gliwka.hyperscan.jni.JavaCppPreset</classOrPackageName>
                            <copyLibs>true</copyLibs>
                            <copyResources>true</copyResources>
                        </configuration>
                    </execution>
                    <execution>
                        <id>javacpp-compiler</id>
                        <phase>process-classes</phase>
                        <goals>
                            <goal>build</goal>
                        </goals>
                        <configuration>
                          <outputDirectory>${project.build.directory}/native/com/gliwka/hyperscan/jni/${env.DETECTED_PLATFORM}/</outputDirectory>
                            <classOrPackageName>com.gliwka.hyperscan.jni.**</classOrPackageName>
                            <copyLibs>true</copyLibs>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-jar-plugin</artifactId>
                <version>3.4.2</version>
                <executions>
                    <execution>
                        <id>native-jar</id>
                        <phase>package</phase>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                        <configuration>
                          <classifier>${env.DETECTED_PLATFORM}</classifier>
                            <skipIfEmpty>true</skipIfEmpty>
                            <archive>
                                <manifestEntries>
                                    <Multi-Release>true</Multi-Release>
                                </manifestEntries>
                            </archive>
                            <classesDirectory>${project.build.directory}/native</classesDirectory>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>3.3.1</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar-no-fork</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>3.12.0</version>
                <configuration>
                    <show>public</show>
                    <nohelp>true</nohelp>
                    <header>hyperscan-java-native, ${project.version}</header>
                    <footer>hyperscan-java-native, ${project.version}</footer>
                    <doctitle>hyperscan-java-native, ${project.version}</doctitle>
                    <doclint>none</doclint>
                </configuration>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
    <dependencies>
        <dependency>
            <groupId>org.bytedeco</groupId>
            <artifactId>javacpp</artifactId>
            <version>${javacpp.version}</version>
        </dependency>
        <dependency>
            <groupId>org.bytedeco</groupId>
            <artifactId>javacpp-platform</artifactId>
            <version>${javacpp.version}</version>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-engine</artifactId>
            <version>6.0.0</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.assertj</groupId>
            <artifactId>assertj-core</artifactId>
            <version>3.27.6</version>
            <scope>test</scope>
        </dependency>
    </dependencies>
</project>
