<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>net.sourceforge.streamsupport</groupId>
    <artifactId>math-base</artifactId>
    <packaging>jar</packaging>
    <version>1.5.1</version>
    <name>math-base</name>
    <description>Elementary math utilities with a focus on random number generation, non-linear optimization, interpolation and solvers</description>
    <url>https://github.com/stefan-zobel/math-base/</url>

    <licenses>
        <license>
            <name>Apache License, version 2.0</name>
            <url>https://www.apache.org/licenses/LICENSE-2.0</url>
        </license>
    </licenses>
    <developers>
        <developer>
            <name>Stefan Zobel</name>
            <email>Spliterator@gmail.com</email>
            <organization>net.sourceforge.streamsupport</organization>
            <organizationUrl>https://github.com/stefan-zobel/</organizationUrl>
        </developer>
    </developers>
    <scm>
        <url>https://github.com/stefan-zobel/math-base</url>
        <connection>scm:git:https://github.com/stefan-zobel/math-base.git</connection>
        <developerConnection>scm:git:https://github.com/stefan-zobel/math-base.git</developerConnection>
    </scm>

    <dependencies>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.13.2</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.openjdk.jmh</groupId>
            <artifactId>jmh-core</artifactId>
            <version>1.37</version>
            <!--scope>test<scope-->
        </dependency>
        <dependency>
            <groupId>org.openjdk.jmh</groupId>
            <artifactId>jmh-generator-annprocess</artifactId>
            <version>1.37</version>
            <!--scope>test<scope-->
        </dependency>
    </dependencies>

    <properties>
        <project.build.sourceEncoding>Cp1252</project.build.sourceEncoding>
        <maven.compiler.release>8</maven.compiler.release>
    </properties>

    <build>
        <resources>
            <resource>
                <directory>src/main/resources</directory>
            </resource>
            <resource>
                <directory>src/main/java25</directory>
                <targetPath>META-INF/versions/25</targetPath>
                <includes>
                    <include>**/*.java</include>
                </includes>
            </resource>
        </resources>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-toolchains-plugin</artifactId>
                <version>3.2.0</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>toolchain</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <toolchains>
                        <jdk>
                            <id>temurin_8</id>
                        </jdk>
                    </toolchains>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.15.0</version>
                <configuration>
                    <annotationProcessorPaths>
                        <path>
                            <groupId>org.openjdk.jmh</groupId>
                            <artifactId>jmh-generator-annprocess</artifactId>
                            <version>1.37</version>
                        </path>
                    </annotationProcessorPaths>
                </configuration>
                <executions>
                    <execution>
                        <id>default-compile</id>
                        <configuration>
                            <source>1.8</source>
                            <target>1.8</target>
                        </configuration>
                    </execution>
                    <execution>
                        <id>compile-java25</id>
                        <phase>compile</phase>
                        <goals>
                            <goal>compile</goal>
                        </goals>
                        <configuration>
                            <release>25</release>
                            <jdkToolchain>
                                <id>temurin_25</id>
                            </jdkToolchain>
                            <compilerArgs>
                                <arg>--add-modules</arg>
                                <arg>jdk.incubator.vector</arg>
                            </compilerArgs>
                            <compileSourceRoots>
                                <compileSourceRoot>
                                    ${project.basedir}/src/main/java25</compileSourceRoot>
                            </compileSourceRoots>
                            <multiReleaseOutput>true</multiReleaseOutput>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>3.5.0</version>
                <configuration>
                    <archive>
                        <manifestEntries>
                            <Multi-Release>true</Multi-Release>
                        </manifestEntries>
                    </archive>
                    <excludes>
                        <exclude>META-INF/versions/25/**/*.java</exclude>
                    </excludes>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>3.12.0</version>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <disableNoFonts>true</disableNoFonts>
                    <sourcepath>${project.basedir}/src/main/java</sourcepath>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>3.4.0</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar-no-fork</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <!-- Generate checksums -->
            <plugin>
                <groupId>net.nicoulaj.maven.plugins</groupId>
                <artifactId>checksum-maven-plugin</artifactId>
                <version>1.11</version>
                <executions>
                    <execution>
                        <id>checksum-local-repo-artifacts</id>
                        <phase>install</phase>
                        <goals>
                            <goal>files</goal>
                        </goals>
                        <configuration>
                            <fileSets>
                                <fileSet>
                                    <directory>${settings.localRepository}/net/sourceforge/streamsupport/math-base/${project.version}</directory>
                                    <includes>
                                        <include>*.pom</include>
                                        <include>*.jar</include>
                                    </includes>
                                </fileSet>
                            </fileSets>
                            <algorithms>
                                <algorithm>SHA-1</algorithm>
                                <algorithm>MD5</algorithm>
                            </algorithms>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>run-benchmarks-j25</id>
            <properties>
                <benchmark.class>.*</benchmark.class>
            </properties>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-toolchains-plugin</artifactId>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>toolchain</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <toolchains>
                                <jdk>
                                    <id>temurin_25</id>
                                </jdk>
                            </toolchains>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>exec-maven-plugin</artifactId>
                        <version>3.6.3</version>
                        <configuration>
                            <executable>java</executable>
                            <classpathScope>test</classpathScope>
                            <arguments>
                                <argument>--add-modules</argument>
                                <argument>jdk.incubator.vector</argument>
                                <argument>-classpath</argument>
                                <classpath />
                                <argument>org.openjdk.jmh.Main</argument>
                                <argument>${benchmark.class}</argument>
                            </arguments>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <version>3.5.5</version>
                        <configuration>
                            <argLine>--add-modules jdk.incubator.vector</argLine>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

</project>
